001package org.hl7.fhir.r4.model; 002 003/*- 004 * #%L 005 * org.hl7.fhir.r4 006 * %% 007 * Copyright (C) 2014 - 2019 Health Level 7 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023/* 024 Copyright (c) 2011+, HL7, Inc. 025 All rights reserved. 026 027 Redistribution and use in source and binary forms, with or without modification, 028 are permitted provided that the following conditions are met: 029 030 * Redistributions of source code must retain the above copyright notice, this 031 list of conditions and the following disclaimer. 032 * Redistributions in binary form must reproduce the above copyright notice, 033 this list of conditions and the following disclaimer in the documentation 034 and/or other materials provided with the distribution. 035 * Neither the name of HL7 nor the names of its contributors may be used to 036 endorse or promote products derived from this software without specific 037 prior written permission. 038 039 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 040 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 041 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 042 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 043 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 044 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 045 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 046 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 047 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 048 POSSIBILITY OF SUCH DAMAGE. 049 050*/ 051 052// Generated on Thu, Dec 13, 2018 14:07+1100 for FHIR v4.0.0 053import java.util.ArrayList; 054import java.util.List; 055 056import org.hl7.fhir.exceptions.FHIRException; 057 058import ca.uhn.fhir.model.api.annotation.Child; 059import ca.uhn.fhir.model.api.annotation.Description; 060import ca.uhn.fhir.model.api.annotation.ResourceDef; 061/** 062 * The manufactured item as contained in the packaged medicinal product. 063 */ 064@ResourceDef(name="MedicinalProductManufactured", profile="http://hl7.org/fhir/StructureDefinition/MedicinalProductManufactured") 065public class MedicinalProductManufactured extends DomainResource { 066 067 /** 068 * Dose form as manufactured and before any transformation into the pharmaceutical product. 069 */ 070 @Child(name = "manufacturedDoseForm", type = {CodeableConcept.class}, order=0, min=1, max=1, modifier=false, summary=true) 071 @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." ) 072 protected CodeableConcept manufacturedDoseForm; 073 074 /** 075 * The “real world” units in which the quantity of the manufactured item is described. 076 */ 077 @Child(name = "unitOfPresentation", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 078 @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." ) 079 protected CodeableConcept unitOfPresentation; 080 081 /** 082 * The quantity or "count number" of the manufactured item. 083 */ 084 @Child(name = "quantity", type = {Quantity.class}, order=2, min=1, max=1, modifier=false, summary=true) 085 @Description(shortDefinition="The quantity or \"count number\" of the manufactured item", formalDefinition="The quantity or \"count number\" of the manufactured item." ) 086 protected Quantity quantity; 087 088 /** 089 * Manufacturer of the item (Note that this should be named "manufacturer" but it currently causes technical issues). 090 */ 091 @Child(name = "manufacturer", type = {Organization.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 092 @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)." ) 093 protected List<Reference> manufacturer; 094 /** 095 * 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).) 096 */ 097 protected List<Organization> manufacturerTarget; 098 099 100 /** 101 * Ingredient. 102 */ 103 @Child(name = "ingredient", type = {MedicinalProductIngredient.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 104 @Description(shortDefinition="Ingredient", formalDefinition="Ingredient." ) 105 protected List<Reference> ingredient; 106 /** 107 * The actual objects that are the target of the reference (Ingredient.) 108 */ 109 protected List<MedicinalProductIngredient> ingredientTarget; 110 111 112 /** 113 * Dimensions, color etc. 114 */ 115 @Child(name = "physicalCharacteristics", type = {ProdCharacteristic.class}, order=5, min=0, max=1, modifier=false, summary=true) 116 @Description(shortDefinition="Dimensions, color etc.", formalDefinition="Dimensions, color etc." ) 117 protected ProdCharacteristic physicalCharacteristics; 118 119 /** 120 * Other codeable characteristics. 121 */ 122 @Child(name = "otherCharacteristics", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 123 @Description(shortDefinition="Other codeable characteristics", formalDefinition="Other codeable characteristics." ) 124 protected List<CodeableConcept> otherCharacteristics; 125 126 private static final long serialVersionUID = 623073384L; 127 128 /** 129 * Constructor 130 */ 131 public MedicinalProductManufactured() { 132 super(); 133 } 134 135 /** 136 * Constructor 137 */ 138 public MedicinalProductManufactured(CodeableConcept manufacturedDoseForm, Quantity quantity) { 139 super(); 140 this.manufacturedDoseForm = manufacturedDoseForm; 141 this.quantity = quantity; 142 } 143 144 /** 145 * @return {@link #manufacturedDoseForm} (Dose form as manufactured and before any transformation into the pharmaceutical product.) 146 */ 147 public CodeableConcept getManufacturedDoseForm() { 148 if (this.manufacturedDoseForm == null) 149 if (Configuration.errorOnAutoCreate()) 150 throw new Error("Attempt to auto-create MedicinalProductManufactured.manufacturedDoseForm"); 151 else if (Configuration.doAutoCreate()) 152 this.manufacturedDoseForm = new CodeableConcept(); // cc 153 return this.manufacturedDoseForm; 154 } 155 156 public boolean hasManufacturedDoseForm() { 157 return this.manufacturedDoseForm != null && !this.manufacturedDoseForm.isEmpty(); 158 } 159 160 /** 161 * @param value {@link #manufacturedDoseForm} (Dose form as manufactured and before any transformation into the pharmaceutical product.) 162 */ 163 public MedicinalProductManufactured setManufacturedDoseForm(CodeableConcept value) { 164 this.manufacturedDoseForm = value; 165 return this; 166 } 167 168 /** 169 * @return {@link #unitOfPresentation} (The “real world” units in which the quantity of the manufactured item is described.) 170 */ 171 public CodeableConcept getUnitOfPresentation() { 172 if (this.unitOfPresentation == null) 173 if (Configuration.errorOnAutoCreate()) 174 throw new Error("Attempt to auto-create MedicinalProductManufactured.unitOfPresentation"); 175 else if (Configuration.doAutoCreate()) 176 this.unitOfPresentation = new CodeableConcept(); // cc 177 return this.unitOfPresentation; 178 } 179 180 public boolean hasUnitOfPresentation() { 181 return this.unitOfPresentation != null && !this.unitOfPresentation.isEmpty(); 182 } 183 184 /** 185 * @param value {@link #unitOfPresentation} (The “real world” units in which the quantity of the manufactured item is described.) 186 */ 187 public MedicinalProductManufactured setUnitOfPresentation(CodeableConcept value) { 188 this.unitOfPresentation = value; 189 return this; 190 } 191 192 /** 193 * @return {@link #quantity} (The quantity or "count number" of the manufactured item.) 194 */ 195 public Quantity getQuantity() { 196 if (this.quantity == null) 197 if (Configuration.errorOnAutoCreate()) 198 throw new Error("Attempt to auto-create MedicinalProductManufactured.quantity"); 199 else if (Configuration.doAutoCreate()) 200 this.quantity = new Quantity(); // cc 201 return this.quantity; 202 } 203 204 public boolean hasQuantity() { 205 return this.quantity != null && !this.quantity.isEmpty(); 206 } 207 208 /** 209 * @param value {@link #quantity} (The quantity or "count number" of the manufactured item.) 210 */ 211 public MedicinalProductManufactured setQuantity(Quantity value) { 212 this.quantity = value; 213 return this; 214 } 215 216 /** 217 * @return {@link #manufacturer} (Manufacturer of the item (Note that this should be named "manufacturer" but it currently causes technical issues).) 218 */ 219 public List<Reference> getManufacturer() { 220 if (this.manufacturer == null) 221 this.manufacturer = new ArrayList<Reference>(); 222 return this.manufacturer; 223 } 224 225 /** 226 * @return Returns a reference to <code>this</code> for easy method chaining 227 */ 228 public MedicinalProductManufactured setManufacturer(List<Reference> theManufacturer) { 229 this.manufacturer = theManufacturer; 230 return this; 231 } 232 233 public boolean hasManufacturer() { 234 if (this.manufacturer == null) 235 return false; 236 for (Reference item : this.manufacturer) 237 if (!item.isEmpty()) 238 return true; 239 return false; 240 } 241 242 public Reference addManufacturer() { //3 243 Reference t = new Reference(); 244 if (this.manufacturer == null) 245 this.manufacturer = new ArrayList<Reference>(); 246 this.manufacturer.add(t); 247 return t; 248 } 249 250 public MedicinalProductManufactured addManufacturer(Reference t) { //3 251 if (t == null) 252 return this; 253 if (this.manufacturer == null) 254 this.manufacturer = new ArrayList<Reference>(); 255 this.manufacturer.add(t); 256 return this; 257 } 258 259 /** 260 * @return The first repetition of repeating field {@link #manufacturer}, creating it if it does not already exist 261 */ 262 public Reference getManufacturerFirstRep() { 263 if (getManufacturer().isEmpty()) { 264 addManufacturer(); 265 } 266 return getManufacturer().get(0); 267 } 268 269 /** 270 * @deprecated Use Reference#setResource(IBaseResource) instead 271 */ 272 @Deprecated 273 public List<Organization> getManufacturerTarget() { 274 if (this.manufacturerTarget == null) 275 this.manufacturerTarget = new ArrayList<Organization>(); 276 return this.manufacturerTarget; 277 } 278 279 /** 280 * @deprecated Use Reference#setResource(IBaseResource) instead 281 */ 282 @Deprecated 283 public Organization addManufacturerTarget() { 284 Organization r = new Organization(); 285 if (this.manufacturerTarget == null) 286 this.manufacturerTarget = new ArrayList<Organization>(); 287 this.manufacturerTarget.add(r); 288 return r; 289 } 290 291 /** 292 * @return {@link #ingredient} (Ingredient.) 293 */ 294 public List<Reference> getIngredient() { 295 if (this.ingredient == null) 296 this.ingredient = new ArrayList<Reference>(); 297 return this.ingredient; 298 } 299 300 /** 301 * @return Returns a reference to <code>this</code> for easy method chaining 302 */ 303 public MedicinalProductManufactured setIngredient(List<Reference> theIngredient) { 304 this.ingredient = theIngredient; 305 return this; 306 } 307 308 public boolean hasIngredient() { 309 if (this.ingredient == null) 310 return false; 311 for (Reference item : this.ingredient) 312 if (!item.isEmpty()) 313 return true; 314 return false; 315 } 316 317 public Reference addIngredient() { //3 318 Reference t = new Reference(); 319 if (this.ingredient == null) 320 this.ingredient = new ArrayList<Reference>(); 321 this.ingredient.add(t); 322 return t; 323 } 324 325 public MedicinalProductManufactured addIngredient(Reference t) { //3 326 if (t == null) 327 return this; 328 if (this.ingredient == null) 329 this.ingredient = new ArrayList<Reference>(); 330 this.ingredient.add(t); 331 return this; 332 } 333 334 /** 335 * @return The first repetition of repeating field {@link #ingredient}, creating it if it does not already exist 336 */ 337 public Reference getIngredientFirstRep() { 338 if (getIngredient().isEmpty()) { 339 addIngredient(); 340 } 341 return getIngredient().get(0); 342 } 343 344 /** 345 * @deprecated Use Reference#setResource(IBaseResource) instead 346 */ 347 @Deprecated 348 public List<MedicinalProductIngredient> getIngredientTarget() { 349 if (this.ingredientTarget == null) 350 this.ingredientTarget = new ArrayList<MedicinalProductIngredient>(); 351 return this.ingredientTarget; 352 } 353 354 /** 355 * @deprecated Use Reference#setResource(IBaseResource) instead 356 */ 357 @Deprecated 358 public MedicinalProductIngredient addIngredientTarget() { 359 MedicinalProductIngredient r = new MedicinalProductIngredient(); 360 if (this.ingredientTarget == null) 361 this.ingredientTarget = new ArrayList<MedicinalProductIngredient>(); 362 this.ingredientTarget.add(r); 363 return r; 364 } 365 366 /** 367 * @return {@link #physicalCharacteristics} (Dimensions, color etc.) 368 */ 369 public ProdCharacteristic getPhysicalCharacteristics() { 370 if (this.physicalCharacteristics == null) 371 if (Configuration.errorOnAutoCreate()) 372 throw new Error("Attempt to auto-create MedicinalProductManufactured.physicalCharacteristics"); 373 else if (Configuration.doAutoCreate()) 374 this.physicalCharacteristics = new ProdCharacteristic(); // cc 375 return this.physicalCharacteristics; 376 } 377 378 public boolean hasPhysicalCharacteristics() { 379 return this.physicalCharacteristics != null && !this.physicalCharacteristics.isEmpty(); 380 } 381 382 /** 383 * @param value {@link #physicalCharacteristics} (Dimensions, color etc.) 384 */ 385 public MedicinalProductManufactured setPhysicalCharacteristics(ProdCharacteristic value) { 386 this.physicalCharacteristics = value; 387 return this; 388 } 389 390 /** 391 * @return {@link #otherCharacteristics} (Other codeable characteristics.) 392 */ 393 public List<CodeableConcept> getOtherCharacteristics() { 394 if (this.otherCharacteristics == null) 395 this.otherCharacteristics = new ArrayList<CodeableConcept>(); 396 return this.otherCharacteristics; 397 } 398 399 /** 400 * @return Returns a reference to <code>this</code> for easy method chaining 401 */ 402 public MedicinalProductManufactured setOtherCharacteristics(List<CodeableConcept> theOtherCharacteristics) { 403 this.otherCharacteristics = theOtherCharacteristics; 404 return this; 405 } 406 407 public boolean hasOtherCharacteristics() { 408 if (this.otherCharacteristics == null) 409 return false; 410 for (CodeableConcept item : this.otherCharacteristics) 411 if (!item.isEmpty()) 412 return true; 413 return false; 414 } 415 416 public CodeableConcept addOtherCharacteristics() { //3 417 CodeableConcept t = new CodeableConcept(); 418 if (this.otherCharacteristics == null) 419 this.otherCharacteristics = new ArrayList<CodeableConcept>(); 420 this.otherCharacteristics.add(t); 421 return t; 422 } 423 424 public MedicinalProductManufactured addOtherCharacteristics(CodeableConcept t) { //3 425 if (t == null) 426 return this; 427 if (this.otherCharacteristics == null) 428 this.otherCharacteristics = new ArrayList<CodeableConcept>(); 429 this.otherCharacteristics.add(t); 430 return this; 431 } 432 433 /** 434 * @return The first repetition of repeating field {@link #otherCharacteristics}, creating it if it does not already exist 435 */ 436 public CodeableConcept getOtherCharacteristicsFirstRep() { 437 if (getOtherCharacteristics().isEmpty()) { 438 addOtherCharacteristics(); 439 } 440 return getOtherCharacteristics().get(0); 441 } 442 443 protected void listChildren(List<Property> children) { 444 super.listChildren(children); 445 children.add(new Property("manufacturedDoseForm", "CodeableConcept", "Dose form as manufactured and before any transformation into the pharmaceutical product.", 0, 1, manufacturedDoseForm)); 446 children.add(new Property("unitOfPresentation", "CodeableConcept", "The “real world” units in which the quantity of the manufactured item is described.", 0, 1, unitOfPresentation)); 447 children.add(new Property("quantity", "Quantity", "The quantity or \"count number\" of the manufactured item.", 0, 1, quantity)); 448 children.add(new Property("manufacturer", "Reference(Organization)", "Manufacturer of the item (Note that this should be named \"manufacturer\" but it currently causes technical issues).", 0, java.lang.Integer.MAX_VALUE, manufacturer)); 449 children.add(new Property("ingredient", "Reference(MedicinalProductIngredient)", "Ingredient.", 0, java.lang.Integer.MAX_VALUE, ingredient)); 450 children.add(new Property("physicalCharacteristics", "ProdCharacteristic", "Dimensions, color etc.", 0, 1, physicalCharacteristics)); 451 children.add(new Property("otherCharacteristics", "CodeableConcept", "Other codeable characteristics.", 0, java.lang.Integer.MAX_VALUE, otherCharacteristics)); 452 } 453 454 @Override 455 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 456 switch (_hash) { 457 case -1451400348: /*manufacturedDoseForm*/ return new Property("manufacturedDoseForm", "CodeableConcept", "Dose form as manufactured and before any transformation into the pharmaceutical product.", 0, 1, manufacturedDoseForm); 458 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); 459 case -1285004149: /*quantity*/ return new Property("quantity", "Quantity", "The quantity or \"count number\" of the manufactured item.", 0, 1, quantity); 460 case -1969347631: /*manufacturer*/ return new Property("manufacturer", "Reference(Organization)", "Manufacturer of the item (Note that this should be named \"manufacturer\" but it currently causes technical issues).", 0, java.lang.Integer.MAX_VALUE, manufacturer); 461 case -206409263: /*ingredient*/ return new Property("ingredient", "Reference(MedicinalProductIngredient)", "Ingredient.", 0, java.lang.Integer.MAX_VALUE, ingredient); 462 case -1599676319: /*physicalCharacteristics*/ return new Property("physicalCharacteristics", "ProdCharacteristic", "Dimensions, color etc.", 0, 1, physicalCharacteristics); 463 case 722135304: /*otherCharacteristics*/ return new Property("otherCharacteristics", "CodeableConcept", "Other codeable characteristics.", 0, java.lang.Integer.MAX_VALUE, otherCharacteristics); 464 default: return super.getNamedProperty(_hash, _name, _checkValid); 465 } 466 467 } 468 469 @Override 470 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 471 switch (hash) { 472 case -1451400348: /*manufacturedDoseForm*/ return this.manufacturedDoseForm == null ? new Base[0] : new Base[] {this.manufacturedDoseForm}; // CodeableConcept 473 case -1427765963: /*unitOfPresentation*/ return this.unitOfPresentation == null ? new Base[0] : new Base[] {this.unitOfPresentation}; // CodeableConcept 474 case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity 475 case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : this.manufacturer.toArray(new Base[this.manufacturer.size()]); // Reference 476 case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // Reference 477 case -1599676319: /*physicalCharacteristics*/ return this.physicalCharacteristics == null ? new Base[0] : new Base[] {this.physicalCharacteristics}; // ProdCharacteristic 478 case 722135304: /*otherCharacteristics*/ return this.otherCharacteristics == null ? new Base[0] : this.otherCharacteristics.toArray(new Base[this.otherCharacteristics.size()]); // CodeableConcept 479 default: return super.getProperty(hash, name, checkValid); 480 } 481 482 } 483 484 @Override 485 public Base setProperty(int hash, String name, Base value) throws FHIRException { 486 switch (hash) { 487 case -1451400348: // manufacturedDoseForm 488 this.manufacturedDoseForm = castToCodeableConcept(value); // CodeableConcept 489 return value; 490 case -1427765963: // unitOfPresentation 491 this.unitOfPresentation = castToCodeableConcept(value); // CodeableConcept 492 return value; 493 case -1285004149: // quantity 494 this.quantity = castToQuantity(value); // Quantity 495 return value; 496 case -1969347631: // manufacturer 497 this.getManufacturer().add(castToReference(value)); // Reference 498 return value; 499 case -206409263: // ingredient 500 this.getIngredient().add(castToReference(value)); // Reference 501 return value; 502 case -1599676319: // physicalCharacteristics 503 this.physicalCharacteristics = castToProdCharacteristic(value); // ProdCharacteristic 504 return value; 505 case 722135304: // otherCharacteristics 506 this.getOtherCharacteristics().add(castToCodeableConcept(value)); // CodeableConcept 507 return value; 508 default: return super.setProperty(hash, name, value); 509 } 510 511 } 512 513 @Override 514 public Base setProperty(String name, Base value) throws FHIRException { 515 if (name.equals("manufacturedDoseForm")) { 516 this.manufacturedDoseForm = castToCodeableConcept(value); // CodeableConcept 517 } else if (name.equals("unitOfPresentation")) { 518 this.unitOfPresentation = castToCodeableConcept(value); // CodeableConcept 519 } else if (name.equals("quantity")) { 520 this.quantity = castToQuantity(value); // Quantity 521 } else if (name.equals("manufacturer")) { 522 this.getManufacturer().add(castToReference(value)); 523 } else if (name.equals("ingredient")) { 524 this.getIngredient().add(castToReference(value)); 525 } else if (name.equals("physicalCharacteristics")) { 526 this.physicalCharacteristics = castToProdCharacteristic(value); // ProdCharacteristic 527 } else if (name.equals("otherCharacteristics")) { 528 this.getOtherCharacteristics().add(castToCodeableConcept(value)); 529 } else 530 return super.setProperty(name, value); 531 return value; 532 } 533 534 @Override 535 public Base makeProperty(int hash, String name) throws FHIRException { 536 switch (hash) { 537 case -1451400348: return getManufacturedDoseForm(); 538 case -1427765963: return getUnitOfPresentation(); 539 case -1285004149: return getQuantity(); 540 case -1969347631: return addManufacturer(); 541 case -206409263: return addIngredient(); 542 case -1599676319: return getPhysicalCharacteristics(); 543 case 722135304: return addOtherCharacteristics(); 544 default: return super.makeProperty(hash, name); 545 } 546 547 } 548 549 @Override 550 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 551 switch (hash) { 552 case -1451400348: /*manufacturedDoseForm*/ return new String[] {"CodeableConcept"}; 553 case -1427765963: /*unitOfPresentation*/ return new String[] {"CodeableConcept"}; 554 case -1285004149: /*quantity*/ return new String[] {"Quantity"}; 555 case -1969347631: /*manufacturer*/ return new String[] {"Reference"}; 556 case -206409263: /*ingredient*/ return new String[] {"Reference"}; 557 case -1599676319: /*physicalCharacteristics*/ return new String[] {"ProdCharacteristic"}; 558 case 722135304: /*otherCharacteristics*/ return new String[] {"CodeableConcept"}; 559 default: return super.getTypesForProperty(hash, name); 560 } 561 562 } 563 564 @Override 565 public Base addChild(String name) throws FHIRException { 566 if (name.equals("manufacturedDoseForm")) { 567 this.manufacturedDoseForm = new CodeableConcept(); 568 return this.manufacturedDoseForm; 569 } 570 else if (name.equals("unitOfPresentation")) { 571 this.unitOfPresentation = new CodeableConcept(); 572 return this.unitOfPresentation; 573 } 574 else if (name.equals("quantity")) { 575 this.quantity = new Quantity(); 576 return this.quantity; 577 } 578 else if (name.equals("manufacturer")) { 579 return addManufacturer(); 580 } 581 else if (name.equals("ingredient")) { 582 return addIngredient(); 583 } 584 else if (name.equals("physicalCharacteristics")) { 585 this.physicalCharacteristics = new ProdCharacteristic(); 586 return this.physicalCharacteristics; 587 } 588 else if (name.equals("otherCharacteristics")) { 589 return addOtherCharacteristics(); 590 } 591 else 592 return super.addChild(name); 593 } 594 595 public String fhirType() { 596 return "MedicinalProductManufactured"; 597 598 } 599 600 public MedicinalProductManufactured copy() { 601 MedicinalProductManufactured dst = new MedicinalProductManufactured(); 602 copyValues(dst); 603 dst.manufacturedDoseForm = manufacturedDoseForm == null ? null : manufacturedDoseForm.copy(); 604 dst.unitOfPresentation = unitOfPresentation == null ? null : unitOfPresentation.copy(); 605 dst.quantity = quantity == null ? null : quantity.copy(); 606 if (manufacturer != null) { 607 dst.manufacturer = new ArrayList<Reference>(); 608 for (Reference i : manufacturer) 609 dst.manufacturer.add(i.copy()); 610 }; 611 if (ingredient != null) { 612 dst.ingredient = new ArrayList<Reference>(); 613 for (Reference i : ingredient) 614 dst.ingredient.add(i.copy()); 615 }; 616 dst.physicalCharacteristics = physicalCharacteristics == null ? null : physicalCharacteristics.copy(); 617 if (otherCharacteristics != null) { 618 dst.otherCharacteristics = new ArrayList<CodeableConcept>(); 619 for (CodeableConcept i : otherCharacteristics) 620 dst.otherCharacteristics.add(i.copy()); 621 }; 622 return dst; 623 } 624 625 protected MedicinalProductManufactured typedCopy() { 626 return copy(); 627 } 628 629 @Override 630 public boolean equalsDeep(Base other_) { 631 if (!super.equalsDeep(other_)) 632 return false; 633 if (!(other_ instanceof MedicinalProductManufactured)) 634 return false; 635 MedicinalProductManufactured o = (MedicinalProductManufactured) other_; 636 return compareDeep(manufacturedDoseForm, o.manufacturedDoseForm, true) && compareDeep(unitOfPresentation, o.unitOfPresentation, true) 637 && compareDeep(quantity, o.quantity, true) && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(ingredient, o.ingredient, true) 638 && compareDeep(physicalCharacteristics, o.physicalCharacteristics, true) && compareDeep(otherCharacteristics, o.otherCharacteristics, true) 639 ; 640 } 641 642 @Override 643 public boolean equalsShallow(Base other_) { 644 if (!super.equalsShallow(other_)) 645 return false; 646 if (!(other_ instanceof MedicinalProductManufactured)) 647 return false; 648 MedicinalProductManufactured o = (MedicinalProductManufactured) other_; 649 return true; 650 } 651 652 public boolean isEmpty() { 653 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(manufacturedDoseForm, unitOfPresentation 654 , quantity, manufacturer, ingredient, physicalCharacteristics, otherCharacteristics 655 ); 656 } 657 658 @Override 659 public ResourceType getResourceType() { 660 return ResourceType.MedicinalProductManufactured; 661 } 662 663 664} 665