001package org.hl7.fhir.r4.model; 002 003 004 005/* 006 Copyright (c) 2011+, HL7, Inc. 007 All rights reserved. 008 009 Redistribution and use in source and binary forms, with or without modification, 010 are permitted provided that the following conditions are met: 011 012 * Redistributions of source code must retain the above copyright notice, this 013 list of conditions and the following disclaimer. 014 * Redistributions in binary form must reproduce the above copyright notice, 015 this list of conditions and the following disclaimer in the documentation 016 and/or other materials provided with the distribution. 017 * Neither the name of HL7 nor the names of its contributors may be used to 018 endorse or promote products derived from this software without specific 019 prior written permission. 020 021 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 022 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 023 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 024 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 025 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 026 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 027 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 028 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 029 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 030 POSSIBILITY OF SUCH DAMAGE. 031 032*/ 033 034 035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1 036 037import java.util.*; 038 039import org.hl7.fhir.utilities.Utilities; 040import ca.uhn.fhir.model.api.annotation.Child; 041import ca.uhn.fhir.model.api.annotation.ChildOrder; 042import ca.uhn.fhir.model.api.annotation.Description; 043import ca.uhn.fhir.model.api.annotation.DatatypeDef; 044import ca.uhn.fhir.model.api.annotation.Block; 045import org.hl7.fhir.instance.model.api.*; 046import org.hl7.fhir.exceptions.FHIRException; 047/** 048 * The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available. 049 */ 050@DatatypeDef(name="ProdCharacteristic") 051public class ProdCharacteristic extends BackboneType implements ICompositeType { 052 053 /** 054 * Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. 055 */ 056 @Child(name = "height", type = {Quantity.class}, order=0, min=0, max=1, modifier=false, summary=true) 057 @Description(shortDefinition="Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used", formalDefinition="Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used." ) 058 protected Quantity height; 059 060 /** 061 * Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. 062 */ 063 @Child(name = "width", type = {Quantity.class}, order=1, min=0, max=1, modifier=false, summary=true) 064 @Description(shortDefinition="Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used", formalDefinition="Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used." ) 065 protected Quantity width; 066 067 /** 068 * Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. 069 */ 070 @Child(name = "depth", type = {Quantity.class}, order=2, min=0, max=1, modifier=false, summary=true) 071 @Description(shortDefinition="Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used", formalDefinition="Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used." ) 072 protected Quantity depth; 073 074 /** 075 * Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. 076 */ 077 @Child(name = "weight", type = {Quantity.class}, order=3, min=0, max=1, modifier=false, summary=true) 078 @Description(shortDefinition="Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used", formalDefinition="Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used." ) 079 protected Quantity weight; 080 081 /** 082 * Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. 083 */ 084 @Child(name = "nominalVolume", type = {Quantity.class}, order=4, min=0, max=1, modifier=false, summary=true) 085 @Description(shortDefinition="Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used", formalDefinition="Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used." ) 086 protected Quantity nominalVolume; 087 088 /** 089 * Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used. 090 */ 091 @Child(name = "externalDiameter", type = {Quantity.class}, order=5, min=0, max=1, modifier=false, summary=true) 092 @Description(shortDefinition="Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used", formalDefinition="Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used." ) 093 protected Quantity externalDiameter; 094 095 /** 096 * Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used. 097 */ 098 @Child(name = "shape", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) 099 @Description(shortDefinition="Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used", formalDefinition="Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used." ) 100 protected StringType shape; 101 102 /** 103 * Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used. 104 */ 105 @Child(name = "color", type = {StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 106 @Description(shortDefinition="Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used", formalDefinition="Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used." ) 107 protected List<StringType> color; 108 109 /** 110 * Where applicable, the imprint can be specified as text. 111 */ 112 @Child(name = "imprint", type = {StringType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 113 @Description(shortDefinition="Where applicable, the imprint can be specified as text", formalDefinition="Where applicable, the imprint can be specified as text." ) 114 protected List<StringType> imprint; 115 116 /** 117 * Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations. 118 */ 119 @Child(name = "image", type = {Attachment.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 120 @Description(shortDefinition="Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations", formalDefinition="Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations." ) 121 protected List<Attachment> image; 122 123 /** 124 * Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used. 125 */ 126 @Child(name = "scoring", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true) 127 @Description(shortDefinition="Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used", formalDefinition="Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used." ) 128 protected CodeableConcept scoring; 129 130 private static final long serialVersionUID = 1521671432L; 131 132 /** 133 * Constructor 134 */ 135 public ProdCharacteristic() { 136 super(); 137 } 138 139 /** 140 * @return {@link #height} (Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.) 141 */ 142 public Quantity getHeight() { 143 if (this.height == null) 144 if (Configuration.errorOnAutoCreate()) 145 throw new Error("Attempt to auto-create ProdCharacteristic.height"); 146 else if (Configuration.doAutoCreate()) 147 this.height = new Quantity(); // cc 148 return this.height; 149 } 150 151 public boolean hasHeight() { 152 return this.height != null && !this.height.isEmpty(); 153 } 154 155 /** 156 * @param value {@link #height} (Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.) 157 */ 158 public ProdCharacteristic setHeight(Quantity value) { 159 this.height = value; 160 return this; 161 } 162 163 /** 164 * @return {@link #width} (Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.) 165 */ 166 public Quantity getWidth() { 167 if (this.width == null) 168 if (Configuration.errorOnAutoCreate()) 169 throw new Error("Attempt to auto-create ProdCharacteristic.width"); 170 else if (Configuration.doAutoCreate()) 171 this.width = new Quantity(); // cc 172 return this.width; 173 } 174 175 public boolean hasWidth() { 176 return this.width != null && !this.width.isEmpty(); 177 } 178 179 /** 180 * @param value {@link #width} (Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.) 181 */ 182 public ProdCharacteristic setWidth(Quantity value) { 183 this.width = value; 184 return this; 185 } 186 187 /** 188 * @return {@link #depth} (Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.) 189 */ 190 public Quantity getDepth() { 191 if (this.depth == null) 192 if (Configuration.errorOnAutoCreate()) 193 throw new Error("Attempt to auto-create ProdCharacteristic.depth"); 194 else if (Configuration.doAutoCreate()) 195 this.depth = new Quantity(); // cc 196 return this.depth; 197 } 198 199 public boolean hasDepth() { 200 return this.depth != null && !this.depth.isEmpty(); 201 } 202 203 /** 204 * @param value {@link #depth} (Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.) 205 */ 206 public ProdCharacteristic setDepth(Quantity value) { 207 this.depth = value; 208 return this; 209 } 210 211 /** 212 * @return {@link #weight} (Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.) 213 */ 214 public Quantity getWeight() { 215 if (this.weight == null) 216 if (Configuration.errorOnAutoCreate()) 217 throw new Error("Attempt to auto-create ProdCharacteristic.weight"); 218 else if (Configuration.doAutoCreate()) 219 this.weight = new Quantity(); // cc 220 return this.weight; 221 } 222 223 public boolean hasWeight() { 224 return this.weight != null && !this.weight.isEmpty(); 225 } 226 227 /** 228 * @param value {@link #weight} (Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.) 229 */ 230 public ProdCharacteristic setWeight(Quantity value) { 231 this.weight = value; 232 return this; 233 } 234 235 /** 236 * @return {@link #nominalVolume} (Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.) 237 */ 238 public Quantity getNominalVolume() { 239 if (this.nominalVolume == null) 240 if (Configuration.errorOnAutoCreate()) 241 throw new Error("Attempt to auto-create ProdCharacteristic.nominalVolume"); 242 else if (Configuration.doAutoCreate()) 243 this.nominalVolume = new Quantity(); // cc 244 return this.nominalVolume; 245 } 246 247 public boolean hasNominalVolume() { 248 return this.nominalVolume != null && !this.nominalVolume.isEmpty(); 249 } 250 251 /** 252 * @param value {@link #nominalVolume} (Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.) 253 */ 254 public ProdCharacteristic setNominalVolume(Quantity value) { 255 this.nominalVolume = value; 256 return this; 257 } 258 259 /** 260 * @return {@link #externalDiameter} (Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.) 261 */ 262 public Quantity getExternalDiameter() { 263 if (this.externalDiameter == null) 264 if (Configuration.errorOnAutoCreate()) 265 throw new Error("Attempt to auto-create ProdCharacteristic.externalDiameter"); 266 else if (Configuration.doAutoCreate()) 267 this.externalDiameter = new Quantity(); // cc 268 return this.externalDiameter; 269 } 270 271 public boolean hasExternalDiameter() { 272 return this.externalDiameter != null && !this.externalDiameter.isEmpty(); 273 } 274 275 /** 276 * @param value {@link #externalDiameter} (Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.) 277 */ 278 public ProdCharacteristic setExternalDiameter(Quantity value) { 279 this.externalDiameter = value; 280 return this; 281 } 282 283 /** 284 * @return {@link #shape} (Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.). This is the underlying object with id, value and extensions. The accessor "getShape" gives direct access to the value 285 */ 286 public StringType getShapeElement() { 287 if (this.shape == null) 288 if (Configuration.errorOnAutoCreate()) 289 throw new Error("Attempt to auto-create ProdCharacteristic.shape"); 290 else if (Configuration.doAutoCreate()) 291 this.shape = new StringType(); // bb 292 return this.shape; 293 } 294 295 public boolean hasShapeElement() { 296 return this.shape != null && !this.shape.isEmpty(); 297 } 298 299 public boolean hasShape() { 300 return this.shape != null && !this.shape.isEmpty(); 301 } 302 303 /** 304 * @param value {@link #shape} (Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.). This is the underlying object with id, value and extensions. The accessor "getShape" gives direct access to the value 305 */ 306 public ProdCharacteristic setShapeElement(StringType value) { 307 this.shape = value; 308 return this; 309 } 310 311 /** 312 * @return Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used. 313 */ 314 public String getShape() { 315 return this.shape == null ? null : this.shape.getValue(); 316 } 317 318 /** 319 * @param value Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used. 320 */ 321 public ProdCharacteristic setShape(String value) { 322 if (Utilities.noString(value)) 323 this.shape = null; 324 else { 325 if (this.shape == null) 326 this.shape = new StringType(); 327 this.shape.setValue(value); 328 } 329 return this; 330 } 331 332 /** 333 * @return {@link #color} (Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.) 334 */ 335 public List<StringType> getColor() { 336 if (this.color == null) 337 this.color = new ArrayList<StringType>(); 338 return this.color; 339 } 340 341 /** 342 * @return Returns a reference to <code>this</code> for easy method chaining 343 */ 344 public ProdCharacteristic setColor(List<StringType> theColor) { 345 this.color = theColor; 346 return this; 347 } 348 349 public boolean hasColor() { 350 if (this.color == null) 351 return false; 352 for (StringType item : this.color) 353 if (!item.isEmpty()) 354 return true; 355 return false; 356 } 357 358 /** 359 * @return {@link #color} (Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.) 360 */ 361 public StringType addColorElement() {//2 362 StringType t = new StringType(); 363 if (this.color == null) 364 this.color = new ArrayList<StringType>(); 365 this.color.add(t); 366 return t; 367 } 368 369 /** 370 * @param value {@link #color} (Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.) 371 */ 372 public ProdCharacteristic addColor(String value) { //1 373 StringType t = new StringType(); 374 t.setValue(value); 375 if (this.color == null) 376 this.color = new ArrayList<StringType>(); 377 this.color.add(t); 378 return this; 379 } 380 381 /** 382 * @param value {@link #color} (Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.) 383 */ 384 public boolean hasColor(String value) { 385 if (this.color == null) 386 return false; 387 for (StringType v : this.color) 388 if (v.getValue().equals(value)) // string 389 return true; 390 return false; 391 } 392 393 /** 394 * @return {@link #imprint} (Where applicable, the imprint can be specified as text.) 395 */ 396 public List<StringType> getImprint() { 397 if (this.imprint == null) 398 this.imprint = new ArrayList<StringType>(); 399 return this.imprint; 400 } 401 402 /** 403 * @return Returns a reference to <code>this</code> for easy method chaining 404 */ 405 public ProdCharacteristic setImprint(List<StringType> theImprint) { 406 this.imprint = theImprint; 407 return this; 408 } 409 410 public boolean hasImprint() { 411 if (this.imprint == null) 412 return false; 413 for (StringType item : this.imprint) 414 if (!item.isEmpty()) 415 return true; 416 return false; 417 } 418 419 /** 420 * @return {@link #imprint} (Where applicable, the imprint can be specified as text.) 421 */ 422 public StringType addImprintElement() {//2 423 StringType t = new StringType(); 424 if (this.imprint == null) 425 this.imprint = new ArrayList<StringType>(); 426 this.imprint.add(t); 427 return t; 428 } 429 430 /** 431 * @param value {@link #imprint} (Where applicable, the imprint can be specified as text.) 432 */ 433 public ProdCharacteristic addImprint(String value) { //1 434 StringType t = new StringType(); 435 t.setValue(value); 436 if (this.imprint == null) 437 this.imprint = new ArrayList<StringType>(); 438 this.imprint.add(t); 439 return this; 440 } 441 442 /** 443 * @param value {@link #imprint} (Where applicable, the imprint can be specified as text.) 444 */ 445 public boolean hasImprint(String value) { 446 if (this.imprint == null) 447 return false; 448 for (StringType v : this.imprint) 449 if (v.getValue().equals(value)) // string 450 return true; 451 return false; 452 } 453 454 /** 455 * @return {@link #image} (Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations.) 456 */ 457 public List<Attachment> getImage() { 458 if (this.image == null) 459 this.image = new ArrayList<Attachment>(); 460 return this.image; 461 } 462 463 /** 464 * @return Returns a reference to <code>this</code> for easy method chaining 465 */ 466 public ProdCharacteristic setImage(List<Attachment> theImage) { 467 this.image = theImage; 468 return this; 469 } 470 471 public boolean hasImage() { 472 if (this.image == null) 473 return false; 474 for (Attachment item : this.image) 475 if (!item.isEmpty()) 476 return true; 477 return false; 478 } 479 480 public Attachment addImage() { //3 481 Attachment t = new Attachment(); 482 if (this.image == null) 483 this.image = new ArrayList<Attachment>(); 484 this.image.add(t); 485 return t; 486 } 487 488 public ProdCharacteristic addImage(Attachment t) { //3 489 if (t == null) 490 return this; 491 if (this.image == null) 492 this.image = new ArrayList<Attachment>(); 493 this.image.add(t); 494 return this; 495 } 496 497 /** 498 * @return The first repetition of repeating field {@link #image}, creating it if it does not already exist 499 */ 500 public Attachment getImageFirstRep() { 501 if (getImage().isEmpty()) { 502 addImage(); 503 } 504 return getImage().get(0); 505 } 506 507 /** 508 * @return {@link #scoring} (Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.) 509 */ 510 public CodeableConcept getScoring() { 511 if (this.scoring == null) 512 if (Configuration.errorOnAutoCreate()) 513 throw new Error("Attempt to auto-create ProdCharacteristic.scoring"); 514 else if (Configuration.doAutoCreate()) 515 this.scoring = new CodeableConcept(); // cc 516 return this.scoring; 517 } 518 519 public boolean hasScoring() { 520 return this.scoring != null && !this.scoring.isEmpty(); 521 } 522 523 /** 524 * @param value {@link #scoring} (Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.) 525 */ 526 public ProdCharacteristic setScoring(CodeableConcept value) { 527 this.scoring = value; 528 return this; 529 } 530 531 protected void listChildren(List<Property> children) { 532 super.listChildren(children); 533 children.add(new Property("height", "Quantity", "Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, height)); 534 children.add(new Property("width", "Quantity", "Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, width)); 535 children.add(new Property("depth", "Quantity", "Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, depth)); 536 children.add(new Property("weight", "Quantity", "Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, weight)); 537 children.add(new Property("nominalVolume", "Quantity", "Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, nominalVolume)); 538 children.add(new Property("externalDiameter", "Quantity", "Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, externalDiameter)); 539 children.add(new Property("shape", "string", "Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.", 0, 1, shape)); 540 children.add(new Property("color", "string", "Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.", 0, java.lang.Integer.MAX_VALUE, color)); 541 children.add(new Property("imprint", "string", "Where applicable, the imprint can be specified as text.", 0, java.lang.Integer.MAX_VALUE, imprint)); 542 children.add(new Property("image", "Attachment", "Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations.", 0, java.lang.Integer.MAX_VALUE, image)); 543 children.add(new Property("scoring", "CodeableConcept", "Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.", 0, 1, scoring)); 544 } 545 546 @Override 547 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 548 switch (_hash) { 549 case -1221029593: /*height*/ return new Property("height", "Quantity", "Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, height); 550 case 113126854: /*width*/ return new Property("width", "Quantity", "Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, width); 551 case 95472323: /*depth*/ return new Property("depth", "Quantity", "Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, depth); 552 case -791592328: /*weight*/ return new Property("weight", "Quantity", "Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, weight); 553 case 1706919702: /*nominalVolume*/ return new Property("nominalVolume", "Quantity", "Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, nominalVolume); 554 case 161374584: /*externalDiameter*/ return new Property("externalDiameter", "Quantity", "Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.", 0, 1, externalDiameter); 555 case 109399969: /*shape*/ return new Property("shape", "string", "Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.", 0, 1, shape); 556 case 94842723: /*color*/ return new Property("color", "string", "Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.", 0, java.lang.Integer.MAX_VALUE, color); 557 case 1926118409: /*imprint*/ return new Property("imprint", "string", "Where applicable, the imprint can be specified as text.", 0, java.lang.Integer.MAX_VALUE, imprint); 558 case 100313435: /*image*/ return new Property("image", "Attachment", "Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations.", 0, java.lang.Integer.MAX_VALUE, image); 559 case 1924005583: /*scoring*/ return new Property("scoring", "CodeableConcept", "Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.", 0, 1, scoring); 560 default: return super.getNamedProperty(_hash, _name, _checkValid); 561 } 562 563 } 564 565 @Override 566 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 567 switch (hash) { 568 case -1221029593: /*height*/ return this.height == null ? new Base[0] : new Base[] {this.height}; // Quantity 569 case 113126854: /*width*/ return this.width == null ? new Base[0] : new Base[] {this.width}; // Quantity 570 case 95472323: /*depth*/ return this.depth == null ? new Base[0] : new Base[] {this.depth}; // Quantity 571 case -791592328: /*weight*/ return this.weight == null ? new Base[0] : new Base[] {this.weight}; // Quantity 572 case 1706919702: /*nominalVolume*/ return this.nominalVolume == null ? new Base[0] : new Base[] {this.nominalVolume}; // Quantity 573 case 161374584: /*externalDiameter*/ return this.externalDiameter == null ? new Base[0] : new Base[] {this.externalDiameter}; // Quantity 574 case 109399969: /*shape*/ return this.shape == null ? new Base[0] : new Base[] {this.shape}; // StringType 575 case 94842723: /*color*/ return this.color == null ? new Base[0] : this.color.toArray(new Base[this.color.size()]); // StringType 576 case 1926118409: /*imprint*/ return this.imprint == null ? new Base[0] : this.imprint.toArray(new Base[this.imprint.size()]); // StringType 577 case 100313435: /*image*/ return this.image == null ? new Base[0] : this.image.toArray(new Base[this.image.size()]); // Attachment 578 case 1924005583: /*scoring*/ return this.scoring == null ? new Base[0] : new Base[] {this.scoring}; // CodeableConcept 579 default: return super.getProperty(hash, name, checkValid); 580 } 581 582 } 583 584 @Override 585 public Base setProperty(int hash, String name, Base value) throws FHIRException { 586 switch (hash) { 587 case -1221029593: // height 588 this.height = castToQuantity(value); // Quantity 589 return value; 590 case 113126854: // width 591 this.width = castToQuantity(value); // Quantity 592 return value; 593 case 95472323: // depth 594 this.depth = castToQuantity(value); // Quantity 595 return value; 596 case -791592328: // weight 597 this.weight = castToQuantity(value); // Quantity 598 return value; 599 case 1706919702: // nominalVolume 600 this.nominalVolume = castToQuantity(value); // Quantity 601 return value; 602 case 161374584: // externalDiameter 603 this.externalDiameter = castToQuantity(value); // Quantity 604 return value; 605 case 109399969: // shape 606 this.shape = castToString(value); // StringType 607 return value; 608 case 94842723: // color 609 this.getColor().add(castToString(value)); // StringType 610 return value; 611 case 1926118409: // imprint 612 this.getImprint().add(castToString(value)); // StringType 613 return value; 614 case 100313435: // image 615 this.getImage().add(castToAttachment(value)); // Attachment 616 return value; 617 case 1924005583: // scoring 618 this.scoring = castToCodeableConcept(value); // CodeableConcept 619 return value; 620 default: return super.setProperty(hash, name, value); 621 } 622 623 } 624 625 @Override 626 public Base setProperty(String name, Base value) throws FHIRException { 627 if (name.equals("height")) { 628 this.height = castToQuantity(value); // Quantity 629 } else if (name.equals("width")) { 630 this.width = castToQuantity(value); // Quantity 631 } else if (name.equals("depth")) { 632 this.depth = castToQuantity(value); // Quantity 633 } else if (name.equals("weight")) { 634 this.weight = castToQuantity(value); // Quantity 635 } else if (name.equals("nominalVolume")) { 636 this.nominalVolume = castToQuantity(value); // Quantity 637 } else if (name.equals("externalDiameter")) { 638 this.externalDiameter = castToQuantity(value); // Quantity 639 } else if (name.equals("shape")) { 640 this.shape = castToString(value); // StringType 641 } else if (name.equals("color")) { 642 this.getColor().add(castToString(value)); 643 } else if (name.equals("imprint")) { 644 this.getImprint().add(castToString(value)); 645 } else if (name.equals("image")) { 646 this.getImage().add(castToAttachment(value)); 647 } else if (name.equals("scoring")) { 648 this.scoring = castToCodeableConcept(value); // CodeableConcept 649 } else 650 return super.setProperty(name, value); 651 return value; 652 } 653 654 @Override 655 public Base makeProperty(int hash, String name) throws FHIRException { 656 switch (hash) { 657 case -1221029593: return getHeight(); 658 case 113126854: return getWidth(); 659 case 95472323: return getDepth(); 660 case -791592328: return getWeight(); 661 case 1706919702: return getNominalVolume(); 662 case 161374584: return getExternalDiameter(); 663 case 109399969: return getShapeElement(); 664 case 94842723: return addColorElement(); 665 case 1926118409: return addImprintElement(); 666 case 100313435: return addImage(); 667 case 1924005583: return getScoring(); 668 default: return super.makeProperty(hash, name); 669 } 670 671 } 672 673 @Override 674 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 675 switch (hash) { 676 case -1221029593: /*height*/ return new String[] {"Quantity"}; 677 case 113126854: /*width*/ return new String[] {"Quantity"}; 678 case 95472323: /*depth*/ return new String[] {"Quantity"}; 679 case -791592328: /*weight*/ return new String[] {"Quantity"}; 680 case 1706919702: /*nominalVolume*/ return new String[] {"Quantity"}; 681 case 161374584: /*externalDiameter*/ return new String[] {"Quantity"}; 682 case 109399969: /*shape*/ return new String[] {"string"}; 683 case 94842723: /*color*/ return new String[] {"string"}; 684 case 1926118409: /*imprint*/ return new String[] {"string"}; 685 case 100313435: /*image*/ return new String[] {"Attachment"}; 686 case 1924005583: /*scoring*/ return new String[] {"CodeableConcept"}; 687 default: return super.getTypesForProperty(hash, name); 688 } 689 690 } 691 692 @Override 693 public Base addChild(String name) throws FHIRException { 694 if (name.equals("height")) { 695 this.height = new Quantity(); 696 return this.height; 697 } 698 else if (name.equals("width")) { 699 this.width = new Quantity(); 700 return this.width; 701 } 702 else if (name.equals("depth")) { 703 this.depth = new Quantity(); 704 return this.depth; 705 } 706 else if (name.equals("weight")) { 707 this.weight = new Quantity(); 708 return this.weight; 709 } 710 else if (name.equals("nominalVolume")) { 711 this.nominalVolume = new Quantity(); 712 return this.nominalVolume; 713 } 714 else if (name.equals("externalDiameter")) { 715 this.externalDiameter = new Quantity(); 716 return this.externalDiameter; 717 } 718 else if (name.equals("shape")) { 719 throw new FHIRException("Cannot call addChild on a primitive type ProdCharacteristic.shape"); 720 } 721 else if (name.equals("color")) { 722 throw new FHIRException("Cannot call addChild on a primitive type ProdCharacteristic.color"); 723 } 724 else if (name.equals("imprint")) { 725 throw new FHIRException("Cannot call addChild on a primitive type ProdCharacteristic.imprint"); 726 } 727 else if (name.equals("image")) { 728 return addImage(); 729 } 730 else if (name.equals("scoring")) { 731 this.scoring = new CodeableConcept(); 732 return this.scoring; 733 } 734 else 735 return super.addChild(name); 736 } 737 738 public String fhirType() { 739 return "ProdCharacteristic"; 740 741 } 742 743 public ProdCharacteristic copy() { 744 ProdCharacteristic dst = new ProdCharacteristic(); 745 copyValues(dst); 746 return dst; 747 } 748 749 public void copyValues(ProdCharacteristic dst) { 750 super.copyValues(dst); 751 dst.height = height == null ? null : height.copy(); 752 dst.width = width == null ? null : width.copy(); 753 dst.depth = depth == null ? null : depth.copy(); 754 dst.weight = weight == null ? null : weight.copy(); 755 dst.nominalVolume = nominalVolume == null ? null : nominalVolume.copy(); 756 dst.externalDiameter = externalDiameter == null ? null : externalDiameter.copy(); 757 dst.shape = shape == null ? null : shape.copy(); 758 if (color != null) { 759 dst.color = new ArrayList<StringType>(); 760 for (StringType i : color) 761 dst.color.add(i.copy()); 762 }; 763 if (imprint != null) { 764 dst.imprint = new ArrayList<StringType>(); 765 for (StringType i : imprint) 766 dst.imprint.add(i.copy()); 767 }; 768 if (image != null) { 769 dst.image = new ArrayList<Attachment>(); 770 for (Attachment i : image) 771 dst.image.add(i.copy()); 772 }; 773 dst.scoring = scoring == null ? null : scoring.copy(); 774 } 775 776 protected ProdCharacteristic typedCopy() { 777 return copy(); 778 } 779 780 @Override 781 public boolean equalsDeep(Base other_) { 782 if (!super.equalsDeep(other_)) 783 return false; 784 if (!(other_ instanceof ProdCharacteristic)) 785 return false; 786 ProdCharacteristic o = (ProdCharacteristic) other_; 787 return compareDeep(height, o.height, true) && compareDeep(width, o.width, true) && compareDeep(depth, o.depth, true) 788 && compareDeep(weight, o.weight, true) && compareDeep(nominalVolume, o.nominalVolume, true) && compareDeep(externalDiameter, o.externalDiameter, true) 789 && compareDeep(shape, o.shape, true) && compareDeep(color, o.color, true) && compareDeep(imprint, o.imprint, true) 790 && compareDeep(image, o.image, true) && compareDeep(scoring, o.scoring, true); 791 } 792 793 @Override 794 public boolean equalsShallow(Base other_) { 795 if (!super.equalsShallow(other_)) 796 return false; 797 if (!(other_ instanceof ProdCharacteristic)) 798 return false; 799 ProdCharacteristic o = (ProdCharacteristic) other_; 800 return compareValues(shape, o.shape, true) && compareValues(color, o.color, true) && compareValues(imprint, o.imprint, true) 801 ; 802 } 803 804 public boolean isEmpty() { 805 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(height, width, depth, weight 806 , nominalVolume, externalDiameter, shape, color, imprint, image, scoring); 807 } 808 809 810}