001package org.hl7.fhir.r5.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.r5
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023/*
024  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Thu, Dec 13, 2018 14:07+1100 for FHIR v4.0.0
053import java.util.ArrayList;
054import java.util.Date;
055import java.util.List;
056import org.hl7.fhir.exceptions.FHIRException;
057import org.hl7.fhir.instance.model.api.ICompositeType;
058
059import org.hl7.fhir.instance.model.api.IBaseDatatypeElement;
060import org.hl7.fhir.utilities.Utilities;
061import ca.uhn.fhir.model.api.annotation.ResourceDef;
062import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
063import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
064import ca.uhn.fhir.model.api.annotation.Child;
065import ca.uhn.fhir.model.api.annotation.ChildOrder;
066import ca.uhn.fhir.model.api.annotation.Description;
067import ca.uhn.fhir.model.api.annotation.Block;
068/**
069 * Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).
070 */
071@ResourceDef(name="MedicinalProductDefinition", profile="http://hl7.org/fhir/StructureDefinition/MedicinalProductDefinition")
072public class MedicinalProductDefinition extends DomainResource {
073
074    @Block()
075    public static class MedicinalProductDefinitionContactComponent extends BackboneElement implements IBaseBackboneElement {
076        /**
077         * Allows the contact to be classified, for example QPPV, Pharmacovigilence Enquiry Information.
078         */
079        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
080        @Description(shortDefinition="Allows the contact to be classified, for example QPPV, Pharmacovigilence Enquiry Information", formalDefinition="Allows the contact to be classified, for example QPPV, Pharmacovigilence Enquiry Information." )
081        protected CodeableConcept type;
082
083        /**
084         * A product specific contact, person (in a role), or an organization.
085         */
086        @Child(name = "contact", type = {Organization.class, PractitionerRole.class}, order=2, min=1, max=1, modifier=false, summary=true)
087        @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." )
088        protected Reference contact;
089
090        private static final long serialVersionUID = -587616244L;
091
092    /**
093     * Constructor
094     */
095      public MedicinalProductDefinitionContactComponent() {
096        super();
097      }
098
099    /**
100     * Constructor
101     */
102      public MedicinalProductDefinitionContactComponent(Reference contact) {
103        super();
104        this.contact = contact;
105      }
106
107        /**
108         * @return {@link #type} (Allows the contact to be classified, for example QPPV, Pharmacovigilence Enquiry Information.)
109         */
110        public CodeableConcept getType() { 
111          if (this.type == null)
112            if (Configuration.errorOnAutoCreate())
113              throw new Error("Attempt to auto-create MedicinalProductDefinitionContactComponent.type");
114            else if (Configuration.doAutoCreate())
115              this.type = new CodeableConcept(); // cc
116          return this.type;
117        }
118
119        public boolean hasType() { 
120          return this.type != null && !this.type.isEmpty();
121        }
122
123        /**
124         * @param value {@link #type} (Allows the contact to be classified, for example QPPV, Pharmacovigilence Enquiry Information.)
125         */
126        public MedicinalProductDefinitionContactComponent setType(CodeableConcept value) { 
127          this.type = value;
128          return this;
129        }
130
131        /**
132         * @return {@link #contact} (A product specific contact, person (in a role), or an organization.)
133         */
134        public Reference getContact() { 
135          if (this.contact == null)
136            if (Configuration.errorOnAutoCreate())
137              throw new Error("Attempt to auto-create MedicinalProductDefinitionContactComponent.contact");
138            else if (Configuration.doAutoCreate())
139              this.contact = new Reference(); // cc
140          return this.contact;
141        }
142
143        public boolean hasContact() { 
144          return this.contact != null && !this.contact.isEmpty();
145        }
146
147        /**
148         * @param value {@link #contact} (A product specific contact, person (in a role), or an organization.)
149         */
150        public MedicinalProductDefinitionContactComponent setContact(Reference value) { 
151          this.contact = value;
152          return this;
153        }
154
155        protected void listChildren(List<Property> children) {
156          super.listChildren(children);
157          children.add(new Property("type", "CodeableConcept", "Allows the contact to be classified, for example QPPV, Pharmacovigilence Enquiry Information.", 0, 1, type));
158          children.add(new Property("contact", "Reference(Organization|PractitionerRole)", "A product specific contact, person (in a role), or an organization.", 0, 1, contact));
159        }
160
161        @Override
162        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
163          switch (_hash) {
164          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Allows the contact to be classified, for example QPPV, Pharmacovigilence Enquiry Information.", 0, 1, type);
165          case 951526432: /*contact*/  return new Property("contact", "Reference(Organization|PractitionerRole)", "A product specific contact, person (in a role), or an organization.", 0, 1, contact);
166          default: return super.getNamedProperty(_hash, _name, _checkValid);
167          }
168
169        }
170
171      @Override
172      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
173        switch (hash) {
174        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
175        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : new Base[] {this.contact}; // Reference
176        default: return super.getProperty(hash, name, checkValid);
177        }
178
179      }
180
181      @Override
182      public Base setProperty(int hash, String name, Base value) throws FHIRException {
183        switch (hash) {
184        case 3575610: // type
185          this.type = castToCodeableConcept(value); // CodeableConcept
186          return value;
187        case 951526432: // contact
188          this.contact = castToReference(value); // Reference
189          return value;
190        default: return super.setProperty(hash, name, value);
191        }
192
193      }
194
195      @Override
196      public Base setProperty(String name, Base value) throws FHIRException {
197        if (name.equals("type")) {
198          this.type = castToCodeableConcept(value); // CodeableConcept
199        } else if (name.equals("contact")) {
200          this.contact = castToReference(value); // Reference
201        } else
202          return super.setProperty(name, value);
203        return value;
204      }
205
206      @Override
207      public Base makeProperty(int hash, String name) throws FHIRException {
208        switch (hash) {
209        case 3575610:  return getType();
210        case 951526432:  return getContact();
211        default: return super.makeProperty(hash, name);
212        }
213
214      }
215
216      @Override
217      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
218        switch (hash) {
219        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
220        case 951526432: /*contact*/ return new String[] {"Reference"};
221        default: return super.getTypesForProperty(hash, name);
222        }
223
224      }
225
226      @Override
227      public Base addChild(String name) throws FHIRException {
228        if (name.equals("type")) {
229          this.type = new CodeableConcept();
230          return this.type;
231        }
232        else if (name.equals("contact")) {
233          this.contact = new Reference();
234          return this.contact;
235        }
236        else
237          return super.addChild(name);
238      }
239
240      public MedicinalProductDefinitionContactComponent copy() {
241        MedicinalProductDefinitionContactComponent dst = new MedicinalProductDefinitionContactComponent();
242        copyValues(dst);
243        return dst;
244      }
245
246      public void copyValues(MedicinalProductDefinitionContactComponent dst) {
247        super.copyValues(dst);
248        dst.type = type == null ? null : type.copy();
249        dst.contact = contact == null ? null : contact.copy();
250      }
251
252      @Override
253      public boolean equalsDeep(Base other_) {
254        if (!super.equalsDeep(other_))
255          return false;
256        if (!(other_ instanceof MedicinalProductDefinitionContactComponent))
257          return false;
258        MedicinalProductDefinitionContactComponent o = (MedicinalProductDefinitionContactComponent) other_;
259        return compareDeep(type, o.type, true) && compareDeep(contact, o.contact, true);
260      }
261
262      @Override
263      public boolean equalsShallow(Base other_) {
264        if (!super.equalsShallow(other_))
265          return false;
266        if (!(other_ instanceof MedicinalProductDefinitionContactComponent))
267          return false;
268        MedicinalProductDefinitionContactComponent o = (MedicinalProductDefinitionContactComponent) other_;
269        return true;
270      }
271
272      public boolean isEmpty() {
273        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, contact);
274      }
275
276  public String fhirType() {
277    return "MedicinalProductDefinition.contact";
278
279  }
280
281  }
282
283    @Block()
284    public static class MedicinalProductDefinitionNameComponent extends BackboneElement implements IBaseBackboneElement {
285        /**
286         * The full product name.
287         */
288        @Child(name = "productName", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
289        @Description(shortDefinition="The full product name", formalDefinition="The full product name." )
290        protected StringType productName;
291
292        /**
293         * Type of the product name, such as rINN or BAN.
294         */
295        @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
296        @Description(shortDefinition="Type of the product name, such as rINN or BAN", formalDefinition="Type of the product name, such as rINN or BAN." )
297        protected Coding type;
298
299        /**
300         * Coding words or phrases of the name.
301         */
302        @Child(name = "namePart", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
303        @Description(shortDefinition="Coding words or phrases of the name", formalDefinition="Coding words or phrases of the name." )
304        protected List<MedicinalProductDefinitionNameNamePartComponent> namePart;
305
306        /**
307         * Country where the name applies.
308         */
309        @Child(name = "countryLanguage", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
310        @Description(shortDefinition="Country where the name applies", formalDefinition="Country where the name applies." )
311        protected List<MedicinalProductDefinitionNameCountryLanguageComponent> countryLanguage;
312
313        private static final long serialVersionUID = -393861059L;
314
315    /**
316     * Constructor
317     */
318      public MedicinalProductDefinitionNameComponent() {
319        super();
320      }
321
322    /**
323     * Constructor
324     */
325      public MedicinalProductDefinitionNameComponent(StringType productName) {
326        super();
327        this.productName = productName;
328      }
329
330        /**
331         * @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
332         */
333        public StringType getProductNameElement() { 
334          if (this.productName == null)
335            if (Configuration.errorOnAutoCreate())
336              throw new Error("Attempt to auto-create MedicinalProductDefinitionNameComponent.productName");
337            else if (Configuration.doAutoCreate())
338              this.productName = new StringType(); // bb
339          return this.productName;
340        }
341
342        public boolean hasProductNameElement() { 
343          return this.productName != null && !this.productName.isEmpty();
344        }
345
346        public boolean hasProductName() { 
347          return this.productName != null && !this.productName.isEmpty();
348        }
349
350        /**
351         * @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
352         */
353        public MedicinalProductDefinitionNameComponent setProductNameElement(StringType value) { 
354          this.productName = value;
355          return this;
356        }
357
358        /**
359         * @return The full product name.
360         */
361        public String getProductName() { 
362          return this.productName == null ? null : this.productName.getValue();
363        }
364
365        /**
366         * @param value The full product name.
367         */
368        public MedicinalProductDefinitionNameComponent setProductName(String value) { 
369            if (this.productName == null)
370              this.productName = new StringType();
371            this.productName.setValue(value);
372          return this;
373        }
374
375        /**
376         * @return {@link #type} (Type of the product name, such as rINN or BAN.)
377         */
378        public Coding getType() { 
379          if (this.type == null)
380            if (Configuration.errorOnAutoCreate())
381              throw new Error("Attempt to auto-create MedicinalProductDefinitionNameComponent.type");
382            else if (Configuration.doAutoCreate())
383              this.type = new Coding(); // cc
384          return this.type;
385        }
386
387        public boolean hasType() { 
388          return this.type != null && !this.type.isEmpty();
389        }
390
391        /**
392         * @param value {@link #type} (Type of the product name, such as rINN or BAN.)
393         */
394        public MedicinalProductDefinitionNameComponent setType(Coding value) { 
395          this.type = value;
396          return this;
397        }
398
399        /**
400         * @return {@link #namePart} (Coding words or phrases of the name.)
401         */
402        public List<MedicinalProductDefinitionNameNamePartComponent> getNamePart() { 
403          if (this.namePart == null)
404            this.namePart = new ArrayList<MedicinalProductDefinitionNameNamePartComponent>();
405          return this.namePart;
406        }
407
408        /**
409         * @return Returns a reference to <code>this</code> for easy method chaining
410         */
411        public MedicinalProductDefinitionNameComponent setNamePart(List<MedicinalProductDefinitionNameNamePartComponent> theNamePart) { 
412          this.namePart = theNamePart;
413          return this;
414        }
415
416        public boolean hasNamePart() { 
417          if (this.namePart == null)
418            return false;
419          for (MedicinalProductDefinitionNameNamePartComponent item : this.namePart)
420            if (!item.isEmpty())
421              return true;
422          return false;
423        }
424
425        public MedicinalProductDefinitionNameNamePartComponent addNamePart() { //3
426          MedicinalProductDefinitionNameNamePartComponent t = new MedicinalProductDefinitionNameNamePartComponent();
427          if (this.namePart == null)
428            this.namePart = new ArrayList<MedicinalProductDefinitionNameNamePartComponent>();
429          this.namePart.add(t);
430          return t;
431        }
432
433        public MedicinalProductDefinitionNameComponent addNamePart(MedicinalProductDefinitionNameNamePartComponent t) { //3
434          if (t == null)
435            return this;
436          if (this.namePart == null)
437            this.namePart = new ArrayList<MedicinalProductDefinitionNameNamePartComponent>();
438          this.namePart.add(t);
439          return this;
440        }
441
442        /**
443         * @return The first repetition of repeating field {@link #namePart}, creating it if it does not already exist
444         */
445        public MedicinalProductDefinitionNameNamePartComponent getNamePartFirstRep() { 
446          if (getNamePart().isEmpty()) {
447            addNamePart();
448          }
449          return getNamePart().get(0);
450        }
451
452        /**
453         * @return {@link #countryLanguage} (Country where the name applies.)
454         */
455        public List<MedicinalProductDefinitionNameCountryLanguageComponent> getCountryLanguage() { 
456          if (this.countryLanguage == null)
457            this.countryLanguage = new ArrayList<MedicinalProductDefinitionNameCountryLanguageComponent>();
458          return this.countryLanguage;
459        }
460
461        /**
462         * @return Returns a reference to <code>this</code> for easy method chaining
463         */
464        public MedicinalProductDefinitionNameComponent setCountryLanguage(List<MedicinalProductDefinitionNameCountryLanguageComponent> theCountryLanguage) { 
465          this.countryLanguage = theCountryLanguage;
466          return this;
467        }
468
469        public boolean hasCountryLanguage() { 
470          if (this.countryLanguage == null)
471            return false;
472          for (MedicinalProductDefinitionNameCountryLanguageComponent item : this.countryLanguage)
473            if (!item.isEmpty())
474              return true;
475          return false;
476        }
477
478        public MedicinalProductDefinitionNameCountryLanguageComponent addCountryLanguage() { //3
479          MedicinalProductDefinitionNameCountryLanguageComponent t = new MedicinalProductDefinitionNameCountryLanguageComponent();
480          if (this.countryLanguage == null)
481            this.countryLanguage = new ArrayList<MedicinalProductDefinitionNameCountryLanguageComponent>();
482          this.countryLanguage.add(t);
483          return t;
484        }
485
486        public MedicinalProductDefinitionNameComponent addCountryLanguage(MedicinalProductDefinitionNameCountryLanguageComponent t) { //3
487          if (t == null)
488            return this;
489          if (this.countryLanguage == null)
490            this.countryLanguage = new ArrayList<MedicinalProductDefinitionNameCountryLanguageComponent>();
491          this.countryLanguage.add(t);
492          return this;
493        }
494
495        /**
496         * @return The first repetition of repeating field {@link #countryLanguage}, creating it if it does not already exist
497         */
498        public MedicinalProductDefinitionNameCountryLanguageComponent getCountryLanguageFirstRep() { 
499          if (getCountryLanguage().isEmpty()) {
500            addCountryLanguage();
501          }
502          return getCountryLanguage().get(0);
503        }
504
505        protected void listChildren(List<Property> children) {
506          super.listChildren(children);
507          children.add(new Property("productName", "string", "The full product name.", 0, 1, productName));
508          children.add(new Property("type", "Coding", "Type of the product name, such as rINN or BAN.", 0, 1, type));
509          children.add(new Property("namePart", "", "Coding words or phrases of the name.", 0, java.lang.Integer.MAX_VALUE, namePart));
510          children.add(new Property("countryLanguage", "", "Country where the name applies.", 0, java.lang.Integer.MAX_VALUE, countryLanguage));
511        }
512
513        @Override
514        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
515          switch (_hash) {
516          case -1491817446: /*productName*/  return new Property("productName", "string", "The full product name.", 0, 1, productName);
517          case 3575610: /*type*/  return new Property("type", "Coding", "Type of the product name, such as rINN or BAN.", 0, 1, type);
518          case 1840452894: /*namePart*/  return new Property("namePart", "", "Coding words or phrases of the name.", 0, java.lang.Integer.MAX_VALUE, namePart);
519          case -141141746: /*countryLanguage*/  return new Property("countryLanguage", "", "Country where the name applies.", 0, java.lang.Integer.MAX_VALUE, countryLanguage);
520          default: return super.getNamedProperty(_hash, _name, _checkValid);
521          }
522
523        }
524
525      @Override
526      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
527        switch (hash) {
528        case -1491817446: /*productName*/ return this.productName == null ? new Base[0] : new Base[] {this.productName}; // StringType
529        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
530        case 1840452894: /*namePart*/ return this.namePart == null ? new Base[0] : this.namePart.toArray(new Base[this.namePart.size()]); // MedicinalProductDefinitionNameNamePartComponent
531        case -141141746: /*countryLanguage*/ return this.countryLanguage == null ? new Base[0] : this.countryLanguage.toArray(new Base[this.countryLanguage.size()]); // MedicinalProductDefinitionNameCountryLanguageComponent
532        default: return super.getProperty(hash, name, checkValid);
533        }
534
535      }
536
537      @Override
538      public Base setProperty(int hash, String name, Base value) throws FHIRException {
539        switch (hash) {
540        case -1491817446: // productName
541          this.productName = castToString(value); // StringType
542          return value;
543        case 3575610: // type
544          this.type = castToCoding(value); // Coding
545          return value;
546        case 1840452894: // namePart
547          this.getNamePart().add((MedicinalProductDefinitionNameNamePartComponent) value); // MedicinalProductDefinitionNameNamePartComponent
548          return value;
549        case -141141746: // countryLanguage
550          this.getCountryLanguage().add((MedicinalProductDefinitionNameCountryLanguageComponent) value); // MedicinalProductDefinitionNameCountryLanguageComponent
551          return value;
552        default: return super.setProperty(hash, name, value);
553        }
554
555      }
556
557      @Override
558      public Base setProperty(String name, Base value) throws FHIRException {
559        if (name.equals("productName")) {
560          this.productName = castToString(value); // StringType
561        } else if (name.equals("type")) {
562          this.type = castToCoding(value); // Coding
563        } else if (name.equals("namePart")) {
564          this.getNamePart().add((MedicinalProductDefinitionNameNamePartComponent) value);
565        } else if (name.equals("countryLanguage")) {
566          this.getCountryLanguage().add((MedicinalProductDefinitionNameCountryLanguageComponent) value);
567        } else
568          return super.setProperty(name, value);
569        return value;
570      }
571
572      @Override
573      public Base makeProperty(int hash, String name) throws FHIRException {
574        switch (hash) {
575        case -1491817446:  return getProductNameElement();
576        case 3575610:  return getType();
577        case 1840452894:  return addNamePart(); 
578        case -141141746:  return addCountryLanguage(); 
579        default: return super.makeProperty(hash, name);
580        }
581
582      }
583
584      @Override
585      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
586        switch (hash) {
587        case -1491817446: /*productName*/ return new String[] {"string"};
588        case 3575610: /*type*/ return new String[] {"Coding"};
589        case 1840452894: /*namePart*/ return new String[] {};
590        case -141141746: /*countryLanguage*/ return new String[] {};
591        default: return super.getTypesForProperty(hash, name);
592        }
593
594      }
595
596      @Override
597      public Base addChild(String name) throws FHIRException {
598        if (name.equals("productName")) {
599          throw new FHIRException("Cannot call addChild on a primitive type MedicinalProductDefinition.productName");
600        }
601        else if (name.equals("type")) {
602          this.type = new Coding();
603          return this.type;
604        }
605        else if (name.equals("namePart")) {
606          return addNamePart();
607        }
608        else if (name.equals("countryLanguage")) {
609          return addCountryLanguage();
610        }
611        else
612          return super.addChild(name);
613      }
614
615      public MedicinalProductDefinitionNameComponent copy() {
616        MedicinalProductDefinitionNameComponent dst = new MedicinalProductDefinitionNameComponent();
617        copyValues(dst);
618        return dst;
619      }
620
621      public void copyValues(MedicinalProductDefinitionNameComponent dst) {
622        super.copyValues(dst);
623        dst.productName = productName == null ? null : productName.copy();
624        dst.type = type == null ? null : type.copy();
625        if (namePart != null) {
626          dst.namePart = new ArrayList<MedicinalProductDefinitionNameNamePartComponent>();
627          for (MedicinalProductDefinitionNameNamePartComponent i : namePart)
628            dst.namePart.add(i.copy());
629        };
630        if (countryLanguage != null) {
631          dst.countryLanguage = new ArrayList<MedicinalProductDefinitionNameCountryLanguageComponent>();
632          for (MedicinalProductDefinitionNameCountryLanguageComponent i : countryLanguage)
633            dst.countryLanguage.add(i.copy());
634        };
635      }
636
637      @Override
638      public boolean equalsDeep(Base other_) {
639        if (!super.equalsDeep(other_))
640          return false;
641        if (!(other_ instanceof MedicinalProductDefinitionNameComponent))
642          return false;
643        MedicinalProductDefinitionNameComponent o = (MedicinalProductDefinitionNameComponent) other_;
644        return compareDeep(productName, o.productName, true) && compareDeep(type, o.type, true) && compareDeep(namePart, o.namePart, true)
645           && compareDeep(countryLanguage, o.countryLanguage, true);
646      }
647
648      @Override
649      public boolean equalsShallow(Base other_) {
650        if (!super.equalsShallow(other_))
651          return false;
652        if (!(other_ instanceof MedicinalProductDefinitionNameComponent))
653          return false;
654        MedicinalProductDefinitionNameComponent o = (MedicinalProductDefinitionNameComponent) other_;
655        return compareValues(productName, o.productName, true);
656      }
657
658      public boolean isEmpty() {
659        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(productName, type, namePart
660          , countryLanguage);
661      }
662
663  public String fhirType() {
664    return "MedicinalProductDefinition.name";
665
666  }
667
668  }
669
670    @Block()
671    public static class MedicinalProductDefinitionNameNamePartComponent extends BackboneElement implements IBaseBackboneElement {
672        /**
673         * A fragment of a product name.
674         */
675        @Child(name = "part", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
676        @Description(shortDefinition="A fragment of a product name", formalDefinition="A fragment of a product name." )
677        protected StringType part;
678
679        /**
680         * Idenifying type for this part of the name (e.g. strength part).
681         */
682        @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true)
683        @Description(shortDefinition="Idenifying type for this part of the name (e.g. strength part)", formalDefinition="Idenifying type for this part of the name (e.g. strength part)." )
684        protected Coding type;
685
686        private static final long serialVersionUID = -301533796L;
687
688    /**
689     * Constructor
690     */
691      public MedicinalProductDefinitionNameNamePartComponent() {
692        super();
693      }
694
695    /**
696     * Constructor
697     */
698      public MedicinalProductDefinitionNameNamePartComponent(StringType part, Coding type) {
699        super();
700        this.part = part;
701        this.type = type;
702      }
703
704        /**
705         * @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
706         */
707        public StringType getPartElement() { 
708          if (this.part == null)
709            if (Configuration.errorOnAutoCreate())
710              throw new Error("Attempt to auto-create MedicinalProductDefinitionNameNamePartComponent.part");
711            else if (Configuration.doAutoCreate())
712              this.part = new StringType(); // bb
713          return this.part;
714        }
715
716        public boolean hasPartElement() { 
717          return this.part != null && !this.part.isEmpty();
718        }
719
720        public boolean hasPart() { 
721          return this.part != null && !this.part.isEmpty();
722        }
723
724        /**
725         * @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
726         */
727        public MedicinalProductDefinitionNameNamePartComponent setPartElement(StringType value) { 
728          this.part = value;
729          return this;
730        }
731
732        /**
733         * @return A fragment of a product name.
734         */
735        public String getPart() { 
736          return this.part == null ? null : this.part.getValue();
737        }
738
739        /**
740         * @param value A fragment of a product name.
741         */
742        public MedicinalProductDefinitionNameNamePartComponent setPart(String value) { 
743            if (this.part == null)
744              this.part = new StringType();
745            this.part.setValue(value);
746          return this;
747        }
748
749        /**
750         * @return {@link #type} (Idenifying type for this part of the name (e.g. strength part).)
751         */
752        public Coding getType() { 
753          if (this.type == null)
754            if (Configuration.errorOnAutoCreate())
755              throw new Error("Attempt to auto-create MedicinalProductDefinitionNameNamePartComponent.type");
756            else if (Configuration.doAutoCreate())
757              this.type = new Coding(); // cc
758          return this.type;
759        }
760
761        public boolean hasType() { 
762          return this.type != null && !this.type.isEmpty();
763        }
764
765        /**
766         * @param value {@link #type} (Idenifying type for this part of the name (e.g. strength part).)
767         */
768        public MedicinalProductDefinitionNameNamePartComponent setType(Coding value) { 
769          this.type = value;
770          return this;
771        }
772
773        protected void listChildren(List<Property> children) {
774          super.listChildren(children);
775          children.add(new Property("part", "string", "A fragment of a product name.", 0, 1, part));
776          children.add(new Property("type", "Coding", "Idenifying type for this part of the name (e.g. strength part).", 0, 1, type));
777        }
778
779        @Override
780        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
781          switch (_hash) {
782          case 3433459: /*part*/  return new Property("part", "string", "A fragment of a product name.", 0, 1, part);
783          case 3575610: /*type*/  return new Property("type", "Coding", "Idenifying type for this part of the name (e.g. strength part).", 0, 1, type);
784          default: return super.getNamedProperty(_hash, _name, _checkValid);
785          }
786
787        }
788
789      @Override
790      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
791        switch (hash) {
792        case 3433459: /*part*/ return this.part == null ? new Base[0] : new Base[] {this.part}; // StringType
793        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
794        default: return super.getProperty(hash, name, checkValid);
795        }
796
797      }
798
799      @Override
800      public Base setProperty(int hash, String name, Base value) throws FHIRException {
801        switch (hash) {
802        case 3433459: // part
803          this.part = castToString(value); // StringType
804          return value;
805        case 3575610: // type
806          this.type = castToCoding(value); // Coding
807          return value;
808        default: return super.setProperty(hash, name, value);
809        }
810
811      }
812
813      @Override
814      public Base setProperty(String name, Base value) throws FHIRException {
815        if (name.equals("part")) {
816          this.part = castToString(value); // StringType
817        } else if (name.equals("type")) {
818          this.type = castToCoding(value); // Coding
819        } else
820          return super.setProperty(name, value);
821        return value;
822      }
823
824      @Override
825      public Base makeProperty(int hash, String name) throws FHIRException {
826        switch (hash) {
827        case 3433459:  return getPartElement();
828        case 3575610:  return getType();
829        default: return super.makeProperty(hash, name);
830        }
831
832      }
833
834      @Override
835      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
836        switch (hash) {
837        case 3433459: /*part*/ return new String[] {"string"};
838        case 3575610: /*type*/ return new String[] {"Coding"};
839        default: return super.getTypesForProperty(hash, name);
840        }
841
842      }
843
844      @Override
845      public Base addChild(String name) throws FHIRException {
846        if (name.equals("part")) {
847          throw new FHIRException("Cannot call addChild on a primitive type MedicinalProductDefinition.part");
848        }
849        else if (name.equals("type")) {
850          this.type = new Coding();
851          return this.type;
852        }
853        else
854          return super.addChild(name);
855      }
856
857      public MedicinalProductDefinitionNameNamePartComponent copy() {
858        MedicinalProductDefinitionNameNamePartComponent dst = new MedicinalProductDefinitionNameNamePartComponent();
859        copyValues(dst);
860        return dst;
861      }
862
863      public void copyValues(MedicinalProductDefinitionNameNamePartComponent dst) {
864        super.copyValues(dst);
865        dst.part = part == null ? null : part.copy();
866        dst.type = type == null ? null : type.copy();
867      }
868
869      @Override
870      public boolean equalsDeep(Base other_) {
871        if (!super.equalsDeep(other_))
872          return false;
873        if (!(other_ instanceof MedicinalProductDefinitionNameNamePartComponent))
874          return false;
875        MedicinalProductDefinitionNameNamePartComponent o = (MedicinalProductDefinitionNameNamePartComponent) other_;
876        return compareDeep(part, o.part, true) && compareDeep(type, o.type, true);
877      }
878
879      @Override
880      public boolean equalsShallow(Base other_) {
881        if (!super.equalsShallow(other_))
882          return false;
883        if (!(other_ instanceof MedicinalProductDefinitionNameNamePartComponent))
884          return false;
885        MedicinalProductDefinitionNameNamePartComponent o = (MedicinalProductDefinitionNameNamePartComponent) other_;
886        return compareValues(part, o.part, true);
887      }
888
889      public boolean isEmpty() {
890        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(part, type);
891      }
892
893  public String fhirType() {
894    return "MedicinalProductDefinition.name.namePart";
895
896  }
897
898  }
899
900    @Block()
901    public static class MedicinalProductDefinitionNameCountryLanguageComponent extends BackboneElement implements IBaseBackboneElement {
902        /**
903         * Country code for where this name applies.
904         */
905        @Child(name = "country", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
906        @Description(shortDefinition="Country code for where this name applies", formalDefinition="Country code for where this name applies." )
907        protected CodeableConcept country;
908
909        /**
910         * Jurisdiction code for where this name applies.
911         */
912        @Child(name = "jurisdiction", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
913        @Description(shortDefinition="Jurisdiction code for where this name applies", formalDefinition="Jurisdiction code for where this name applies." )
914        protected CodeableConcept jurisdiction;
915
916        /**
917         * Language code for this name.
918         */
919        @Child(name = "language", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true)
920        @Description(shortDefinition="Language code for this name", formalDefinition="Language code for this name." )
921        protected CodeableConcept language;
922
923        private static final long serialVersionUID = 1627157564L;
924
925    /**
926     * Constructor
927     */
928      public MedicinalProductDefinitionNameCountryLanguageComponent() {
929        super();
930      }
931
932    /**
933     * Constructor
934     */
935      public MedicinalProductDefinitionNameCountryLanguageComponent(CodeableConcept country, CodeableConcept language) {
936        super();
937        this.country = country;
938        this.language = language;
939      }
940
941        /**
942         * @return {@link #country} (Country code for where this name applies.)
943         */
944        public CodeableConcept getCountry() { 
945          if (this.country == null)
946            if (Configuration.errorOnAutoCreate())
947              throw new Error("Attempt to auto-create MedicinalProductDefinitionNameCountryLanguageComponent.country");
948            else if (Configuration.doAutoCreate())
949              this.country = new CodeableConcept(); // cc
950          return this.country;
951        }
952
953        public boolean hasCountry() { 
954          return this.country != null && !this.country.isEmpty();
955        }
956
957        /**
958         * @param value {@link #country} (Country code for where this name applies.)
959         */
960        public MedicinalProductDefinitionNameCountryLanguageComponent setCountry(CodeableConcept value) { 
961          this.country = value;
962          return this;
963        }
964
965        /**
966         * @return {@link #jurisdiction} (Jurisdiction code for where this name applies.)
967         */
968        public CodeableConcept getJurisdiction() { 
969          if (this.jurisdiction == null)
970            if (Configuration.errorOnAutoCreate())
971              throw new Error("Attempt to auto-create MedicinalProductDefinitionNameCountryLanguageComponent.jurisdiction");
972            else if (Configuration.doAutoCreate())
973              this.jurisdiction = new CodeableConcept(); // cc
974          return this.jurisdiction;
975        }
976
977        public boolean hasJurisdiction() { 
978          return this.jurisdiction != null && !this.jurisdiction.isEmpty();
979        }
980
981        /**
982         * @param value {@link #jurisdiction} (Jurisdiction code for where this name applies.)
983         */
984        public MedicinalProductDefinitionNameCountryLanguageComponent setJurisdiction(CodeableConcept value) { 
985          this.jurisdiction = value;
986          return this;
987        }
988
989        /**
990         * @return {@link #language} (Language code for this name.)
991         */
992        public CodeableConcept getLanguage() { 
993          if (this.language == null)
994            if (Configuration.errorOnAutoCreate())
995              throw new Error("Attempt to auto-create MedicinalProductDefinitionNameCountryLanguageComponent.language");
996            else if (Configuration.doAutoCreate())
997              this.language = new CodeableConcept(); // cc
998          return this.language;
999        }
1000
1001        public boolean hasLanguage() { 
1002          return this.language != null && !this.language.isEmpty();
1003        }
1004
1005        /**
1006         * @param value {@link #language} (Language code for this name.)
1007         */
1008        public MedicinalProductDefinitionNameCountryLanguageComponent setLanguage(CodeableConcept value) { 
1009          this.language = value;
1010          return this;
1011        }
1012
1013        protected void listChildren(List<Property> children) {
1014          super.listChildren(children);
1015          children.add(new Property("country", "CodeableConcept", "Country code for where this name applies.", 0, 1, country));
1016          children.add(new Property("jurisdiction", "CodeableConcept", "Jurisdiction code for where this name applies.", 0, 1, jurisdiction));
1017          children.add(new Property("language", "CodeableConcept", "Language code for this name.", 0, 1, language));
1018        }
1019
1020        @Override
1021        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1022          switch (_hash) {
1023          case 957831062: /*country*/  return new Property("country", "CodeableConcept", "Country code for where this name applies.", 0, 1, country);
1024          case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "Jurisdiction code for where this name applies.", 0, 1, jurisdiction);
1025          case -1613589672: /*language*/  return new Property("language", "CodeableConcept", "Language code for this name.", 0, 1, language);
1026          default: return super.getNamedProperty(_hash, _name, _checkValid);
1027          }
1028
1029        }
1030
1031      @Override
1032      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1033        switch (hash) {
1034        case 957831062: /*country*/ return this.country == null ? new Base[0] : new Base[] {this.country}; // CodeableConcept
1035        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : new Base[] {this.jurisdiction}; // CodeableConcept
1036        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept
1037        default: return super.getProperty(hash, name, checkValid);
1038        }
1039
1040      }
1041
1042      @Override
1043      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1044        switch (hash) {
1045        case 957831062: // country
1046          this.country = castToCodeableConcept(value); // CodeableConcept
1047          return value;
1048        case -507075711: // jurisdiction
1049          this.jurisdiction = castToCodeableConcept(value); // CodeableConcept
1050          return value;
1051        case -1613589672: // language
1052          this.language = castToCodeableConcept(value); // CodeableConcept
1053          return value;
1054        default: return super.setProperty(hash, name, value);
1055        }
1056
1057      }
1058
1059      @Override
1060      public Base setProperty(String name, Base value) throws FHIRException {
1061        if (name.equals("country")) {
1062          this.country = castToCodeableConcept(value); // CodeableConcept
1063        } else if (name.equals("jurisdiction")) {
1064          this.jurisdiction = castToCodeableConcept(value); // CodeableConcept
1065        } else if (name.equals("language")) {
1066          this.language = castToCodeableConcept(value); // CodeableConcept
1067        } else
1068          return super.setProperty(name, value);
1069        return value;
1070      }
1071
1072      @Override
1073      public Base makeProperty(int hash, String name) throws FHIRException {
1074        switch (hash) {
1075        case 957831062:  return getCountry();
1076        case -507075711:  return getJurisdiction();
1077        case -1613589672:  return getLanguage();
1078        default: return super.makeProperty(hash, name);
1079        }
1080
1081      }
1082
1083      @Override
1084      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1085        switch (hash) {
1086        case 957831062: /*country*/ return new String[] {"CodeableConcept"};
1087        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
1088        case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
1089        default: return super.getTypesForProperty(hash, name);
1090        }
1091
1092      }
1093
1094      @Override
1095      public Base addChild(String name) throws FHIRException {
1096        if (name.equals("country")) {
1097          this.country = new CodeableConcept();
1098          return this.country;
1099        }
1100        else if (name.equals("jurisdiction")) {
1101          this.jurisdiction = new CodeableConcept();
1102          return this.jurisdiction;
1103        }
1104        else if (name.equals("language")) {
1105          this.language = new CodeableConcept();
1106          return this.language;
1107        }
1108        else
1109          return super.addChild(name);
1110      }
1111
1112      public MedicinalProductDefinitionNameCountryLanguageComponent copy() {
1113        MedicinalProductDefinitionNameCountryLanguageComponent dst = new MedicinalProductDefinitionNameCountryLanguageComponent();
1114        copyValues(dst);
1115        return dst;
1116      }
1117
1118      public void copyValues(MedicinalProductDefinitionNameCountryLanguageComponent dst) {
1119        super.copyValues(dst);
1120        dst.country = country == null ? null : country.copy();
1121        dst.jurisdiction = jurisdiction == null ? null : jurisdiction.copy();
1122        dst.language = language == null ? null : language.copy();
1123      }
1124
1125      @Override
1126      public boolean equalsDeep(Base other_) {
1127        if (!super.equalsDeep(other_))
1128          return false;
1129        if (!(other_ instanceof MedicinalProductDefinitionNameCountryLanguageComponent))
1130          return false;
1131        MedicinalProductDefinitionNameCountryLanguageComponent o = (MedicinalProductDefinitionNameCountryLanguageComponent) other_;
1132        return compareDeep(country, o.country, true) && compareDeep(jurisdiction, o.jurisdiction, true)
1133           && compareDeep(language, o.language, true);
1134      }
1135
1136      @Override
1137      public boolean equalsShallow(Base other_) {
1138        if (!super.equalsShallow(other_))
1139          return false;
1140        if (!(other_ instanceof MedicinalProductDefinitionNameCountryLanguageComponent))
1141          return false;
1142        MedicinalProductDefinitionNameCountryLanguageComponent o = (MedicinalProductDefinitionNameCountryLanguageComponent) other_;
1143        return true;
1144      }
1145
1146      public boolean isEmpty() {
1147        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(country, jurisdiction, language
1148          );
1149      }
1150
1151  public String fhirType() {
1152    return "MedicinalProductDefinition.name.countryLanguage";
1153
1154  }
1155
1156  }
1157
1158    @Block()
1159    public static class MedicinalProductDefinitionManufacturingBusinessOperationComponent extends BackboneElement implements IBaseBackboneElement {
1160        /**
1161         * The type of manufacturing operation e.g. manufacturing itself, re-packaging.
1162         */
1163        @Child(name = "operationType", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
1164        @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." )
1165        protected CodeableConcept operationType;
1166
1167        /**
1168         * Regulatory authorization reference number.
1169         */
1170        @Child(name = "authorisationReferenceNumber", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=true)
1171        @Description(shortDefinition="Regulatory authorization reference number", formalDefinition="Regulatory authorization reference number." )
1172        protected Identifier authorisationReferenceNumber;
1173
1174        /**
1175         * Regulatory authorization date.
1176         */
1177        @Child(name = "effectiveDate", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true)
1178        @Description(shortDefinition="Regulatory authorization date", formalDefinition="Regulatory authorization date." )
1179        protected Period effectiveDate;
1180
1181        /**
1182         * To indicate if this proces is commercially confidential.
1183         */
1184        @Child(name = "confidentialityIndicator", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
1185        @Description(shortDefinition="To indicate if this proces is commercially confidential", formalDefinition="To indicate if this proces is commercially confidential." )
1186        protected CodeableConcept confidentialityIndicator;
1187
1188        /**
1189         * The manufacturer or establishment associated with the process.
1190         */
1191        @Child(name = "manufacturer", type = {Organization.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1192        @Description(shortDefinition="The manufacturer or establishment associated with the process", formalDefinition="The manufacturer or establishment associated with the process." )
1193        protected List<Reference> manufacturer;
1194
1195        /**
1196         * A regulator which oversees the operation.
1197         */
1198        @Child(name = "regulator", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true)
1199        @Description(shortDefinition="A regulator which oversees the operation", formalDefinition="A regulator which oversees the operation." )
1200        protected Reference regulator;
1201
1202        private static final long serialVersionUID = -268651569L;
1203
1204    /**
1205     * Constructor
1206     */
1207      public MedicinalProductDefinitionManufacturingBusinessOperationComponent() {
1208        super();
1209      }
1210
1211        /**
1212         * @return {@link #operationType} (The type of manufacturing operation e.g. manufacturing itself, re-packaging.)
1213         */
1214        public CodeableConcept getOperationType() { 
1215          if (this.operationType == null)
1216            if (Configuration.errorOnAutoCreate())
1217              throw new Error("Attempt to auto-create MedicinalProductDefinitionManufacturingBusinessOperationComponent.operationType");
1218            else if (Configuration.doAutoCreate())
1219              this.operationType = new CodeableConcept(); // cc
1220          return this.operationType;
1221        }
1222
1223        public boolean hasOperationType() { 
1224          return this.operationType != null && !this.operationType.isEmpty();
1225        }
1226
1227        /**
1228         * @param value {@link #operationType} (The type of manufacturing operation e.g. manufacturing itself, re-packaging.)
1229         */
1230        public MedicinalProductDefinitionManufacturingBusinessOperationComponent setOperationType(CodeableConcept value) { 
1231          this.operationType = value;
1232          return this;
1233        }
1234
1235        /**
1236         * @return {@link #authorisationReferenceNumber} (Regulatory authorization reference number.)
1237         */
1238        public Identifier getAuthorisationReferenceNumber() { 
1239          if (this.authorisationReferenceNumber == null)
1240            if (Configuration.errorOnAutoCreate())
1241              throw new Error("Attempt to auto-create MedicinalProductDefinitionManufacturingBusinessOperationComponent.authorisationReferenceNumber");
1242            else if (Configuration.doAutoCreate())
1243              this.authorisationReferenceNumber = new Identifier(); // cc
1244          return this.authorisationReferenceNumber;
1245        }
1246
1247        public boolean hasAuthorisationReferenceNumber() { 
1248          return this.authorisationReferenceNumber != null && !this.authorisationReferenceNumber.isEmpty();
1249        }
1250
1251        /**
1252         * @param value {@link #authorisationReferenceNumber} (Regulatory authorization reference number.)
1253         */
1254        public MedicinalProductDefinitionManufacturingBusinessOperationComponent setAuthorisationReferenceNumber(Identifier value) { 
1255          this.authorisationReferenceNumber = value;
1256          return this;
1257        }
1258
1259        /**
1260         * @return {@link #effectiveDate} (Regulatory authorization date.)
1261         */
1262        public Period getEffectiveDate() { 
1263          if (this.effectiveDate == null)
1264            if (Configuration.errorOnAutoCreate())
1265              throw new Error("Attempt to auto-create MedicinalProductDefinitionManufacturingBusinessOperationComponent.effectiveDate");
1266            else if (Configuration.doAutoCreate())
1267              this.effectiveDate = new Period(); // cc
1268          return this.effectiveDate;
1269        }
1270
1271        public boolean hasEffectiveDate() { 
1272          return this.effectiveDate != null && !this.effectiveDate.isEmpty();
1273        }
1274
1275        /**
1276         * @param value {@link #effectiveDate} (Regulatory authorization date.)
1277         */
1278        public MedicinalProductDefinitionManufacturingBusinessOperationComponent setEffectiveDate(Period value) { 
1279          this.effectiveDate = value;
1280          return this;
1281        }
1282
1283        /**
1284         * @return {@link #confidentialityIndicator} (To indicate if this proces is commercially confidential.)
1285         */
1286        public CodeableConcept getConfidentialityIndicator() { 
1287          if (this.confidentialityIndicator == null)
1288            if (Configuration.errorOnAutoCreate())
1289              throw new Error("Attempt to auto-create MedicinalProductDefinitionManufacturingBusinessOperationComponent.confidentialityIndicator");
1290            else if (Configuration.doAutoCreate())
1291              this.confidentialityIndicator = new CodeableConcept(); // cc
1292          return this.confidentialityIndicator;
1293        }
1294
1295        public boolean hasConfidentialityIndicator() { 
1296          return this.confidentialityIndicator != null && !this.confidentialityIndicator.isEmpty();
1297        }
1298
1299        /**
1300         * @param value {@link #confidentialityIndicator} (To indicate if this proces is commercially confidential.)
1301         */
1302        public MedicinalProductDefinitionManufacturingBusinessOperationComponent setConfidentialityIndicator(CodeableConcept value) { 
1303          this.confidentialityIndicator = value;
1304          return this;
1305        }
1306
1307        /**
1308         * @return {@link #manufacturer} (The manufacturer or establishment associated with the process.)
1309         */
1310        public List<Reference> getManufacturer() { 
1311          if (this.manufacturer == null)
1312            this.manufacturer = new ArrayList<Reference>();
1313          return this.manufacturer;
1314        }
1315
1316        /**
1317         * @return Returns a reference to <code>this</code> for easy method chaining
1318         */
1319        public MedicinalProductDefinitionManufacturingBusinessOperationComponent setManufacturer(List<Reference> theManufacturer) { 
1320          this.manufacturer = theManufacturer;
1321          return this;
1322        }
1323
1324        public boolean hasManufacturer() { 
1325          if (this.manufacturer == null)
1326            return false;
1327          for (Reference item : this.manufacturer)
1328            if (!item.isEmpty())
1329              return true;
1330          return false;
1331        }
1332
1333        public Reference addManufacturer() { //3
1334          Reference t = new Reference();
1335          if (this.manufacturer == null)
1336            this.manufacturer = new ArrayList<Reference>();
1337          this.manufacturer.add(t);
1338          return t;
1339        }
1340
1341        public MedicinalProductDefinitionManufacturingBusinessOperationComponent addManufacturer(Reference t) { //3
1342          if (t == null)
1343            return this;
1344          if (this.manufacturer == null)
1345            this.manufacturer = new ArrayList<Reference>();
1346          this.manufacturer.add(t);
1347          return this;
1348        }
1349
1350        /**
1351         * @return The first repetition of repeating field {@link #manufacturer}, creating it if it does not already exist
1352         */
1353        public Reference getManufacturerFirstRep() { 
1354          if (getManufacturer().isEmpty()) {
1355            addManufacturer();
1356          }
1357          return getManufacturer().get(0);
1358        }
1359
1360        /**
1361         * @return {@link #regulator} (A regulator which oversees the operation.)
1362         */
1363        public Reference getRegulator() { 
1364          if (this.regulator == null)
1365            if (Configuration.errorOnAutoCreate())
1366              throw new Error("Attempt to auto-create MedicinalProductDefinitionManufacturingBusinessOperationComponent.regulator");
1367            else if (Configuration.doAutoCreate())
1368              this.regulator = new Reference(); // cc
1369          return this.regulator;
1370        }
1371
1372        public boolean hasRegulator() { 
1373          return this.regulator != null && !this.regulator.isEmpty();
1374        }
1375
1376        /**
1377         * @param value {@link #regulator} (A regulator which oversees the operation.)
1378         */
1379        public MedicinalProductDefinitionManufacturingBusinessOperationComponent setRegulator(Reference value) { 
1380          this.regulator = value;
1381          return this;
1382        }
1383
1384        protected void listChildren(List<Property> children) {
1385          super.listChildren(children);
1386          children.add(new Property("operationType", "CodeableConcept", "The type of manufacturing operation e.g. manufacturing itself, re-packaging.", 0, 1, operationType));
1387          children.add(new Property("authorisationReferenceNumber", "Identifier", "Regulatory authorization reference number.", 0, 1, authorisationReferenceNumber));
1388          children.add(new Property("effectiveDate", "Period", "Regulatory authorization date.", 0, 1, effectiveDate));
1389          children.add(new Property("confidentialityIndicator", "CodeableConcept", "To indicate if this proces is commercially confidential.", 0, 1, confidentialityIndicator));
1390          children.add(new Property("manufacturer", "Reference(Organization)", "The manufacturer or establishment associated with the process.", 0, java.lang.Integer.MAX_VALUE, manufacturer));
1391          children.add(new Property("regulator", "Reference(Organization)", "A regulator which oversees the operation.", 0, 1, regulator));
1392        }
1393
1394        @Override
1395        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1396          switch (_hash) {
1397          case 91999553: /*operationType*/  return new Property("operationType", "CodeableConcept", "The type of manufacturing operation e.g. manufacturing itself, re-packaging.", 0, 1, operationType);
1398          case -1940839884: /*authorisationReferenceNumber*/  return new Property("authorisationReferenceNumber", "Identifier", "Regulatory authorization reference number.", 0, 1, authorisationReferenceNumber);
1399          case -930389515: /*effectiveDate*/  return new Property("effectiveDate", "Period", "Regulatory authorization date.", 0, 1, effectiveDate);
1400          case -1449404791: /*confidentialityIndicator*/  return new Property("confidentialityIndicator", "CodeableConcept", "To indicate if this proces is commercially confidential.", 0, 1, confidentialityIndicator);
1401          case -1969347631: /*manufacturer*/  return new Property("manufacturer", "Reference(Organization)", "The manufacturer or establishment associated with the process.", 0, java.lang.Integer.MAX_VALUE, manufacturer);
1402          case 414760449: /*regulator*/  return new Property("regulator", "Reference(Organization)", "A regulator which oversees the operation.", 0, 1, regulator);
1403          default: return super.getNamedProperty(_hash, _name, _checkValid);
1404          }
1405
1406        }
1407
1408      @Override
1409      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1410        switch (hash) {
1411        case 91999553: /*operationType*/ return this.operationType == null ? new Base[0] : new Base[] {this.operationType}; // CodeableConcept
1412        case -1940839884: /*authorisationReferenceNumber*/ return this.authorisationReferenceNumber == null ? new Base[0] : new Base[] {this.authorisationReferenceNumber}; // Identifier
1413        case -930389515: /*effectiveDate*/ return this.effectiveDate == null ? new Base[0] : new Base[] {this.effectiveDate}; // Period
1414        case -1449404791: /*confidentialityIndicator*/ return this.confidentialityIndicator == null ? new Base[0] : new Base[] {this.confidentialityIndicator}; // CodeableConcept
1415        case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : this.manufacturer.toArray(new Base[this.manufacturer.size()]); // Reference
1416        case 414760449: /*regulator*/ return this.regulator == null ? new Base[0] : new Base[] {this.regulator}; // Reference
1417        default: return super.getProperty(hash, name, checkValid);
1418        }
1419
1420      }
1421
1422      @Override
1423      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1424        switch (hash) {
1425        case 91999553: // operationType
1426          this.operationType = castToCodeableConcept(value); // CodeableConcept
1427          return value;
1428        case -1940839884: // authorisationReferenceNumber
1429          this.authorisationReferenceNumber = castToIdentifier(value); // Identifier
1430          return value;
1431        case -930389515: // effectiveDate
1432          this.effectiveDate = castToPeriod(value); // Period
1433          return value;
1434        case -1449404791: // confidentialityIndicator
1435          this.confidentialityIndicator = castToCodeableConcept(value); // CodeableConcept
1436          return value;
1437        case -1969347631: // manufacturer
1438          this.getManufacturer().add(castToReference(value)); // Reference
1439          return value;
1440        case 414760449: // regulator
1441          this.regulator = castToReference(value); // Reference
1442          return value;
1443        default: return super.setProperty(hash, name, value);
1444        }
1445
1446      }
1447
1448      @Override
1449      public Base setProperty(String name, Base value) throws FHIRException {
1450        if (name.equals("operationType")) {
1451          this.operationType = castToCodeableConcept(value); // CodeableConcept
1452        } else if (name.equals("authorisationReferenceNumber")) {
1453          this.authorisationReferenceNumber = castToIdentifier(value); // Identifier
1454        } else if (name.equals("effectiveDate")) {
1455          this.effectiveDate = castToPeriod(value); // Period
1456        } else if (name.equals("confidentialityIndicator")) {
1457          this.confidentialityIndicator = castToCodeableConcept(value); // CodeableConcept
1458        } else if (name.equals("manufacturer")) {
1459          this.getManufacturer().add(castToReference(value));
1460        } else if (name.equals("regulator")) {
1461          this.regulator = castToReference(value); // Reference
1462        } else
1463          return super.setProperty(name, value);
1464        return value;
1465      }
1466
1467      @Override
1468      public Base makeProperty(int hash, String name) throws FHIRException {
1469        switch (hash) {
1470        case 91999553:  return getOperationType();
1471        case -1940839884:  return getAuthorisationReferenceNumber();
1472        case -930389515:  return getEffectiveDate();
1473        case -1449404791:  return getConfidentialityIndicator();
1474        case -1969347631:  return addManufacturer(); 
1475        case 414760449:  return getRegulator();
1476        default: return super.makeProperty(hash, name);
1477        }
1478
1479      }
1480
1481      @Override
1482      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1483        switch (hash) {
1484        case 91999553: /*operationType*/ return new String[] {"CodeableConcept"};
1485        case -1940839884: /*authorisationReferenceNumber*/ return new String[] {"Identifier"};
1486        case -930389515: /*effectiveDate*/ return new String[] {"Period"};
1487        case -1449404791: /*confidentialityIndicator*/ return new String[] {"CodeableConcept"};
1488        case -1969347631: /*manufacturer*/ return new String[] {"Reference"};
1489        case 414760449: /*regulator*/ return new String[] {"Reference"};
1490        default: return super.getTypesForProperty(hash, name);
1491        }
1492
1493      }
1494
1495      @Override
1496      public Base addChild(String name) throws FHIRException {
1497        if (name.equals("operationType")) {
1498          this.operationType = new CodeableConcept();
1499          return this.operationType;
1500        }
1501        else if (name.equals("authorisationReferenceNumber")) {
1502          this.authorisationReferenceNumber = new Identifier();
1503          return this.authorisationReferenceNumber;
1504        }
1505        else if (name.equals("effectiveDate")) {
1506          this.effectiveDate = new Period();
1507          return this.effectiveDate;
1508        }
1509        else if (name.equals("confidentialityIndicator")) {
1510          this.confidentialityIndicator = new CodeableConcept();
1511          return this.confidentialityIndicator;
1512        }
1513        else if (name.equals("manufacturer")) {
1514          return addManufacturer();
1515        }
1516        else if (name.equals("regulator")) {
1517          this.regulator = new Reference();
1518          return this.regulator;
1519        }
1520        else
1521          return super.addChild(name);
1522      }
1523
1524      public MedicinalProductDefinitionManufacturingBusinessOperationComponent copy() {
1525        MedicinalProductDefinitionManufacturingBusinessOperationComponent dst = new MedicinalProductDefinitionManufacturingBusinessOperationComponent();
1526        copyValues(dst);
1527        return dst;
1528      }
1529
1530      public void copyValues(MedicinalProductDefinitionManufacturingBusinessOperationComponent dst) {
1531        super.copyValues(dst);
1532        dst.operationType = operationType == null ? null : operationType.copy();
1533        dst.authorisationReferenceNumber = authorisationReferenceNumber == null ? null : authorisationReferenceNumber.copy();
1534        dst.effectiveDate = effectiveDate == null ? null : effectiveDate.copy();
1535        dst.confidentialityIndicator = confidentialityIndicator == null ? null : confidentialityIndicator.copy();
1536        if (manufacturer != null) {
1537          dst.manufacturer = new ArrayList<Reference>();
1538          for (Reference i : manufacturer)
1539            dst.manufacturer.add(i.copy());
1540        };
1541        dst.regulator = regulator == null ? null : regulator.copy();
1542      }
1543
1544      @Override
1545      public boolean equalsDeep(Base other_) {
1546        if (!super.equalsDeep(other_))
1547          return false;
1548        if (!(other_ instanceof MedicinalProductDefinitionManufacturingBusinessOperationComponent))
1549          return false;
1550        MedicinalProductDefinitionManufacturingBusinessOperationComponent o = (MedicinalProductDefinitionManufacturingBusinessOperationComponent) other_;
1551        return compareDeep(operationType, o.operationType, true) && compareDeep(authorisationReferenceNumber, o.authorisationReferenceNumber, true)
1552           && compareDeep(effectiveDate, o.effectiveDate, true) && compareDeep(confidentialityIndicator, o.confidentialityIndicator, true)
1553           && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(regulator, o.regulator, true)
1554          ;
1555      }
1556
1557      @Override
1558      public boolean equalsShallow(Base other_) {
1559        if (!super.equalsShallow(other_))
1560          return false;
1561        if (!(other_ instanceof MedicinalProductDefinitionManufacturingBusinessOperationComponent))
1562          return false;
1563        MedicinalProductDefinitionManufacturingBusinessOperationComponent o = (MedicinalProductDefinitionManufacturingBusinessOperationComponent) other_;
1564        return true;
1565      }
1566
1567      public boolean isEmpty() {
1568        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(operationType, authorisationReferenceNumber
1569          , effectiveDate, confidentialityIndicator, manufacturer, regulator);
1570      }
1571
1572  public String fhirType() {
1573    return "MedicinalProductDefinition.manufacturingBusinessOperation";
1574
1575  }
1576
1577  }
1578
1579    @Block()
1580    public static class MedicinalProductDefinitionSpecialDesignationComponent extends BackboneElement implements IBaseBackboneElement {
1581        /**
1582         * Identifier for the designation, or procedure number.
1583         */
1584        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1585        @Description(shortDefinition="Identifier for the designation, or procedure number", formalDefinition="Identifier for the designation, or procedure number." )
1586        protected List<Identifier> identifier;
1587
1588        /**
1589         * The type of special designation, e.g. orphan drug, minor use.
1590         */
1591        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
1592        @Description(shortDefinition="The type of special designation, e.g. orphan drug, minor use", formalDefinition="The type of special designation, e.g. orphan drug, minor use." )
1593        protected CodeableConcept type;
1594
1595        /**
1596         * The intended use of the product, e.g. prevention, treatment.
1597         */
1598        @Child(name = "intendedUse", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
1599        @Description(shortDefinition="The intended use of the product, e.g. prevention, treatment", formalDefinition="The intended use of the product, e.g. prevention, treatment." )
1600        protected CodeableConcept intendedUse;
1601
1602        /**
1603         * Condition for which the medicinal use applies.
1604         */
1605        @Child(name = "indication", type = {CodeableConcept.class, ClinicalUseIssue.class}, order=4, min=0, max=1, modifier=false, summary=true)
1606        @Description(shortDefinition="Condition for which the medicinal use applies", formalDefinition="Condition for which the medicinal use applies." )
1607        protected Type indication;
1608
1609        /**
1610         * For example granted, pending, expired or withdrawn.
1611         */
1612        @Child(name = "status", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true)
1613        @Description(shortDefinition="For example granted, pending, expired or withdrawn", formalDefinition="For example granted, pending, expired or withdrawn." )
1614        protected CodeableConcept status;
1615
1616        /**
1617         * Date when the designation was granted.
1618         */
1619        @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true)
1620        @Description(shortDefinition="Date when the designation was granted", formalDefinition="Date when the designation was granted." )
1621        protected DateTimeType date;
1622
1623        /**
1624         * Animal species for which this applies.
1625         */
1626        @Child(name = "species", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true)
1627        @Description(shortDefinition="Animal species for which this applies", formalDefinition="Animal species for which this applies." )
1628        protected CodeableConcept species;
1629
1630        private static final long serialVersionUID = -1316809207L;
1631
1632    /**
1633     * Constructor
1634     */
1635      public MedicinalProductDefinitionSpecialDesignationComponent() {
1636        super();
1637      }
1638
1639        /**
1640         * @return {@link #identifier} (Identifier for the designation, or procedure number.)
1641         */
1642        public List<Identifier> getIdentifier() { 
1643          if (this.identifier == null)
1644            this.identifier = new ArrayList<Identifier>();
1645          return this.identifier;
1646        }
1647
1648        /**
1649         * @return Returns a reference to <code>this</code> for easy method chaining
1650         */
1651        public MedicinalProductDefinitionSpecialDesignationComponent setIdentifier(List<Identifier> theIdentifier) { 
1652          this.identifier = theIdentifier;
1653          return this;
1654        }
1655
1656        public boolean hasIdentifier() { 
1657          if (this.identifier == null)
1658            return false;
1659          for (Identifier item : this.identifier)
1660            if (!item.isEmpty())
1661              return true;
1662          return false;
1663        }
1664
1665        public Identifier addIdentifier() { //3
1666          Identifier t = new Identifier();
1667          if (this.identifier == null)
1668            this.identifier = new ArrayList<Identifier>();
1669          this.identifier.add(t);
1670          return t;
1671        }
1672
1673        public MedicinalProductDefinitionSpecialDesignationComponent addIdentifier(Identifier t) { //3
1674          if (t == null)
1675            return this;
1676          if (this.identifier == null)
1677            this.identifier = new ArrayList<Identifier>();
1678          this.identifier.add(t);
1679          return this;
1680        }
1681
1682        /**
1683         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1684         */
1685        public Identifier getIdentifierFirstRep() { 
1686          if (getIdentifier().isEmpty()) {
1687            addIdentifier();
1688          }
1689          return getIdentifier().get(0);
1690        }
1691
1692        /**
1693         * @return {@link #type} (The type of special designation, e.g. orphan drug, minor use.)
1694         */
1695        public CodeableConcept getType() { 
1696          if (this.type == null)
1697            if (Configuration.errorOnAutoCreate())
1698              throw new Error("Attempt to auto-create MedicinalProductDefinitionSpecialDesignationComponent.type");
1699            else if (Configuration.doAutoCreate())
1700              this.type = new CodeableConcept(); // cc
1701          return this.type;
1702        }
1703
1704        public boolean hasType() { 
1705          return this.type != null && !this.type.isEmpty();
1706        }
1707
1708        /**
1709         * @param value {@link #type} (The type of special designation, e.g. orphan drug, minor use.)
1710         */
1711        public MedicinalProductDefinitionSpecialDesignationComponent setType(CodeableConcept value) { 
1712          this.type = value;
1713          return this;
1714        }
1715
1716        /**
1717         * @return {@link #intendedUse} (The intended use of the product, e.g. prevention, treatment.)
1718         */
1719        public CodeableConcept getIntendedUse() { 
1720          if (this.intendedUse == null)
1721            if (Configuration.errorOnAutoCreate())
1722              throw new Error("Attempt to auto-create MedicinalProductDefinitionSpecialDesignationComponent.intendedUse");
1723            else if (Configuration.doAutoCreate())
1724              this.intendedUse = new CodeableConcept(); // cc
1725          return this.intendedUse;
1726        }
1727
1728        public boolean hasIntendedUse() { 
1729          return this.intendedUse != null && !this.intendedUse.isEmpty();
1730        }
1731
1732        /**
1733         * @param value {@link #intendedUse} (The intended use of the product, e.g. prevention, treatment.)
1734         */
1735        public MedicinalProductDefinitionSpecialDesignationComponent setIntendedUse(CodeableConcept value) { 
1736          this.intendedUse = value;
1737          return this;
1738        }
1739
1740        /**
1741         * @return {@link #indication} (Condition for which the medicinal use applies.)
1742         */
1743        public Type getIndication() { 
1744          return this.indication;
1745        }
1746
1747        /**
1748         * @return {@link #indication} (Condition for which the medicinal use applies.)
1749         */
1750        public CodeableConcept getIndicationCodeableConcept() throws FHIRException { 
1751          if (this.indication == null)
1752            this.indication = new CodeableConcept();
1753          if (!(this.indication instanceof CodeableConcept))
1754            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.indication.getClass().getName()+" was encountered");
1755          return (CodeableConcept) this.indication;
1756        }
1757
1758        public boolean hasIndicationCodeableConcept() { 
1759          return this != null && this.indication instanceof CodeableConcept;
1760        }
1761
1762        /**
1763         * @return {@link #indication} (Condition for which the medicinal use applies.)
1764         */
1765        public Reference getIndicationReference() throws FHIRException { 
1766          if (this.indication == null)
1767            this.indication = new Reference();
1768          if (!(this.indication instanceof Reference))
1769            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.indication.getClass().getName()+" was encountered");
1770          return (Reference) this.indication;
1771        }
1772
1773        public boolean hasIndicationReference() { 
1774          return this != null && this.indication instanceof Reference;
1775        }
1776
1777        public boolean hasIndication() { 
1778          return this.indication != null && !this.indication.isEmpty();
1779        }
1780
1781        /**
1782         * @param value {@link #indication} (Condition for which the medicinal use applies.)
1783         */
1784        public MedicinalProductDefinitionSpecialDesignationComponent setIndication(Type value) { 
1785          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
1786            throw new Error("Not the right type for MedicinalProductDefinition.specialDesignation.indication[x]: "+value.fhirType());
1787          this.indication = value;
1788          return this;
1789        }
1790
1791        /**
1792         * @return {@link #status} (For example granted, pending, expired or withdrawn.)
1793         */
1794        public CodeableConcept getStatus() { 
1795          if (this.status == null)
1796            if (Configuration.errorOnAutoCreate())
1797              throw new Error("Attempt to auto-create MedicinalProductDefinitionSpecialDesignationComponent.status");
1798            else if (Configuration.doAutoCreate())
1799              this.status = new CodeableConcept(); // cc
1800          return this.status;
1801        }
1802
1803        public boolean hasStatus() { 
1804          return this.status != null && !this.status.isEmpty();
1805        }
1806
1807        /**
1808         * @param value {@link #status} (For example granted, pending, expired or withdrawn.)
1809         */
1810        public MedicinalProductDefinitionSpecialDesignationComponent setStatus(CodeableConcept value) { 
1811          this.status = value;
1812          return this;
1813        }
1814
1815        /**
1816         * @return {@link #date} (Date when the designation was granted.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1817         */
1818        public DateTimeType getDateElement() { 
1819          if (this.date == null)
1820            if (Configuration.errorOnAutoCreate())
1821              throw new Error("Attempt to auto-create MedicinalProductDefinitionSpecialDesignationComponent.date");
1822            else if (Configuration.doAutoCreate())
1823              this.date = new DateTimeType(); // bb
1824          return this.date;
1825        }
1826
1827        public boolean hasDateElement() { 
1828          return this.date != null && !this.date.isEmpty();
1829        }
1830
1831        public boolean hasDate() { 
1832          return this.date != null && !this.date.isEmpty();
1833        }
1834
1835        /**
1836         * @param value {@link #date} (Date when the designation was granted.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1837         */
1838        public MedicinalProductDefinitionSpecialDesignationComponent setDateElement(DateTimeType value) { 
1839          this.date = value;
1840          return this;
1841        }
1842
1843        /**
1844         * @return Date when the designation was granted.
1845         */
1846        public Date getDate() { 
1847          return this.date == null ? null : this.date.getValue();
1848        }
1849
1850        /**
1851         * @param value Date when the designation was granted.
1852         */
1853        public MedicinalProductDefinitionSpecialDesignationComponent setDate(Date value) { 
1854          if (value == null)
1855            this.date = null;
1856          else {
1857            if (this.date == null)
1858              this.date = new DateTimeType();
1859            this.date.setValue(value);
1860          }
1861          return this;
1862        }
1863
1864        /**
1865         * @return {@link #species} (Animal species for which this applies.)
1866         */
1867        public CodeableConcept getSpecies() { 
1868          if (this.species == null)
1869            if (Configuration.errorOnAutoCreate())
1870              throw new Error("Attempt to auto-create MedicinalProductDefinitionSpecialDesignationComponent.species");
1871            else if (Configuration.doAutoCreate())
1872              this.species = new CodeableConcept(); // cc
1873          return this.species;
1874        }
1875
1876        public boolean hasSpecies() { 
1877          return this.species != null && !this.species.isEmpty();
1878        }
1879
1880        /**
1881         * @param value {@link #species} (Animal species for which this applies.)
1882         */
1883        public MedicinalProductDefinitionSpecialDesignationComponent setSpecies(CodeableConcept value) { 
1884          this.species = value;
1885          return this;
1886        }
1887
1888        protected void listChildren(List<Property> children) {
1889          super.listChildren(children);
1890          children.add(new Property("identifier", "Identifier", "Identifier for the designation, or procedure number.", 0, java.lang.Integer.MAX_VALUE, identifier));
1891          children.add(new Property("type", "CodeableConcept", "The type of special designation, e.g. orphan drug, minor use.", 0, 1, type));
1892          children.add(new Property("intendedUse", "CodeableConcept", "The intended use of the product, e.g. prevention, treatment.", 0, 1, intendedUse));
1893          children.add(new Property("indication[x]", "CodeableConcept|Reference(ClinicalUseIssue)", "Condition for which the medicinal use applies.", 0, 1, indication));
1894          children.add(new Property("status", "CodeableConcept", "For example granted, pending, expired or withdrawn.", 0, 1, status));
1895          children.add(new Property("date", "dateTime", "Date when the designation was granted.", 0, 1, date));
1896          children.add(new Property("species", "CodeableConcept", "Animal species for which this applies.", 0, 1, species));
1897        }
1898
1899        @Override
1900        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1901          switch (_hash) {
1902          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifier for the designation, or procedure number.", 0, java.lang.Integer.MAX_VALUE, identifier);
1903          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The type of special designation, e.g. orphan drug, minor use.", 0, 1, type);
1904          case -1618671268: /*intendedUse*/  return new Property("intendedUse", "CodeableConcept", "The intended use of the product, e.g. prevention, treatment.", 0, 1, intendedUse);
1905          case -501208668: /*indication[x]*/  return new Property("indication[x]", "CodeableConcept|Reference(ClinicalUseIssue)", "Condition for which the medicinal use applies.", 0, 1, indication);
1906          case -597168804: /*indication*/  return new Property("indication[x]", "CodeableConcept|Reference(ClinicalUseIssue)", "Condition for which the medicinal use applies.", 0, 1, indication);
1907          case -1094003035: /*indicationCodeableConcept*/  return new Property("indication[x]", "CodeableConcept|Reference(ClinicalUseIssue)", "Condition for which the medicinal use applies.", 0, 1, indication);
1908          case 803518799: /*indicationReference*/  return new Property("indication[x]", "CodeableConcept|Reference(ClinicalUseIssue)", "Condition for which the medicinal use applies.", 0, 1, indication);
1909          case -892481550: /*status*/  return new Property("status", "CodeableConcept", "For example granted, pending, expired or withdrawn.", 0, 1, status);
1910          case 3076014: /*date*/  return new Property("date", "dateTime", "Date when the designation was granted.", 0, 1, date);
1911          case -2008465092: /*species*/  return new Property("species", "CodeableConcept", "Animal species for which this applies.", 0, 1, species);
1912          default: return super.getNamedProperty(_hash, _name, _checkValid);
1913          }
1914
1915        }
1916
1917      @Override
1918      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1919        switch (hash) {
1920        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1921        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1922        case -1618671268: /*intendedUse*/ return this.intendedUse == null ? new Base[0] : new Base[] {this.intendedUse}; // CodeableConcept
1923        case -597168804: /*indication*/ return this.indication == null ? new Base[0] : new Base[] {this.indication}; // Type
1924        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept
1925        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
1926        case -2008465092: /*species*/ return this.species == null ? new Base[0] : new Base[] {this.species}; // CodeableConcept
1927        default: return super.getProperty(hash, name, checkValid);
1928        }
1929
1930      }
1931
1932      @Override
1933      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1934        switch (hash) {
1935        case -1618432855: // identifier
1936          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1937          return value;
1938        case 3575610: // type
1939          this.type = castToCodeableConcept(value); // CodeableConcept
1940          return value;
1941        case -1618671268: // intendedUse
1942          this.intendedUse = castToCodeableConcept(value); // CodeableConcept
1943          return value;
1944        case -597168804: // indication
1945          this.indication = castToType(value); // Type
1946          return value;
1947        case -892481550: // status
1948          this.status = castToCodeableConcept(value); // CodeableConcept
1949          return value;
1950        case 3076014: // date
1951          this.date = castToDateTime(value); // DateTimeType
1952          return value;
1953        case -2008465092: // species
1954          this.species = castToCodeableConcept(value); // CodeableConcept
1955          return value;
1956        default: return super.setProperty(hash, name, value);
1957        }
1958
1959      }
1960
1961      @Override
1962      public Base setProperty(String name, Base value) throws FHIRException {
1963        if (name.equals("identifier")) {
1964          this.getIdentifier().add(castToIdentifier(value));
1965        } else if (name.equals("type")) {
1966          this.type = castToCodeableConcept(value); // CodeableConcept
1967        } else if (name.equals("intendedUse")) {
1968          this.intendedUse = castToCodeableConcept(value); // CodeableConcept
1969        } else if (name.equals("indication[x]")) {
1970          this.indication = castToType(value); // Type
1971        } else if (name.equals("status")) {
1972          this.status = castToCodeableConcept(value); // CodeableConcept
1973        } else if (name.equals("date")) {
1974          this.date = castToDateTime(value); // DateTimeType
1975        } else if (name.equals("species")) {
1976          this.species = castToCodeableConcept(value); // CodeableConcept
1977        } else
1978          return super.setProperty(name, value);
1979        return value;
1980      }
1981
1982      @Override
1983      public Base makeProperty(int hash, String name) throws FHIRException {
1984        switch (hash) {
1985        case -1618432855:  return addIdentifier(); 
1986        case 3575610:  return getType();
1987        case -1618671268:  return getIntendedUse();
1988        case -501208668:  return getIndication();
1989        case -597168804:  return getIndication();
1990        case -892481550:  return getStatus();
1991        case 3076014:  return getDateElement();
1992        case -2008465092:  return getSpecies();
1993        default: return super.makeProperty(hash, name);
1994        }
1995
1996      }
1997
1998      @Override
1999      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2000        switch (hash) {
2001        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2002        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2003        case -1618671268: /*intendedUse*/ return new String[] {"CodeableConcept"};
2004        case -597168804: /*indication*/ return new String[] {"CodeableConcept", "Reference"};
2005        case -892481550: /*status*/ return new String[] {"CodeableConcept"};
2006        case 3076014: /*date*/ return new String[] {"dateTime"};
2007        case -2008465092: /*species*/ return new String[] {"CodeableConcept"};
2008        default: return super.getTypesForProperty(hash, name);
2009        }
2010
2011      }
2012
2013      @Override
2014      public Base addChild(String name) throws FHIRException {
2015        if (name.equals("identifier")) {
2016          return addIdentifier();
2017        }
2018        else if (name.equals("type")) {
2019          this.type = new CodeableConcept();
2020          return this.type;
2021        }
2022        else if (name.equals("intendedUse")) {
2023          this.intendedUse = new CodeableConcept();
2024          return this.intendedUse;
2025        }
2026        else if (name.equals("indicationCodeableConcept")) {
2027          this.indication = new CodeableConcept();
2028          return this.indication;
2029        }
2030        else if (name.equals("indicationReference")) {
2031          this.indication = new Reference();
2032          return this.indication;
2033        }
2034        else if (name.equals("status")) {
2035          this.status = new CodeableConcept();
2036          return this.status;
2037        }
2038        else if (name.equals("date")) {
2039          throw new FHIRException("Cannot call addChild on a primitive type MedicinalProductDefinition.date");
2040        }
2041        else if (name.equals("species")) {
2042          this.species = new CodeableConcept();
2043          return this.species;
2044        }
2045        else
2046          return super.addChild(name);
2047      }
2048
2049      public MedicinalProductDefinitionSpecialDesignationComponent copy() {
2050        MedicinalProductDefinitionSpecialDesignationComponent dst = new MedicinalProductDefinitionSpecialDesignationComponent();
2051        copyValues(dst);
2052        return dst;
2053      }
2054
2055      public void copyValues(MedicinalProductDefinitionSpecialDesignationComponent dst) {
2056        super.copyValues(dst);
2057        if (identifier != null) {
2058          dst.identifier = new ArrayList<Identifier>();
2059          for (Identifier i : identifier)
2060            dst.identifier.add(i.copy());
2061        };
2062        dst.type = type == null ? null : type.copy();
2063        dst.intendedUse = intendedUse == null ? null : intendedUse.copy();
2064        dst.indication = indication == null ? null : indication.copy();
2065        dst.status = status == null ? null : status.copy();
2066        dst.date = date == null ? null : date.copy();
2067        dst.species = species == null ? null : species.copy();
2068      }
2069
2070      @Override
2071      public boolean equalsDeep(Base other_) {
2072        if (!super.equalsDeep(other_))
2073          return false;
2074        if (!(other_ instanceof MedicinalProductDefinitionSpecialDesignationComponent))
2075          return false;
2076        MedicinalProductDefinitionSpecialDesignationComponent o = (MedicinalProductDefinitionSpecialDesignationComponent) other_;
2077        return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(intendedUse, o.intendedUse, true)
2078           && compareDeep(indication, o.indication, true) && compareDeep(status, o.status, true) && compareDeep(date, o.date, true)
2079           && compareDeep(species, o.species, true);
2080      }
2081
2082      @Override
2083      public boolean equalsShallow(Base other_) {
2084        if (!super.equalsShallow(other_))
2085          return false;
2086        if (!(other_ instanceof MedicinalProductDefinitionSpecialDesignationComponent))
2087          return false;
2088        MedicinalProductDefinitionSpecialDesignationComponent o = (MedicinalProductDefinitionSpecialDesignationComponent) other_;
2089        return compareValues(date, o.date, true);
2090      }
2091
2092      public boolean isEmpty() {
2093        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, intendedUse
2094          , indication, status, date, species);
2095      }
2096
2097  public String fhirType() {
2098    return "MedicinalProductDefinition.specialDesignation";
2099
2100  }
2101
2102  }
2103
2104    /**
2105     * Business identifier for this product. Could be an MPID.
2106     */
2107    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2108    @Description(shortDefinition="Business identifier for this product. Could be an MPID", formalDefinition="Business identifier for this product. Could be an MPID." )
2109    protected List<Identifier> identifier;
2110
2111    /**
2112     * Regulatory type, e.g. Investigational or Authorized.
2113     */
2114    @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
2115    @Description(shortDefinition="Regulatory type, e.g. Investigational or Authorized", formalDefinition="Regulatory type, e.g. Investigational or Authorized." )
2116    protected CodeableConcept type;
2117
2118    /**
2119     * If this medicine applies to human or veterinary uses.
2120     */
2121    @Child(name = "domain", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
2122    @Description(shortDefinition="If this medicine applies to human or veterinary uses", formalDefinition="If this medicine applies to human or veterinary uses." )
2123    protected Coding domain;
2124
2125    /**
2126     * General description of this product.
2127     */
2128    @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
2129    @Description(shortDefinition="General description of this product", formalDefinition="General description of this product." )
2130    protected StringType description;
2131
2132    /**
2133     * The dose form for a single part product, or combined form of a multiple part product.
2134     */
2135    @Child(name = "combinedPharmaceuticalDoseForm", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
2136    @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." )
2137    protected CodeableConcept combinedPharmaceuticalDoseForm;
2138
2139    /**
2140     * General combined description of indication(s) for this product. See also MedicinalProductDefinitionIndication.
2141     */
2142    @Child(name = "indication", type = {MarkdownType.class}, order=5, min=0, max=1, modifier=false, summary=true)
2143    @Description(shortDefinition="General combined description of indication(s) for this product. See also MedicinalProductDefinitionIndication", formalDefinition="General combined description of indication(s) for this product. See also MedicinalProductDefinitionIndication." )
2144    protected MarkdownType indication;
2145
2146    /**
2147     * The legal status of supply of the medicinal product as classified by the regulator.
2148     */
2149    @Child(name = "legalStatusOfSupply", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true)
2150    @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." )
2151    protected CodeableConcept legalStatusOfSupply;
2152
2153    /**
2154     * Whether the Medicinal Product is subject to additional monitoring for regulatory reasons.
2155     */
2156    @Child(name = "additionalMonitoringIndicator", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true)
2157    @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." )
2158    protected CodeableConcept additionalMonitoringIndicator;
2159
2160    /**
2161     * Whether the Medicinal Product is subject to special measures for regulatory reasons.
2162     */
2163    @Child(name = "specialMeasure", type = {StringType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2164    @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." )
2165    protected List<StringType> specialMeasure;
2166
2167    /**
2168     * If authorised for use in children.
2169     */
2170    @Child(name = "paediatricUseIndicator", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true)
2171    @Description(shortDefinition="If authorised for use in children", formalDefinition="If authorised for use in children." )
2172    protected CodeableConcept paediatricUseIndicator;
2173
2174    /**
2175     * Allows the product to be classified by various systems.
2176     */
2177    @Child(name = "productClassification", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2178    @Description(shortDefinition="Allows the product to be classified by various systems", formalDefinition="Allows the product to be classified by various systems." )
2179    protected List<CodeableConcept> productClassification;
2180
2181    /**
2182     * Marketing status of the medicinal product, in contrast to marketing authorizaton.
2183     */
2184    @Child(name = "marketingStatus", type = {MarketingStatus.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2185    @Description(shortDefinition="Marketing status of the medicinal product, in contrast to marketing authorizaton", formalDefinition="Marketing status of the medicinal product, in contrast to marketing authorizaton." )
2186    protected List<MarketingStatus> marketingStatus;
2187
2188    /**
2189     * Pharmaceutical aspects of product.
2190     */
2191    @Child(name = "pharmaceuticalProduct", type = {AdministrableProductDefinition.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2192    @Description(shortDefinition="Pharmaceutical aspects of product", formalDefinition="Pharmaceutical aspects of product." )
2193    protected List<Reference> pharmaceuticalProduct;
2194
2195    /**
2196     * Package representation for the product.
2197     */
2198    @Child(name = "packagedMedicinalProduct", type = {PackagedProductDefinition.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2199    @Description(shortDefinition="Package representation for the product", formalDefinition="Package representation for the product." )
2200    protected List<Reference> packagedMedicinalProduct;
2201
2202    /**
2203     * The ingredients of this medicinal product - when not specified elsewhere. This is only needed if the ingredients are not specified by the pharmaceuticalProduct or packagedMedicinalProduct references above. In cases where those levels of detail are not used, the ingredients may be specified directly here.
2204     */
2205    @Child(name = "ingredient", type = {Ingredient.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2206    @Description(shortDefinition="The ingredients of this medicinal product - when not specified elsewhere. This is only needed if the ingredients are not specified by the pharmaceuticalProduct or packagedMedicinalProduct references above. In cases where those levels of detail are not used, the ingredients may be specified directly here", formalDefinition="The ingredients of this medicinal product - when not specified elsewhere. This is only needed if the ingredients are not specified by the pharmaceuticalProduct or packagedMedicinalProduct references above. In cases where those levels of detail are not used, the ingredients may be specified directly here." )
2207    protected List<Reference> ingredient;
2208
2209    /**
2210     * Supporting documentation, typically for regulatory submission.
2211     */
2212    @Child(name = "attachedDocument", type = {DocumentReference.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2213    @Description(shortDefinition="Supporting documentation, typically for regulatory submission", formalDefinition="Supporting documentation, typically for regulatory submission." )
2214    protected List<Reference> attachedDocument;
2215
2216    /**
2217     * A master file for to the medicinal product (e.g. Pharmacovigilance System Master File).
2218     */
2219    @Child(name = "masterFile", type = {DocumentReference.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2220    @Description(shortDefinition="A master file for to the medicinal product (e.g. Pharmacovigilance System Master File)", formalDefinition="A master file for to the medicinal product (e.g. Pharmacovigilance System Master File)." )
2221    protected List<Reference> masterFile;
2222
2223    /**
2224     * A product specific contact, person (in a role), or an organization.
2225     */
2226    @Child(name = "contact", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2227    @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." )
2228    protected List<MedicinalProductDefinitionContactComponent> contact;
2229
2230    /**
2231     * Clinical trials or studies that this product is involved in.
2232     */
2233    @Child(name = "clinicalTrial", type = {ResearchStudy.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2234    @Description(shortDefinition="Clinical trials or studies that this product is involved in", formalDefinition="Clinical trials or studies that this product is involved in." )
2235    protected List<Reference> clinicalTrial;
2236
2237    /**
2238     * The product's name, including full name and possibly coded parts.
2239     */
2240    @Child(name = "name", type = {}, order=19, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2241    @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." )
2242    protected List<MedicinalProductDefinitionNameComponent> name;
2243
2244    /**
2245     * Reference to another product, e.g. for linking authorised to investigational product.
2246     */
2247    @Child(name = "crossReference", type = {Identifier.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2248    @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." )
2249    protected List<Identifier> crossReference;
2250
2251    /**
2252     * An operation applied to the product, for manufacturing or adminsitrative purpose.
2253     */
2254    @Child(name = "manufacturingBusinessOperation", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2255    @Description(shortDefinition="An operation applied to the product, for manufacturing or adminsitrative purpose", formalDefinition="An operation applied to the product, for manufacturing or adminsitrative purpose." )
2256    protected List<MedicinalProductDefinitionManufacturingBusinessOperationComponent> manufacturingBusinessOperation;
2257
2258    /**
2259     * Indicates if the medicinal product has an orphan designation for the treatment of a rare disease.
2260     */
2261    @Child(name = "specialDesignation", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2262    @Description(shortDefinition="Indicates if the medicinal product has an orphan designation for the treatment of a rare disease", formalDefinition="Indicates if the medicinal product has an orphan designation for the treatment of a rare disease." )
2263    protected List<MedicinalProductDefinitionSpecialDesignationComponent> specialDesignation;
2264
2265    private static final long serialVersionUID = 1392072167L;
2266
2267  /**
2268   * Constructor
2269   */
2270    public MedicinalProductDefinition() {
2271      super();
2272    }
2273
2274    /**
2275     * @return {@link #identifier} (Business identifier for this product. Could be an MPID.)
2276     */
2277    public List<Identifier> getIdentifier() { 
2278      if (this.identifier == null)
2279        this.identifier = new ArrayList<Identifier>();
2280      return this.identifier;
2281    }
2282
2283    /**
2284     * @return Returns a reference to <code>this</code> for easy method chaining
2285     */
2286    public MedicinalProductDefinition setIdentifier(List<Identifier> theIdentifier) { 
2287      this.identifier = theIdentifier;
2288      return this;
2289    }
2290
2291    public boolean hasIdentifier() { 
2292      if (this.identifier == null)
2293        return false;
2294      for (Identifier item : this.identifier)
2295        if (!item.isEmpty())
2296          return true;
2297      return false;
2298    }
2299
2300    public Identifier addIdentifier() { //3
2301      Identifier t = new Identifier();
2302      if (this.identifier == null)
2303        this.identifier = new ArrayList<Identifier>();
2304      this.identifier.add(t);
2305      return t;
2306    }
2307
2308    public MedicinalProductDefinition addIdentifier(Identifier t) { //3
2309      if (t == null)
2310        return this;
2311      if (this.identifier == null)
2312        this.identifier = new ArrayList<Identifier>();
2313      this.identifier.add(t);
2314      return this;
2315    }
2316
2317    /**
2318     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
2319     */
2320    public Identifier getIdentifierFirstRep() { 
2321      if (getIdentifier().isEmpty()) {
2322        addIdentifier();
2323      }
2324      return getIdentifier().get(0);
2325    }
2326
2327    /**
2328     * @return {@link #type} (Regulatory type, e.g. Investigational or Authorized.)
2329     */
2330    public CodeableConcept getType() { 
2331      if (this.type == null)
2332        if (Configuration.errorOnAutoCreate())
2333          throw new Error("Attempt to auto-create MedicinalProductDefinition.type");
2334        else if (Configuration.doAutoCreate())
2335          this.type = new CodeableConcept(); // cc
2336      return this.type;
2337    }
2338
2339    public boolean hasType() { 
2340      return this.type != null && !this.type.isEmpty();
2341    }
2342
2343    /**
2344     * @param value {@link #type} (Regulatory type, e.g. Investigational or Authorized.)
2345     */
2346    public MedicinalProductDefinition setType(CodeableConcept value) { 
2347      this.type = value;
2348      return this;
2349    }
2350
2351    /**
2352     * @return {@link #domain} (If this medicine applies to human or veterinary uses.)
2353     */
2354    public Coding getDomain() { 
2355      if (this.domain == null)
2356        if (Configuration.errorOnAutoCreate())
2357          throw new Error("Attempt to auto-create MedicinalProductDefinition.domain");
2358        else if (Configuration.doAutoCreate())
2359          this.domain = new Coding(); // cc
2360      return this.domain;
2361    }
2362
2363    public boolean hasDomain() { 
2364      return this.domain != null && !this.domain.isEmpty();
2365    }
2366
2367    /**
2368     * @param value {@link #domain} (If this medicine applies to human or veterinary uses.)
2369     */
2370    public MedicinalProductDefinition setDomain(Coding value) { 
2371      this.domain = value;
2372      return this;
2373    }
2374
2375    /**
2376     * @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
2377     */
2378    public StringType getDescriptionElement() { 
2379      if (this.description == null)
2380        if (Configuration.errorOnAutoCreate())
2381          throw new Error("Attempt to auto-create MedicinalProductDefinition.description");
2382        else if (Configuration.doAutoCreate())
2383          this.description = new StringType(); // bb
2384      return this.description;
2385    }
2386
2387    public boolean hasDescriptionElement() { 
2388      return this.description != null && !this.description.isEmpty();
2389    }
2390
2391    public boolean hasDescription() { 
2392      return this.description != null && !this.description.isEmpty();
2393    }
2394
2395    /**
2396     * @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
2397     */
2398    public MedicinalProductDefinition setDescriptionElement(StringType value) { 
2399      this.description = value;
2400      return this;
2401    }
2402
2403    /**
2404     * @return General description of this product.
2405     */
2406    public String getDescription() { 
2407      return this.description == null ? null : this.description.getValue();
2408    }
2409
2410    /**
2411     * @param value General description of this product.
2412     */
2413    public MedicinalProductDefinition setDescription(String value) { 
2414      if (Utilities.noString(value))
2415        this.description = null;
2416      else {
2417        if (this.description == null)
2418          this.description = new StringType();
2419        this.description.setValue(value);
2420      }
2421      return this;
2422    }
2423
2424    /**
2425     * @return {@link #combinedPharmaceuticalDoseForm} (The dose form for a single part product, or combined form of a multiple part product.)
2426     */
2427    public CodeableConcept getCombinedPharmaceuticalDoseForm() { 
2428      if (this.combinedPharmaceuticalDoseForm == null)
2429        if (Configuration.errorOnAutoCreate())
2430          throw new Error("Attempt to auto-create MedicinalProductDefinition.combinedPharmaceuticalDoseForm");
2431        else if (Configuration.doAutoCreate())
2432          this.combinedPharmaceuticalDoseForm = new CodeableConcept(); // cc
2433      return this.combinedPharmaceuticalDoseForm;
2434    }
2435
2436    public boolean hasCombinedPharmaceuticalDoseForm() { 
2437      return this.combinedPharmaceuticalDoseForm != null && !this.combinedPharmaceuticalDoseForm.isEmpty();
2438    }
2439
2440    /**
2441     * @param value {@link #combinedPharmaceuticalDoseForm} (The dose form for a single part product, or combined form of a multiple part product.)
2442     */
2443    public MedicinalProductDefinition setCombinedPharmaceuticalDoseForm(CodeableConcept value) { 
2444      this.combinedPharmaceuticalDoseForm = value;
2445      return this;
2446    }
2447
2448    /**
2449     * @return {@link #indication} (General combined description of indication(s) for this product. See also MedicinalProductDefinitionIndication.). This is the underlying object with id, value and extensions. The accessor "getIndication" gives direct access to the value
2450     */
2451    public MarkdownType getIndicationElement() { 
2452      if (this.indication == null)
2453        if (Configuration.errorOnAutoCreate())
2454          throw new Error("Attempt to auto-create MedicinalProductDefinition.indication");
2455        else if (Configuration.doAutoCreate())
2456          this.indication = new MarkdownType(); // bb
2457      return this.indication;
2458    }
2459
2460    public boolean hasIndicationElement() { 
2461      return this.indication != null && !this.indication.isEmpty();
2462    }
2463
2464    public boolean hasIndication() { 
2465      return this.indication != null && !this.indication.isEmpty();
2466    }
2467
2468    /**
2469     * @param value {@link #indication} (General combined description of indication(s) for this product. See also MedicinalProductDefinitionIndication.). This is the underlying object with id, value and extensions. The accessor "getIndication" gives direct access to the value
2470     */
2471    public MedicinalProductDefinition setIndicationElement(MarkdownType value) { 
2472      this.indication = value;
2473      return this;
2474    }
2475
2476    /**
2477     * @return General combined description of indication(s) for this product. See also MedicinalProductDefinitionIndication.
2478     */
2479    public String getIndication() { 
2480      return this.indication == null ? null : this.indication.getValue();
2481    }
2482
2483    /**
2484     * @param value General combined description of indication(s) for this product. See also MedicinalProductDefinitionIndication.
2485     */
2486    public MedicinalProductDefinition setIndication(String value) { 
2487      if (value == null)
2488        this.indication = null;
2489      else {
2490        if (this.indication == null)
2491          this.indication = new MarkdownType();
2492        this.indication.setValue(value);
2493      }
2494      return this;
2495    }
2496
2497    /**
2498     * @return {@link #legalStatusOfSupply} (The legal status of supply of the medicinal product as classified by the regulator.)
2499     */
2500    public CodeableConcept getLegalStatusOfSupply() { 
2501      if (this.legalStatusOfSupply == null)
2502        if (Configuration.errorOnAutoCreate())
2503          throw new Error("Attempt to auto-create MedicinalProductDefinition.legalStatusOfSupply");
2504        else if (Configuration.doAutoCreate())
2505          this.legalStatusOfSupply = new CodeableConcept(); // cc
2506      return this.legalStatusOfSupply;
2507    }
2508
2509    public boolean hasLegalStatusOfSupply() { 
2510      return this.legalStatusOfSupply != null && !this.legalStatusOfSupply.isEmpty();
2511    }
2512
2513    /**
2514     * @param value {@link #legalStatusOfSupply} (The legal status of supply of the medicinal product as classified by the regulator.)
2515     */
2516    public MedicinalProductDefinition setLegalStatusOfSupply(CodeableConcept value) { 
2517      this.legalStatusOfSupply = value;
2518      return this;
2519    }
2520
2521    /**
2522     * @return {@link #additionalMonitoringIndicator} (Whether the Medicinal Product is subject to additional monitoring for regulatory reasons.)
2523     */
2524    public CodeableConcept getAdditionalMonitoringIndicator() { 
2525      if (this.additionalMonitoringIndicator == null)
2526        if (Configuration.errorOnAutoCreate())
2527          throw new Error("Attempt to auto-create MedicinalProductDefinition.additionalMonitoringIndicator");
2528        else if (Configuration.doAutoCreate())
2529          this.additionalMonitoringIndicator = new CodeableConcept(); // cc
2530      return this.additionalMonitoringIndicator;
2531    }
2532
2533    public boolean hasAdditionalMonitoringIndicator() { 
2534      return this.additionalMonitoringIndicator != null && !this.additionalMonitoringIndicator.isEmpty();
2535    }
2536
2537    /**
2538     * @param value {@link #additionalMonitoringIndicator} (Whether the Medicinal Product is subject to additional monitoring for regulatory reasons.)
2539     */
2540    public MedicinalProductDefinition setAdditionalMonitoringIndicator(CodeableConcept value) { 
2541      this.additionalMonitoringIndicator = value;
2542      return this;
2543    }
2544
2545    /**
2546     * @return {@link #specialMeasure} (Whether the Medicinal Product is subject to special measures for regulatory reasons.)
2547     */
2548    public List<StringType> getSpecialMeasure() { 
2549      if (this.specialMeasure == null)
2550        this.specialMeasure = new ArrayList<StringType>();
2551      return this.specialMeasure;
2552    }
2553
2554    /**
2555     * @return Returns a reference to <code>this</code> for easy method chaining
2556     */
2557    public MedicinalProductDefinition setSpecialMeasure(List<StringType> theSpecialMeasure) { 
2558      this.specialMeasure = theSpecialMeasure;
2559      return this;
2560    }
2561
2562    public boolean hasSpecialMeasure() { 
2563      if (this.specialMeasure == null)
2564        return false;
2565      for (StringType item : this.specialMeasure)
2566        if (!item.isEmpty())
2567          return true;
2568      return false;
2569    }
2570
2571    /**
2572     * @return {@link #specialMeasure} (Whether the Medicinal Product is subject to special measures for regulatory reasons.)
2573     */
2574    public StringType addSpecialMeasureElement() {//2 
2575      StringType t = new StringType();
2576      if (this.specialMeasure == null)
2577        this.specialMeasure = new ArrayList<StringType>();
2578      this.specialMeasure.add(t);
2579      return t;
2580    }
2581
2582    /**
2583     * @param value {@link #specialMeasure} (Whether the Medicinal Product is subject to special measures for regulatory reasons.)
2584     */
2585    public MedicinalProductDefinition addSpecialMeasure(String value) { //1
2586      StringType t = new StringType();
2587      t.setValue(value);
2588      if (this.specialMeasure == null)
2589        this.specialMeasure = new ArrayList<StringType>();
2590      this.specialMeasure.add(t);
2591      return this;
2592    }
2593
2594    /**
2595     * @param value {@link #specialMeasure} (Whether the Medicinal Product is subject to special measures for regulatory reasons.)
2596     */
2597    public boolean hasSpecialMeasure(String value) { 
2598      if (this.specialMeasure == null)
2599        return false;
2600      for (StringType v : this.specialMeasure)
2601        if (v.getValue().equals(value)) // string
2602          return true;
2603      return false;
2604    }
2605
2606    /**
2607     * @return {@link #paediatricUseIndicator} (If authorised for use in children.)
2608     */
2609    public CodeableConcept getPaediatricUseIndicator() { 
2610      if (this.paediatricUseIndicator == null)
2611        if (Configuration.errorOnAutoCreate())
2612          throw new Error("Attempt to auto-create MedicinalProductDefinition.paediatricUseIndicator");
2613        else if (Configuration.doAutoCreate())
2614          this.paediatricUseIndicator = new CodeableConcept(); // cc
2615      return this.paediatricUseIndicator;
2616    }
2617
2618    public boolean hasPaediatricUseIndicator() { 
2619      return this.paediatricUseIndicator != null && !this.paediatricUseIndicator.isEmpty();
2620    }
2621
2622    /**
2623     * @param value {@link #paediatricUseIndicator} (If authorised for use in children.)
2624     */
2625    public MedicinalProductDefinition setPaediatricUseIndicator(CodeableConcept value) { 
2626      this.paediatricUseIndicator = value;
2627      return this;
2628    }
2629
2630    /**
2631     * @return {@link #productClassification} (Allows the product to be classified by various systems.)
2632     */
2633    public List<CodeableConcept> getProductClassification() { 
2634      if (this.productClassification == null)
2635        this.productClassification = new ArrayList<CodeableConcept>();
2636      return this.productClassification;
2637    }
2638
2639    /**
2640     * @return Returns a reference to <code>this</code> for easy method chaining
2641     */
2642    public MedicinalProductDefinition setProductClassification(List<CodeableConcept> theProductClassification) { 
2643      this.productClassification = theProductClassification;
2644      return this;
2645    }
2646
2647    public boolean hasProductClassification() { 
2648      if (this.productClassification == null)
2649        return false;
2650      for (CodeableConcept item : this.productClassification)
2651        if (!item.isEmpty())
2652          return true;
2653      return false;
2654    }
2655
2656    public CodeableConcept addProductClassification() { //3
2657      CodeableConcept t = new CodeableConcept();
2658      if (this.productClassification == null)
2659        this.productClassification = new ArrayList<CodeableConcept>();
2660      this.productClassification.add(t);
2661      return t;
2662    }
2663
2664    public MedicinalProductDefinition addProductClassification(CodeableConcept t) { //3
2665      if (t == null)
2666        return this;
2667      if (this.productClassification == null)
2668        this.productClassification = new ArrayList<CodeableConcept>();
2669      this.productClassification.add(t);
2670      return this;
2671    }
2672
2673    /**
2674     * @return The first repetition of repeating field {@link #productClassification}, creating it if it does not already exist
2675     */
2676    public CodeableConcept getProductClassificationFirstRep() { 
2677      if (getProductClassification().isEmpty()) {
2678        addProductClassification();
2679      }
2680      return getProductClassification().get(0);
2681    }
2682
2683    /**
2684     * @return {@link #marketingStatus} (Marketing status of the medicinal product, in contrast to marketing authorizaton.)
2685     */
2686    public List<MarketingStatus> getMarketingStatus() { 
2687      if (this.marketingStatus == null)
2688        this.marketingStatus = new ArrayList<MarketingStatus>();
2689      return this.marketingStatus;
2690    }
2691
2692    /**
2693     * @return Returns a reference to <code>this</code> for easy method chaining
2694     */
2695    public MedicinalProductDefinition setMarketingStatus(List<MarketingStatus> theMarketingStatus) { 
2696      this.marketingStatus = theMarketingStatus;
2697      return this;
2698    }
2699
2700    public boolean hasMarketingStatus() { 
2701      if (this.marketingStatus == null)
2702        return false;
2703      for (MarketingStatus item : this.marketingStatus)
2704        if (!item.isEmpty())
2705          return true;
2706      return false;
2707    }
2708
2709    public MarketingStatus addMarketingStatus() { //3
2710      MarketingStatus t = new MarketingStatus();
2711      if (this.marketingStatus == null)
2712        this.marketingStatus = new ArrayList<MarketingStatus>();
2713      this.marketingStatus.add(t);
2714      return t;
2715    }
2716
2717    public MedicinalProductDefinition addMarketingStatus(MarketingStatus t) { //3
2718      if (t == null)
2719        return this;
2720      if (this.marketingStatus == null)
2721        this.marketingStatus = new ArrayList<MarketingStatus>();
2722      this.marketingStatus.add(t);
2723      return this;
2724    }
2725
2726    /**
2727     * @return The first repetition of repeating field {@link #marketingStatus}, creating it if it does not already exist
2728     */
2729    public MarketingStatus getMarketingStatusFirstRep() { 
2730      if (getMarketingStatus().isEmpty()) {
2731        addMarketingStatus();
2732      }
2733      return getMarketingStatus().get(0);
2734    }
2735
2736    /**
2737     * @return {@link #pharmaceuticalProduct} (Pharmaceutical aspects of product.)
2738     */
2739    public List<Reference> getPharmaceuticalProduct() { 
2740      if (this.pharmaceuticalProduct == null)
2741        this.pharmaceuticalProduct = new ArrayList<Reference>();
2742      return this.pharmaceuticalProduct;
2743    }
2744
2745    /**
2746     * @return Returns a reference to <code>this</code> for easy method chaining
2747     */
2748    public MedicinalProductDefinition setPharmaceuticalProduct(List<Reference> thePharmaceuticalProduct) { 
2749      this.pharmaceuticalProduct = thePharmaceuticalProduct;
2750      return this;
2751    }
2752
2753    public boolean hasPharmaceuticalProduct() { 
2754      if (this.pharmaceuticalProduct == null)
2755        return false;
2756      for (Reference item : this.pharmaceuticalProduct)
2757        if (!item.isEmpty())
2758          return true;
2759      return false;
2760    }
2761
2762    public Reference addPharmaceuticalProduct() { //3
2763      Reference t = new Reference();
2764      if (this.pharmaceuticalProduct == null)
2765        this.pharmaceuticalProduct = new ArrayList<Reference>();
2766      this.pharmaceuticalProduct.add(t);
2767      return t;
2768    }
2769
2770    public MedicinalProductDefinition addPharmaceuticalProduct(Reference t) { //3
2771      if (t == null)
2772        return this;
2773      if (this.pharmaceuticalProduct == null)
2774        this.pharmaceuticalProduct = new ArrayList<Reference>();
2775      this.pharmaceuticalProduct.add(t);
2776      return this;
2777    }
2778
2779    /**
2780     * @return The first repetition of repeating field {@link #pharmaceuticalProduct}, creating it if it does not already exist
2781     */
2782    public Reference getPharmaceuticalProductFirstRep() { 
2783      if (getPharmaceuticalProduct().isEmpty()) {
2784        addPharmaceuticalProduct();
2785      }
2786      return getPharmaceuticalProduct().get(0);
2787    }
2788
2789    /**
2790     * @return {@link #packagedMedicinalProduct} (Package representation for the product.)
2791     */
2792    public List<Reference> getPackagedMedicinalProduct() { 
2793      if (this.packagedMedicinalProduct == null)
2794        this.packagedMedicinalProduct = new ArrayList<Reference>();
2795      return this.packagedMedicinalProduct;
2796    }
2797
2798    /**
2799     * @return Returns a reference to <code>this</code> for easy method chaining
2800     */
2801    public MedicinalProductDefinition setPackagedMedicinalProduct(List<Reference> thePackagedMedicinalProduct) { 
2802      this.packagedMedicinalProduct = thePackagedMedicinalProduct;
2803      return this;
2804    }
2805
2806    public boolean hasPackagedMedicinalProduct() { 
2807      if (this.packagedMedicinalProduct == null)
2808        return false;
2809      for (Reference item : this.packagedMedicinalProduct)
2810        if (!item.isEmpty())
2811          return true;
2812      return false;
2813    }
2814
2815    public Reference addPackagedMedicinalProduct() { //3
2816      Reference t = new Reference();
2817      if (this.packagedMedicinalProduct == null)
2818        this.packagedMedicinalProduct = new ArrayList<Reference>();
2819      this.packagedMedicinalProduct.add(t);
2820      return t;
2821    }
2822
2823    public MedicinalProductDefinition addPackagedMedicinalProduct(Reference t) { //3
2824      if (t == null)
2825        return this;
2826      if (this.packagedMedicinalProduct == null)
2827        this.packagedMedicinalProduct = new ArrayList<Reference>();
2828      this.packagedMedicinalProduct.add(t);
2829      return this;
2830    }
2831
2832    /**
2833     * @return The first repetition of repeating field {@link #packagedMedicinalProduct}, creating it if it does not already exist
2834     */
2835    public Reference getPackagedMedicinalProductFirstRep() { 
2836      if (getPackagedMedicinalProduct().isEmpty()) {
2837        addPackagedMedicinalProduct();
2838      }
2839      return getPackagedMedicinalProduct().get(0);
2840    }
2841
2842    /**
2843     * @return {@link #ingredient} (The ingredients of this medicinal product - when not specified elsewhere. This is only needed if the ingredients are not specified by the pharmaceuticalProduct or packagedMedicinalProduct references above. In cases where those levels of detail are not used, the ingredients may be specified directly here.)
2844     */
2845    public List<Reference> getIngredient() { 
2846      if (this.ingredient == null)
2847        this.ingredient = new ArrayList<Reference>();
2848      return this.ingredient;
2849    }
2850
2851    /**
2852     * @return Returns a reference to <code>this</code> for easy method chaining
2853     */
2854    public MedicinalProductDefinition setIngredient(List<Reference> theIngredient) { 
2855      this.ingredient = theIngredient;
2856      return this;
2857    }
2858
2859    public boolean hasIngredient() { 
2860      if (this.ingredient == null)
2861        return false;
2862      for (Reference item : this.ingredient)
2863        if (!item.isEmpty())
2864          return true;
2865      return false;
2866    }
2867
2868    public Reference addIngredient() { //3
2869      Reference t = new Reference();
2870      if (this.ingredient == null)
2871        this.ingredient = new ArrayList<Reference>();
2872      this.ingredient.add(t);
2873      return t;
2874    }
2875
2876    public MedicinalProductDefinition addIngredient(Reference t) { //3
2877      if (t == null)
2878        return this;
2879      if (this.ingredient == null)
2880        this.ingredient = new ArrayList<Reference>();
2881      this.ingredient.add(t);
2882      return this;
2883    }
2884
2885    /**
2886     * @return The first repetition of repeating field {@link #ingredient}, creating it if it does not already exist
2887     */
2888    public Reference getIngredientFirstRep() { 
2889      if (getIngredient().isEmpty()) {
2890        addIngredient();
2891      }
2892      return getIngredient().get(0);
2893    }
2894
2895    /**
2896     * @return {@link #attachedDocument} (Supporting documentation, typically for regulatory submission.)
2897     */
2898    public List<Reference> getAttachedDocument() { 
2899      if (this.attachedDocument == null)
2900        this.attachedDocument = new ArrayList<Reference>();
2901      return this.attachedDocument;
2902    }
2903
2904    /**
2905     * @return Returns a reference to <code>this</code> for easy method chaining
2906     */
2907    public MedicinalProductDefinition setAttachedDocument(List<Reference> theAttachedDocument) { 
2908      this.attachedDocument = theAttachedDocument;
2909      return this;
2910    }
2911
2912    public boolean hasAttachedDocument() { 
2913      if (this.attachedDocument == null)
2914        return false;
2915      for (Reference item : this.attachedDocument)
2916        if (!item.isEmpty())
2917          return true;
2918      return false;
2919    }
2920
2921    public Reference addAttachedDocument() { //3
2922      Reference t = new Reference();
2923      if (this.attachedDocument == null)
2924        this.attachedDocument = new ArrayList<Reference>();
2925      this.attachedDocument.add(t);
2926      return t;
2927    }
2928
2929    public MedicinalProductDefinition addAttachedDocument(Reference t) { //3
2930      if (t == null)
2931        return this;
2932      if (this.attachedDocument == null)
2933        this.attachedDocument = new ArrayList<Reference>();
2934      this.attachedDocument.add(t);
2935      return this;
2936    }
2937
2938    /**
2939     * @return The first repetition of repeating field {@link #attachedDocument}, creating it if it does not already exist
2940     */
2941    public Reference getAttachedDocumentFirstRep() { 
2942      if (getAttachedDocument().isEmpty()) {
2943        addAttachedDocument();
2944      }
2945      return getAttachedDocument().get(0);
2946    }
2947
2948    /**
2949     * @return {@link #masterFile} (A master file for to the medicinal product (e.g. Pharmacovigilance System Master File).)
2950     */
2951    public List<Reference> getMasterFile() { 
2952      if (this.masterFile == null)
2953        this.masterFile = new ArrayList<Reference>();
2954      return this.masterFile;
2955    }
2956
2957    /**
2958     * @return Returns a reference to <code>this</code> for easy method chaining
2959     */
2960    public MedicinalProductDefinition setMasterFile(List<Reference> theMasterFile) { 
2961      this.masterFile = theMasterFile;
2962      return this;
2963    }
2964
2965    public boolean hasMasterFile() { 
2966      if (this.masterFile == null)
2967        return false;
2968      for (Reference item : this.masterFile)
2969        if (!item.isEmpty())
2970          return true;
2971      return false;
2972    }
2973
2974    public Reference addMasterFile() { //3
2975      Reference t = new Reference();
2976      if (this.masterFile == null)
2977        this.masterFile = new ArrayList<Reference>();
2978      this.masterFile.add(t);
2979      return t;
2980    }
2981
2982    public MedicinalProductDefinition addMasterFile(Reference t) { //3
2983      if (t == null)
2984        return this;
2985      if (this.masterFile == null)
2986        this.masterFile = new ArrayList<Reference>();
2987      this.masterFile.add(t);
2988      return this;
2989    }
2990
2991    /**
2992     * @return The first repetition of repeating field {@link #masterFile}, creating it if it does not already exist
2993     */
2994    public Reference getMasterFileFirstRep() { 
2995      if (getMasterFile().isEmpty()) {
2996        addMasterFile();
2997      }
2998      return getMasterFile().get(0);
2999    }
3000
3001    /**
3002     * @return {@link #contact} (A product specific contact, person (in a role), or an organization.)
3003     */
3004    public List<MedicinalProductDefinitionContactComponent> getContact() { 
3005      if (this.contact == null)
3006        this.contact = new ArrayList<MedicinalProductDefinitionContactComponent>();
3007      return this.contact;
3008    }
3009
3010    /**
3011     * @return Returns a reference to <code>this</code> for easy method chaining
3012     */
3013    public MedicinalProductDefinition setContact(List<MedicinalProductDefinitionContactComponent> theContact) { 
3014      this.contact = theContact;
3015      return this;
3016    }
3017
3018    public boolean hasContact() { 
3019      if (this.contact == null)
3020        return false;
3021      for (MedicinalProductDefinitionContactComponent item : this.contact)
3022        if (!item.isEmpty())
3023          return true;
3024      return false;
3025    }
3026
3027    public MedicinalProductDefinitionContactComponent addContact() { //3
3028      MedicinalProductDefinitionContactComponent t = new MedicinalProductDefinitionContactComponent();
3029      if (this.contact == null)
3030        this.contact = new ArrayList<MedicinalProductDefinitionContactComponent>();
3031      this.contact.add(t);
3032      return t;
3033    }
3034
3035    public MedicinalProductDefinition addContact(MedicinalProductDefinitionContactComponent t) { //3
3036      if (t == null)
3037        return this;
3038      if (this.contact == null)
3039        this.contact = new ArrayList<MedicinalProductDefinitionContactComponent>();
3040      this.contact.add(t);
3041      return this;
3042    }
3043
3044    /**
3045     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
3046     */
3047    public MedicinalProductDefinitionContactComponent getContactFirstRep() { 
3048      if (getContact().isEmpty()) {
3049        addContact();
3050      }
3051      return getContact().get(0);
3052    }
3053
3054    /**
3055     * @return {@link #clinicalTrial} (Clinical trials or studies that this product is involved in.)
3056     */
3057    public List<Reference> getClinicalTrial() { 
3058      if (this.clinicalTrial == null)
3059        this.clinicalTrial = new ArrayList<Reference>();
3060      return this.clinicalTrial;
3061    }
3062
3063    /**
3064     * @return Returns a reference to <code>this</code> for easy method chaining
3065     */
3066    public MedicinalProductDefinition setClinicalTrial(List<Reference> theClinicalTrial) { 
3067      this.clinicalTrial = theClinicalTrial;
3068      return this;
3069    }
3070
3071    public boolean hasClinicalTrial() { 
3072      if (this.clinicalTrial == null)
3073        return false;
3074      for (Reference item : this.clinicalTrial)
3075        if (!item.isEmpty())
3076          return true;
3077      return false;
3078    }
3079
3080    public Reference addClinicalTrial() { //3
3081      Reference t = new Reference();
3082      if (this.clinicalTrial == null)
3083        this.clinicalTrial = new ArrayList<Reference>();
3084      this.clinicalTrial.add(t);
3085      return t;
3086    }
3087
3088    public MedicinalProductDefinition addClinicalTrial(Reference t) { //3
3089      if (t == null)
3090        return this;
3091      if (this.clinicalTrial == null)
3092        this.clinicalTrial = new ArrayList<Reference>();
3093      this.clinicalTrial.add(t);
3094      return this;
3095    }
3096
3097    /**
3098     * @return The first repetition of repeating field {@link #clinicalTrial}, creating it if it does not already exist
3099     */
3100    public Reference getClinicalTrialFirstRep() { 
3101      if (getClinicalTrial().isEmpty()) {
3102        addClinicalTrial();
3103      }
3104      return getClinicalTrial().get(0);
3105    }
3106
3107    /**
3108     * @return {@link #name} (The product's name, including full name and possibly coded parts.)
3109     */
3110    public List<MedicinalProductDefinitionNameComponent> getName() { 
3111      if (this.name == null)
3112        this.name = new ArrayList<MedicinalProductDefinitionNameComponent>();
3113      return this.name;
3114    }
3115
3116    /**
3117     * @return Returns a reference to <code>this</code> for easy method chaining
3118     */
3119    public MedicinalProductDefinition setName(List<MedicinalProductDefinitionNameComponent> theName) { 
3120      this.name = theName;
3121      return this;
3122    }
3123
3124    public boolean hasName() { 
3125      if (this.name == null)
3126        return false;
3127      for (MedicinalProductDefinitionNameComponent item : this.name)
3128        if (!item.isEmpty())
3129          return true;
3130      return false;
3131    }
3132
3133    public MedicinalProductDefinitionNameComponent addName() { //3
3134      MedicinalProductDefinitionNameComponent t = new MedicinalProductDefinitionNameComponent();
3135      if (this.name == null)
3136        this.name = new ArrayList<MedicinalProductDefinitionNameComponent>();
3137      this.name.add(t);
3138      return t;
3139    }
3140
3141    public MedicinalProductDefinition addName(MedicinalProductDefinitionNameComponent t) { //3
3142      if (t == null)
3143        return this;
3144      if (this.name == null)
3145        this.name = new ArrayList<MedicinalProductDefinitionNameComponent>();
3146      this.name.add(t);
3147      return this;
3148    }
3149
3150    /**
3151     * @return The first repetition of repeating field {@link #name}, creating it if it does not already exist
3152     */
3153    public MedicinalProductDefinitionNameComponent getNameFirstRep() { 
3154      if (getName().isEmpty()) {
3155        addName();
3156      }
3157      return getName().get(0);
3158    }
3159
3160    /**
3161     * @return {@link #crossReference} (Reference to another product, e.g. for linking authorised to investigational product.)
3162     */
3163    public List<Identifier> getCrossReference() { 
3164      if (this.crossReference == null)
3165        this.crossReference = new ArrayList<Identifier>();
3166      return this.crossReference;
3167    }
3168
3169    /**
3170     * @return Returns a reference to <code>this</code> for easy method chaining
3171     */
3172    public MedicinalProductDefinition setCrossReference(List<Identifier> theCrossReference) { 
3173      this.crossReference = theCrossReference;
3174      return this;
3175    }
3176
3177    public boolean hasCrossReference() { 
3178      if (this.crossReference == null)
3179        return false;
3180      for (Identifier item : this.crossReference)
3181        if (!item.isEmpty())
3182          return true;
3183      return false;
3184    }
3185
3186    public Identifier addCrossReference() { //3
3187      Identifier t = new Identifier();
3188      if (this.crossReference == null)
3189        this.crossReference = new ArrayList<Identifier>();
3190      this.crossReference.add(t);
3191      return t;
3192    }
3193
3194    public MedicinalProductDefinition addCrossReference(Identifier t) { //3
3195      if (t == null)
3196        return this;
3197      if (this.crossReference == null)
3198        this.crossReference = new ArrayList<Identifier>();
3199      this.crossReference.add(t);
3200      return this;
3201    }
3202
3203    /**
3204     * @return The first repetition of repeating field {@link #crossReference}, creating it if it does not already exist
3205     */
3206    public Identifier getCrossReferenceFirstRep() { 
3207      if (getCrossReference().isEmpty()) {
3208        addCrossReference();
3209      }
3210      return getCrossReference().get(0);
3211    }
3212
3213    /**
3214     * @return {@link #manufacturingBusinessOperation} (An operation applied to the product, for manufacturing or adminsitrative purpose.)
3215     */
3216    public List<MedicinalProductDefinitionManufacturingBusinessOperationComponent> getManufacturingBusinessOperation() { 
3217      if (this.manufacturingBusinessOperation == null)
3218        this.manufacturingBusinessOperation = new ArrayList<MedicinalProductDefinitionManufacturingBusinessOperationComponent>();
3219      return this.manufacturingBusinessOperation;
3220    }
3221
3222    /**
3223     * @return Returns a reference to <code>this</code> for easy method chaining
3224     */
3225    public MedicinalProductDefinition setManufacturingBusinessOperation(List<MedicinalProductDefinitionManufacturingBusinessOperationComponent> theManufacturingBusinessOperation) { 
3226      this.manufacturingBusinessOperation = theManufacturingBusinessOperation;
3227      return this;
3228    }
3229
3230    public boolean hasManufacturingBusinessOperation() { 
3231      if (this.manufacturingBusinessOperation == null)
3232        return false;
3233      for (MedicinalProductDefinitionManufacturingBusinessOperationComponent item : this.manufacturingBusinessOperation)
3234        if (!item.isEmpty())
3235          return true;
3236      return false;
3237    }
3238
3239    public MedicinalProductDefinitionManufacturingBusinessOperationComponent addManufacturingBusinessOperation() { //3
3240      MedicinalProductDefinitionManufacturingBusinessOperationComponent t = new MedicinalProductDefinitionManufacturingBusinessOperationComponent();
3241      if (this.manufacturingBusinessOperation == null)
3242        this.manufacturingBusinessOperation = new ArrayList<MedicinalProductDefinitionManufacturingBusinessOperationComponent>();
3243      this.manufacturingBusinessOperation.add(t);
3244      return t;
3245    }
3246
3247    public MedicinalProductDefinition addManufacturingBusinessOperation(MedicinalProductDefinitionManufacturingBusinessOperationComponent t) { //3
3248      if (t == null)
3249        return this;
3250      if (this.manufacturingBusinessOperation == null)
3251        this.manufacturingBusinessOperation = new ArrayList<MedicinalProductDefinitionManufacturingBusinessOperationComponent>();
3252      this.manufacturingBusinessOperation.add(t);
3253      return this;
3254    }
3255
3256    /**
3257     * @return The first repetition of repeating field {@link #manufacturingBusinessOperation}, creating it if it does not already exist
3258     */
3259    public MedicinalProductDefinitionManufacturingBusinessOperationComponent getManufacturingBusinessOperationFirstRep() { 
3260      if (getManufacturingBusinessOperation().isEmpty()) {
3261        addManufacturingBusinessOperation();
3262      }
3263      return getManufacturingBusinessOperation().get(0);
3264    }
3265
3266    /**
3267     * @return {@link #specialDesignation} (Indicates if the medicinal product has an orphan designation for the treatment of a rare disease.)
3268     */
3269    public List<MedicinalProductDefinitionSpecialDesignationComponent> getSpecialDesignation() { 
3270      if (this.specialDesignation == null)
3271        this.specialDesignation = new ArrayList<MedicinalProductDefinitionSpecialDesignationComponent>();
3272      return this.specialDesignation;
3273    }
3274
3275    /**
3276     * @return Returns a reference to <code>this</code> for easy method chaining
3277     */
3278    public MedicinalProductDefinition setSpecialDesignation(List<MedicinalProductDefinitionSpecialDesignationComponent> theSpecialDesignation) { 
3279      this.specialDesignation = theSpecialDesignation;
3280      return this;
3281    }
3282
3283    public boolean hasSpecialDesignation() { 
3284      if (this.specialDesignation == null)
3285        return false;
3286      for (MedicinalProductDefinitionSpecialDesignationComponent item : this.specialDesignation)
3287        if (!item.isEmpty())
3288          return true;
3289      return false;
3290    }
3291
3292    public MedicinalProductDefinitionSpecialDesignationComponent addSpecialDesignation() { //3
3293      MedicinalProductDefinitionSpecialDesignationComponent t = new MedicinalProductDefinitionSpecialDesignationComponent();
3294      if (this.specialDesignation == null)
3295        this.specialDesignation = new ArrayList<MedicinalProductDefinitionSpecialDesignationComponent>();
3296      this.specialDesignation.add(t);
3297      return t;
3298    }
3299
3300    public MedicinalProductDefinition addSpecialDesignation(MedicinalProductDefinitionSpecialDesignationComponent t) { //3
3301      if (t == null)
3302        return this;
3303      if (this.specialDesignation == null)
3304        this.specialDesignation = new ArrayList<MedicinalProductDefinitionSpecialDesignationComponent>();
3305      this.specialDesignation.add(t);
3306      return this;
3307    }
3308
3309    /**
3310     * @return The first repetition of repeating field {@link #specialDesignation}, creating it if it does not already exist
3311     */
3312    public MedicinalProductDefinitionSpecialDesignationComponent getSpecialDesignationFirstRep() { 
3313      if (getSpecialDesignation().isEmpty()) {
3314        addSpecialDesignation();
3315      }
3316      return getSpecialDesignation().get(0);
3317    }
3318
3319      protected void listChildren(List<Property> children) {
3320        super.listChildren(children);
3321        children.add(new Property("identifier", "Identifier", "Business identifier for this product. Could be an MPID.", 0, java.lang.Integer.MAX_VALUE, identifier));
3322        children.add(new Property("type", "CodeableConcept", "Regulatory type, e.g. Investigational or Authorized.", 0, 1, type));
3323        children.add(new Property("domain", "Coding", "If this medicine applies to human or veterinary uses.", 0, 1, domain));
3324        children.add(new Property("description", "string", "General description of this product.", 0, 1, description));
3325        children.add(new Property("combinedPharmaceuticalDoseForm", "CodeableConcept", "The dose form for a single part product, or combined form of a multiple part product.", 0, 1, combinedPharmaceuticalDoseForm));
3326        children.add(new Property("indication", "markdown", "General combined description of indication(s) for this product. See also MedicinalProductDefinitionIndication.", 0, 1, indication));
3327        children.add(new Property("legalStatusOfSupply", "CodeableConcept", "The legal status of supply of the medicinal product as classified by the regulator.", 0, 1, legalStatusOfSupply));
3328        children.add(new Property("additionalMonitoringIndicator", "CodeableConcept", "Whether the Medicinal Product is subject to additional monitoring for regulatory reasons.", 0, 1, additionalMonitoringIndicator));
3329        children.add(new Property("specialMeasure", "string", "Whether the Medicinal Product is subject to special measures for regulatory reasons.", 0, java.lang.Integer.MAX_VALUE, specialMeasure));
3330        children.add(new Property("paediatricUseIndicator", "CodeableConcept", "If authorised for use in children.", 0, 1, paediatricUseIndicator));
3331        children.add(new Property("productClassification", "CodeableConcept", "Allows the product to be classified by various systems.", 0, java.lang.Integer.MAX_VALUE, productClassification));
3332        children.add(new Property("marketingStatus", "MarketingStatus", "Marketing status of the medicinal product, in contrast to marketing authorizaton.", 0, java.lang.Integer.MAX_VALUE, marketingStatus));
3333        children.add(new Property("pharmaceuticalProduct", "Reference(AdministrableProductDefinition)", "Pharmaceutical aspects of product.", 0, java.lang.Integer.MAX_VALUE, pharmaceuticalProduct));
3334        children.add(new Property("packagedMedicinalProduct", "Reference(PackagedProductDefinition)", "Package representation for the product.", 0, java.lang.Integer.MAX_VALUE, packagedMedicinalProduct));
3335        children.add(new Property("ingredient", "Reference(Ingredient)", "The ingredients of this medicinal product - when not specified elsewhere. This is only needed if the ingredients are not specified by the pharmaceuticalProduct or packagedMedicinalProduct references above. In cases where those levels of detail are not used, the ingredients may be specified directly here.", 0, java.lang.Integer.MAX_VALUE, ingredient));
3336        children.add(new Property("attachedDocument", "Reference(DocumentReference)", "Supporting documentation, typically for regulatory submission.", 0, java.lang.Integer.MAX_VALUE, attachedDocument));
3337        children.add(new Property("masterFile", "Reference(DocumentReference)", "A master file for to the medicinal product (e.g. Pharmacovigilance System Master File).", 0, java.lang.Integer.MAX_VALUE, masterFile));
3338        children.add(new Property("contact", "", "A product specific contact, person (in a role), or an organization.", 0, java.lang.Integer.MAX_VALUE, contact));
3339        children.add(new Property("clinicalTrial", "Reference(ResearchStudy)", "Clinical trials or studies that this product is involved in.", 0, java.lang.Integer.MAX_VALUE, clinicalTrial));
3340        children.add(new Property("name", "", "The product's name, including full name and possibly coded parts.", 0, java.lang.Integer.MAX_VALUE, name));
3341        children.add(new Property("crossReference", "Identifier", "Reference to another product, e.g. for linking authorised to investigational product.", 0, java.lang.Integer.MAX_VALUE, crossReference));
3342        children.add(new Property("manufacturingBusinessOperation", "", "An operation applied to the product, for manufacturing or adminsitrative purpose.", 0, java.lang.Integer.MAX_VALUE, manufacturingBusinessOperation));
3343        children.add(new Property("specialDesignation", "", "Indicates if the medicinal product has an orphan designation for the treatment of a rare disease.", 0, java.lang.Integer.MAX_VALUE, specialDesignation));
3344      }
3345
3346      @Override
3347      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3348        switch (_hash) {
3349        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifier for this product. Could be an MPID.", 0, java.lang.Integer.MAX_VALUE, identifier);
3350        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Regulatory type, e.g. Investigational or Authorized.", 0, 1, type);
3351        case -1326197564: /*domain*/  return new Property("domain", "Coding", "If this medicine applies to human or veterinary uses.", 0, 1, domain);
3352        case -1724546052: /*description*/  return new Property("description", "string", "General description of this product.", 0, 1, description);
3353        case -1992898487: /*combinedPharmaceuticalDoseForm*/  return new Property("combinedPharmaceuticalDoseForm", "CodeableConcept", "The dose form for a single part product, or combined form of a multiple part product.", 0, 1, combinedPharmaceuticalDoseForm);
3354        case -597168804: /*indication*/  return new Property("indication", "markdown", "General combined description of indication(s) for this product. See also MedicinalProductDefinitionIndication.", 0, 1, indication);
3355        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);
3356        case 1935999744: /*additionalMonitoringIndicator*/  return new Property("additionalMonitoringIndicator", "CodeableConcept", "Whether the Medicinal Product is subject to additional monitoring for regulatory reasons.", 0, 1, additionalMonitoringIndicator);
3357        case 1001286245: /*specialMeasure*/  return new Property("specialMeasure", "string", "Whether the Medicinal Product is subject to special measures for regulatory reasons.", 0, java.lang.Integer.MAX_VALUE, specialMeasure);
3358        case -1019867160: /*paediatricUseIndicator*/  return new Property("paediatricUseIndicator", "CodeableConcept", "If authorised for use in children.", 0, 1, paediatricUseIndicator);
3359        case 1247936181: /*productClassification*/  return new Property("productClassification", "CodeableConcept", "Allows the product to be classified by various systems.", 0, java.lang.Integer.MAX_VALUE, productClassification);
3360        case 70767032: /*marketingStatus*/  return new Property("marketingStatus", "MarketingStatus", "Marketing status of the medicinal product, in contrast to marketing authorizaton.", 0, java.lang.Integer.MAX_VALUE, marketingStatus);
3361        case 443273260: /*pharmaceuticalProduct*/  return new Property("pharmaceuticalProduct", "Reference(AdministrableProductDefinition)", "Pharmaceutical aspects of product.", 0, java.lang.Integer.MAX_VALUE, pharmaceuticalProduct);
3362        case -361025513: /*packagedMedicinalProduct*/  return new Property("packagedMedicinalProduct", "Reference(PackagedProductDefinition)", "Package representation for the product.", 0, java.lang.Integer.MAX_VALUE, packagedMedicinalProduct);
3363        case -206409263: /*ingredient*/  return new Property("ingredient", "Reference(Ingredient)", "The ingredients of this medicinal product - when not specified elsewhere. This is only needed if the ingredients are not specified by the pharmaceuticalProduct or packagedMedicinalProduct references above. In cases where those levels of detail are not used, the ingredients may be specified directly here.", 0, java.lang.Integer.MAX_VALUE, ingredient);
3364        case -513945889: /*attachedDocument*/  return new Property("attachedDocument", "Reference(DocumentReference)", "Supporting documentation, typically for regulatory submission.", 0, java.lang.Integer.MAX_VALUE, attachedDocument);
3365        case -2039573762: /*masterFile*/  return new Property("masterFile", "Reference(DocumentReference)", "A master file for to the medicinal product (e.g. Pharmacovigilance System Master File).", 0, java.lang.Integer.MAX_VALUE, masterFile);
3366        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);
3367        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);
3368        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);
3369        case -986968341: /*crossReference*/  return new Property("crossReference", "Identifier", "Reference to another product, e.g. for linking authorised to investigational product.", 0, java.lang.Integer.MAX_VALUE, crossReference);
3370        case -171103255: /*manufacturingBusinessOperation*/  return new Property("manufacturingBusinessOperation", "", "An operation applied to the product, for manufacturing or adminsitrative purpose.", 0, java.lang.Integer.MAX_VALUE, manufacturingBusinessOperation);
3371        case -964310658: /*specialDesignation*/  return new Property("specialDesignation", "", "Indicates if the medicinal product has an orphan designation for the treatment of a rare disease.", 0, java.lang.Integer.MAX_VALUE, specialDesignation);
3372        default: return super.getNamedProperty(_hash, _name, _checkValid);
3373        }
3374
3375      }
3376
3377      @Override
3378      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3379        switch (hash) {
3380        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3381        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3382        case -1326197564: /*domain*/ return this.domain == null ? new Base[0] : new Base[] {this.domain}; // Coding
3383        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
3384        case -1992898487: /*combinedPharmaceuticalDoseForm*/ return this.combinedPharmaceuticalDoseForm == null ? new Base[0] : new Base[] {this.combinedPharmaceuticalDoseForm}; // CodeableConcept
3385        case -597168804: /*indication*/ return this.indication == null ? new Base[0] : new Base[] {this.indication}; // MarkdownType
3386        case -844874031: /*legalStatusOfSupply*/ return this.legalStatusOfSupply == null ? new Base[0] : new Base[] {this.legalStatusOfSupply}; // CodeableConcept
3387        case 1935999744: /*additionalMonitoringIndicator*/ return this.additionalMonitoringIndicator == null ? new Base[0] : new Base[] {this.additionalMonitoringIndicator}; // CodeableConcept
3388        case 1001286245: /*specialMeasure*/ return this.specialMeasure == null ? new Base[0] : this.specialMeasure.toArray(new Base[this.specialMeasure.size()]); // StringType
3389        case -1019867160: /*paediatricUseIndicator*/ return this.paediatricUseIndicator == null ? new Base[0] : new Base[] {this.paediatricUseIndicator}; // CodeableConcept
3390        case 1247936181: /*productClassification*/ return this.productClassification == null ? new Base[0] : this.productClassification.toArray(new Base[this.productClassification.size()]); // CodeableConcept
3391        case 70767032: /*marketingStatus*/ return this.marketingStatus == null ? new Base[0] : this.marketingStatus.toArray(new Base[this.marketingStatus.size()]); // MarketingStatus
3392        case 443273260: /*pharmaceuticalProduct*/ return this.pharmaceuticalProduct == null ? new Base[0] : this.pharmaceuticalProduct.toArray(new Base[this.pharmaceuticalProduct.size()]); // Reference
3393        case -361025513: /*packagedMedicinalProduct*/ return this.packagedMedicinalProduct == null ? new Base[0] : this.packagedMedicinalProduct.toArray(new Base[this.packagedMedicinalProduct.size()]); // Reference
3394        case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // Reference
3395        case -513945889: /*attachedDocument*/ return this.attachedDocument == null ? new Base[0] : this.attachedDocument.toArray(new Base[this.attachedDocument.size()]); // Reference
3396        case -2039573762: /*masterFile*/ return this.masterFile == null ? new Base[0] : this.masterFile.toArray(new Base[this.masterFile.size()]); // Reference
3397        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // MedicinalProductDefinitionContactComponent
3398        case 1232866243: /*clinicalTrial*/ return this.clinicalTrial == null ? new Base[0] : this.clinicalTrial.toArray(new Base[this.clinicalTrial.size()]); // Reference
3399        case 3373707: /*name*/ return this.name == null ? new Base[0] : this.name.toArray(new Base[this.name.size()]); // MedicinalProductDefinitionNameComponent
3400        case -986968341: /*crossReference*/ return this.crossReference == null ? new Base[0] : this.crossReference.toArray(new Base[this.crossReference.size()]); // Identifier
3401        case -171103255: /*manufacturingBusinessOperation*/ return this.manufacturingBusinessOperation == null ? new Base[0] : this.manufacturingBusinessOperation.toArray(new Base[this.manufacturingBusinessOperation.size()]); // MedicinalProductDefinitionManufacturingBusinessOperationComponent
3402        case -964310658: /*specialDesignation*/ return this.specialDesignation == null ? new Base[0] : this.specialDesignation.toArray(new Base[this.specialDesignation.size()]); // MedicinalProductDefinitionSpecialDesignationComponent
3403        default: return super.getProperty(hash, name, checkValid);
3404        }
3405
3406      }
3407
3408      @Override
3409      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3410        switch (hash) {
3411        case -1618432855: // identifier
3412          this.getIdentifier().add(castToIdentifier(value)); // Identifier
3413          return value;
3414        case 3575610: // type
3415          this.type = castToCodeableConcept(value); // CodeableConcept
3416          return value;
3417        case -1326197564: // domain
3418          this.domain = castToCoding(value); // Coding
3419          return value;
3420        case -1724546052: // description
3421          this.description = castToString(value); // StringType
3422          return value;
3423        case -1992898487: // combinedPharmaceuticalDoseForm
3424          this.combinedPharmaceuticalDoseForm = castToCodeableConcept(value); // CodeableConcept
3425          return value;
3426        case -597168804: // indication
3427          this.indication = castToMarkdown(value); // MarkdownType
3428          return value;
3429        case -844874031: // legalStatusOfSupply
3430          this.legalStatusOfSupply = castToCodeableConcept(value); // CodeableConcept
3431          return value;
3432        case 1935999744: // additionalMonitoringIndicator
3433          this.additionalMonitoringIndicator = castToCodeableConcept(value); // CodeableConcept
3434          return value;
3435        case 1001286245: // specialMeasure
3436          this.getSpecialMeasure().add(castToString(value)); // StringType
3437          return value;
3438        case -1019867160: // paediatricUseIndicator
3439          this.paediatricUseIndicator = castToCodeableConcept(value); // CodeableConcept
3440          return value;
3441        case 1247936181: // productClassification
3442          this.getProductClassification().add(castToCodeableConcept(value)); // CodeableConcept
3443          return value;
3444        case 70767032: // marketingStatus
3445          this.getMarketingStatus().add(castToMarketingStatus(value)); // MarketingStatus
3446          return value;
3447        case 443273260: // pharmaceuticalProduct
3448          this.getPharmaceuticalProduct().add(castToReference(value)); // Reference
3449          return value;
3450        case -361025513: // packagedMedicinalProduct
3451          this.getPackagedMedicinalProduct().add(castToReference(value)); // Reference
3452          return value;
3453        case -206409263: // ingredient
3454          this.getIngredient().add(castToReference(value)); // Reference
3455          return value;
3456        case -513945889: // attachedDocument
3457          this.getAttachedDocument().add(castToReference(value)); // Reference
3458          return value;
3459        case -2039573762: // masterFile
3460          this.getMasterFile().add(castToReference(value)); // Reference
3461          return value;
3462        case 951526432: // contact
3463          this.getContact().add((MedicinalProductDefinitionContactComponent) value); // MedicinalProductDefinitionContactComponent
3464          return value;
3465        case 1232866243: // clinicalTrial
3466          this.getClinicalTrial().add(castToReference(value)); // Reference
3467          return value;
3468        case 3373707: // name
3469          this.getName().add((MedicinalProductDefinitionNameComponent) value); // MedicinalProductDefinitionNameComponent
3470          return value;
3471        case -986968341: // crossReference
3472          this.getCrossReference().add(castToIdentifier(value)); // Identifier
3473          return value;
3474        case -171103255: // manufacturingBusinessOperation
3475          this.getManufacturingBusinessOperation().add((MedicinalProductDefinitionManufacturingBusinessOperationComponent) value); // MedicinalProductDefinitionManufacturingBusinessOperationComponent
3476          return value;
3477        case -964310658: // specialDesignation
3478          this.getSpecialDesignation().add((MedicinalProductDefinitionSpecialDesignationComponent) value); // MedicinalProductDefinitionSpecialDesignationComponent
3479          return value;
3480        default: return super.setProperty(hash, name, value);
3481        }
3482
3483      }
3484
3485      @Override
3486      public Base setProperty(String name, Base value) throws FHIRException {
3487        if (name.equals("identifier")) {
3488          this.getIdentifier().add(castToIdentifier(value));
3489        } else if (name.equals("type")) {
3490          this.type = castToCodeableConcept(value); // CodeableConcept
3491        } else if (name.equals("domain")) {
3492          this.domain = castToCoding(value); // Coding
3493        } else if (name.equals("description")) {
3494          this.description = castToString(value); // StringType
3495        } else if (name.equals("combinedPharmaceuticalDoseForm")) {
3496          this.combinedPharmaceuticalDoseForm = castToCodeableConcept(value); // CodeableConcept
3497        } else if (name.equals("indication")) {
3498          this.indication = castToMarkdown(value); // MarkdownType
3499        } else if (name.equals("legalStatusOfSupply")) {
3500          this.legalStatusOfSupply = castToCodeableConcept(value); // CodeableConcept
3501        } else if (name.equals("additionalMonitoringIndicator")) {
3502          this.additionalMonitoringIndicator = castToCodeableConcept(value); // CodeableConcept
3503        } else if (name.equals("specialMeasure")) {
3504          this.getSpecialMeasure().add(castToString(value));
3505        } else if (name.equals("paediatricUseIndicator")) {
3506          this.paediatricUseIndicator = castToCodeableConcept(value); // CodeableConcept
3507        } else if (name.equals("productClassification")) {
3508          this.getProductClassification().add(castToCodeableConcept(value));
3509        } else if (name.equals("marketingStatus")) {
3510          this.getMarketingStatus().add(castToMarketingStatus(value));
3511        } else if (name.equals("pharmaceuticalProduct")) {
3512          this.getPharmaceuticalProduct().add(castToReference(value));
3513        } else if (name.equals("packagedMedicinalProduct")) {
3514          this.getPackagedMedicinalProduct().add(castToReference(value));
3515        } else if (name.equals("ingredient")) {
3516          this.getIngredient().add(castToReference(value));
3517        } else if (name.equals("attachedDocument")) {
3518          this.getAttachedDocument().add(castToReference(value));
3519        } else if (name.equals("masterFile")) {
3520          this.getMasterFile().add(castToReference(value));
3521        } else if (name.equals("contact")) {
3522          this.getContact().add((MedicinalProductDefinitionContactComponent) value);
3523        } else if (name.equals("clinicalTrial")) {
3524          this.getClinicalTrial().add(castToReference(value));
3525        } else if (name.equals("name")) {
3526          this.getName().add((MedicinalProductDefinitionNameComponent) value);
3527        } else if (name.equals("crossReference")) {
3528          this.getCrossReference().add(castToIdentifier(value));
3529        } else if (name.equals("manufacturingBusinessOperation")) {
3530          this.getManufacturingBusinessOperation().add((MedicinalProductDefinitionManufacturingBusinessOperationComponent) value);
3531        } else if (name.equals("specialDesignation")) {
3532          this.getSpecialDesignation().add((MedicinalProductDefinitionSpecialDesignationComponent) value);
3533        } else
3534          return super.setProperty(name, value);
3535        return value;
3536      }
3537
3538      @Override
3539      public Base makeProperty(int hash, String name) throws FHIRException {
3540        switch (hash) {
3541        case -1618432855:  return addIdentifier(); 
3542        case 3575610:  return getType();
3543        case -1326197564:  return getDomain();
3544        case -1724546052:  return getDescriptionElement();
3545        case -1992898487:  return getCombinedPharmaceuticalDoseForm();
3546        case -597168804:  return getIndicationElement();
3547        case -844874031:  return getLegalStatusOfSupply();
3548        case 1935999744:  return getAdditionalMonitoringIndicator();
3549        case 1001286245:  return addSpecialMeasureElement();
3550        case -1019867160:  return getPaediatricUseIndicator();
3551        case 1247936181:  return addProductClassification(); 
3552        case 70767032:  return addMarketingStatus(); 
3553        case 443273260:  return addPharmaceuticalProduct(); 
3554        case -361025513:  return addPackagedMedicinalProduct(); 
3555        case -206409263:  return addIngredient(); 
3556        case -513945889:  return addAttachedDocument(); 
3557        case -2039573762:  return addMasterFile(); 
3558        case 951526432:  return addContact(); 
3559        case 1232866243:  return addClinicalTrial(); 
3560        case 3373707:  return addName(); 
3561        case -986968341:  return addCrossReference(); 
3562        case -171103255:  return addManufacturingBusinessOperation(); 
3563        case -964310658:  return addSpecialDesignation(); 
3564        default: return super.makeProperty(hash, name);
3565        }
3566
3567      }
3568
3569      @Override
3570      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3571        switch (hash) {
3572        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3573        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3574        case -1326197564: /*domain*/ return new String[] {"Coding"};
3575        case -1724546052: /*description*/ return new String[] {"string"};
3576        case -1992898487: /*combinedPharmaceuticalDoseForm*/ return new String[] {"CodeableConcept"};
3577        case -597168804: /*indication*/ return new String[] {"markdown"};
3578        case -844874031: /*legalStatusOfSupply*/ return new String[] {"CodeableConcept"};
3579        case 1935999744: /*additionalMonitoringIndicator*/ return new String[] {"CodeableConcept"};
3580        case 1001286245: /*specialMeasure*/ return new String[] {"string"};
3581        case -1019867160: /*paediatricUseIndicator*/ return new String[] {"CodeableConcept"};
3582        case 1247936181: /*productClassification*/ return new String[] {"CodeableConcept"};
3583        case 70767032: /*marketingStatus*/ return new String[] {"MarketingStatus"};
3584        case 443273260: /*pharmaceuticalProduct*/ return new String[] {"Reference"};
3585        case -361025513: /*packagedMedicinalProduct*/ return new String[] {"Reference"};
3586        case -206409263: /*ingredient*/ return new String[] {"Reference"};
3587        case -513945889: /*attachedDocument*/ return new String[] {"Reference"};
3588        case -2039573762: /*masterFile*/ return new String[] {"Reference"};
3589        case 951526432: /*contact*/ return new String[] {};
3590        case 1232866243: /*clinicalTrial*/ return new String[] {"Reference"};
3591        case 3373707: /*name*/ return new String[] {};
3592        case -986968341: /*crossReference*/ return new String[] {"Identifier"};
3593        case -171103255: /*manufacturingBusinessOperation*/ return new String[] {};
3594        case -964310658: /*specialDesignation*/ return new String[] {};
3595        default: return super.getTypesForProperty(hash, name);
3596        }
3597
3598      }
3599
3600      @Override
3601      public Base addChild(String name) throws FHIRException {
3602        if (name.equals("identifier")) {
3603          return addIdentifier();
3604        }
3605        else if (name.equals("type")) {
3606          this.type = new CodeableConcept();
3607          return this.type;
3608        }
3609        else if (name.equals("domain")) {
3610          this.domain = new Coding();
3611          return this.domain;
3612        }
3613        else if (name.equals("description")) {
3614          throw new FHIRException("Cannot call addChild on a primitive type MedicinalProductDefinition.description");
3615        }
3616        else if (name.equals("combinedPharmaceuticalDoseForm")) {
3617          this.combinedPharmaceuticalDoseForm = new CodeableConcept();
3618          return this.combinedPharmaceuticalDoseForm;
3619        }
3620        else if (name.equals("indication")) {
3621          throw new FHIRException("Cannot call addChild on a primitive type MedicinalProductDefinition.indication");
3622        }
3623        else if (name.equals("legalStatusOfSupply")) {
3624          this.legalStatusOfSupply = new CodeableConcept();
3625          return this.legalStatusOfSupply;
3626        }
3627        else if (name.equals("additionalMonitoringIndicator")) {
3628          this.additionalMonitoringIndicator = new CodeableConcept();
3629          return this.additionalMonitoringIndicator;
3630        }
3631        else if (name.equals("specialMeasure")) {
3632          throw new FHIRException("Cannot call addChild on a primitive type MedicinalProductDefinition.specialMeasure");
3633        }
3634        else if (name.equals("paediatricUseIndicator")) {
3635          this.paediatricUseIndicator = new CodeableConcept();
3636          return this.paediatricUseIndicator;
3637        }
3638        else if (name.equals("productClassification")) {
3639          return addProductClassification();
3640        }
3641        else if (name.equals("marketingStatus")) {
3642          return addMarketingStatus();
3643        }
3644        else if (name.equals("pharmaceuticalProduct")) {
3645          return addPharmaceuticalProduct();
3646        }
3647        else if (name.equals("packagedMedicinalProduct")) {
3648          return addPackagedMedicinalProduct();
3649        }
3650        else if (name.equals("ingredient")) {
3651          return addIngredient();
3652        }
3653        else if (name.equals("attachedDocument")) {
3654          return addAttachedDocument();
3655        }
3656        else if (name.equals("masterFile")) {
3657          return addMasterFile();
3658        }
3659        else if (name.equals("contact")) {
3660          return addContact();
3661        }
3662        else if (name.equals("clinicalTrial")) {
3663          return addClinicalTrial();
3664        }
3665        else if (name.equals("name")) {
3666          return addName();
3667        }
3668        else if (name.equals("crossReference")) {
3669          return addCrossReference();
3670        }
3671        else if (name.equals("manufacturingBusinessOperation")) {
3672          return addManufacturingBusinessOperation();
3673        }
3674        else if (name.equals("specialDesignation")) {
3675          return addSpecialDesignation();
3676        }
3677        else
3678          return super.addChild(name);
3679      }
3680
3681  public String fhirType() {
3682    return "MedicinalProductDefinition";
3683
3684  }
3685
3686      public MedicinalProductDefinition copy() {
3687        MedicinalProductDefinition dst = new MedicinalProductDefinition();
3688        copyValues(dst);
3689        return dst;
3690      }
3691
3692      public void copyValues(MedicinalProductDefinition dst) {
3693        super.copyValues(dst);
3694        if (identifier != null) {
3695          dst.identifier = new ArrayList<Identifier>();
3696          for (Identifier i : identifier)
3697            dst.identifier.add(i.copy());
3698        };
3699        dst.type = type == null ? null : type.copy();
3700        dst.domain = domain == null ? null : domain.copy();
3701        dst.description = description == null ? null : description.copy();
3702        dst.combinedPharmaceuticalDoseForm = combinedPharmaceuticalDoseForm == null ? null : combinedPharmaceuticalDoseForm.copy();
3703        dst.indication = indication == null ? null : indication.copy();
3704        dst.legalStatusOfSupply = legalStatusOfSupply == null ? null : legalStatusOfSupply.copy();
3705        dst.additionalMonitoringIndicator = additionalMonitoringIndicator == null ? null : additionalMonitoringIndicator.copy();
3706        if (specialMeasure != null) {
3707          dst.specialMeasure = new ArrayList<StringType>();
3708          for (StringType i : specialMeasure)
3709            dst.specialMeasure.add(i.copy());
3710        };
3711        dst.paediatricUseIndicator = paediatricUseIndicator == null ? null : paediatricUseIndicator.copy();
3712        if (productClassification != null) {
3713          dst.productClassification = new ArrayList<CodeableConcept>();
3714          for (CodeableConcept i : productClassification)
3715            dst.productClassification.add(i.copy());
3716        };
3717        if (marketingStatus != null) {
3718          dst.marketingStatus = new ArrayList<MarketingStatus>();
3719          for (MarketingStatus i : marketingStatus)
3720            dst.marketingStatus.add(i.copy());
3721        };
3722        if (pharmaceuticalProduct != null) {
3723          dst.pharmaceuticalProduct = new ArrayList<Reference>();
3724          for (Reference i : pharmaceuticalProduct)
3725            dst.pharmaceuticalProduct.add(i.copy());
3726        };
3727        if (packagedMedicinalProduct != null) {
3728          dst.packagedMedicinalProduct = new ArrayList<Reference>();
3729          for (Reference i : packagedMedicinalProduct)
3730            dst.packagedMedicinalProduct.add(i.copy());
3731        };
3732        if (ingredient != null) {
3733          dst.ingredient = new ArrayList<Reference>();
3734          for (Reference i : ingredient)
3735            dst.ingredient.add(i.copy());
3736        };
3737        if (attachedDocument != null) {
3738          dst.attachedDocument = new ArrayList<Reference>();
3739          for (Reference i : attachedDocument)
3740            dst.attachedDocument.add(i.copy());
3741        };
3742        if (masterFile != null) {
3743          dst.masterFile = new ArrayList<Reference>();
3744          for (Reference i : masterFile)
3745            dst.masterFile.add(i.copy());
3746        };
3747        if (contact != null) {
3748          dst.contact = new ArrayList<MedicinalProductDefinitionContactComponent>();
3749          for (MedicinalProductDefinitionContactComponent i : contact)
3750            dst.contact.add(i.copy());
3751        };
3752        if (clinicalTrial != null) {
3753          dst.clinicalTrial = new ArrayList<Reference>();
3754          for (Reference i : clinicalTrial)
3755            dst.clinicalTrial.add(i.copy());
3756        };
3757        if (name != null) {
3758          dst.name = new ArrayList<MedicinalProductDefinitionNameComponent>();
3759          for (MedicinalProductDefinitionNameComponent i : name)
3760            dst.name.add(i.copy());
3761        };
3762        if (crossReference != null) {
3763          dst.crossReference = new ArrayList<Identifier>();
3764          for (Identifier i : crossReference)
3765            dst.crossReference.add(i.copy());
3766        };
3767        if (manufacturingBusinessOperation != null) {
3768          dst.manufacturingBusinessOperation = new ArrayList<MedicinalProductDefinitionManufacturingBusinessOperationComponent>();
3769          for (MedicinalProductDefinitionManufacturingBusinessOperationComponent i : manufacturingBusinessOperation)
3770            dst.manufacturingBusinessOperation.add(i.copy());
3771        };
3772        if (specialDesignation != null) {
3773          dst.specialDesignation = new ArrayList<MedicinalProductDefinitionSpecialDesignationComponent>();
3774          for (MedicinalProductDefinitionSpecialDesignationComponent i : specialDesignation)
3775            dst.specialDesignation.add(i.copy());
3776        };
3777      }
3778
3779      protected MedicinalProductDefinition typedCopy() {
3780        return copy();
3781      }
3782
3783      @Override
3784      public boolean equalsDeep(Base other_) {
3785        if (!super.equalsDeep(other_))
3786          return false;
3787        if (!(other_ instanceof MedicinalProductDefinition))
3788          return false;
3789        MedicinalProductDefinition o = (MedicinalProductDefinition) other_;
3790        return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(domain, o.domain, true)
3791           && compareDeep(description, o.description, true) && compareDeep(combinedPharmaceuticalDoseForm, o.combinedPharmaceuticalDoseForm, true)
3792           && compareDeep(indication, o.indication, true) && compareDeep(legalStatusOfSupply, o.legalStatusOfSupply, true)
3793           && compareDeep(additionalMonitoringIndicator, o.additionalMonitoringIndicator, true) && compareDeep(specialMeasure, o.specialMeasure, true)
3794           && compareDeep(paediatricUseIndicator, o.paediatricUseIndicator, true) && compareDeep(productClassification, o.productClassification, true)
3795           && compareDeep(marketingStatus, o.marketingStatus, true) && compareDeep(pharmaceuticalProduct, o.pharmaceuticalProduct, true)
3796           && compareDeep(packagedMedicinalProduct, o.packagedMedicinalProduct, true) && compareDeep(ingredient, o.ingredient, true)
3797           && compareDeep(attachedDocument, o.attachedDocument, true) && compareDeep(masterFile, o.masterFile, true)
3798           && compareDeep(contact, o.contact, true) && compareDeep(clinicalTrial, o.clinicalTrial, true) && compareDeep(name, o.name, true)
3799           && compareDeep(crossReference, o.crossReference, true) && compareDeep(manufacturingBusinessOperation, o.manufacturingBusinessOperation, true)
3800           && compareDeep(specialDesignation, o.specialDesignation, true);
3801      }
3802
3803      @Override
3804      public boolean equalsShallow(Base other_) {
3805        if (!super.equalsShallow(other_))
3806          return false;
3807        if (!(other_ instanceof MedicinalProductDefinition))
3808          return false;
3809        MedicinalProductDefinition o = (MedicinalProductDefinition) other_;
3810        return compareValues(description, o.description, true) && compareValues(indication, o.indication, true)
3811           && compareValues(specialMeasure, o.specialMeasure, true);
3812      }
3813
3814      public boolean isEmpty() {
3815        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, domain
3816          , description, combinedPharmaceuticalDoseForm, indication, legalStatusOfSupply, additionalMonitoringIndicator
3817          , specialMeasure, paediatricUseIndicator, productClassification, marketingStatus, pharmaceuticalProduct
3818          , packagedMedicinalProduct, ingredient, attachedDocument, masterFile, contact, clinicalTrial
3819          , name, crossReference, manufacturingBusinessOperation, specialDesignation);
3820      }
3821
3822  @Override
3823  public ResourceType getResourceType() {
3824    return ResourceType.MedicinalProductDefinition;
3825   }
3826
3827 /**
3828   * Search parameter: <b>identifier</b>
3829   * <p>
3830   * Description: <b>Business identifier for this product. Could be an MPID</b><br>
3831   * Type: <b>token</b><br>
3832   * Path: <b>MedicinalProductDefinition.identifier</b><br>
3833   * </p>
3834   */
3835  @SearchParamDefinition(name="identifier", path="MedicinalProductDefinition.identifier", description="Business identifier for this product. Could be an MPID", type="token" )
3836  public static final String SP_IDENTIFIER = "identifier";
3837 /**
3838   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3839   * <p>
3840   * Description: <b>Business identifier for this product. Could be an MPID</b><br>
3841   * Type: <b>token</b><br>
3842   * Path: <b>MedicinalProductDefinition.identifier</b><br>
3843   * </p>
3844   */
3845  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3846
3847 /**
3848   * Search parameter: <b>name</b>
3849   * <p>
3850   * Description: <b>The full product name</b><br>
3851   * Type: <b>string</b><br>
3852   * Path: <b>MedicinalProductDefinition.name.productName</b><br>
3853   * </p>
3854   */
3855  @SearchParamDefinition(name="name", path="MedicinalProductDefinition.name.productName", description="The full product name", type="string" )
3856  public static final String SP_NAME = "name";
3857 /**
3858   * <b>Fluent Client</b> search parameter constant for <b>name</b>
3859   * <p>
3860   * Description: <b>The full product name</b><br>
3861   * Type: <b>string</b><br>
3862   * Path: <b>MedicinalProductDefinition.name.productName</b><br>
3863   * </p>
3864   */
3865  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
3866
3867 /**
3868   * Search parameter: <b>name-language</b>
3869   * <p>
3870   * Description: <b>Language code for this name</b><br>
3871   * Type: <b>token</b><br>
3872   * Path: <b>MedicinalProductDefinition.name.countryLanguage.language</b><br>
3873   * </p>
3874   */
3875  @SearchParamDefinition(name="name-language", path="MedicinalProductDefinition.name.countryLanguage.language", description="Language code for this name", type="token" )
3876  public static final String SP_NAME_LANGUAGE = "name-language";
3877 /**
3878   * <b>Fluent Client</b> search parameter constant for <b>name-language</b>
3879   * <p>
3880   * Description: <b>Language code for this name</b><br>
3881   * Type: <b>token</b><br>
3882   * Path: <b>MedicinalProductDefinition.name.countryLanguage.language</b><br>
3883   * </p>
3884   */
3885  public static final ca.uhn.fhir.rest.gclient.TokenClientParam NAME_LANGUAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_NAME_LANGUAGE);
3886
3887
3888}
3889