001package org.hl7.fhir.r4.model; 002 003/* 004 Copyright (c) 2011+, HL7, Inc. 005 All rights reserved. 006 007 Redistribution and use in source and binary forms, with or without modification, 008 are permitted provided that the following conditions are met: 009 010 * Redistributions of source code must retain the above copyright notice, this 011 list of conditions and the following disclaimer. 012 * Redistributions in binary form must reproduce the above copyright notice, 013 this list of conditions and the following disclaimer in the documentation 014 and/or other materials provided with the distribution. 015 * Neither the name of HL7 nor the names of its contributors may be used to 016 endorse or promote products derived from this software without specific 017 prior written permission. 018 019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 022 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 023 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 024 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 025 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 026 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 027 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 028 POSSIBILITY OF SUCH DAMAGE. 029 030*/ 031 032// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0 033 034import java.util.*; 035 036import org.hl7.fhir.utilities.Utilities; 037import ca.uhn.fhir.model.api.annotation.ResourceDef; 038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 039import ca.uhn.fhir.model.api.annotation.Child; 040import ca.uhn.fhir.model.api.annotation.ChildOrder; 041import ca.uhn.fhir.model.api.annotation.Description; 042import ca.uhn.fhir.model.api.annotation.Block; 043import org.hl7.fhir.instance.model.api.*; 044import org.hl7.fhir.exceptions.FHIRException; 045/** 046 * A medicinal product in a container or package. 047 */ 048@ResourceDef(name="MedicinalProductPackaged", profile="http://hl7.org/fhir/Profile/MedicinalProductPackaged") 049public class MedicinalProductPackaged extends DomainResource { 050 051 @Block() 052 public static class MedicinalProductPackagedBatchIdentifierComponent extends BackboneElement implements IBaseBackboneElement { 053 /** 054 * A number appearing on the outer packaging of a specific batch. 055 */ 056 @Child(name = "outerPackaging", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) 057 @Description(shortDefinition="A number appearing on the outer packaging of a specific batch", formalDefinition="A number appearing on the outer packaging of a specific batch." ) 058 protected Identifier outerPackaging; 059 060 /** 061 * A number appearing on the immediate packaging (and not the outer packaging). 062 */ 063 @Child(name = "immediatePackaging", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=true) 064 @Description(shortDefinition="A number appearing on the immediate packaging (and not the outer packaging)", formalDefinition="A number appearing on the immediate packaging (and not the outer packaging)." ) 065 protected Identifier immediatePackaging; 066 067 private static final long serialVersionUID = 1187365068L; 068 069 /** 070 * Constructor 071 */ 072 public MedicinalProductPackagedBatchIdentifierComponent() { 073 super(); 074 } 075 076 /** 077 * Constructor 078 */ 079 public MedicinalProductPackagedBatchIdentifierComponent(Identifier outerPackaging) { 080 super(); 081 this.outerPackaging = outerPackaging; 082 } 083 084 /** 085 * @return {@link #outerPackaging} (A number appearing on the outer packaging of a specific batch.) 086 */ 087 public Identifier getOuterPackaging() { 088 if (this.outerPackaging == null) 089 if (Configuration.errorOnAutoCreate()) 090 throw new Error("Attempt to auto-create MedicinalProductPackagedBatchIdentifierComponent.outerPackaging"); 091 else if (Configuration.doAutoCreate()) 092 this.outerPackaging = new Identifier(); // cc 093 return this.outerPackaging; 094 } 095 096 public boolean hasOuterPackaging() { 097 return this.outerPackaging != null && !this.outerPackaging.isEmpty(); 098 } 099 100 /** 101 * @param value {@link #outerPackaging} (A number appearing on the outer packaging of a specific batch.) 102 */ 103 public MedicinalProductPackagedBatchIdentifierComponent setOuterPackaging(Identifier value) { 104 this.outerPackaging = value; 105 return this; 106 } 107 108 /** 109 * @return {@link #immediatePackaging} (A number appearing on the immediate packaging (and not the outer packaging).) 110 */ 111 public Identifier getImmediatePackaging() { 112 if (this.immediatePackaging == null) 113 if (Configuration.errorOnAutoCreate()) 114 throw new Error("Attempt to auto-create MedicinalProductPackagedBatchIdentifierComponent.immediatePackaging"); 115 else if (Configuration.doAutoCreate()) 116 this.immediatePackaging = new Identifier(); // cc 117 return this.immediatePackaging; 118 } 119 120 public boolean hasImmediatePackaging() { 121 return this.immediatePackaging != null && !this.immediatePackaging.isEmpty(); 122 } 123 124 /** 125 * @param value {@link #immediatePackaging} (A number appearing on the immediate packaging (and not the outer packaging).) 126 */ 127 public MedicinalProductPackagedBatchIdentifierComponent setImmediatePackaging(Identifier value) { 128 this.immediatePackaging = value; 129 return this; 130 } 131 132 protected void listChildren(List<Property> children) { 133 super.listChildren(children); 134 children.add(new Property("outerPackaging", "Identifier", "A number appearing on the outer packaging of a specific batch.", 0, 1, outerPackaging)); 135 children.add(new Property("immediatePackaging", "Identifier", "A number appearing on the immediate packaging (and not the outer packaging).", 0, 1, immediatePackaging)); 136 } 137 138 @Override 139 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 140 switch (_hash) { 141 case -682249912: /*outerPackaging*/ return new Property("outerPackaging", "Identifier", "A number appearing on the outer packaging of a specific batch.", 0, 1, outerPackaging); 142 case 721147602: /*immediatePackaging*/ return new Property("immediatePackaging", "Identifier", "A number appearing on the immediate packaging (and not the outer packaging).", 0, 1, immediatePackaging); 143 default: return super.getNamedProperty(_hash, _name, _checkValid); 144 } 145 146 } 147 148 @Override 149 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 150 switch (hash) { 151 case -682249912: /*outerPackaging*/ return this.outerPackaging == null ? new Base[0] : new Base[] {this.outerPackaging}; // Identifier 152 case 721147602: /*immediatePackaging*/ return this.immediatePackaging == null ? new Base[0] : new Base[] {this.immediatePackaging}; // Identifier 153 default: return super.getProperty(hash, name, checkValid); 154 } 155 156 } 157 158 @Override 159 public Base setProperty(int hash, String name, Base value) throws FHIRException { 160 switch (hash) { 161 case -682249912: // outerPackaging 162 this.outerPackaging = castToIdentifier(value); // Identifier 163 return value; 164 case 721147602: // immediatePackaging 165 this.immediatePackaging = castToIdentifier(value); // Identifier 166 return value; 167 default: return super.setProperty(hash, name, value); 168 } 169 170 } 171 172 @Override 173 public Base setProperty(String name, Base value) throws FHIRException { 174 if (name.equals("outerPackaging")) { 175 this.outerPackaging = castToIdentifier(value); // Identifier 176 } else if (name.equals("immediatePackaging")) { 177 this.immediatePackaging = castToIdentifier(value); // Identifier 178 } else 179 return super.setProperty(name, value); 180 return value; 181 } 182 183 @Override 184 public Base makeProperty(int hash, String name) throws FHIRException { 185 switch (hash) { 186 case -682249912: return getOuterPackaging(); 187 case 721147602: return getImmediatePackaging(); 188 default: return super.makeProperty(hash, name); 189 } 190 191 } 192 193 @Override 194 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 195 switch (hash) { 196 case -682249912: /*outerPackaging*/ return new String[] {"Identifier"}; 197 case 721147602: /*immediatePackaging*/ return new String[] {"Identifier"}; 198 default: return super.getTypesForProperty(hash, name); 199 } 200 201 } 202 203 @Override 204 public Base addChild(String name) throws FHIRException { 205 if (name.equals("outerPackaging")) { 206 this.outerPackaging = new Identifier(); 207 return this.outerPackaging; 208 } 209 else if (name.equals("immediatePackaging")) { 210 this.immediatePackaging = new Identifier(); 211 return this.immediatePackaging; 212 } 213 else 214 return super.addChild(name); 215 } 216 217 public MedicinalProductPackagedBatchIdentifierComponent copy() { 218 MedicinalProductPackagedBatchIdentifierComponent dst = new MedicinalProductPackagedBatchIdentifierComponent(); 219 copyValues(dst); 220 dst.outerPackaging = outerPackaging == null ? null : outerPackaging.copy(); 221 dst.immediatePackaging = immediatePackaging == null ? null : immediatePackaging.copy(); 222 return dst; 223 } 224 225 @Override 226 public boolean equalsDeep(Base other_) { 227 if (!super.equalsDeep(other_)) 228 return false; 229 if (!(other_ instanceof MedicinalProductPackagedBatchIdentifierComponent)) 230 return false; 231 MedicinalProductPackagedBatchIdentifierComponent o = (MedicinalProductPackagedBatchIdentifierComponent) other_; 232 return compareDeep(outerPackaging, o.outerPackaging, true) && compareDeep(immediatePackaging, o.immediatePackaging, true) 233 ; 234 } 235 236 @Override 237 public boolean equalsShallow(Base other_) { 238 if (!super.equalsShallow(other_)) 239 return false; 240 if (!(other_ instanceof MedicinalProductPackagedBatchIdentifierComponent)) 241 return false; 242 MedicinalProductPackagedBatchIdentifierComponent o = (MedicinalProductPackagedBatchIdentifierComponent) other_; 243 return true; 244 } 245 246 public boolean isEmpty() { 247 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(outerPackaging, immediatePackaging 248 ); 249 } 250 251 public String fhirType() { 252 return "MedicinalProductPackaged.batchIdentifier"; 253 254 } 255 256 } 257 258 @Block() 259 public static class MedicinalProductPackagedPackageItemComponent extends BackboneElement implements IBaseBackboneElement { 260 /** 261 * Including possibly Data Carrier Identifier. 262 */ 263 @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 264 @Description(shortDefinition="Including possibly Data Carrier Identifier", formalDefinition="Including possibly Data Carrier Identifier." ) 265 protected List<Identifier> identifier; 266 267 /** 268 * The physical type of the container of the medicine. 269 */ 270 @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true) 271 @Description(shortDefinition="The physical type of the container of the medicine", formalDefinition="The physical type of the container of the medicine." ) 272 protected CodeableConcept type; 273 274 /** 275 * The quantity of this package in the medicinal product, at the current level of packaging. The outermost is always 1. 276 */ 277 @Child(name = "quantity", type = {Quantity.class}, order=3, min=1, max=1, modifier=false, summary=true) 278 @Description(shortDefinition="The quantity of this package in the medicinal product, at the current level of packaging. The outermost is always 1", formalDefinition="The quantity of this package in the medicinal product, at the current level of packaging. The outermost is always 1." ) 279 protected Quantity quantity; 280 281 /** 282 * Material type of the package item. 283 */ 284 @Child(name = "material", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 285 @Description(shortDefinition="Material type of the package item", formalDefinition="Material type of the package item." ) 286 protected List<CodeableConcept> material; 287 288 /** 289 * A possible alternate material for the packaging. 290 */ 291 @Child(name = "alternateMaterial", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 292 @Description(shortDefinition="A possible alternate material for the packaging", formalDefinition="A possible alternate material for the packaging." ) 293 protected List<CodeableConcept> alternateMaterial; 294 295 /** 296 * Manufacturer of this Package Item. 297 */ 298 @Child(name = "manufacturer", type = {Organization.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 299 @Description(shortDefinition="Manufacturer of this Package Item", formalDefinition="Manufacturer of this Package Item." ) 300 protected List<Reference> manufacturer; 301 /** 302 * The actual objects that are the target of the reference (Manufacturer of this Package Item.) 303 */ 304 protected List<Organization> manufacturerTarget; 305 306 307 /** 308 * A device accompanying a medicinal product. 309 */ 310 @Child(name = "device", type = {MedicinalProductDeviceSpec.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 311 @Description(shortDefinition="A device accompanying a medicinal product", formalDefinition="A device accompanying a medicinal product." ) 312 protected List<Reference> device; 313 /** 314 * The actual objects that are the target of the reference (A device accompanying a medicinal product.) 315 */ 316 protected List<MedicinalProductDeviceSpec> deviceTarget; 317 318 319 /** 320 * The manufactured item as contained in the packaged medicinal product. 321 */ 322 @Child(name = "manufacturedItem", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 323 @Description(shortDefinition="The manufactured item as contained in the packaged medicinal product", formalDefinition="The manufactured item as contained in the packaged medicinal product." ) 324 protected List<MedicinalProductPackagedPackageItemManufacturedItemComponent> manufacturedItem; 325 326 /** 327 * Other codeable characteristics. 328 */ 329 @Child(name = "otherCharacteristics", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 330 @Description(shortDefinition="Other codeable characteristics", formalDefinition="Other codeable characteristics." ) 331 protected List<CodeableConcept> otherCharacteristics; 332 333 /** 334 * Allows containers within containers. 335 */ 336 @Child(name = "packageItem", type = {MedicinalProductPackagedPackageItemComponent.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 337 @Description(shortDefinition="Allows containers within containers", formalDefinition="Allows containers within containers." ) 338 protected List<MedicinalProductPackagedPackageItemComponent> packageItem; 339 340 /** 341 * Dimensions, color etc. 342 */ 343 @Child(name = "physicalCharacteristics", type = {ProdCharacteristic.class}, order=11, min=0, max=1, modifier=false, summary=true) 344 @Description(shortDefinition="Dimensions, color etc.", formalDefinition="Dimensions, color etc." ) 345 protected ProdCharacteristic physicalCharacteristics; 346 347 /** 348 * Shelf Life and storage information. 349 */ 350 @Child(name = "shelfLifeStorage", type = {ProductShelfLife.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 351 @Description(shortDefinition="Shelf Life and storage information", formalDefinition="Shelf Life and storage information." ) 352 protected List<ProductShelfLife> shelfLifeStorage; 353 354 private static final long serialVersionUID = -1046468533L; 355 356 /** 357 * Constructor 358 */ 359 public MedicinalProductPackagedPackageItemComponent() { 360 super(); 361 } 362 363 /** 364 * Constructor 365 */ 366 public MedicinalProductPackagedPackageItemComponent(CodeableConcept type, Quantity quantity) { 367 super(); 368 this.type = type; 369 this.quantity = quantity; 370 } 371 372 /** 373 * @return {@link #identifier} (Including possibly Data Carrier Identifier.) 374 */ 375 public List<Identifier> getIdentifier() { 376 if (this.identifier == null) 377 this.identifier = new ArrayList<Identifier>(); 378 return this.identifier; 379 } 380 381 /** 382 * @return Returns a reference to <code>this</code> for easy method chaining 383 */ 384 public MedicinalProductPackagedPackageItemComponent setIdentifier(List<Identifier> theIdentifier) { 385 this.identifier = theIdentifier; 386 return this; 387 } 388 389 public boolean hasIdentifier() { 390 if (this.identifier == null) 391 return false; 392 for (Identifier item : this.identifier) 393 if (!item.isEmpty()) 394 return true; 395 return false; 396 } 397 398 public Identifier addIdentifier() { //3 399 Identifier t = new Identifier(); 400 if (this.identifier == null) 401 this.identifier = new ArrayList<Identifier>(); 402 this.identifier.add(t); 403 return t; 404 } 405 406 public MedicinalProductPackagedPackageItemComponent addIdentifier(Identifier t) { //3 407 if (t == null) 408 return this; 409 if (this.identifier == null) 410 this.identifier = new ArrayList<Identifier>(); 411 this.identifier.add(t); 412 return this; 413 } 414 415 /** 416 * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist 417 */ 418 public Identifier getIdentifierFirstRep() { 419 if (getIdentifier().isEmpty()) { 420 addIdentifier(); 421 } 422 return getIdentifier().get(0); 423 } 424 425 /** 426 * @return {@link #type} (The physical type of the container of the medicine.) 427 */ 428 public CodeableConcept getType() { 429 if (this.type == null) 430 if (Configuration.errorOnAutoCreate()) 431 throw new Error("Attempt to auto-create MedicinalProductPackagedPackageItemComponent.type"); 432 else if (Configuration.doAutoCreate()) 433 this.type = new CodeableConcept(); // cc 434 return this.type; 435 } 436 437 public boolean hasType() { 438 return this.type != null && !this.type.isEmpty(); 439 } 440 441 /** 442 * @param value {@link #type} (The physical type of the container of the medicine.) 443 */ 444 public MedicinalProductPackagedPackageItemComponent setType(CodeableConcept value) { 445 this.type = value; 446 return this; 447 } 448 449 /** 450 * @return {@link #quantity} (The quantity of this package in the medicinal product, at the current level of packaging. The outermost is always 1.) 451 */ 452 public Quantity getQuantity() { 453 if (this.quantity == null) 454 if (Configuration.errorOnAutoCreate()) 455 throw new Error("Attempt to auto-create MedicinalProductPackagedPackageItemComponent.quantity"); 456 else if (Configuration.doAutoCreate()) 457 this.quantity = new Quantity(); // cc 458 return this.quantity; 459 } 460 461 public boolean hasQuantity() { 462 return this.quantity != null && !this.quantity.isEmpty(); 463 } 464 465 /** 466 * @param value {@link #quantity} (The quantity of this package in the medicinal product, at the current level of packaging. The outermost is always 1.) 467 */ 468 public MedicinalProductPackagedPackageItemComponent setQuantity(Quantity value) { 469 this.quantity = value; 470 return this; 471 } 472 473 /** 474 * @return {@link #material} (Material type of the package item.) 475 */ 476 public List<CodeableConcept> getMaterial() { 477 if (this.material == null) 478 this.material = new ArrayList<CodeableConcept>(); 479 return this.material; 480 } 481 482 /** 483 * @return Returns a reference to <code>this</code> for easy method chaining 484 */ 485 public MedicinalProductPackagedPackageItemComponent setMaterial(List<CodeableConcept> theMaterial) { 486 this.material = theMaterial; 487 return this; 488 } 489 490 public boolean hasMaterial() { 491 if (this.material == null) 492 return false; 493 for (CodeableConcept item : this.material) 494 if (!item.isEmpty()) 495 return true; 496 return false; 497 } 498 499 public CodeableConcept addMaterial() { //3 500 CodeableConcept t = new CodeableConcept(); 501 if (this.material == null) 502 this.material = new ArrayList<CodeableConcept>(); 503 this.material.add(t); 504 return t; 505 } 506 507 public MedicinalProductPackagedPackageItemComponent addMaterial(CodeableConcept t) { //3 508 if (t == null) 509 return this; 510 if (this.material == null) 511 this.material = new ArrayList<CodeableConcept>(); 512 this.material.add(t); 513 return this; 514 } 515 516 /** 517 * @return The first repetition of repeating field {@link #material}, creating it if it does not already exist 518 */ 519 public CodeableConcept getMaterialFirstRep() { 520 if (getMaterial().isEmpty()) { 521 addMaterial(); 522 } 523 return getMaterial().get(0); 524 } 525 526 /** 527 * @return {@link #alternateMaterial} (A possible alternate material for the packaging.) 528 */ 529 public List<CodeableConcept> getAlternateMaterial() { 530 if (this.alternateMaterial == null) 531 this.alternateMaterial = new ArrayList<CodeableConcept>(); 532 return this.alternateMaterial; 533 } 534 535 /** 536 * @return Returns a reference to <code>this</code> for easy method chaining 537 */ 538 public MedicinalProductPackagedPackageItemComponent setAlternateMaterial(List<CodeableConcept> theAlternateMaterial) { 539 this.alternateMaterial = theAlternateMaterial; 540 return this; 541 } 542 543 public boolean hasAlternateMaterial() { 544 if (this.alternateMaterial == null) 545 return false; 546 for (CodeableConcept item : this.alternateMaterial) 547 if (!item.isEmpty()) 548 return true; 549 return false; 550 } 551 552 public CodeableConcept addAlternateMaterial() { //3 553 CodeableConcept t = new CodeableConcept(); 554 if (this.alternateMaterial == null) 555 this.alternateMaterial = new ArrayList<CodeableConcept>(); 556 this.alternateMaterial.add(t); 557 return t; 558 } 559 560 public MedicinalProductPackagedPackageItemComponent addAlternateMaterial(CodeableConcept t) { //3 561 if (t == null) 562 return this; 563 if (this.alternateMaterial == null) 564 this.alternateMaterial = new ArrayList<CodeableConcept>(); 565 this.alternateMaterial.add(t); 566 return this; 567 } 568 569 /** 570 * @return The first repetition of repeating field {@link #alternateMaterial}, creating it if it does not already exist 571 */ 572 public CodeableConcept getAlternateMaterialFirstRep() { 573 if (getAlternateMaterial().isEmpty()) { 574 addAlternateMaterial(); 575 } 576 return getAlternateMaterial().get(0); 577 } 578 579 /** 580 * @return {@link #manufacturer} (Manufacturer of this Package Item.) 581 */ 582 public List<Reference> getManufacturer() { 583 if (this.manufacturer == null) 584 this.manufacturer = new ArrayList<Reference>(); 585 return this.manufacturer; 586 } 587 588 /** 589 * @return Returns a reference to <code>this</code> for easy method chaining 590 */ 591 public MedicinalProductPackagedPackageItemComponent setManufacturer(List<Reference> theManufacturer) { 592 this.manufacturer = theManufacturer; 593 return this; 594 } 595 596 public boolean hasManufacturer() { 597 if (this.manufacturer == null) 598 return false; 599 for (Reference item : this.manufacturer) 600 if (!item.isEmpty()) 601 return true; 602 return false; 603 } 604 605 public Reference addManufacturer() { //3 606 Reference t = new Reference(); 607 if (this.manufacturer == null) 608 this.manufacturer = new ArrayList<Reference>(); 609 this.manufacturer.add(t); 610 return t; 611 } 612 613 public MedicinalProductPackagedPackageItemComponent addManufacturer(Reference t) { //3 614 if (t == null) 615 return this; 616 if (this.manufacturer == null) 617 this.manufacturer = new ArrayList<Reference>(); 618 this.manufacturer.add(t); 619 return this; 620 } 621 622 /** 623 * @return The first repetition of repeating field {@link #manufacturer}, creating it if it does not already exist 624 */ 625 public Reference getManufacturerFirstRep() { 626 if (getManufacturer().isEmpty()) { 627 addManufacturer(); 628 } 629 return getManufacturer().get(0); 630 } 631 632 /** 633 * @deprecated Use Reference#setResource(IBaseResource) instead 634 */ 635 @Deprecated 636 public List<Organization> getManufacturerTarget() { 637 if (this.manufacturerTarget == null) 638 this.manufacturerTarget = new ArrayList<Organization>(); 639 return this.manufacturerTarget; 640 } 641 642 /** 643 * @deprecated Use Reference#setResource(IBaseResource) instead 644 */ 645 @Deprecated 646 public Organization addManufacturerTarget() { 647 Organization r = new Organization(); 648 if (this.manufacturerTarget == null) 649 this.manufacturerTarget = new ArrayList<Organization>(); 650 this.manufacturerTarget.add(r); 651 return r; 652 } 653 654 /** 655 * @return {@link #device} (A device accompanying a medicinal product.) 656 */ 657 public List<Reference> getDevice() { 658 if (this.device == null) 659 this.device = new ArrayList<Reference>(); 660 return this.device; 661 } 662 663 /** 664 * @return Returns a reference to <code>this</code> for easy method chaining 665 */ 666 public MedicinalProductPackagedPackageItemComponent setDevice(List<Reference> theDevice) { 667 this.device = theDevice; 668 return this; 669 } 670 671 public boolean hasDevice() { 672 if (this.device == null) 673 return false; 674 for (Reference item : this.device) 675 if (!item.isEmpty()) 676 return true; 677 return false; 678 } 679 680 public Reference addDevice() { //3 681 Reference t = new Reference(); 682 if (this.device == null) 683 this.device = new ArrayList<Reference>(); 684 this.device.add(t); 685 return t; 686 } 687 688 public MedicinalProductPackagedPackageItemComponent addDevice(Reference t) { //3 689 if (t == null) 690 return this; 691 if (this.device == null) 692 this.device = new ArrayList<Reference>(); 693 this.device.add(t); 694 return this; 695 } 696 697 /** 698 * @return The first repetition of repeating field {@link #device}, creating it if it does not already exist 699 */ 700 public Reference getDeviceFirstRep() { 701 if (getDevice().isEmpty()) { 702 addDevice(); 703 } 704 return getDevice().get(0); 705 } 706 707 /** 708 * @deprecated Use Reference#setResource(IBaseResource) instead 709 */ 710 @Deprecated 711 public List<MedicinalProductDeviceSpec> getDeviceTarget() { 712 if (this.deviceTarget == null) 713 this.deviceTarget = new ArrayList<MedicinalProductDeviceSpec>(); 714 return this.deviceTarget; 715 } 716 717 /** 718 * @deprecated Use Reference#setResource(IBaseResource) instead 719 */ 720 @Deprecated 721 public MedicinalProductDeviceSpec addDeviceTarget() { 722 MedicinalProductDeviceSpec r = new MedicinalProductDeviceSpec(); 723 if (this.deviceTarget == null) 724 this.deviceTarget = new ArrayList<MedicinalProductDeviceSpec>(); 725 this.deviceTarget.add(r); 726 return r; 727 } 728 729 /** 730 * @return {@link #manufacturedItem} (The manufactured item as contained in the packaged medicinal product.) 731 */ 732 public List<MedicinalProductPackagedPackageItemManufacturedItemComponent> getManufacturedItem() { 733 if (this.manufacturedItem == null) 734 this.manufacturedItem = new ArrayList<MedicinalProductPackagedPackageItemManufacturedItemComponent>(); 735 return this.manufacturedItem; 736 } 737 738 /** 739 * @return Returns a reference to <code>this</code> for easy method chaining 740 */ 741 public MedicinalProductPackagedPackageItemComponent setManufacturedItem(List<MedicinalProductPackagedPackageItemManufacturedItemComponent> theManufacturedItem) { 742 this.manufacturedItem = theManufacturedItem; 743 return this; 744 } 745 746 public boolean hasManufacturedItem() { 747 if (this.manufacturedItem == null) 748 return false; 749 for (MedicinalProductPackagedPackageItemManufacturedItemComponent item : this.manufacturedItem) 750 if (!item.isEmpty()) 751 return true; 752 return false; 753 } 754 755 public MedicinalProductPackagedPackageItemManufacturedItemComponent addManufacturedItem() { //3 756 MedicinalProductPackagedPackageItemManufacturedItemComponent t = new MedicinalProductPackagedPackageItemManufacturedItemComponent(); 757 if (this.manufacturedItem == null) 758 this.manufacturedItem = new ArrayList<MedicinalProductPackagedPackageItemManufacturedItemComponent>(); 759 this.manufacturedItem.add(t); 760 return t; 761 } 762 763 public MedicinalProductPackagedPackageItemComponent addManufacturedItem(MedicinalProductPackagedPackageItemManufacturedItemComponent t) { //3 764 if (t == null) 765 return this; 766 if (this.manufacturedItem == null) 767 this.manufacturedItem = new ArrayList<MedicinalProductPackagedPackageItemManufacturedItemComponent>(); 768 this.manufacturedItem.add(t); 769 return this; 770 } 771 772 /** 773 * @return The first repetition of repeating field {@link #manufacturedItem}, creating it if it does not already exist 774 */ 775 public MedicinalProductPackagedPackageItemManufacturedItemComponent getManufacturedItemFirstRep() { 776 if (getManufacturedItem().isEmpty()) { 777 addManufacturedItem(); 778 } 779 return getManufacturedItem().get(0); 780 } 781 782 /** 783 * @return {@link #otherCharacteristics} (Other codeable characteristics.) 784 */ 785 public List<CodeableConcept> getOtherCharacteristics() { 786 if (this.otherCharacteristics == null) 787 this.otherCharacteristics = new ArrayList<CodeableConcept>(); 788 return this.otherCharacteristics; 789 } 790 791 /** 792 * @return Returns a reference to <code>this</code> for easy method chaining 793 */ 794 public MedicinalProductPackagedPackageItemComponent setOtherCharacteristics(List<CodeableConcept> theOtherCharacteristics) { 795 this.otherCharacteristics = theOtherCharacteristics; 796 return this; 797 } 798 799 public boolean hasOtherCharacteristics() { 800 if (this.otherCharacteristics == null) 801 return false; 802 for (CodeableConcept item : this.otherCharacteristics) 803 if (!item.isEmpty()) 804 return true; 805 return false; 806 } 807 808 public CodeableConcept addOtherCharacteristics() { //3 809 CodeableConcept t = new CodeableConcept(); 810 if (this.otherCharacteristics == null) 811 this.otherCharacteristics = new ArrayList<CodeableConcept>(); 812 this.otherCharacteristics.add(t); 813 return t; 814 } 815 816 public MedicinalProductPackagedPackageItemComponent addOtherCharacteristics(CodeableConcept t) { //3 817 if (t == null) 818 return this; 819 if (this.otherCharacteristics == null) 820 this.otherCharacteristics = new ArrayList<CodeableConcept>(); 821 this.otherCharacteristics.add(t); 822 return this; 823 } 824 825 /** 826 * @return The first repetition of repeating field {@link #otherCharacteristics}, creating it if it does not already exist 827 */ 828 public CodeableConcept getOtherCharacteristicsFirstRep() { 829 if (getOtherCharacteristics().isEmpty()) { 830 addOtherCharacteristics(); 831 } 832 return getOtherCharacteristics().get(0); 833 } 834 835 /** 836 * @return {@link #packageItem} (Allows containers within containers.) 837 */ 838 public List<MedicinalProductPackagedPackageItemComponent> getPackageItem() { 839 if (this.packageItem == null) 840 this.packageItem = new ArrayList<MedicinalProductPackagedPackageItemComponent>(); 841 return this.packageItem; 842 } 843 844 /** 845 * @return Returns a reference to <code>this</code> for easy method chaining 846 */ 847 public MedicinalProductPackagedPackageItemComponent setPackageItem(List<MedicinalProductPackagedPackageItemComponent> thePackageItem) { 848 this.packageItem = thePackageItem; 849 return this; 850 } 851 852 public boolean hasPackageItem() { 853 if (this.packageItem == null) 854 return false; 855 for (MedicinalProductPackagedPackageItemComponent item : this.packageItem) 856 if (!item.isEmpty()) 857 return true; 858 return false; 859 } 860 861 public MedicinalProductPackagedPackageItemComponent addPackageItem() { //3 862 MedicinalProductPackagedPackageItemComponent t = new MedicinalProductPackagedPackageItemComponent(); 863 if (this.packageItem == null) 864 this.packageItem = new ArrayList<MedicinalProductPackagedPackageItemComponent>(); 865 this.packageItem.add(t); 866 return t; 867 } 868 869 public MedicinalProductPackagedPackageItemComponent addPackageItem(MedicinalProductPackagedPackageItemComponent t) { //3 870 if (t == null) 871 return this; 872 if (this.packageItem == null) 873 this.packageItem = new ArrayList<MedicinalProductPackagedPackageItemComponent>(); 874 this.packageItem.add(t); 875 return this; 876 } 877 878 /** 879 * @return The first repetition of repeating field {@link #packageItem}, creating it if it does not already exist 880 */ 881 public MedicinalProductPackagedPackageItemComponent getPackageItemFirstRep() { 882 if (getPackageItem().isEmpty()) { 883 addPackageItem(); 884 } 885 return getPackageItem().get(0); 886 } 887 888 /** 889 * @return {@link #physicalCharacteristics} (Dimensions, color etc.) 890 */ 891 public ProdCharacteristic getPhysicalCharacteristics() { 892 if (this.physicalCharacteristics == null) 893 if (Configuration.errorOnAutoCreate()) 894 throw new Error("Attempt to auto-create MedicinalProductPackagedPackageItemComponent.physicalCharacteristics"); 895 else if (Configuration.doAutoCreate()) 896 this.physicalCharacteristics = new ProdCharacteristic(); // cc 897 return this.physicalCharacteristics; 898 } 899 900 public boolean hasPhysicalCharacteristics() { 901 return this.physicalCharacteristics != null && !this.physicalCharacteristics.isEmpty(); 902 } 903 904 /** 905 * @param value {@link #physicalCharacteristics} (Dimensions, color etc.) 906 */ 907 public MedicinalProductPackagedPackageItemComponent setPhysicalCharacteristics(ProdCharacteristic value) { 908 this.physicalCharacteristics = value; 909 return this; 910 } 911 912 /** 913 * @return {@link #shelfLifeStorage} (Shelf Life and storage information.) 914 */ 915 public List<ProductShelfLife> getShelfLifeStorage() { 916 if (this.shelfLifeStorage == null) 917 this.shelfLifeStorage = new ArrayList<ProductShelfLife>(); 918 return this.shelfLifeStorage; 919 } 920 921 /** 922 * @return Returns a reference to <code>this</code> for easy method chaining 923 */ 924 public MedicinalProductPackagedPackageItemComponent setShelfLifeStorage(List<ProductShelfLife> theShelfLifeStorage) { 925 this.shelfLifeStorage = theShelfLifeStorage; 926 return this; 927 } 928 929 public boolean hasShelfLifeStorage() { 930 if (this.shelfLifeStorage == null) 931 return false; 932 for (ProductShelfLife item : this.shelfLifeStorage) 933 if (!item.isEmpty()) 934 return true; 935 return false; 936 } 937 938 public ProductShelfLife addShelfLifeStorage() { //3 939 ProductShelfLife t = new ProductShelfLife(); 940 if (this.shelfLifeStorage == null) 941 this.shelfLifeStorage = new ArrayList<ProductShelfLife>(); 942 this.shelfLifeStorage.add(t); 943 return t; 944 } 945 946 public MedicinalProductPackagedPackageItemComponent addShelfLifeStorage(ProductShelfLife t) { //3 947 if (t == null) 948 return this; 949 if (this.shelfLifeStorage == null) 950 this.shelfLifeStorage = new ArrayList<ProductShelfLife>(); 951 this.shelfLifeStorage.add(t); 952 return this; 953 } 954 955 /** 956 * @return The first repetition of repeating field {@link #shelfLifeStorage}, creating it if it does not already exist 957 */ 958 public ProductShelfLife getShelfLifeStorageFirstRep() { 959 if (getShelfLifeStorage().isEmpty()) { 960 addShelfLifeStorage(); 961 } 962 return getShelfLifeStorage().get(0); 963 } 964 965 protected void listChildren(List<Property> children) { 966 super.listChildren(children); 967 children.add(new Property("identifier", "Identifier", "Including possibly Data Carrier Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); 968 children.add(new Property("type", "CodeableConcept", "The physical type of the container of the medicine.", 0, 1, type)); 969 children.add(new Property("quantity", "Quantity", "The quantity of this package in the medicinal product, at the current level of packaging. The outermost is always 1.", 0, 1, quantity)); 970 children.add(new Property("material", "CodeableConcept", "Material type of the package item.", 0, java.lang.Integer.MAX_VALUE, material)); 971 children.add(new Property("alternateMaterial", "CodeableConcept", "A possible alternate material for the packaging.", 0, java.lang.Integer.MAX_VALUE, alternateMaterial)); 972 children.add(new Property("manufacturer", "Reference(Organization)", "Manufacturer of this Package Item.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); 973 children.add(new Property("device", "Reference(MedicinalProductDeviceSpec)", "A device accompanying a medicinal product.", 0, java.lang.Integer.MAX_VALUE, device)); 974 children.add(new Property("manufacturedItem", "", "The manufactured item as contained in the packaged medicinal product.", 0, java.lang.Integer.MAX_VALUE, manufacturedItem)); 975 children.add(new Property("otherCharacteristics", "CodeableConcept", "Other codeable characteristics.", 0, java.lang.Integer.MAX_VALUE, otherCharacteristics)); 976 children.add(new Property("packageItem", "@MedicinalProductPackaged.packageItem", "Allows containers within containers.", 0, java.lang.Integer.MAX_VALUE, packageItem)); 977 children.add(new Property("physicalCharacteristics", "ProdCharacteristic", "Dimensions, color etc.", 0, 1, physicalCharacteristics)); 978 children.add(new Property("shelfLifeStorage", "ProductShelfLife", "Shelf Life and storage information.", 0, java.lang.Integer.MAX_VALUE, shelfLifeStorage)); 979 } 980 981 @Override 982 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 983 switch (_hash) { 984 case -1618432855: /*identifier*/ return new Property("identifier", "Identifier", "Including possibly Data Carrier Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier); 985 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "The physical type of the container of the medicine.", 0, 1, type); 986 case -1285004149: /*quantity*/ return new Property("quantity", "Quantity", "The quantity of this package in the medicinal product, at the current level of packaging. The outermost is always 1.", 0, 1, quantity); 987 case 299066663: /*material*/ return new Property("material", "CodeableConcept", "Material type of the package item.", 0, java.lang.Integer.MAX_VALUE, material); 988 case -1021448255: /*alternateMaterial*/ return new Property("alternateMaterial", "CodeableConcept", "A possible alternate material for the packaging.", 0, java.lang.Integer.MAX_VALUE, alternateMaterial); 989 case -1969347631: /*manufacturer*/ return new Property("manufacturer", "Reference(Organization)", "Manufacturer of this Package Item.", 0, java.lang.Integer.MAX_VALUE, manufacturer); 990 case -1335157162: /*device*/ return new Property("device", "Reference(MedicinalProductDeviceSpec)", "A device accompanying a medicinal product.", 0, java.lang.Integer.MAX_VALUE, device); 991 case 62093686: /*manufacturedItem*/ return new Property("manufacturedItem", "", "The manufactured item as contained in the packaged medicinal product.", 0, java.lang.Integer.MAX_VALUE, manufacturedItem); 992 case 722135304: /*otherCharacteristics*/ return new Property("otherCharacteristics", "CodeableConcept", "Other codeable characteristics.", 0, java.lang.Integer.MAX_VALUE, otherCharacteristics); 993 case 908628089: /*packageItem*/ return new Property("packageItem", "@MedicinalProductPackaged.packageItem", "Allows containers within containers.", 0, java.lang.Integer.MAX_VALUE, packageItem); 994 case -1599676319: /*physicalCharacteristics*/ return new Property("physicalCharacteristics", "ProdCharacteristic", "Dimensions, color etc.", 0, 1, physicalCharacteristics); 995 case 172049237: /*shelfLifeStorage*/ return new Property("shelfLifeStorage", "ProductShelfLife", "Shelf Life and storage information.", 0, java.lang.Integer.MAX_VALUE, shelfLifeStorage); 996 default: return super.getNamedProperty(_hash, _name, _checkValid); 997 } 998 999 } 1000 1001 @Override 1002 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1003 switch (hash) { 1004 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier 1005 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 1006 case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity 1007 case 299066663: /*material*/ return this.material == null ? new Base[0] : this.material.toArray(new Base[this.material.size()]); // CodeableConcept 1008 case -1021448255: /*alternateMaterial*/ return this.alternateMaterial == null ? new Base[0] : this.alternateMaterial.toArray(new Base[this.alternateMaterial.size()]); // CodeableConcept 1009 case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : this.manufacturer.toArray(new Base[this.manufacturer.size()]); // Reference 1010 case -1335157162: /*device*/ return this.device == null ? new Base[0] : this.device.toArray(new Base[this.device.size()]); // Reference 1011 case 62093686: /*manufacturedItem*/ return this.manufacturedItem == null ? new Base[0] : this.manufacturedItem.toArray(new Base[this.manufacturedItem.size()]); // MedicinalProductPackagedPackageItemManufacturedItemComponent 1012 case 722135304: /*otherCharacteristics*/ return this.otherCharacteristics == null ? new Base[0] : this.otherCharacteristics.toArray(new Base[this.otherCharacteristics.size()]); // CodeableConcept 1013 case 908628089: /*packageItem*/ return this.packageItem == null ? new Base[0] : this.packageItem.toArray(new Base[this.packageItem.size()]); // MedicinalProductPackagedPackageItemComponent 1014 case -1599676319: /*physicalCharacteristics*/ return this.physicalCharacteristics == null ? new Base[0] : new Base[] {this.physicalCharacteristics}; // ProdCharacteristic 1015 case 172049237: /*shelfLifeStorage*/ return this.shelfLifeStorage == null ? new Base[0] : this.shelfLifeStorage.toArray(new Base[this.shelfLifeStorage.size()]); // ProductShelfLife 1016 default: return super.getProperty(hash, name, checkValid); 1017 } 1018 1019 } 1020 1021 @Override 1022 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1023 switch (hash) { 1024 case -1618432855: // identifier 1025 this.getIdentifier().add(castToIdentifier(value)); // Identifier 1026 return value; 1027 case 3575610: // type 1028 this.type = castToCodeableConcept(value); // CodeableConcept 1029 return value; 1030 case -1285004149: // quantity 1031 this.quantity = castToQuantity(value); // Quantity 1032 return value; 1033 case 299066663: // material 1034 this.getMaterial().add(castToCodeableConcept(value)); // CodeableConcept 1035 return value; 1036 case -1021448255: // alternateMaterial 1037 this.getAlternateMaterial().add(castToCodeableConcept(value)); // CodeableConcept 1038 return value; 1039 case -1969347631: // manufacturer 1040 this.getManufacturer().add(castToReference(value)); // Reference 1041 return value; 1042 case -1335157162: // device 1043 this.getDevice().add(castToReference(value)); // Reference 1044 return value; 1045 case 62093686: // manufacturedItem 1046 this.getManufacturedItem().add((MedicinalProductPackagedPackageItemManufacturedItemComponent) value); // MedicinalProductPackagedPackageItemManufacturedItemComponent 1047 return value; 1048 case 722135304: // otherCharacteristics 1049 this.getOtherCharacteristics().add(castToCodeableConcept(value)); // CodeableConcept 1050 return value; 1051 case 908628089: // packageItem 1052 this.getPackageItem().add((MedicinalProductPackagedPackageItemComponent) value); // MedicinalProductPackagedPackageItemComponent 1053 return value; 1054 case -1599676319: // physicalCharacteristics 1055 this.physicalCharacteristics = castToProdCharacteristic(value); // ProdCharacteristic 1056 return value; 1057 case 172049237: // shelfLifeStorage 1058 this.getShelfLifeStorage().add(castToProductShelfLife(value)); // ProductShelfLife 1059 return value; 1060 default: return super.setProperty(hash, name, value); 1061 } 1062 1063 } 1064 1065 @Override 1066 public Base setProperty(String name, Base value) throws FHIRException { 1067 if (name.equals("identifier")) { 1068 this.getIdentifier().add(castToIdentifier(value)); 1069 } else if (name.equals("type")) { 1070 this.type = castToCodeableConcept(value); // CodeableConcept 1071 } else if (name.equals("quantity")) { 1072 this.quantity = castToQuantity(value); // Quantity 1073 } else if (name.equals("material")) { 1074 this.getMaterial().add(castToCodeableConcept(value)); 1075 } else if (name.equals("alternateMaterial")) { 1076 this.getAlternateMaterial().add(castToCodeableConcept(value)); 1077 } else if (name.equals("manufacturer")) { 1078 this.getManufacturer().add(castToReference(value)); 1079 } else if (name.equals("device")) { 1080 this.getDevice().add(castToReference(value)); 1081 } else if (name.equals("manufacturedItem")) { 1082 this.getManufacturedItem().add((MedicinalProductPackagedPackageItemManufacturedItemComponent) value); 1083 } else if (name.equals("otherCharacteristics")) { 1084 this.getOtherCharacteristics().add(castToCodeableConcept(value)); 1085 } else if (name.equals("packageItem")) { 1086 this.getPackageItem().add((MedicinalProductPackagedPackageItemComponent) value); 1087 } else if (name.equals("physicalCharacteristics")) { 1088 this.physicalCharacteristics = castToProdCharacteristic(value); // ProdCharacteristic 1089 } else if (name.equals("shelfLifeStorage")) { 1090 this.getShelfLifeStorage().add(castToProductShelfLife(value)); 1091 } else 1092 return super.setProperty(name, value); 1093 return value; 1094 } 1095 1096 @Override 1097 public Base makeProperty(int hash, String name) throws FHIRException { 1098 switch (hash) { 1099 case -1618432855: return addIdentifier(); 1100 case 3575610: return getType(); 1101 case -1285004149: return getQuantity(); 1102 case 299066663: return addMaterial(); 1103 case -1021448255: return addAlternateMaterial(); 1104 case -1969347631: return addManufacturer(); 1105 case -1335157162: return addDevice(); 1106 case 62093686: return addManufacturedItem(); 1107 case 722135304: return addOtherCharacteristics(); 1108 case 908628089: return addPackageItem(); 1109 case -1599676319: return getPhysicalCharacteristics(); 1110 case 172049237: return addShelfLifeStorage(); 1111 default: return super.makeProperty(hash, name); 1112 } 1113 1114 } 1115 1116 @Override 1117 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1118 switch (hash) { 1119 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 1120 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 1121 case -1285004149: /*quantity*/ return new String[] {"Quantity"}; 1122 case 299066663: /*material*/ return new String[] {"CodeableConcept"}; 1123 case -1021448255: /*alternateMaterial*/ return new String[] {"CodeableConcept"}; 1124 case -1969347631: /*manufacturer*/ return new String[] {"Reference"}; 1125 case -1335157162: /*device*/ return new String[] {"Reference"}; 1126 case 62093686: /*manufacturedItem*/ return new String[] {}; 1127 case 722135304: /*otherCharacteristics*/ return new String[] {"CodeableConcept"}; 1128 case 908628089: /*packageItem*/ return new String[] {"@MedicinalProductPackaged.packageItem"}; 1129 case -1599676319: /*physicalCharacteristics*/ return new String[] {"ProdCharacteristic"}; 1130 case 172049237: /*shelfLifeStorage*/ return new String[] {"ProductShelfLife"}; 1131 default: return super.getTypesForProperty(hash, name); 1132 } 1133 1134 } 1135 1136 @Override 1137 public Base addChild(String name) throws FHIRException { 1138 if (name.equals("identifier")) { 1139 return addIdentifier(); 1140 } 1141 else if (name.equals("type")) { 1142 this.type = new CodeableConcept(); 1143 return this.type; 1144 } 1145 else if (name.equals("quantity")) { 1146 this.quantity = new Quantity(); 1147 return this.quantity; 1148 } 1149 else if (name.equals("material")) { 1150 return addMaterial(); 1151 } 1152 else if (name.equals("alternateMaterial")) { 1153 return addAlternateMaterial(); 1154 } 1155 else if (name.equals("manufacturer")) { 1156 return addManufacturer(); 1157 } 1158 else if (name.equals("device")) { 1159 return addDevice(); 1160 } 1161 else if (name.equals("manufacturedItem")) { 1162 return addManufacturedItem(); 1163 } 1164 else if (name.equals("otherCharacteristics")) { 1165 return addOtherCharacteristics(); 1166 } 1167 else if (name.equals("packageItem")) { 1168 return addPackageItem(); 1169 } 1170 else if (name.equals("physicalCharacteristics")) { 1171 this.physicalCharacteristics = new ProdCharacteristic(); 1172 return this.physicalCharacteristics; 1173 } 1174 else if (name.equals("shelfLifeStorage")) { 1175 return addShelfLifeStorage(); 1176 } 1177 else 1178 return super.addChild(name); 1179 } 1180 1181 public MedicinalProductPackagedPackageItemComponent copy() { 1182 MedicinalProductPackagedPackageItemComponent dst = new MedicinalProductPackagedPackageItemComponent(); 1183 copyValues(dst); 1184 if (identifier != null) { 1185 dst.identifier = new ArrayList<Identifier>(); 1186 for (Identifier i : identifier) 1187 dst.identifier.add(i.copy()); 1188 }; 1189 dst.type = type == null ? null : type.copy(); 1190 dst.quantity = quantity == null ? null : quantity.copy(); 1191 if (material != null) { 1192 dst.material = new ArrayList<CodeableConcept>(); 1193 for (CodeableConcept i : material) 1194 dst.material.add(i.copy()); 1195 }; 1196 if (alternateMaterial != null) { 1197 dst.alternateMaterial = new ArrayList<CodeableConcept>(); 1198 for (CodeableConcept i : alternateMaterial) 1199 dst.alternateMaterial.add(i.copy()); 1200 }; 1201 if (manufacturer != null) { 1202 dst.manufacturer = new ArrayList<Reference>(); 1203 for (Reference i : manufacturer) 1204 dst.manufacturer.add(i.copy()); 1205 }; 1206 if (device != null) { 1207 dst.device = new ArrayList<Reference>(); 1208 for (Reference i : device) 1209 dst.device.add(i.copy()); 1210 }; 1211 if (manufacturedItem != null) { 1212 dst.manufacturedItem = new ArrayList<MedicinalProductPackagedPackageItemManufacturedItemComponent>(); 1213 for (MedicinalProductPackagedPackageItemManufacturedItemComponent i : manufacturedItem) 1214 dst.manufacturedItem.add(i.copy()); 1215 }; 1216 if (otherCharacteristics != null) { 1217 dst.otherCharacteristics = new ArrayList<CodeableConcept>(); 1218 for (CodeableConcept i : otherCharacteristics) 1219 dst.otherCharacteristics.add(i.copy()); 1220 }; 1221 if (packageItem != null) { 1222 dst.packageItem = new ArrayList<MedicinalProductPackagedPackageItemComponent>(); 1223 for (MedicinalProductPackagedPackageItemComponent i : packageItem) 1224 dst.packageItem.add(i.copy()); 1225 }; 1226 dst.physicalCharacteristics = physicalCharacteristics == null ? null : physicalCharacteristics.copy(); 1227 if (shelfLifeStorage != null) { 1228 dst.shelfLifeStorage = new ArrayList<ProductShelfLife>(); 1229 for (ProductShelfLife i : shelfLifeStorage) 1230 dst.shelfLifeStorage.add(i.copy()); 1231 }; 1232 return dst; 1233 } 1234 1235 @Override 1236 public boolean equalsDeep(Base other_) { 1237 if (!super.equalsDeep(other_)) 1238 return false; 1239 if (!(other_ instanceof MedicinalProductPackagedPackageItemComponent)) 1240 return false; 1241 MedicinalProductPackagedPackageItemComponent o = (MedicinalProductPackagedPackageItemComponent) other_; 1242 return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(quantity, o.quantity, true) 1243 && compareDeep(material, o.material, true) && compareDeep(alternateMaterial, o.alternateMaterial, true) 1244 && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(device, o.device, true) && compareDeep(manufacturedItem, o.manufacturedItem, true) 1245 && compareDeep(otherCharacteristics, o.otherCharacteristics, true) && compareDeep(packageItem, o.packageItem, true) 1246 && compareDeep(physicalCharacteristics, o.physicalCharacteristics, true) && compareDeep(shelfLifeStorage, o.shelfLifeStorage, true) 1247 ; 1248 } 1249 1250 @Override 1251 public boolean equalsShallow(Base other_) { 1252 if (!super.equalsShallow(other_)) 1253 return false; 1254 if (!(other_ instanceof MedicinalProductPackagedPackageItemComponent)) 1255 return false; 1256 MedicinalProductPackagedPackageItemComponent o = (MedicinalProductPackagedPackageItemComponent) other_; 1257 return true; 1258 } 1259 1260 public boolean isEmpty() { 1261 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, quantity 1262 , material, alternateMaterial, manufacturer, device, manufacturedItem, otherCharacteristics 1263 , packageItem, physicalCharacteristics, shelfLifeStorage); 1264 } 1265 1266 public String fhirType() { 1267 return "MedicinalProductPackaged.packageItem"; 1268 1269 } 1270 1271 } 1272 1273 @Block() 1274 public static class MedicinalProductPackagedPackageItemManufacturedItemComponent extends BackboneElement implements IBaseBackboneElement { 1275 /** 1276 * Dose form as manufactured and before any transformation into the pharmaceutical product. 1277 */ 1278 @Child(name = "manufacturedDoseForm", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) 1279 @Description(shortDefinition="Dose form as manufactured and before any transformation into the pharmaceutical product", formalDefinition="Dose form as manufactured and before any transformation into the pharmaceutical product." ) 1280 protected CodeableConcept manufacturedDoseForm; 1281 1282 /** 1283 * The “real world” units in which the quantity of the manufactured item is described. 1284 */ 1285 @Child(name = "unitOfPresentation", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 1286 @Description(shortDefinition="The “real world” units in which the quantity of the manufactured item is described", formalDefinition="The “real world” units in which the quantity of the manufactured item is described." ) 1287 protected CodeableConcept unitOfPresentation; 1288 1289 /** 1290 * The quantity or "count number" of the manufactured item. 1291 */ 1292 @Child(name = "quantity", type = {Quantity.class}, order=3, min=1, max=1, modifier=false, summary=true) 1293 @Description(shortDefinition="The quantity or \"count number\" of the manufactured item", formalDefinition="The quantity or \"count number\" of the manufactured item." ) 1294 protected Quantity quantity; 1295 1296 /** 1297 * Manufacturer of the item (Note that this should be named "manufacturer" but it currently causes technical issues). 1298 */ 1299 @Child(name = "xManufacturer", type = {Organization.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1300 @Description(shortDefinition="Manufacturer of the item (Note that this should be named \"manufacturer\" but it currently causes technical issues)", formalDefinition="Manufacturer of the item (Note that this should be named \"manufacturer\" but it currently causes technical issues)." ) 1301 protected List<Reference> xManufacturer; 1302 /** 1303 * The actual objects that are the target of the reference (Manufacturer of the item (Note that this should be named "manufacturer" but it currently causes technical issues).) 1304 */ 1305 protected List<Organization> xManufacturerTarget; 1306 1307 1308 /** 1309 * Ingredient. 1310 */ 1311 @Child(name = "ingredient", type = {MedicinalProductIngredient.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1312 @Description(shortDefinition="Ingredient", formalDefinition="Ingredient." ) 1313 protected List<Reference> ingredient; 1314 /** 1315 * The actual objects that are the target of the reference (Ingredient.) 1316 */ 1317 protected List<MedicinalProductIngredient> ingredientTarget; 1318 1319 1320 /** 1321 * Dimensions, color etc. 1322 */ 1323 @Child(name = "physicalCharacteristics", type = {ProdCharacteristic.class}, order=6, min=0, max=1, modifier=false, summary=true) 1324 @Description(shortDefinition="Dimensions, color etc.", formalDefinition="Dimensions, color etc." ) 1325 protected ProdCharacteristic physicalCharacteristics; 1326 1327 private static final long serialVersionUID = 54400069L; 1328 1329 /** 1330 * Constructor 1331 */ 1332 public MedicinalProductPackagedPackageItemManufacturedItemComponent() { 1333 super(); 1334 } 1335 1336 /** 1337 * Constructor 1338 */ 1339 public MedicinalProductPackagedPackageItemManufacturedItemComponent(CodeableConcept manufacturedDoseForm, Quantity quantity) { 1340 super(); 1341 this.manufacturedDoseForm = manufacturedDoseForm; 1342 this.quantity = quantity; 1343 } 1344 1345 /** 1346 * @return {@link #manufacturedDoseForm} (Dose form as manufactured and before any transformation into the pharmaceutical product.) 1347 */ 1348 public CodeableConcept getManufacturedDoseForm() { 1349 if (this.manufacturedDoseForm == null) 1350 if (Configuration.errorOnAutoCreate()) 1351 throw new Error("Attempt to auto-create MedicinalProductPackagedPackageItemManufacturedItemComponent.manufacturedDoseForm"); 1352 else if (Configuration.doAutoCreate()) 1353 this.manufacturedDoseForm = new CodeableConcept(); // cc 1354 return this.manufacturedDoseForm; 1355 } 1356 1357 public boolean hasManufacturedDoseForm() { 1358 return this.manufacturedDoseForm != null && !this.manufacturedDoseForm.isEmpty(); 1359 } 1360 1361 /** 1362 * @param value {@link #manufacturedDoseForm} (Dose form as manufactured and before any transformation into the pharmaceutical product.) 1363 */ 1364 public MedicinalProductPackagedPackageItemManufacturedItemComponent setManufacturedDoseForm(CodeableConcept value) { 1365 this.manufacturedDoseForm = value; 1366 return this; 1367 } 1368 1369 /** 1370 * @return {@link #unitOfPresentation} (The “real world” units in which the quantity of the manufactured item is described.) 1371 */ 1372 public CodeableConcept getUnitOfPresentation() { 1373 if (this.unitOfPresentation == null) 1374 if (Configuration.errorOnAutoCreate()) 1375 throw new Error("Attempt to auto-create MedicinalProductPackagedPackageItemManufacturedItemComponent.unitOfPresentation"); 1376 else if (Configuration.doAutoCreate()) 1377 this.unitOfPresentation = new CodeableConcept(); // cc 1378 return this.unitOfPresentation; 1379 } 1380 1381 public boolean hasUnitOfPresentation() { 1382 return this.unitOfPresentation != null && !this.unitOfPresentation.isEmpty(); 1383 } 1384 1385 /** 1386 * @param value {@link #unitOfPresentation} (The “real world” units in which the quantity of the manufactured item is described.) 1387 */ 1388 public MedicinalProductPackagedPackageItemManufacturedItemComponent setUnitOfPresentation(CodeableConcept value) { 1389 this.unitOfPresentation = value; 1390 return this; 1391 } 1392 1393 /** 1394 * @return {@link #quantity} (The quantity or "count number" of the manufactured item.) 1395 */ 1396 public Quantity getQuantity() { 1397 if (this.quantity == null) 1398 if (Configuration.errorOnAutoCreate()) 1399 throw new Error("Attempt to auto-create MedicinalProductPackagedPackageItemManufacturedItemComponent.quantity"); 1400 else if (Configuration.doAutoCreate()) 1401 this.quantity = new Quantity(); // cc 1402 return this.quantity; 1403 } 1404 1405 public boolean hasQuantity() { 1406 return this.quantity != null && !this.quantity.isEmpty(); 1407 } 1408 1409 /** 1410 * @param value {@link #quantity} (The quantity or "count number" of the manufactured item.) 1411 */ 1412 public MedicinalProductPackagedPackageItemManufacturedItemComponent setQuantity(Quantity value) { 1413 this.quantity = value; 1414 return this; 1415 } 1416 1417 /** 1418 * @return {@link #xManufacturer} (Manufacturer of the item (Note that this should be named "manufacturer" but it currently causes technical issues).) 1419 */ 1420 public List<Reference> getXManufacturer() { 1421 if (this.xManufacturer == null) 1422 this.xManufacturer = new ArrayList<Reference>(); 1423 return this.xManufacturer; 1424 } 1425 1426 /** 1427 * @return Returns a reference to <code>this</code> for easy method chaining 1428 */ 1429 public MedicinalProductPackagedPackageItemManufacturedItemComponent setXManufacturer(List<Reference> theXManufacturer) { 1430 this.xManufacturer = theXManufacturer; 1431 return this; 1432 } 1433 1434 public boolean hasXManufacturer() { 1435 if (this.xManufacturer == null) 1436 return false; 1437 for (Reference item : this.xManufacturer) 1438 if (!item.isEmpty()) 1439 return true; 1440 return false; 1441 } 1442 1443 public Reference addXManufacturer() { //3 1444 Reference t = new Reference(); 1445 if (this.xManufacturer == null) 1446 this.xManufacturer = new ArrayList<Reference>(); 1447 this.xManufacturer.add(t); 1448 return t; 1449 } 1450 1451 public MedicinalProductPackagedPackageItemManufacturedItemComponent addXManufacturer(Reference t) { //3 1452 if (t == null) 1453 return this; 1454 if (this.xManufacturer == null) 1455 this.xManufacturer = new ArrayList<Reference>(); 1456 this.xManufacturer.add(t); 1457 return this; 1458 } 1459 1460 /** 1461 * @return The first repetition of repeating field {@link #xManufacturer}, creating it if it does not already exist 1462 */ 1463 public Reference getXManufacturerFirstRep() { 1464 if (getXManufacturer().isEmpty()) { 1465 addXManufacturer(); 1466 } 1467 return getXManufacturer().get(0); 1468 } 1469 1470 /** 1471 * @deprecated Use Reference#setResource(IBaseResource) instead 1472 */ 1473 @Deprecated 1474 public List<Organization> getXManufacturerTarget() { 1475 if (this.xManufacturerTarget == null) 1476 this.xManufacturerTarget = new ArrayList<Organization>(); 1477 return this.xManufacturerTarget; 1478 } 1479 1480 /** 1481 * @deprecated Use Reference#setResource(IBaseResource) instead 1482 */ 1483 @Deprecated 1484 public Organization addXManufacturerTarget() { 1485 Organization r = new Organization(); 1486 if (this.xManufacturerTarget == null) 1487 this.xManufacturerTarget = new ArrayList<Organization>(); 1488 this.xManufacturerTarget.add(r); 1489 return r; 1490 } 1491 1492 /** 1493 * @return {@link #ingredient} (Ingredient.) 1494 */ 1495 public List<Reference> getIngredient() { 1496 if (this.ingredient == null) 1497 this.ingredient = new ArrayList<Reference>(); 1498 return this.ingredient; 1499 } 1500 1501 /** 1502 * @return Returns a reference to <code>this</code> for easy method chaining 1503 */ 1504 public MedicinalProductPackagedPackageItemManufacturedItemComponent setIngredient(List<Reference> theIngredient) { 1505 this.ingredient = theIngredient; 1506 return this; 1507 } 1508 1509 public boolean hasIngredient() { 1510 if (this.ingredient == null) 1511 return false; 1512 for (Reference item : this.ingredient) 1513 if (!item.isEmpty()) 1514 return true; 1515 return false; 1516 } 1517 1518 public Reference addIngredient() { //3 1519 Reference t = new Reference(); 1520 if (this.ingredient == null) 1521 this.ingredient = new ArrayList<Reference>(); 1522 this.ingredient.add(t); 1523 return t; 1524 } 1525 1526 public MedicinalProductPackagedPackageItemManufacturedItemComponent addIngredient(Reference t) { //3 1527 if (t == null) 1528 return this; 1529 if (this.ingredient == null) 1530 this.ingredient = new ArrayList<Reference>(); 1531 this.ingredient.add(t); 1532 return this; 1533 } 1534 1535 /** 1536 * @return The first repetition of repeating field {@link #ingredient}, creating it if it does not already exist 1537 */ 1538 public Reference getIngredientFirstRep() { 1539 if (getIngredient().isEmpty()) { 1540 addIngredient(); 1541 } 1542 return getIngredient().get(0); 1543 } 1544 1545 /** 1546 * @deprecated Use Reference#setResource(IBaseResource) instead 1547 */ 1548 @Deprecated 1549 public List<MedicinalProductIngredient> getIngredientTarget() { 1550 if (this.ingredientTarget == null) 1551 this.ingredientTarget = new ArrayList<MedicinalProductIngredient>(); 1552 return this.ingredientTarget; 1553 } 1554 1555 /** 1556 * @deprecated Use Reference#setResource(IBaseResource) instead 1557 */ 1558 @Deprecated 1559 public MedicinalProductIngredient addIngredientTarget() { 1560 MedicinalProductIngredient r = new MedicinalProductIngredient(); 1561 if (this.ingredientTarget == null) 1562 this.ingredientTarget = new ArrayList<MedicinalProductIngredient>(); 1563 this.ingredientTarget.add(r); 1564 return r; 1565 } 1566 1567 /** 1568 * @return {@link #physicalCharacteristics} (Dimensions, color etc.) 1569 */ 1570 public ProdCharacteristic getPhysicalCharacteristics() { 1571 if (this.physicalCharacteristics == null) 1572 if (Configuration.errorOnAutoCreate()) 1573 throw new Error("Attempt to auto-create MedicinalProductPackagedPackageItemManufacturedItemComponent.physicalCharacteristics"); 1574 else if (Configuration.doAutoCreate()) 1575 this.physicalCharacteristics = new ProdCharacteristic(); // cc 1576 return this.physicalCharacteristics; 1577 } 1578 1579 public boolean hasPhysicalCharacteristics() { 1580 return this.physicalCharacteristics != null && !this.physicalCharacteristics.isEmpty(); 1581 } 1582 1583 /** 1584 * @param value {@link #physicalCharacteristics} (Dimensions, color etc.) 1585 */ 1586 public MedicinalProductPackagedPackageItemManufacturedItemComponent setPhysicalCharacteristics(ProdCharacteristic value) { 1587 this.physicalCharacteristics = value; 1588 return this; 1589 } 1590 1591 protected void listChildren(List<Property> children) { 1592 super.listChildren(children); 1593 children.add(new Property("manufacturedDoseForm", "CodeableConcept", "Dose form as manufactured and before any transformation into the pharmaceutical product.", 0, 1, manufacturedDoseForm)); 1594 children.add(new Property("unitOfPresentation", "CodeableConcept", "The “real world” units in which the quantity of the manufactured item is described.", 0, 1, unitOfPresentation)); 1595 children.add(new Property("quantity", "Quantity", "The quantity or \"count number\" of the manufactured item.", 0, 1, quantity)); 1596 children.add(new Property("xManufacturer", "Reference(Organization)", "Manufacturer of the item (Note that this should be named \"manufacturer\" but it currently causes technical issues).", 0, java.lang.Integer.MAX_VALUE, xManufacturer)); 1597 children.add(new Property("ingredient", "Reference(MedicinalProductIngredient)", "Ingredient.", 0, java.lang.Integer.MAX_VALUE, ingredient)); 1598 children.add(new Property("physicalCharacteristics", "ProdCharacteristic", "Dimensions, color etc.", 0, 1, physicalCharacteristics)); 1599 } 1600 1601 @Override 1602 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1603 switch (_hash) { 1604 case -1451400348: /*manufacturedDoseForm*/ return new Property("manufacturedDoseForm", "CodeableConcept", "Dose form as manufactured and before any transformation into the pharmaceutical product.", 0, 1, manufacturedDoseForm); 1605 case -1427765963: /*unitOfPresentation*/ return new Property("unitOfPresentation", "CodeableConcept", "The “real world” units in which the quantity of the manufactured item is described.", 0, 1, unitOfPresentation); 1606 case -1285004149: /*quantity*/ return new Property("quantity", "Quantity", "The quantity or \"count number\" of the manufactured item.", 0, 1, quantity); 1607 case 1641317481: /*xManufacturer*/ return new Property("xManufacturer", "Reference(Organization)", "Manufacturer of the item (Note that this should be named \"manufacturer\" but it currently causes technical issues).", 0, java.lang.Integer.MAX_VALUE, xManufacturer); 1608 case -206409263: /*ingredient*/ return new Property("ingredient", "Reference(MedicinalProductIngredient)", "Ingredient.", 0, java.lang.Integer.MAX_VALUE, ingredient); 1609 case -1599676319: /*physicalCharacteristics*/ return new Property("physicalCharacteristics", "ProdCharacteristic", "Dimensions, color etc.", 0, 1, physicalCharacteristics); 1610 default: return super.getNamedProperty(_hash, _name, _checkValid); 1611 } 1612 1613 } 1614 1615 @Override 1616 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1617 switch (hash) { 1618 case -1451400348: /*manufacturedDoseForm*/ return this.manufacturedDoseForm == null ? new Base[0] : new Base[] {this.manufacturedDoseForm}; // CodeableConcept 1619 case -1427765963: /*unitOfPresentation*/ return this.unitOfPresentation == null ? new Base[0] : new Base[] {this.unitOfPresentation}; // CodeableConcept 1620 case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity 1621 case 1641317481: /*xManufacturer*/ return this.xManufacturer == null ? new Base[0] : this.xManufacturer.toArray(new Base[this.xManufacturer.size()]); // Reference 1622 case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // Reference 1623 case -1599676319: /*physicalCharacteristics*/ return this.physicalCharacteristics == null ? new Base[0] : new Base[] {this.physicalCharacteristics}; // ProdCharacteristic 1624 default: return super.getProperty(hash, name, checkValid); 1625 } 1626 1627 } 1628 1629 @Override 1630 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1631 switch (hash) { 1632 case -1451400348: // manufacturedDoseForm 1633 this.manufacturedDoseForm = castToCodeableConcept(value); // CodeableConcept 1634 return value; 1635 case -1427765963: // unitOfPresentation 1636 this.unitOfPresentation = castToCodeableConcept(value); // CodeableConcept 1637 return value; 1638 case -1285004149: // quantity 1639 this.quantity = castToQuantity(value); // Quantity 1640 return value; 1641 case 1641317481: // xManufacturer 1642 this.getXManufacturer().add(castToReference(value)); // Reference 1643 return value; 1644 case -206409263: // ingredient 1645 this.getIngredient().add(castToReference(value)); // Reference 1646 return value; 1647 case -1599676319: // physicalCharacteristics 1648 this.physicalCharacteristics = castToProdCharacteristic(value); // ProdCharacteristic 1649 return value; 1650 default: return super.setProperty(hash, name, value); 1651 } 1652 1653 } 1654 1655 @Override 1656 public Base setProperty(String name, Base value) throws FHIRException { 1657 if (name.equals("manufacturedDoseForm")) { 1658 this.manufacturedDoseForm = castToCodeableConcept(value); // CodeableConcept 1659 } else if (name.equals("unitOfPresentation")) { 1660 this.unitOfPresentation = castToCodeableConcept(value); // CodeableConcept 1661 } else if (name.equals("quantity")) { 1662 this.quantity = castToQuantity(value); // Quantity 1663 } else if (name.equals("xManufacturer")) { 1664 this.getXManufacturer().add(castToReference(value)); 1665 } else if (name.equals("ingredient")) { 1666 this.getIngredient().add(castToReference(value)); 1667 } else if (name.equals("physicalCharacteristics")) { 1668 this.physicalCharacteristics = castToProdCharacteristic(value); // ProdCharacteristic 1669 } else 1670 return super.setProperty(name, value); 1671 return value; 1672 } 1673 1674 @Override 1675 public Base makeProperty(int hash, String name) throws FHIRException { 1676 switch (hash) { 1677 case -1451400348: return getManufacturedDoseForm(); 1678 case -1427765963: return getUnitOfPresentation(); 1679 case -1285004149: return getQuantity(); 1680 case 1641317481: return addXManufacturer(); 1681 case -206409263: return addIngredient(); 1682 case -1599676319: return getPhysicalCharacteristics(); 1683 default: return super.makeProperty(hash, name); 1684 } 1685 1686 } 1687 1688 @Override 1689 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1690 switch (hash) { 1691 case -1451400348: /*manufacturedDoseForm*/ return new String[] {"CodeableConcept"}; 1692 case -1427765963: /*unitOfPresentation*/ return new String[] {"CodeableConcept"}; 1693 case -1285004149: /*quantity*/ return new String[] {"Quantity"}; 1694 case 1641317481: /*xManufacturer*/ return new String[] {"Reference"}; 1695 case -206409263: /*ingredient*/ return new String[] {"Reference"}; 1696 case -1599676319: /*physicalCharacteristics*/ return new String[] {"ProdCharacteristic"}; 1697 default: return super.getTypesForProperty(hash, name); 1698 } 1699 1700 } 1701 1702 @Override 1703 public Base addChild(String name) throws FHIRException { 1704 if (name.equals("manufacturedDoseForm")) { 1705 this.manufacturedDoseForm = new CodeableConcept(); 1706 return this.manufacturedDoseForm; 1707 } 1708 else if (name.equals("unitOfPresentation")) { 1709 this.unitOfPresentation = new CodeableConcept(); 1710 return this.unitOfPresentation; 1711 } 1712 else if (name.equals("quantity")) { 1713 this.quantity = new Quantity(); 1714 return this.quantity; 1715 } 1716 else if (name.equals("xManufacturer")) { 1717 return addXManufacturer(); 1718 } 1719 else if (name.equals("ingredient")) { 1720 return addIngredient(); 1721 } 1722 else if (name.equals("physicalCharacteristics")) { 1723 this.physicalCharacteristics = new ProdCharacteristic(); 1724 return this.physicalCharacteristics; 1725 } 1726 else 1727 return super.addChild(name); 1728 } 1729 1730 public MedicinalProductPackagedPackageItemManufacturedItemComponent copy() { 1731 MedicinalProductPackagedPackageItemManufacturedItemComponent dst = new MedicinalProductPackagedPackageItemManufacturedItemComponent(); 1732 copyValues(dst); 1733 dst.manufacturedDoseForm = manufacturedDoseForm == null ? null : manufacturedDoseForm.copy(); 1734 dst.unitOfPresentation = unitOfPresentation == null ? null : unitOfPresentation.copy(); 1735 dst.quantity = quantity == null ? null : quantity.copy(); 1736 if (xManufacturer != null) { 1737 dst.xManufacturer = new ArrayList<Reference>(); 1738 for (Reference i : xManufacturer) 1739 dst.xManufacturer.add(i.copy()); 1740 }; 1741 if (ingredient != null) { 1742 dst.ingredient = new ArrayList<Reference>(); 1743 for (Reference i : ingredient) 1744 dst.ingredient.add(i.copy()); 1745 }; 1746 dst.physicalCharacteristics = physicalCharacteristics == null ? null : physicalCharacteristics.copy(); 1747 return dst; 1748 } 1749 1750 @Override 1751 public boolean equalsDeep(Base other_) { 1752 if (!super.equalsDeep(other_)) 1753 return false; 1754 if (!(other_ instanceof MedicinalProductPackagedPackageItemManufacturedItemComponent)) 1755 return false; 1756 MedicinalProductPackagedPackageItemManufacturedItemComponent o = (MedicinalProductPackagedPackageItemManufacturedItemComponent) other_; 1757 return compareDeep(manufacturedDoseForm, o.manufacturedDoseForm, true) && compareDeep(unitOfPresentation, o.unitOfPresentation, true) 1758 && compareDeep(quantity, o.quantity, true) && compareDeep(xManufacturer, o.xManufacturer, true) 1759 && compareDeep(ingredient, o.ingredient, true) && compareDeep(physicalCharacteristics, o.physicalCharacteristics, true) 1760 ; 1761 } 1762 1763 @Override 1764 public boolean equalsShallow(Base other_) { 1765 if (!super.equalsShallow(other_)) 1766 return false; 1767 if (!(other_ instanceof MedicinalProductPackagedPackageItemManufacturedItemComponent)) 1768 return false; 1769 MedicinalProductPackagedPackageItemManufacturedItemComponent o = (MedicinalProductPackagedPackageItemManufacturedItemComponent) other_; 1770 return true; 1771 } 1772 1773 public boolean isEmpty() { 1774 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(manufacturedDoseForm, unitOfPresentation 1775 , quantity, xManufacturer, ingredient, physicalCharacteristics); 1776 } 1777 1778 public String fhirType() { 1779 return "MedicinalProductPackaged.packageItem.manufacturedItem"; 1780 1781 } 1782 1783 } 1784 1785 /** 1786 * Unique identifier. 1787 */ 1788 @Child(name = "identifier", type = {Identifier.class}, order=0, min=1, max=1, modifier=false, summary=true) 1789 @Description(shortDefinition="Unique identifier", formalDefinition="Unique identifier." ) 1790 protected Identifier identifier; 1791 1792 /** 1793 * Textual description. 1794 */ 1795 @Child(name = "description", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) 1796 @Description(shortDefinition="Textual description", formalDefinition="Textual description." ) 1797 protected StringType description; 1798 1799 /** 1800 * Marketing information. 1801 */ 1802 @Child(name = "marketingStatus", type = {MarketingStatus.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1803 @Description(shortDefinition="Marketing information", formalDefinition="Marketing information." ) 1804 protected List<MarketingStatus> marketingStatus; 1805 1806 /** 1807 * Batch numbering. 1808 */ 1809 @Child(name = "batchIdentifier", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1810 @Description(shortDefinition="Batch numbering", formalDefinition="Batch numbering." ) 1811 protected List<MedicinalProductPackagedBatchIdentifierComponent> batchIdentifier; 1812 1813 /** 1814 * A packaging item, as a contained for medicine, possibly with other packaging items within. 1815 */ 1816 @Child(name = "packageItem", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1817 @Description(shortDefinition="A packaging item, as a contained for medicine, possibly with other packaging items within", formalDefinition="A packaging item, as a contained for medicine, possibly with other packaging items within." ) 1818 protected List<MedicinalProductPackagedPackageItemComponent> packageItem; 1819 1820 private static final long serialVersionUID = -934778857L; 1821 1822 /** 1823 * Constructor 1824 */ 1825 public MedicinalProductPackaged() { 1826 super(); 1827 } 1828 1829 /** 1830 * Constructor 1831 */ 1832 public MedicinalProductPackaged(Identifier identifier) { 1833 super(); 1834 this.identifier = identifier; 1835 } 1836 1837 /** 1838 * @return {@link #identifier} (Unique identifier.) 1839 */ 1840 public Identifier getIdentifier() { 1841 if (this.identifier == null) 1842 if (Configuration.errorOnAutoCreate()) 1843 throw new Error("Attempt to auto-create MedicinalProductPackaged.identifier"); 1844 else if (Configuration.doAutoCreate()) 1845 this.identifier = new Identifier(); // cc 1846 return this.identifier; 1847 } 1848 1849 public boolean hasIdentifier() { 1850 return this.identifier != null && !this.identifier.isEmpty(); 1851 } 1852 1853 /** 1854 * @param value {@link #identifier} (Unique identifier.) 1855 */ 1856 public MedicinalProductPackaged setIdentifier(Identifier value) { 1857 this.identifier = value; 1858 return this; 1859 } 1860 1861 /** 1862 * @return {@link #description} (Textual description.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 1863 */ 1864 public StringType getDescriptionElement() { 1865 if (this.description == null) 1866 if (Configuration.errorOnAutoCreate()) 1867 throw new Error("Attempt to auto-create MedicinalProductPackaged.description"); 1868 else if (Configuration.doAutoCreate()) 1869 this.description = new StringType(); // bb 1870 return this.description; 1871 } 1872 1873 public boolean hasDescriptionElement() { 1874 return this.description != null && !this.description.isEmpty(); 1875 } 1876 1877 public boolean hasDescription() { 1878 return this.description != null && !this.description.isEmpty(); 1879 } 1880 1881 /** 1882 * @param value {@link #description} (Textual description.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 1883 */ 1884 public MedicinalProductPackaged setDescriptionElement(StringType value) { 1885 this.description = value; 1886 return this; 1887 } 1888 1889 /** 1890 * @return Textual description. 1891 */ 1892 public String getDescription() { 1893 return this.description == null ? null : this.description.getValue(); 1894 } 1895 1896 /** 1897 * @param value Textual description. 1898 */ 1899 public MedicinalProductPackaged setDescription(String value) { 1900 if (Utilities.noString(value)) 1901 this.description = null; 1902 else { 1903 if (this.description == null) 1904 this.description = new StringType(); 1905 this.description.setValue(value); 1906 } 1907 return this; 1908 } 1909 1910 /** 1911 * @return {@link #marketingStatus} (Marketing information.) 1912 */ 1913 public List<MarketingStatus> getMarketingStatus() { 1914 if (this.marketingStatus == null) 1915 this.marketingStatus = new ArrayList<MarketingStatus>(); 1916 return this.marketingStatus; 1917 } 1918 1919 /** 1920 * @return Returns a reference to <code>this</code> for easy method chaining 1921 */ 1922 public MedicinalProductPackaged setMarketingStatus(List<MarketingStatus> theMarketingStatus) { 1923 this.marketingStatus = theMarketingStatus; 1924 return this; 1925 } 1926 1927 public boolean hasMarketingStatus() { 1928 if (this.marketingStatus == null) 1929 return false; 1930 for (MarketingStatus item : this.marketingStatus) 1931 if (!item.isEmpty()) 1932 return true; 1933 return false; 1934 } 1935 1936 public MarketingStatus addMarketingStatus() { //3 1937 MarketingStatus t = new MarketingStatus(); 1938 if (this.marketingStatus == null) 1939 this.marketingStatus = new ArrayList<MarketingStatus>(); 1940 this.marketingStatus.add(t); 1941 return t; 1942 } 1943 1944 public MedicinalProductPackaged addMarketingStatus(MarketingStatus t) { //3 1945 if (t == null) 1946 return this; 1947 if (this.marketingStatus == null) 1948 this.marketingStatus = new ArrayList<MarketingStatus>(); 1949 this.marketingStatus.add(t); 1950 return this; 1951 } 1952 1953 /** 1954 * @return The first repetition of repeating field {@link #marketingStatus}, creating it if it does not already exist 1955 */ 1956 public MarketingStatus getMarketingStatusFirstRep() { 1957 if (getMarketingStatus().isEmpty()) { 1958 addMarketingStatus(); 1959 } 1960 return getMarketingStatus().get(0); 1961 } 1962 1963 /** 1964 * @return {@link #batchIdentifier} (Batch numbering.) 1965 */ 1966 public List<MedicinalProductPackagedBatchIdentifierComponent> getBatchIdentifier() { 1967 if (this.batchIdentifier == null) 1968 this.batchIdentifier = new ArrayList<MedicinalProductPackagedBatchIdentifierComponent>(); 1969 return this.batchIdentifier; 1970 } 1971 1972 /** 1973 * @return Returns a reference to <code>this</code> for easy method chaining 1974 */ 1975 public MedicinalProductPackaged setBatchIdentifier(List<MedicinalProductPackagedBatchIdentifierComponent> theBatchIdentifier) { 1976 this.batchIdentifier = theBatchIdentifier; 1977 return this; 1978 } 1979 1980 public boolean hasBatchIdentifier() { 1981 if (this.batchIdentifier == null) 1982 return false; 1983 for (MedicinalProductPackagedBatchIdentifierComponent item : this.batchIdentifier) 1984 if (!item.isEmpty()) 1985 return true; 1986 return false; 1987 } 1988 1989 public MedicinalProductPackagedBatchIdentifierComponent addBatchIdentifier() { //3 1990 MedicinalProductPackagedBatchIdentifierComponent t = new MedicinalProductPackagedBatchIdentifierComponent(); 1991 if (this.batchIdentifier == null) 1992 this.batchIdentifier = new ArrayList<MedicinalProductPackagedBatchIdentifierComponent>(); 1993 this.batchIdentifier.add(t); 1994 return t; 1995 } 1996 1997 public MedicinalProductPackaged addBatchIdentifier(MedicinalProductPackagedBatchIdentifierComponent t) { //3 1998 if (t == null) 1999 return this; 2000 if (this.batchIdentifier == null) 2001 this.batchIdentifier = new ArrayList<MedicinalProductPackagedBatchIdentifierComponent>(); 2002 this.batchIdentifier.add(t); 2003 return this; 2004 } 2005 2006 /** 2007 * @return The first repetition of repeating field {@link #batchIdentifier}, creating it if it does not already exist 2008 */ 2009 public MedicinalProductPackagedBatchIdentifierComponent getBatchIdentifierFirstRep() { 2010 if (getBatchIdentifier().isEmpty()) { 2011 addBatchIdentifier(); 2012 } 2013 return getBatchIdentifier().get(0); 2014 } 2015 2016 /** 2017 * @return {@link #packageItem} (A packaging item, as a contained for medicine, possibly with other packaging items within.) 2018 */ 2019 public List<MedicinalProductPackagedPackageItemComponent> getPackageItem() { 2020 if (this.packageItem == null) 2021 this.packageItem = new ArrayList<MedicinalProductPackagedPackageItemComponent>(); 2022 return this.packageItem; 2023 } 2024 2025 /** 2026 * @return Returns a reference to <code>this</code> for easy method chaining 2027 */ 2028 public MedicinalProductPackaged setPackageItem(List<MedicinalProductPackagedPackageItemComponent> thePackageItem) { 2029 this.packageItem = thePackageItem; 2030 return this; 2031 } 2032 2033 public boolean hasPackageItem() { 2034 if (this.packageItem == null) 2035 return false; 2036 for (MedicinalProductPackagedPackageItemComponent item : this.packageItem) 2037 if (!item.isEmpty()) 2038 return true; 2039 return false; 2040 } 2041 2042 public MedicinalProductPackagedPackageItemComponent addPackageItem() { //3 2043 MedicinalProductPackagedPackageItemComponent t = new MedicinalProductPackagedPackageItemComponent(); 2044 if (this.packageItem == null) 2045 this.packageItem = new ArrayList<MedicinalProductPackagedPackageItemComponent>(); 2046 this.packageItem.add(t); 2047 return t; 2048 } 2049 2050 public MedicinalProductPackaged addPackageItem(MedicinalProductPackagedPackageItemComponent t) { //3 2051 if (t == null) 2052 return this; 2053 if (this.packageItem == null) 2054 this.packageItem = new ArrayList<MedicinalProductPackagedPackageItemComponent>(); 2055 this.packageItem.add(t); 2056 return this; 2057 } 2058 2059 /** 2060 * @return The first repetition of repeating field {@link #packageItem}, creating it if it does not already exist 2061 */ 2062 public MedicinalProductPackagedPackageItemComponent getPackageItemFirstRep() { 2063 if (getPackageItem().isEmpty()) { 2064 addPackageItem(); 2065 } 2066 return getPackageItem().get(0); 2067 } 2068 2069 protected void listChildren(List<Property> children) { 2070 super.listChildren(children); 2071 children.add(new Property("identifier", "Identifier", "Unique identifier.", 0, 1, identifier)); 2072 children.add(new Property("description", "string", "Textual description.", 0, 1, description)); 2073 children.add(new Property("marketingStatus", "MarketingStatus", "Marketing information.", 0, java.lang.Integer.MAX_VALUE, marketingStatus)); 2074 children.add(new Property("batchIdentifier", "", "Batch numbering.", 0, java.lang.Integer.MAX_VALUE, batchIdentifier)); 2075 children.add(new Property("packageItem", "", "A packaging item, as a contained for medicine, possibly with other packaging items within.", 0, java.lang.Integer.MAX_VALUE, packageItem)); 2076 } 2077 2078 @Override 2079 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 2080 switch (_hash) { 2081 case -1618432855: /*identifier*/ return new Property("identifier", "Identifier", "Unique identifier.", 0, 1, identifier); 2082 case -1724546052: /*description*/ return new Property("description", "string", "Textual description.", 0, 1, description); 2083 case 70767032: /*marketingStatus*/ return new Property("marketingStatus", "MarketingStatus", "Marketing information.", 0, java.lang.Integer.MAX_VALUE, marketingStatus); 2084 case -1688395901: /*batchIdentifier*/ return new Property("batchIdentifier", "", "Batch numbering.", 0, java.lang.Integer.MAX_VALUE, batchIdentifier); 2085 case 908628089: /*packageItem*/ return new Property("packageItem", "", "A packaging item, as a contained for medicine, possibly with other packaging items within.", 0, java.lang.Integer.MAX_VALUE, packageItem); 2086 default: return super.getNamedProperty(_hash, _name, _checkValid); 2087 } 2088 2089 } 2090 2091 @Override 2092 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 2093 switch (hash) { 2094 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier 2095 case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType 2096 case 70767032: /*marketingStatus*/ return this.marketingStatus == null ? new Base[0] : this.marketingStatus.toArray(new Base[this.marketingStatus.size()]); // MarketingStatus 2097 case -1688395901: /*batchIdentifier*/ return this.batchIdentifier == null ? new Base[0] : this.batchIdentifier.toArray(new Base[this.batchIdentifier.size()]); // MedicinalProductPackagedBatchIdentifierComponent 2098 case 908628089: /*packageItem*/ return this.packageItem == null ? new Base[0] : this.packageItem.toArray(new Base[this.packageItem.size()]); // MedicinalProductPackagedPackageItemComponent 2099 default: return super.getProperty(hash, name, checkValid); 2100 } 2101 2102 } 2103 2104 @Override 2105 public Base setProperty(int hash, String name, Base value) throws FHIRException { 2106 switch (hash) { 2107 case -1618432855: // identifier 2108 this.identifier = castToIdentifier(value); // Identifier 2109 return value; 2110 case -1724546052: // description 2111 this.description = castToString(value); // StringType 2112 return value; 2113 case 70767032: // marketingStatus 2114 this.getMarketingStatus().add(castToMarketingStatus(value)); // MarketingStatus 2115 return value; 2116 case -1688395901: // batchIdentifier 2117 this.getBatchIdentifier().add((MedicinalProductPackagedBatchIdentifierComponent) value); // MedicinalProductPackagedBatchIdentifierComponent 2118 return value; 2119 case 908628089: // packageItem 2120 this.getPackageItem().add((MedicinalProductPackagedPackageItemComponent) value); // MedicinalProductPackagedPackageItemComponent 2121 return value; 2122 default: return super.setProperty(hash, name, value); 2123 } 2124 2125 } 2126 2127 @Override 2128 public Base setProperty(String name, Base value) throws FHIRException { 2129 if (name.equals("identifier")) { 2130 this.identifier = castToIdentifier(value); // Identifier 2131 } else if (name.equals("description")) { 2132 this.description = castToString(value); // StringType 2133 } else if (name.equals("marketingStatus")) { 2134 this.getMarketingStatus().add(castToMarketingStatus(value)); 2135 } else if (name.equals("batchIdentifier")) { 2136 this.getBatchIdentifier().add((MedicinalProductPackagedBatchIdentifierComponent) value); 2137 } else if (name.equals("packageItem")) { 2138 this.getPackageItem().add((MedicinalProductPackagedPackageItemComponent) value); 2139 } else 2140 return super.setProperty(name, value); 2141 return value; 2142 } 2143 2144 @Override 2145 public Base makeProperty(int hash, String name) throws FHIRException { 2146 switch (hash) { 2147 case -1618432855: return getIdentifier(); 2148 case -1724546052: return getDescriptionElement(); 2149 case 70767032: return addMarketingStatus(); 2150 case -1688395901: return addBatchIdentifier(); 2151 case 908628089: return addPackageItem(); 2152 default: return super.makeProperty(hash, name); 2153 } 2154 2155 } 2156 2157 @Override 2158 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 2159 switch (hash) { 2160 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 2161 case -1724546052: /*description*/ return new String[] {"string"}; 2162 case 70767032: /*marketingStatus*/ return new String[] {"MarketingStatus"}; 2163 case -1688395901: /*batchIdentifier*/ return new String[] {}; 2164 case 908628089: /*packageItem*/ return new String[] {}; 2165 default: return super.getTypesForProperty(hash, name); 2166 } 2167 2168 } 2169 2170 @Override 2171 public Base addChild(String name) throws FHIRException { 2172 if (name.equals("identifier")) { 2173 this.identifier = new Identifier(); 2174 return this.identifier; 2175 } 2176 else if (name.equals("description")) { 2177 throw new FHIRException("Cannot call addChild on a primitive type MedicinalProductPackaged.description"); 2178 } 2179 else if (name.equals("marketingStatus")) { 2180 return addMarketingStatus(); 2181 } 2182 else if (name.equals("batchIdentifier")) { 2183 return addBatchIdentifier(); 2184 } 2185 else if (name.equals("packageItem")) { 2186 return addPackageItem(); 2187 } 2188 else 2189 return super.addChild(name); 2190 } 2191 2192 public String fhirType() { 2193 return "MedicinalProductPackaged"; 2194 2195 } 2196 2197 public MedicinalProductPackaged copy() { 2198 MedicinalProductPackaged dst = new MedicinalProductPackaged(); 2199 copyValues(dst); 2200 dst.identifier = identifier == null ? null : identifier.copy(); 2201 dst.description = description == null ? null : description.copy(); 2202 if (marketingStatus != null) { 2203 dst.marketingStatus = new ArrayList<MarketingStatus>(); 2204 for (MarketingStatus i : marketingStatus) 2205 dst.marketingStatus.add(i.copy()); 2206 }; 2207 if (batchIdentifier != null) { 2208 dst.batchIdentifier = new ArrayList<MedicinalProductPackagedBatchIdentifierComponent>(); 2209 for (MedicinalProductPackagedBatchIdentifierComponent i : batchIdentifier) 2210 dst.batchIdentifier.add(i.copy()); 2211 }; 2212 if (packageItem != null) { 2213 dst.packageItem = new ArrayList<MedicinalProductPackagedPackageItemComponent>(); 2214 for (MedicinalProductPackagedPackageItemComponent i : packageItem) 2215 dst.packageItem.add(i.copy()); 2216 }; 2217 return dst; 2218 } 2219 2220 protected MedicinalProductPackaged typedCopy() { 2221 return copy(); 2222 } 2223 2224 @Override 2225 public boolean equalsDeep(Base other_) { 2226 if (!super.equalsDeep(other_)) 2227 return false; 2228 if (!(other_ instanceof MedicinalProductPackaged)) 2229 return false; 2230 MedicinalProductPackaged o = (MedicinalProductPackaged) other_; 2231 return compareDeep(identifier, o.identifier, true) && compareDeep(description, o.description, true) 2232 && compareDeep(marketingStatus, o.marketingStatus, true) && compareDeep(batchIdentifier, o.batchIdentifier, true) 2233 && compareDeep(packageItem, o.packageItem, true); 2234 } 2235 2236 @Override 2237 public boolean equalsShallow(Base other_) { 2238 if (!super.equalsShallow(other_)) 2239 return false; 2240 if (!(other_ instanceof MedicinalProductPackaged)) 2241 return false; 2242 MedicinalProductPackaged o = (MedicinalProductPackaged) other_; 2243 return compareValues(description, o.description, true); 2244 } 2245 2246 public boolean isEmpty() { 2247 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, description, marketingStatus 2248 , batchIdentifier, packageItem); 2249 } 2250 2251 @Override 2252 public ResourceType getResourceType() { 2253 return ResourceType.MedicinalProductPackaged; 2254 } 2255 2256 2257} 2258