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