
001package org.hl7.fhir.r5.model; 002 003 004/* 005 Copyright (c) 2011+, HL7, Inc. 006 All rights reserved. 007 008 Redistribution and use in source and binary forms, with or without modification, \ 009 are permitted provided that the following conditions are met: 010 011 * Redistributions of source code must retain the above copyright notice, this \ 012 list of conditions and the following disclaimer. 013 * Redistributions in binary form must reproduce the above copyright notice, \ 014 this list of conditions and the following disclaimer in the documentation \ 015 and/or other materials provided with the distribution. 016 * Neither the name of HL7 nor the names of its contributors may be used to 017 endorse or promote products derived from this software without specific 018 prior written permission. 019 020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \ 021 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \ 022 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \ 023 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \ 024 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \ 025 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \ 026 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \ 027 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \ 028 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \ 029 POSSIBILITY OF SUCH DAMAGE. 030 */ 031 032// Generated on Sat, Nov 5, 2022 10:47+1100 for FHIR v5.0.0-ballot 033 034import java.util.ArrayList; 035import java.util.Date; 036import java.util.List; 037import org.hl7.fhir.utilities.Utilities; 038import org.hl7.fhir.r5.model.Enumerations.*; 039import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 040import org.hl7.fhir.exceptions.FHIRException; 041import org.hl7.fhir.instance.model.api.ICompositeType; 042import ca.uhn.fhir.model.api.annotation.ResourceDef; 043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 044import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 045import ca.uhn.fhir.model.api.annotation.Child; 046import ca.uhn.fhir.model.api.annotation.ChildOrder; 047import ca.uhn.fhir.model.api.annotation.Description; 048import ca.uhn.fhir.model.api.annotation.Block; 049 050/** 051 * The detailed description of a substance, typically at a level beyond what is used for prescribing. 052 */ 053@ResourceDef(name="SubstanceDefinition", profile="http://hl7.org/fhir/StructureDefinition/SubstanceDefinition") 054public class SubstanceDefinition extends DomainResource { 055 056 @Block() 057 public static class SubstanceDefinitionMoietyComponent extends BackboneElement implements IBaseBackboneElement { 058 /** 059 * Role that the moiety is playing. 060 */ 061 @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 062 @Description(shortDefinition="Role that the moiety is playing", formalDefinition="Role that the moiety is playing." ) 063 protected CodeableConcept role; 064 065 /** 066 * Identifier by which this moiety substance is known. 067 */ 068 @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=true) 069 @Description(shortDefinition="Identifier by which this moiety substance is known", formalDefinition="Identifier by which this moiety substance is known." ) 070 protected Identifier identifier; 071 072 /** 073 * Textual name for this moiety substance. 074 */ 075 @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) 076 @Description(shortDefinition="Textual name for this moiety substance", formalDefinition="Textual name for this moiety substance." ) 077 protected StringType name; 078 079 /** 080 * Stereochemistry type. 081 */ 082 @Child(name = "stereochemistry", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) 083 @Description(shortDefinition="Stereochemistry type", formalDefinition="Stereochemistry type." ) 084 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-stereochemistry") 085 protected CodeableConcept stereochemistry; 086 087 /** 088 * Optical activity type. 089 */ 090 @Child(name = "opticalActivity", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) 091 @Description(shortDefinition="Optical activity type", formalDefinition="Optical activity type." ) 092 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-optical-activity") 093 protected CodeableConcept opticalActivity; 094 095 /** 096 * Molecular formula for this moiety of this substance, typically using the Hill system. 097 */ 098 @Child(name = "molecularFormula", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) 099 @Description(shortDefinition="Molecular formula for this moiety (e.g. with the Hill system)", formalDefinition="Molecular formula for this moiety of this substance, typically using the Hill system." ) 100 protected StringType molecularFormula; 101 102 /** 103 * Quantitative value for this moiety. 104 */ 105 @Child(name = "amount", type = {Quantity.class, StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) 106 @Description(shortDefinition="Quantitative value for this moiety", formalDefinition="Quantitative value for this moiety." ) 107 protected DataType amount; 108 109 /** 110 * The measurement type of the quantitative value. In capturing the actual relative amounts of substances or molecular fragments it may be necessary to indicate whether the amount refers to, for example, a mole ratio or weight ratio. 111 */ 112 @Child(name = "measurementType", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=true) 113 @Description(shortDefinition="The measurement type of the quantitative value", formalDefinition="The measurement type of the quantitative value. In capturing the actual relative amounts of substances or molecular fragments it may be necessary to indicate whether the amount refers to, for example, a mole ratio or weight ratio." ) 114 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-amount-type") 115 protected CodeableConcept measurementType; 116 117 private static final long serialVersionUID = 271962476L; 118 119 /** 120 * Constructor 121 */ 122 public SubstanceDefinitionMoietyComponent() { 123 super(); 124 } 125 126 /** 127 * @return {@link #role} (Role that the moiety is playing.) 128 */ 129 public CodeableConcept getRole() { 130 if (this.role == null) 131 if (Configuration.errorOnAutoCreate()) 132 throw new Error("Attempt to auto-create SubstanceDefinitionMoietyComponent.role"); 133 else if (Configuration.doAutoCreate()) 134 this.role = new CodeableConcept(); // cc 135 return this.role; 136 } 137 138 public boolean hasRole() { 139 return this.role != null && !this.role.isEmpty(); 140 } 141 142 /** 143 * @param value {@link #role} (Role that the moiety is playing.) 144 */ 145 public SubstanceDefinitionMoietyComponent setRole(CodeableConcept value) { 146 this.role = value; 147 return this; 148 } 149 150 /** 151 * @return {@link #identifier} (Identifier by which this moiety substance is known.) 152 */ 153 public Identifier getIdentifier() { 154 if (this.identifier == null) 155 if (Configuration.errorOnAutoCreate()) 156 throw new Error("Attempt to auto-create SubstanceDefinitionMoietyComponent.identifier"); 157 else if (Configuration.doAutoCreate()) 158 this.identifier = new Identifier(); // cc 159 return this.identifier; 160 } 161 162 public boolean hasIdentifier() { 163 return this.identifier != null && !this.identifier.isEmpty(); 164 } 165 166 /** 167 * @param value {@link #identifier} (Identifier by which this moiety substance is known.) 168 */ 169 public SubstanceDefinitionMoietyComponent setIdentifier(Identifier value) { 170 this.identifier = value; 171 return this; 172 } 173 174 /** 175 * @return {@link #name} (Textual name for this moiety substance.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 176 */ 177 public StringType getNameElement() { 178 if (this.name == null) 179 if (Configuration.errorOnAutoCreate()) 180 throw new Error("Attempt to auto-create SubstanceDefinitionMoietyComponent.name"); 181 else if (Configuration.doAutoCreate()) 182 this.name = new StringType(); // bb 183 return this.name; 184 } 185 186 public boolean hasNameElement() { 187 return this.name != null && !this.name.isEmpty(); 188 } 189 190 public boolean hasName() { 191 return this.name != null && !this.name.isEmpty(); 192 } 193 194 /** 195 * @param value {@link #name} (Textual name for this moiety substance.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 196 */ 197 public SubstanceDefinitionMoietyComponent setNameElement(StringType value) { 198 this.name = value; 199 return this; 200 } 201 202 /** 203 * @return Textual name for this moiety substance. 204 */ 205 public String getName() { 206 return this.name == null ? null : this.name.getValue(); 207 } 208 209 /** 210 * @param value Textual name for this moiety substance. 211 */ 212 public SubstanceDefinitionMoietyComponent setName(String value) { 213 if (Utilities.noString(value)) 214 this.name = null; 215 else { 216 if (this.name == null) 217 this.name = new StringType(); 218 this.name.setValue(value); 219 } 220 return this; 221 } 222 223 /** 224 * @return {@link #stereochemistry} (Stereochemistry type.) 225 */ 226 public CodeableConcept getStereochemistry() { 227 if (this.stereochemistry == null) 228 if (Configuration.errorOnAutoCreate()) 229 throw new Error("Attempt to auto-create SubstanceDefinitionMoietyComponent.stereochemistry"); 230 else if (Configuration.doAutoCreate()) 231 this.stereochemistry = new CodeableConcept(); // cc 232 return this.stereochemistry; 233 } 234 235 public boolean hasStereochemistry() { 236 return this.stereochemistry != null && !this.stereochemistry.isEmpty(); 237 } 238 239 /** 240 * @param value {@link #stereochemistry} (Stereochemistry type.) 241 */ 242 public SubstanceDefinitionMoietyComponent setStereochemistry(CodeableConcept value) { 243 this.stereochemistry = value; 244 return this; 245 } 246 247 /** 248 * @return {@link #opticalActivity} (Optical activity type.) 249 */ 250 public CodeableConcept getOpticalActivity() { 251 if (this.opticalActivity == null) 252 if (Configuration.errorOnAutoCreate()) 253 throw new Error("Attempt to auto-create SubstanceDefinitionMoietyComponent.opticalActivity"); 254 else if (Configuration.doAutoCreate()) 255 this.opticalActivity = new CodeableConcept(); // cc 256 return this.opticalActivity; 257 } 258 259 public boolean hasOpticalActivity() { 260 return this.opticalActivity != null && !this.opticalActivity.isEmpty(); 261 } 262 263 /** 264 * @param value {@link #opticalActivity} (Optical activity type.) 265 */ 266 public SubstanceDefinitionMoietyComponent setOpticalActivity(CodeableConcept value) { 267 this.opticalActivity = value; 268 return this; 269 } 270 271 /** 272 * @return {@link #molecularFormula} (Molecular formula for this moiety of this substance, typically using the Hill system.). This is the underlying object with id, value and extensions. The accessor "getMolecularFormula" gives direct access to the value 273 */ 274 public StringType getMolecularFormulaElement() { 275 if (this.molecularFormula == null) 276 if (Configuration.errorOnAutoCreate()) 277 throw new Error("Attempt to auto-create SubstanceDefinitionMoietyComponent.molecularFormula"); 278 else if (Configuration.doAutoCreate()) 279 this.molecularFormula = new StringType(); // bb 280 return this.molecularFormula; 281 } 282 283 public boolean hasMolecularFormulaElement() { 284 return this.molecularFormula != null && !this.molecularFormula.isEmpty(); 285 } 286 287 public boolean hasMolecularFormula() { 288 return this.molecularFormula != null && !this.molecularFormula.isEmpty(); 289 } 290 291 /** 292 * @param value {@link #molecularFormula} (Molecular formula for this moiety of this substance, typically using the Hill system.). This is the underlying object with id, value and extensions. The accessor "getMolecularFormula" gives direct access to the value 293 */ 294 public SubstanceDefinitionMoietyComponent setMolecularFormulaElement(StringType value) { 295 this.molecularFormula = value; 296 return this; 297 } 298 299 /** 300 * @return Molecular formula for this moiety of this substance, typically using the Hill system. 301 */ 302 public String getMolecularFormula() { 303 return this.molecularFormula == null ? null : this.molecularFormula.getValue(); 304 } 305 306 /** 307 * @param value Molecular formula for this moiety of this substance, typically using the Hill system. 308 */ 309 public SubstanceDefinitionMoietyComponent setMolecularFormula(String value) { 310 if (Utilities.noString(value)) 311 this.molecularFormula = null; 312 else { 313 if (this.molecularFormula == null) 314 this.molecularFormula = new StringType(); 315 this.molecularFormula.setValue(value); 316 } 317 return this; 318 } 319 320 /** 321 * @return {@link #amount} (Quantitative value for this moiety.) 322 */ 323 public DataType getAmount() { 324 return this.amount; 325 } 326 327 /** 328 * @return {@link #amount} (Quantitative value for this moiety.) 329 */ 330 public Quantity getAmountQuantity() throws FHIRException { 331 if (this.amount == null) 332 this.amount = new Quantity(); 333 if (!(this.amount instanceof Quantity)) 334 throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.amount.getClass().getName()+" was encountered"); 335 return (Quantity) this.amount; 336 } 337 338 public boolean hasAmountQuantity() { 339 return this != null && this.amount instanceof Quantity; 340 } 341 342 /** 343 * @return {@link #amount} (Quantitative value for this moiety.) 344 */ 345 public StringType getAmountStringType() throws FHIRException { 346 if (this.amount == null) 347 this.amount = new StringType(); 348 if (!(this.amount instanceof StringType)) 349 throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.amount.getClass().getName()+" was encountered"); 350 return (StringType) this.amount; 351 } 352 353 public boolean hasAmountStringType() { 354 return this != null && this.amount instanceof StringType; 355 } 356 357 public boolean hasAmount() { 358 return this.amount != null && !this.amount.isEmpty(); 359 } 360 361 /** 362 * @param value {@link #amount} (Quantitative value for this moiety.) 363 */ 364 public SubstanceDefinitionMoietyComponent setAmount(DataType value) { 365 if (value != null && !(value instanceof Quantity || value instanceof StringType)) 366 throw new Error("Not the right type for SubstanceDefinition.moiety.amount[x]: "+value.fhirType()); 367 this.amount = value; 368 return this; 369 } 370 371 /** 372 * @return {@link #measurementType} (The measurement type of the quantitative value. In capturing the actual relative amounts of substances or molecular fragments it may be necessary to indicate whether the amount refers to, for example, a mole ratio or weight ratio.) 373 */ 374 public CodeableConcept getMeasurementType() { 375 if (this.measurementType == null) 376 if (Configuration.errorOnAutoCreate()) 377 throw new Error("Attempt to auto-create SubstanceDefinitionMoietyComponent.measurementType"); 378 else if (Configuration.doAutoCreate()) 379 this.measurementType = new CodeableConcept(); // cc 380 return this.measurementType; 381 } 382 383 public boolean hasMeasurementType() { 384 return this.measurementType != null && !this.measurementType.isEmpty(); 385 } 386 387 /** 388 * @param value {@link #measurementType} (The measurement type of the quantitative value. In capturing the actual relative amounts of substances or molecular fragments it may be necessary to indicate whether the amount refers to, for example, a mole ratio or weight ratio.) 389 */ 390 public SubstanceDefinitionMoietyComponent setMeasurementType(CodeableConcept value) { 391 this.measurementType = value; 392 return this; 393 } 394 395 protected void listChildren(List<Property> children) { 396 super.listChildren(children); 397 children.add(new Property("role", "CodeableConcept", "Role that the moiety is playing.", 0, 1, role)); 398 children.add(new Property("identifier", "Identifier", "Identifier by which this moiety substance is known.", 0, 1, identifier)); 399 children.add(new Property("name", "string", "Textual name for this moiety substance.", 0, 1, name)); 400 children.add(new Property("stereochemistry", "CodeableConcept", "Stereochemistry type.", 0, 1, stereochemistry)); 401 children.add(new Property("opticalActivity", "CodeableConcept", "Optical activity type.", 0, 1, opticalActivity)); 402 children.add(new Property("molecularFormula", "string", "Molecular formula for this moiety of this substance, typically using the Hill system.", 0, 1, molecularFormula)); 403 children.add(new Property("amount[x]", "Quantity|string", "Quantitative value for this moiety.", 0, 1, amount)); 404 children.add(new Property("measurementType", "CodeableConcept", "The measurement type of the quantitative value. In capturing the actual relative amounts of substances or molecular fragments it may be necessary to indicate whether the amount refers to, for example, a mole ratio or weight ratio.", 0, 1, measurementType)); 405 } 406 407 @Override 408 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 409 switch (_hash) { 410 case 3506294: /*role*/ return new Property("role", "CodeableConcept", "Role that the moiety is playing.", 0, 1, role); 411 case -1618432855: /*identifier*/ return new Property("identifier", "Identifier", "Identifier by which this moiety substance is known.", 0, 1, identifier); 412 case 3373707: /*name*/ return new Property("name", "string", "Textual name for this moiety substance.", 0, 1, name); 413 case 263475116: /*stereochemistry*/ return new Property("stereochemistry", "CodeableConcept", "Stereochemistry type.", 0, 1, stereochemistry); 414 case 1420900135: /*opticalActivity*/ return new Property("opticalActivity", "CodeableConcept", "Optical activity type.", 0, 1, opticalActivity); 415 case 616660246: /*molecularFormula*/ return new Property("molecularFormula", "string", "Molecular formula for this moiety of this substance, typically using the Hill system.", 0, 1, molecularFormula); 416 case 646780200: /*amount[x]*/ return new Property("amount[x]", "Quantity|string", "Quantitative value for this moiety.", 0, 1, amount); 417 case -1413853096: /*amount*/ return new Property("amount[x]", "Quantity|string", "Quantitative value for this moiety.", 0, 1, amount); 418 case 1664303363: /*amountQuantity*/ return new Property("amount[x]", "Quantity", "Quantitative value for this moiety.", 0, 1, amount); 419 case 773651081: /*amountString*/ return new Property("amount[x]", "string", "Quantitative value for this moiety.", 0, 1, amount); 420 case 1670291734: /*measurementType*/ return new Property("measurementType", "CodeableConcept", "The measurement type of the quantitative value. In capturing the actual relative amounts of substances or molecular fragments it may be necessary to indicate whether the amount refers to, for example, a mole ratio or weight ratio.", 0, 1, measurementType); 421 default: return super.getNamedProperty(_hash, _name, _checkValid); 422 } 423 424 } 425 426 @Override 427 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 428 switch (hash) { 429 case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept 430 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier 431 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 432 case 263475116: /*stereochemistry*/ return this.stereochemistry == null ? new Base[0] : new Base[] {this.stereochemistry}; // CodeableConcept 433 case 1420900135: /*opticalActivity*/ return this.opticalActivity == null ? new Base[0] : new Base[] {this.opticalActivity}; // CodeableConcept 434 case 616660246: /*molecularFormula*/ return this.molecularFormula == null ? new Base[0] : new Base[] {this.molecularFormula}; // StringType 435 case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // DataType 436 case 1670291734: /*measurementType*/ return this.measurementType == null ? new Base[0] : new Base[] {this.measurementType}; // CodeableConcept 437 default: return super.getProperty(hash, name, checkValid); 438 } 439 440 } 441 442 @Override 443 public Base setProperty(int hash, String name, Base value) throws FHIRException { 444 switch (hash) { 445 case 3506294: // role 446 this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 447 return value; 448 case -1618432855: // identifier 449 this.identifier = TypeConvertor.castToIdentifier(value); // Identifier 450 return value; 451 case 3373707: // name 452 this.name = TypeConvertor.castToString(value); // StringType 453 return value; 454 case 263475116: // stereochemistry 455 this.stereochemistry = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 456 return value; 457 case 1420900135: // opticalActivity 458 this.opticalActivity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 459 return value; 460 case 616660246: // molecularFormula 461 this.molecularFormula = TypeConvertor.castToString(value); // StringType 462 return value; 463 case -1413853096: // amount 464 this.amount = TypeConvertor.castToType(value); // DataType 465 return value; 466 case 1670291734: // measurementType 467 this.measurementType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 468 return value; 469 default: return super.setProperty(hash, name, value); 470 } 471 472 } 473 474 @Override 475 public Base setProperty(String name, Base value) throws FHIRException { 476 if (name.equals("role")) { 477 this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 478 } else if (name.equals("identifier")) { 479 this.identifier = TypeConvertor.castToIdentifier(value); // Identifier 480 } else if (name.equals("name")) { 481 this.name = TypeConvertor.castToString(value); // StringType 482 } else if (name.equals("stereochemistry")) { 483 this.stereochemistry = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 484 } else if (name.equals("opticalActivity")) { 485 this.opticalActivity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 486 } else if (name.equals("molecularFormula")) { 487 this.molecularFormula = TypeConvertor.castToString(value); // StringType 488 } else if (name.equals("amount[x]")) { 489 this.amount = TypeConvertor.castToType(value); // DataType 490 } else if (name.equals("measurementType")) { 491 this.measurementType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 492 } else 493 return super.setProperty(name, value); 494 return value; 495 } 496 497 @Override 498 public Base makeProperty(int hash, String name) throws FHIRException { 499 switch (hash) { 500 case 3506294: return getRole(); 501 case -1618432855: return getIdentifier(); 502 case 3373707: return getNameElement(); 503 case 263475116: return getStereochemistry(); 504 case 1420900135: return getOpticalActivity(); 505 case 616660246: return getMolecularFormulaElement(); 506 case 646780200: return getAmount(); 507 case -1413853096: return getAmount(); 508 case 1670291734: return getMeasurementType(); 509 default: return super.makeProperty(hash, name); 510 } 511 512 } 513 514 @Override 515 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 516 switch (hash) { 517 case 3506294: /*role*/ return new String[] {"CodeableConcept"}; 518 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 519 case 3373707: /*name*/ return new String[] {"string"}; 520 case 263475116: /*stereochemistry*/ return new String[] {"CodeableConcept"}; 521 case 1420900135: /*opticalActivity*/ return new String[] {"CodeableConcept"}; 522 case 616660246: /*molecularFormula*/ return new String[] {"string"}; 523 case -1413853096: /*amount*/ return new String[] {"Quantity", "string"}; 524 case 1670291734: /*measurementType*/ return new String[] {"CodeableConcept"}; 525 default: return super.getTypesForProperty(hash, name); 526 } 527 528 } 529 530 @Override 531 public Base addChild(String name) throws FHIRException { 532 if (name.equals("role")) { 533 this.role = new CodeableConcept(); 534 return this.role; 535 } 536 else if (name.equals("identifier")) { 537 this.identifier = new Identifier(); 538 return this.identifier; 539 } 540 else if (name.equals("name")) { 541 throw new FHIRException("Cannot call addChild on a primitive type SubstanceDefinition.moiety.name"); 542 } 543 else if (name.equals("stereochemistry")) { 544 this.stereochemistry = new CodeableConcept(); 545 return this.stereochemistry; 546 } 547 else if (name.equals("opticalActivity")) { 548 this.opticalActivity = new CodeableConcept(); 549 return this.opticalActivity; 550 } 551 else if (name.equals("molecularFormula")) { 552 throw new FHIRException("Cannot call addChild on a primitive type SubstanceDefinition.moiety.molecularFormula"); 553 } 554 else if (name.equals("amountQuantity")) { 555 this.amount = new Quantity(); 556 return this.amount; 557 } 558 else if (name.equals("amountString")) { 559 this.amount = new StringType(); 560 return this.amount; 561 } 562 else if (name.equals("measurementType")) { 563 this.measurementType = new CodeableConcept(); 564 return this.measurementType; 565 } 566 else 567 return super.addChild(name); 568 } 569 570 public SubstanceDefinitionMoietyComponent copy() { 571 SubstanceDefinitionMoietyComponent dst = new SubstanceDefinitionMoietyComponent(); 572 copyValues(dst); 573 return dst; 574 } 575 576 public void copyValues(SubstanceDefinitionMoietyComponent dst) { 577 super.copyValues(dst); 578 dst.role = role == null ? null : role.copy(); 579 dst.identifier = identifier == null ? null : identifier.copy(); 580 dst.name = name == null ? null : name.copy(); 581 dst.stereochemistry = stereochemistry == null ? null : stereochemistry.copy(); 582 dst.opticalActivity = opticalActivity == null ? null : opticalActivity.copy(); 583 dst.molecularFormula = molecularFormula == null ? null : molecularFormula.copy(); 584 dst.amount = amount == null ? null : amount.copy(); 585 dst.measurementType = measurementType == null ? null : measurementType.copy(); 586 } 587 588 @Override 589 public boolean equalsDeep(Base other_) { 590 if (!super.equalsDeep(other_)) 591 return false; 592 if (!(other_ instanceof SubstanceDefinitionMoietyComponent)) 593 return false; 594 SubstanceDefinitionMoietyComponent o = (SubstanceDefinitionMoietyComponent) other_; 595 return compareDeep(role, o.role, true) && compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) 596 && compareDeep(stereochemistry, o.stereochemistry, true) && compareDeep(opticalActivity, o.opticalActivity, true) 597 && compareDeep(molecularFormula, o.molecularFormula, true) && compareDeep(amount, o.amount, true) 598 && compareDeep(measurementType, o.measurementType, true); 599 } 600 601 @Override 602 public boolean equalsShallow(Base other_) { 603 if (!super.equalsShallow(other_)) 604 return false; 605 if (!(other_ instanceof SubstanceDefinitionMoietyComponent)) 606 return false; 607 SubstanceDefinitionMoietyComponent o = (SubstanceDefinitionMoietyComponent) other_; 608 return compareValues(name, o.name, true) && compareValues(molecularFormula, o.molecularFormula, true) 609 ; 610 } 611 612 public boolean isEmpty() { 613 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(role, identifier, name, stereochemistry 614 , opticalActivity, molecularFormula, amount, measurementType); 615 } 616 617 public String fhirType() { 618 return "SubstanceDefinition.moiety"; 619 620 } 621 622 } 623 624 @Block() 625 public static class SubstanceDefinitionPropertyComponent extends BackboneElement implements IBaseBackboneElement { 626 /** 627 * A code expressing the type of property. 628 */ 629 @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) 630 @Description(shortDefinition="A code expressing the type of property", formalDefinition="A code expressing the type of property." ) 631 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/product-characteristic-codes") 632 protected CodeableConcept type; 633 634 /** 635 * A value for the property. 636 */ 637 @Child(name = "value", type = {CodeableConcept.class, Quantity.class, DateType.class, BooleanType.class, Attachment.class}, order=2, min=0, max=1, modifier=false, summary=true) 638 @Description(shortDefinition="A value for the property", formalDefinition="A value for the property." ) 639 protected DataType value; 640 641 private static final long serialVersionUID = -1659186716L; 642 643 /** 644 * Constructor 645 */ 646 public SubstanceDefinitionPropertyComponent() { 647 super(); 648 } 649 650 /** 651 * Constructor 652 */ 653 public SubstanceDefinitionPropertyComponent(CodeableConcept type) { 654 super(); 655 this.setType(type); 656 } 657 658 /** 659 * @return {@link #type} (A code expressing the type of property.) 660 */ 661 public CodeableConcept getType() { 662 if (this.type == null) 663 if (Configuration.errorOnAutoCreate()) 664 throw new Error("Attempt to auto-create SubstanceDefinitionPropertyComponent.type"); 665 else if (Configuration.doAutoCreate()) 666 this.type = new CodeableConcept(); // cc 667 return this.type; 668 } 669 670 public boolean hasType() { 671 return this.type != null && !this.type.isEmpty(); 672 } 673 674 /** 675 * @param value {@link #type} (A code expressing the type of property.) 676 */ 677 public SubstanceDefinitionPropertyComponent setType(CodeableConcept value) { 678 this.type = value; 679 return this; 680 } 681 682 /** 683 * @return {@link #value} (A value for the property.) 684 */ 685 public DataType getValue() { 686 return this.value; 687 } 688 689 /** 690 * @return {@link #value} (A value for the property.) 691 */ 692 public CodeableConcept getValueCodeableConcept() throws FHIRException { 693 if (this.value == null) 694 this.value = new CodeableConcept(); 695 if (!(this.value instanceof CodeableConcept)) 696 throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); 697 return (CodeableConcept) this.value; 698 } 699 700 public boolean hasValueCodeableConcept() { 701 return this != null && this.value instanceof CodeableConcept; 702 } 703 704 /** 705 * @return {@link #value} (A value for the property.) 706 */ 707 public Quantity getValueQuantity() throws FHIRException { 708 if (this.value == null) 709 this.value = new Quantity(); 710 if (!(this.value instanceof Quantity)) 711 throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); 712 return (Quantity) this.value; 713 } 714 715 public boolean hasValueQuantity() { 716 return this != null && this.value instanceof Quantity; 717 } 718 719 /** 720 * @return {@link #value} (A value for the property.) 721 */ 722 public DateType getValueDateType() throws FHIRException { 723 if (this.value == null) 724 this.value = new DateType(); 725 if (!(this.value instanceof DateType)) 726 throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered"); 727 return (DateType) this.value; 728 } 729 730 public boolean hasValueDateType() { 731 return this != null && this.value instanceof DateType; 732 } 733 734 /** 735 * @return {@link #value} (A value for the property.) 736 */ 737 public BooleanType getValueBooleanType() throws FHIRException { 738 if (this.value == null) 739 this.value = new BooleanType(); 740 if (!(this.value instanceof BooleanType)) 741 throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); 742 return (BooleanType) this.value; 743 } 744 745 public boolean hasValueBooleanType() { 746 return this != null && this.value instanceof BooleanType; 747 } 748 749 /** 750 * @return {@link #value} (A value for the property.) 751 */ 752 public Attachment getValueAttachment() throws FHIRException { 753 if (this.value == null) 754 this.value = new Attachment(); 755 if (!(this.value instanceof Attachment)) 756 throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); 757 return (Attachment) this.value; 758 } 759 760 public boolean hasValueAttachment() { 761 return this != null && this.value instanceof Attachment; 762 } 763 764 public boolean hasValue() { 765 return this.value != null && !this.value.isEmpty(); 766 } 767 768 /** 769 * @param value {@link #value} (A value for the property.) 770 */ 771 public SubstanceDefinitionPropertyComponent setValue(DataType value) { 772 if (value != null && !(value instanceof CodeableConcept || value instanceof Quantity || value instanceof DateType || value instanceof BooleanType || value instanceof Attachment)) 773 throw new Error("Not the right type for SubstanceDefinition.property.value[x]: "+value.fhirType()); 774 this.value = value; 775 return this; 776 } 777 778 protected void listChildren(List<Property> children) { 779 super.listChildren(children); 780 children.add(new Property("type", "CodeableConcept", "A code expressing the type of property.", 0, 1, type)); 781 children.add(new Property("value[x]", "CodeableConcept|Quantity|date|boolean|Attachment", "A value for the property.", 0, 1, value)); 782 } 783 784 @Override 785 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 786 switch (_hash) { 787 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "A code expressing the type of property.", 0, 1, type); 788 case -1410166417: /*value[x]*/ return new Property("value[x]", "CodeableConcept|Quantity|date|boolean|Attachment", "A value for the property.", 0, 1, value); 789 case 111972721: /*value*/ return new Property("value[x]", "CodeableConcept|Quantity|date|boolean|Attachment", "A value for the property.", 0, 1, value); 790 case 924902896: /*valueCodeableConcept*/ return new Property("value[x]", "CodeableConcept", "A value for the property.", 0, 1, value); 791 case -2029823716: /*valueQuantity*/ return new Property("value[x]", "Quantity", "A value for the property.", 0, 1, value); 792 case -766192449: /*valueDate*/ return new Property("value[x]", "date", "A value for the property.", 0, 1, value); 793 case 733421943: /*valueBoolean*/ return new Property("value[x]", "boolean", "A value for the property.", 0, 1, value); 794 case -475566732: /*valueAttachment*/ return new Property("value[x]", "Attachment", "A value for the property.", 0, 1, value); 795 default: return super.getNamedProperty(_hash, _name, _checkValid); 796 } 797 798 } 799 800 @Override 801 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 802 switch (hash) { 803 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 804 case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType 805 default: return super.getProperty(hash, name, checkValid); 806 } 807 808 } 809 810 @Override 811 public Base setProperty(int hash, String name, Base value) throws FHIRException { 812 switch (hash) { 813 case 3575610: // type 814 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 815 return value; 816 case 111972721: // value 817 this.value = TypeConvertor.castToType(value); // DataType 818 return value; 819 default: return super.setProperty(hash, name, value); 820 } 821 822 } 823 824 @Override 825 public Base setProperty(String name, Base value) throws FHIRException { 826 if (name.equals("type")) { 827 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 828 } else if (name.equals("value[x]")) { 829 this.value = TypeConvertor.castToType(value); // DataType 830 } else 831 return super.setProperty(name, value); 832 return value; 833 } 834 835 @Override 836 public Base makeProperty(int hash, String name) throws FHIRException { 837 switch (hash) { 838 case 3575610: return getType(); 839 case -1410166417: return getValue(); 840 case 111972721: return getValue(); 841 default: return super.makeProperty(hash, name); 842 } 843 844 } 845 846 @Override 847 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 848 switch (hash) { 849 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 850 case 111972721: /*value*/ return new String[] {"CodeableConcept", "Quantity", "date", "boolean", "Attachment"}; 851 default: return super.getTypesForProperty(hash, name); 852 } 853 854 } 855 856 @Override 857 public Base addChild(String name) throws FHIRException { 858 if (name.equals("type")) { 859 this.type = new CodeableConcept(); 860 return this.type; 861 } 862 else if (name.equals("valueCodeableConcept")) { 863 this.value = new CodeableConcept(); 864 return this.value; 865 } 866 else if (name.equals("valueQuantity")) { 867 this.value = new Quantity(); 868 return this.value; 869 } 870 else if (name.equals("valueDate")) { 871 this.value = new DateType(); 872 return this.value; 873 } 874 else if (name.equals("valueBoolean")) { 875 this.value = new BooleanType(); 876 return this.value; 877 } 878 else if (name.equals("valueAttachment")) { 879 this.value = new Attachment(); 880 return this.value; 881 } 882 else 883 return super.addChild(name); 884 } 885 886 public SubstanceDefinitionPropertyComponent copy() { 887 SubstanceDefinitionPropertyComponent dst = new SubstanceDefinitionPropertyComponent(); 888 copyValues(dst); 889 return dst; 890 } 891 892 public void copyValues(SubstanceDefinitionPropertyComponent dst) { 893 super.copyValues(dst); 894 dst.type = type == null ? null : type.copy(); 895 dst.value = value == null ? null : value.copy(); 896 } 897 898 @Override 899 public boolean equalsDeep(Base other_) { 900 if (!super.equalsDeep(other_)) 901 return false; 902 if (!(other_ instanceof SubstanceDefinitionPropertyComponent)) 903 return false; 904 SubstanceDefinitionPropertyComponent o = (SubstanceDefinitionPropertyComponent) other_; 905 return compareDeep(type, o.type, true) && compareDeep(value, o.value, true); 906 } 907 908 @Override 909 public boolean equalsShallow(Base other_) { 910 if (!super.equalsShallow(other_)) 911 return false; 912 if (!(other_ instanceof SubstanceDefinitionPropertyComponent)) 913 return false; 914 SubstanceDefinitionPropertyComponent o = (SubstanceDefinitionPropertyComponent) other_; 915 return true; 916 } 917 918 public boolean isEmpty() { 919 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value); 920 } 921 922 public String fhirType() { 923 return "SubstanceDefinition.property"; 924 925 } 926 927 } 928 929 @Block() 930 public static class SubstanceDefinitionMolecularWeightComponent extends BackboneElement implements IBaseBackboneElement { 931 /** 932 * The method by which the molecular weight was determined. 933 */ 934 @Child(name = "method", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 935 @Description(shortDefinition="The method by which the weight was determined", formalDefinition="The method by which the molecular weight was determined." ) 936 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-weight-method") 937 protected CodeableConcept method; 938 939 /** 940 * Type of molecular weight such as exact, average (also known as. number average), weight average. 941 */ 942 @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 943 @Description(shortDefinition="Type of molecular weight e.g. exact, average, weight average", formalDefinition="Type of molecular weight such as exact, average (also known as. number average), weight average." ) 944 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-weight-type") 945 protected CodeableConcept type; 946 947 /** 948 * Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field. 949 */ 950 @Child(name = "amount", type = {Quantity.class}, order=3, min=1, max=1, modifier=false, summary=true) 951 @Description(shortDefinition="Used to capture quantitative values for a variety of elements", formalDefinition="Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field." ) 952 protected Quantity amount; 953 954 private static final long serialVersionUID = 805939780L; 955 956 /** 957 * Constructor 958 */ 959 public SubstanceDefinitionMolecularWeightComponent() { 960 super(); 961 } 962 963 /** 964 * Constructor 965 */ 966 public SubstanceDefinitionMolecularWeightComponent(Quantity amount) { 967 super(); 968 this.setAmount(amount); 969 } 970 971 /** 972 * @return {@link #method} (The method by which the molecular weight was determined.) 973 */ 974 public CodeableConcept getMethod() { 975 if (this.method == null) 976 if (Configuration.errorOnAutoCreate()) 977 throw new Error("Attempt to auto-create SubstanceDefinitionMolecularWeightComponent.method"); 978 else if (Configuration.doAutoCreate()) 979 this.method = new CodeableConcept(); // cc 980 return this.method; 981 } 982 983 public boolean hasMethod() { 984 return this.method != null && !this.method.isEmpty(); 985 } 986 987 /** 988 * @param value {@link #method} (The method by which the molecular weight was determined.) 989 */ 990 public SubstanceDefinitionMolecularWeightComponent setMethod(CodeableConcept value) { 991 this.method = value; 992 return this; 993 } 994 995 /** 996 * @return {@link #type} (Type of molecular weight such as exact, average (also known as. number average), weight average.) 997 */ 998 public CodeableConcept getType() { 999 if (this.type == null) 1000 if (Configuration.errorOnAutoCreate()) 1001 throw new Error("Attempt to auto-create SubstanceDefinitionMolecularWeightComponent.type"); 1002 else if (Configuration.doAutoCreate()) 1003 this.type = new CodeableConcept(); // cc 1004 return this.type; 1005 } 1006 1007 public boolean hasType() { 1008 return this.type != null && !this.type.isEmpty(); 1009 } 1010 1011 /** 1012 * @param value {@link #type} (Type of molecular weight such as exact, average (also known as. number average), weight average.) 1013 */ 1014 public SubstanceDefinitionMolecularWeightComponent setType(CodeableConcept value) { 1015 this.type = value; 1016 return this; 1017 } 1018 1019 /** 1020 * @return {@link #amount} (Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field.) 1021 */ 1022 public Quantity getAmount() { 1023 if (this.amount == null) 1024 if (Configuration.errorOnAutoCreate()) 1025 throw new Error("Attempt to auto-create SubstanceDefinitionMolecularWeightComponent.amount"); 1026 else if (Configuration.doAutoCreate()) 1027 this.amount = new Quantity(); // cc 1028 return this.amount; 1029 } 1030 1031 public boolean hasAmount() { 1032 return this.amount != null && !this.amount.isEmpty(); 1033 } 1034 1035 /** 1036 * @param value {@link #amount} (Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field.) 1037 */ 1038 public SubstanceDefinitionMolecularWeightComponent setAmount(Quantity value) { 1039 this.amount = value; 1040 return this; 1041 } 1042 1043 protected void listChildren(List<Property> children) { 1044 super.listChildren(children); 1045 children.add(new Property("method", "CodeableConcept", "The method by which the molecular weight was determined.", 0, 1, method)); 1046 children.add(new Property("type", "CodeableConcept", "Type of molecular weight such as exact, average (also known as. number average), weight average.", 0, 1, type)); 1047 children.add(new Property("amount", "Quantity", "Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field.", 0, 1, amount)); 1048 } 1049 1050 @Override 1051 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1052 switch (_hash) { 1053 case -1077554975: /*method*/ return new Property("method", "CodeableConcept", "The method by which the molecular weight was determined.", 0, 1, method); 1054 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "Type of molecular weight such as exact, average (also known as. number average), weight average.", 0, 1, type); 1055 case -1413853096: /*amount*/ return new Property("amount", "Quantity", "Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field.", 0, 1, amount); 1056 default: return super.getNamedProperty(_hash, _name, _checkValid); 1057 } 1058 1059 } 1060 1061 @Override 1062 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1063 switch (hash) { 1064 case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept 1065 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 1066 case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Quantity 1067 default: return super.getProperty(hash, name, checkValid); 1068 } 1069 1070 } 1071 1072 @Override 1073 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1074 switch (hash) { 1075 case -1077554975: // method 1076 this.method = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1077 return value; 1078 case 3575610: // type 1079 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1080 return value; 1081 case -1413853096: // amount 1082 this.amount = TypeConvertor.castToQuantity(value); // Quantity 1083 return value; 1084 default: return super.setProperty(hash, name, value); 1085 } 1086 1087 } 1088 1089 @Override 1090 public Base setProperty(String name, Base value) throws FHIRException { 1091 if (name.equals("method")) { 1092 this.method = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1093 } else if (name.equals("type")) { 1094 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1095 } else if (name.equals("amount")) { 1096 this.amount = TypeConvertor.castToQuantity(value); // Quantity 1097 } else 1098 return super.setProperty(name, value); 1099 return value; 1100 } 1101 1102 @Override 1103 public Base makeProperty(int hash, String name) throws FHIRException { 1104 switch (hash) { 1105 case -1077554975: return getMethod(); 1106 case 3575610: return getType(); 1107 case -1413853096: return getAmount(); 1108 default: return super.makeProperty(hash, name); 1109 } 1110 1111 } 1112 1113 @Override 1114 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1115 switch (hash) { 1116 case -1077554975: /*method*/ return new String[] {"CodeableConcept"}; 1117 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 1118 case -1413853096: /*amount*/ return new String[] {"Quantity"}; 1119 default: return super.getTypesForProperty(hash, name); 1120 } 1121 1122 } 1123 1124 @Override 1125 public Base addChild(String name) throws FHIRException { 1126 if (name.equals("method")) { 1127 this.method = new CodeableConcept(); 1128 return this.method; 1129 } 1130 else if (name.equals("type")) { 1131 this.type = new CodeableConcept(); 1132 return this.type; 1133 } 1134 else if (name.equals("amount")) { 1135 this.amount = new Quantity(); 1136 return this.amount; 1137 } 1138 else 1139 return super.addChild(name); 1140 } 1141 1142 public SubstanceDefinitionMolecularWeightComponent copy() { 1143 SubstanceDefinitionMolecularWeightComponent dst = new SubstanceDefinitionMolecularWeightComponent(); 1144 copyValues(dst); 1145 return dst; 1146 } 1147 1148 public void copyValues(SubstanceDefinitionMolecularWeightComponent dst) { 1149 super.copyValues(dst); 1150 dst.method = method == null ? null : method.copy(); 1151 dst.type = type == null ? null : type.copy(); 1152 dst.amount = amount == null ? null : amount.copy(); 1153 } 1154 1155 @Override 1156 public boolean equalsDeep(Base other_) { 1157 if (!super.equalsDeep(other_)) 1158 return false; 1159 if (!(other_ instanceof SubstanceDefinitionMolecularWeightComponent)) 1160 return false; 1161 SubstanceDefinitionMolecularWeightComponent o = (SubstanceDefinitionMolecularWeightComponent) other_; 1162 return compareDeep(method, o.method, true) && compareDeep(type, o.type, true) && compareDeep(amount, o.amount, true) 1163 ; 1164 } 1165 1166 @Override 1167 public boolean equalsShallow(Base other_) { 1168 if (!super.equalsShallow(other_)) 1169 return false; 1170 if (!(other_ instanceof SubstanceDefinitionMolecularWeightComponent)) 1171 return false; 1172 SubstanceDefinitionMolecularWeightComponent o = (SubstanceDefinitionMolecularWeightComponent) other_; 1173 return true; 1174 } 1175 1176 public boolean isEmpty() { 1177 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(method, type, amount); 1178 } 1179 1180 public String fhirType() { 1181 return "SubstanceDefinition.molecularWeight"; 1182 1183 } 1184 1185 } 1186 1187 @Block() 1188 public static class SubstanceDefinitionStructureComponent extends BackboneElement implements IBaseBackboneElement { 1189 /** 1190 * Stereochemistry type. 1191 */ 1192 @Child(name = "stereochemistry", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 1193 @Description(shortDefinition="Stereochemistry type", formalDefinition="Stereochemistry type." ) 1194 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-stereochemistry") 1195 protected CodeableConcept stereochemistry; 1196 1197 /** 1198 * Optical activity type. 1199 */ 1200 @Child(name = "opticalActivity", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 1201 @Description(shortDefinition="Optical activity type", formalDefinition="Optical activity type." ) 1202 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-optical-activity") 1203 protected CodeableConcept opticalActivity; 1204 1205 /** 1206 * Molecular formula of this substance, typically using the Hill system. 1207 */ 1208 @Child(name = "molecularFormula", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) 1209 @Description(shortDefinition="Molecular formula (e.g. using the Hill system)", formalDefinition="Molecular formula of this substance, typically using the Hill system." ) 1210 protected StringType molecularFormula; 1211 1212 /** 1213 * Specified per moiety according to the Hill system, i.e. first C, then H, then alphabetical, each moiety separated by a dot. 1214 */ 1215 @Child(name = "molecularFormulaByMoiety", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) 1216 @Description(shortDefinition="Specified per moiety according to the Hill system", formalDefinition="Specified per moiety according to the Hill system, i.e. first C, then H, then alphabetical, each moiety separated by a dot." ) 1217 protected StringType molecularFormulaByMoiety; 1218 1219 /** 1220 * The molecular weight or weight range (for proteins, polymers or nucleic acids). 1221 */ 1222 @Child(name = "molecularWeight", type = {SubstanceDefinitionMolecularWeightComponent.class}, order=5, min=0, max=1, modifier=false, summary=true) 1223 @Description(shortDefinition="The molecular weight or weight range", formalDefinition="The molecular weight or weight range (for proteins, polymers or nucleic acids)." ) 1224 protected SubstanceDefinitionMolecularWeightComponent molecularWeight; 1225 1226 /** 1227 * The method used to elucidate the structure or characterization of the drug substance. Examples: X-ray, HPLC, NMR, Peptide mapping, Ligand binding assay. 1228 */ 1229 @Child(name = "technique", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1230 @Description(shortDefinition="The method used to find the structure e.g. X-ray, NMR", formalDefinition="The method used to elucidate the structure or characterization of the drug substance. Examples: X-ray, HPLC, NMR, Peptide mapping, Ligand binding assay." ) 1231 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-structure-technique") 1232 protected List<CodeableConcept> technique; 1233 1234 /** 1235 * The source of information about the structure. 1236 */ 1237 @Child(name = "sourceDocument", type = {DocumentReference.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1238 @Description(shortDefinition="Source of information for the structure", formalDefinition="The source of information about the structure." ) 1239 protected List<Reference> sourceDocument; 1240 1241 /** 1242 * A depiction of the structure or characterization of the substance. 1243 */ 1244 @Child(name = "representation", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1245 @Description(shortDefinition="A depiction of the structure or characterization of the substance", formalDefinition="A depiction of the structure or characterization of the substance." ) 1246 protected List<SubstanceDefinitionStructureRepresentationComponent> representation; 1247 1248 private static final long serialVersionUID = -2137814144L; 1249 1250 /** 1251 * Constructor 1252 */ 1253 public SubstanceDefinitionStructureComponent() { 1254 super(); 1255 } 1256 1257 /** 1258 * @return {@link #stereochemistry} (Stereochemistry type.) 1259 */ 1260 public CodeableConcept getStereochemistry() { 1261 if (this.stereochemistry == null) 1262 if (Configuration.errorOnAutoCreate()) 1263 throw new Error("Attempt to auto-create SubstanceDefinitionStructureComponent.stereochemistry"); 1264 else if (Configuration.doAutoCreate()) 1265 this.stereochemistry = new CodeableConcept(); // cc 1266 return this.stereochemistry; 1267 } 1268 1269 public boolean hasStereochemistry() { 1270 return this.stereochemistry != null && !this.stereochemistry.isEmpty(); 1271 } 1272 1273 /** 1274 * @param value {@link #stereochemistry} (Stereochemistry type.) 1275 */ 1276 public SubstanceDefinitionStructureComponent setStereochemistry(CodeableConcept value) { 1277 this.stereochemistry = value; 1278 return this; 1279 } 1280 1281 /** 1282 * @return {@link #opticalActivity} (Optical activity type.) 1283 */ 1284 public CodeableConcept getOpticalActivity() { 1285 if (this.opticalActivity == null) 1286 if (Configuration.errorOnAutoCreate()) 1287 throw new Error("Attempt to auto-create SubstanceDefinitionStructureComponent.opticalActivity"); 1288 else if (Configuration.doAutoCreate()) 1289 this.opticalActivity = new CodeableConcept(); // cc 1290 return this.opticalActivity; 1291 } 1292 1293 public boolean hasOpticalActivity() { 1294 return this.opticalActivity != null && !this.opticalActivity.isEmpty(); 1295 } 1296 1297 /** 1298 * @param value {@link #opticalActivity} (Optical activity type.) 1299 */ 1300 public SubstanceDefinitionStructureComponent setOpticalActivity(CodeableConcept value) { 1301 this.opticalActivity = value; 1302 return this; 1303 } 1304 1305 /** 1306 * @return {@link #molecularFormula} (Molecular formula of this substance, typically using the Hill system.). This is the underlying object with id, value and extensions. The accessor "getMolecularFormula" gives direct access to the value 1307 */ 1308 public StringType getMolecularFormulaElement() { 1309 if (this.molecularFormula == null) 1310 if (Configuration.errorOnAutoCreate()) 1311 throw new Error("Attempt to auto-create SubstanceDefinitionStructureComponent.molecularFormula"); 1312 else if (Configuration.doAutoCreate()) 1313 this.molecularFormula = new StringType(); // bb 1314 return this.molecularFormula; 1315 } 1316 1317 public boolean hasMolecularFormulaElement() { 1318 return this.molecularFormula != null && !this.molecularFormula.isEmpty(); 1319 } 1320 1321 public boolean hasMolecularFormula() { 1322 return this.molecularFormula != null && !this.molecularFormula.isEmpty(); 1323 } 1324 1325 /** 1326 * @param value {@link #molecularFormula} (Molecular formula of this substance, typically using the Hill system.). This is the underlying object with id, value and extensions. The accessor "getMolecularFormula" gives direct access to the value 1327 */ 1328 public SubstanceDefinitionStructureComponent setMolecularFormulaElement(StringType value) { 1329 this.molecularFormula = value; 1330 return this; 1331 } 1332 1333 /** 1334 * @return Molecular formula of this substance, typically using the Hill system. 1335 */ 1336 public String getMolecularFormula() { 1337 return this.molecularFormula == null ? null : this.molecularFormula.getValue(); 1338 } 1339 1340 /** 1341 * @param value Molecular formula of this substance, typically using the Hill system. 1342 */ 1343 public SubstanceDefinitionStructureComponent setMolecularFormula(String value) { 1344 if (Utilities.noString(value)) 1345 this.molecularFormula = null; 1346 else { 1347 if (this.molecularFormula == null) 1348 this.molecularFormula = new StringType(); 1349 this.molecularFormula.setValue(value); 1350 } 1351 return this; 1352 } 1353 1354 /** 1355 * @return {@link #molecularFormulaByMoiety} (Specified per moiety according to the Hill system, i.e. first C, then H, then alphabetical, each moiety separated by a dot.). This is the underlying object with id, value and extensions. The accessor "getMolecularFormulaByMoiety" gives direct access to the value 1356 */ 1357 public StringType getMolecularFormulaByMoietyElement() { 1358 if (this.molecularFormulaByMoiety == null) 1359 if (Configuration.errorOnAutoCreate()) 1360 throw new Error("Attempt to auto-create SubstanceDefinitionStructureComponent.molecularFormulaByMoiety"); 1361 else if (Configuration.doAutoCreate()) 1362 this.molecularFormulaByMoiety = new StringType(); // bb 1363 return this.molecularFormulaByMoiety; 1364 } 1365 1366 public boolean hasMolecularFormulaByMoietyElement() { 1367 return this.molecularFormulaByMoiety != null && !this.molecularFormulaByMoiety.isEmpty(); 1368 } 1369 1370 public boolean hasMolecularFormulaByMoiety() { 1371 return this.molecularFormulaByMoiety != null && !this.molecularFormulaByMoiety.isEmpty(); 1372 } 1373 1374 /** 1375 * @param value {@link #molecularFormulaByMoiety} (Specified per moiety according to the Hill system, i.e. first C, then H, then alphabetical, each moiety separated by a dot.). This is the underlying object with id, value and extensions. The accessor "getMolecularFormulaByMoiety" gives direct access to the value 1376 */ 1377 public SubstanceDefinitionStructureComponent setMolecularFormulaByMoietyElement(StringType value) { 1378 this.molecularFormulaByMoiety = value; 1379 return this; 1380 } 1381 1382 /** 1383 * @return Specified per moiety according to the Hill system, i.e. first C, then H, then alphabetical, each moiety separated by a dot. 1384 */ 1385 public String getMolecularFormulaByMoiety() { 1386 return this.molecularFormulaByMoiety == null ? null : this.molecularFormulaByMoiety.getValue(); 1387 } 1388 1389 /** 1390 * @param value Specified per moiety according to the Hill system, i.e. first C, then H, then alphabetical, each moiety separated by a dot. 1391 */ 1392 public SubstanceDefinitionStructureComponent setMolecularFormulaByMoiety(String value) { 1393 if (Utilities.noString(value)) 1394 this.molecularFormulaByMoiety = null; 1395 else { 1396 if (this.molecularFormulaByMoiety == null) 1397 this.molecularFormulaByMoiety = new StringType(); 1398 this.molecularFormulaByMoiety.setValue(value); 1399 } 1400 return this; 1401 } 1402 1403 /** 1404 * @return {@link #molecularWeight} (The molecular weight or weight range (for proteins, polymers or nucleic acids).) 1405 */ 1406 public SubstanceDefinitionMolecularWeightComponent getMolecularWeight() { 1407 if (this.molecularWeight == null) 1408 if (Configuration.errorOnAutoCreate()) 1409 throw new Error("Attempt to auto-create SubstanceDefinitionStructureComponent.molecularWeight"); 1410 else if (Configuration.doAutoCreate()) 1411 this.molecularWeight = new SubstanceDefinitionMolecularWeightComponent(); // cc 1412 return this.molecularWeight; 1413 } 1414 1415 public boolean hasMolecularWeight() { 1416 return this.molecularWeight != null && !this.molecularWeight.isEmpty(); 1417 } 1418 1419 /** 1420 * @param value {@link #molecularWeight} (The molecular weight or weight range (for proteins, polymers or nucleic acids).) 1421 */ 1422 public SubstanceDefinitionStructureComponent setMolecularWeight(SubstanceDefinitionMolecularWeightComponent value) { 1423 this.molecularWeight = value; 1424 return this; 1425 } 1426 1427 /** 1428 * @return {@link #technique} (The method used to elucidate the structure or characterization of the drug substance. Examples: X-ray, HPLC, NMR, Peptide mapping, Ligand binding assay.) 1429 */ 1430 public List<CodeableConcept> getTechnique() { 1431 if (this.technique == null) 1432 this.technique = new ArrayList<CodeableConcept>(); 1433 return this.technique; 1434 } 1435 1436 /** 1437 * @return Returns a reference to <code>this</code> for easy method chaining 1438 */ 1439 public SubstanceDefinitionStructureComponent setTechnique(List<CodeableConcept> theTechnique) { 1440 this.technique = theTechnique; 1441 return this; 1442 } 1443 1444 public boolean hasTechnique() { 1445 if (this.technique == null) 1446 return false; 1447 for (CodeableConcept item : this.technique) 1448 if (!item.isEmpty()) 1449 return true; 1450 return false; 1451 } 1452 1453 public CodeableConcept addTechnique() { //3 1454 CodeableConcept t = new CodeableConcept(); 1455 if (this.technique == null) 1456 this.technique = new ArrayList<CodeableConcept>(); 1457 this.technique.add(t); 1458 return t; 1459 } 1460 1461 public SubstanceDefinitionStructureComponent addTechnique(CodeableConcept t) { //3 1462 if (t == null) 1463 return this; 1464 if (this.technique == null) 1465 this.technique = new ArrayList<CodeableConcept>(); 1466 this.technique.add(t); 1467 return this; 1468 } 1469 1470 /** 1471 * @return The first repetition of repeating field {@link #technique}, creating it if it does not already exist {3} 1472 */ 1473 public CodeableConcept getTechniqueFirstRep() { 1474 if (getTechnique().isEmpty()) { 1475 addTechnique(); 1476 } 1477 return getTechnique().get(0); 1478 } 1479 1480 /** 1481 * @return {@link #sourceDocument} (The source of information about the structure.) 1482 */ 1483 public List<Reference> getSourceDocument() { 1484 if (this.sourceDocument == null) 1485 this.sourceDocument = new ArrayList<Reference>(); 1486 return this.sourceDocument; 1487 } 1488 1489 /** 1490 * @return Returns a reference to <code>this</code> for easy method chaining 1491 */ 1492 public SubstanceDefinitionStructureComponent setSourceDocument(List<Reference> theSourceDocument) { 1493 this.sourceDocument = theSourceDocument; 1494 return this; 1495 } 1496 1497 public boolean hasSourceDocument() { 1498 if (this.sourceDocument == null) 1499 return false; 1500 for (Reference item : this.sourceDocument) 1501 if (!item.isEmpty()) 1502 return true; 1503 return false; 1504 } 1505 1506 public Reference addSourceDocument() { //3 1507 Reference t = new Reference(); 1508 if (this.sourceDocument == null) 1509 this.sourceDocument = new ArrayList<Reference>(); 1510 this.sourceDocument.add(t); 1511 return t; 1512 } 1513 1514 public SubstanceDefinitionStructureComponent addSourceDocument(Reference t) { //3 1515 if (t == null) 1516 return this; 1517 if (this.sourceDocument == null) 1518 this.sourceDocument = new ArrayList<Reference>(); 1519 this.sourceDocument.add(t); 1520 return this; 1521 } 1522 1523 /** 1524 * @return The first repetition of repeating field {@link #sourceDocument}, creating it if it does not already exist {3} 1525 */ 1526 public Reference getSourceDocumentFirstRep() { 1527 if (getSourceDocument().isEmpty()) { 1528 addSourceDocument(); 1529 } 1530 return getSourceDocument().get(0); 1531 } 1532 1533 /** 1534 * @return {@link #representation} (A depiction of the structure or characterization of the substance.) 1535 */ 1536 public List<SubstanceDefinitionStructureRepresentationComponent> getRepresentation() { 1537 if (this.representation == null) 1538 this.representation = new ArrayList<SubstanceDefinitionStructureRepresentationComponent>(); 1539 return this.representation; 1540 } 1541 1542 /** 1543 * @return Returns a reference to <code>this</code> for easy method chaining 1544 */ 1545 public SubstanceDefinitionStructureComponent setRepresentation(List<SubstanceDefinitionStructureRepresentationComponent> theRepresentation) { 1546 this.representation = theRepresentation; 1547 return this; 1548 } 1549 1550 public boolean hasRepresentation() { 1551 if (this.representation == null) 1552 return false; 1553 for (SubstanceDefinitionStructureRepresentationComponent item : this.representation) 1554 if (!item.isEmpty()) 1555 return true; 1556 return false; 1557 } 1558 1559 public SubstanceDefinitionStructureRepresentationComponent addRepresentation() { //3 1560 SubstanceDefinitionStructureRepresentationComponent t = new SubstanceDefinitionStructureRepresentationComponent(); 1561 if (this.representation == null) 1562 this.representation = new ArrayList<SubstanceDefinitionStructureRepresentationComponent>(); 1563 this.representation.add(t); 1564 return t; 1565 } 1566 1567 public SubstanceDefinitionStructureComponent addRepresentation(SubstanceDefinitionStructureRepresentationComponent t) { //3 1568 if (t == null) 1569 return this; 1570 if (this.representation == null) 1571 this.representation = new ArrayList<SubstanceDefinitionStructureRepresentationComponent>(); 1572 this.representation.add(t); 1573 return this; 1574 } 1575 1576 /** 1577 * @return The first repetition of repeating field {@link #representation}, creating it if it does not already exist {3} 1578 */ 1579 public SubstanceDefinitionStructureRepresentationComponent getRepresentationFirstRep() { 1580 if (getRepresentation().isEmpty()) { 1581 addRepresentation(); 1582 } 1583 return getRepresentation().get(0); 1584 } 1585 1586 protected void listChildren(List<Property> children) { 1587 super.listChildren(children); 1588 children.add(new Property("stereochemistry", "CodeableConcept", "Stereochemistry type.", 0, 1, stereochemistry)); 1589 children.add(new Property("opticalActivity", "CodeableConcept", "Optical activity type.", 0, 1, opticalActivity)); 1590 children.add(new Property("molecularFormula", "string", "Molecular formula of this substance, typically using the Hill system.", 0, 1, molecularFormula)); 1591 children.add(new Property("molecularFormulaByMoiety", "string", "Specified per moiety according to the Hill system, i.e. first C, then H, then alphabetical, each moiety separated by a dot.", 0, 1, molecularFormulaByMoiety)); 1592 children.add(new Property("molecularWeight", "@SubstanceDefinition.molecularWeight", "The molecular weight or weight range (for proteins, polymers or nucleic acids).", 0, 1, molecularWeight)); 1593 children.add(new Property("technique", "CodeableConcept", "The method used to elucidate the structure or characterization of the drug substance. Examples: X-ray, HPLC, NMR, Peptide mapping, Ligand binding assay.", 0, java.lang.Integer.MAX_VALUE, technique)); 1594 children.add(new Property("sourceDocument", "Reference(DocumentReference)", "The source of information about the structure.", 0, java.lang.Integer.MAX_VALUE, sourceDocument)); 1595 children.add(new Property("representation", "", "A depiction of the structure or characterization of the substance.", 0, java.lang.Integer.MAX_VALUE, representation)); 1596 } 1597 1598 @Override 1599 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1600 switch (_hash) { 1601 case 263475116: /*stereochemistry*/ return new Property("stereochemistry", "CodeableConcept", "Stereochemistry type.", 0, 1, stereochemistry); 1602 case 1420900135: /*opticalActivity*/ return new Property("opticalActivity", "CodeableConcept", "Optical activity type.", 0, 1, opticalActivity); 1603 case 616660246: /*molecularFormula*/ return new Property("molecularFormula", "string", "Molecular formula of this substance, typically using the Hill system.", 0, 1, molecularFormula); 1604 case 1315452848: /*molecularFormulaByMoiety*/ return new Property("molecularFormulaByMoiety", "string", "Specified per moiety according to the Hill system, i.e. first C, then H, then alphabetical, each moiety separated by a dot.", 0, 1, molecularFormulaByMoiety); 1605 case 635625672: /*molecularWeight*/ return new Property("molecularWeight", "@SubstanceDefinition.molecularWeight", "The molecular weight or weight range (for proteins, polymers or nucleic acids).", 0, 1, molecularWeight); 1606 case 1469675088: /*technique*/ return new Property("technique", "CodeableConcept", "The method used to elucidate the structure or characterization of the drug substance. Examples: X-ray, HPLC, NMR, Peptide mapping, Ligand binding assay.", 0, java.lang.Integer.MAX_VALUE, technique); 1607 case -501788074: /*sourceDocument*/ return new Property("sourceDocument", "Reference(DocumentReference)", "The source of information about the structure.", 0, java.lang.Integer.MAX_VALUE, sourceDocument); 1608 case -671065907: /*representation*/ return new Property("representation", "", "A depiction of the structure or characterization of the substance.", 0, java.lang.Integer.MAX_VALUE, representation); 1609 default: return super.getNamedProperty(_hash, _name, _checkValid); 1610 } 1611 1612 } 1613 1614 @Override 1615 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1616 switch (hash) { 1617 case 263475116: /*stereochemistry*/ return this.stereochemistry == null ? new Base[0] : new Base[] {this.stereochemistry}; // CodeableConcept 1618 case 1420900135: /*opticalActivity*/ return this.opticalActivity == null ? new Base[0] : new Base[] {this.opticalActivity}; // CodeableConcept 1619 case 616660246: /*molecularFormula*/ return this.molecularFormula == null ? new Base[0] : new Base[] {this.molecularFormula}; // StringType 1620 case 1315452848: /*molecularFormulaByMoiety*/ return this.molecularFormulaByMoiety == null ? new Base[0] : new Base[] {this.molecularFormulaByMoiety}; // StringType 1621 case 635625672: /*molecularWeight*/ return this.molecularWeight == null ? new Base[0] : new Base[] {this.molecularWeight}; // SubstanceDefinitionMolecularWeightComponent 1622 case 1469675088: /*technique*/ return this.technique == null ? new Base[0] : this.technique.toArray(new Base[this.technique.size()]); // CodeableConcept 1623 case -501788074: /*sourceDocument*/ return this.sourceDocument == null ? new Base[0] : this.sourceDocument.toArray(new Base[this.sourceDocument.size()]); // Reference 1624 case -671065907: /*representation*/ return this.representation == null ? new Base[0] : this.representation.toArray(new Base[this.representation.size()]); // SubstanceDefinitionStructureRepresentationComponent 1625 default: return super.getProperty(hash, name, checkValid); 1626 } 1627 1628 } 1629 1630 @Override 1631 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1632 switch (hash) { 1633 case 263475116: // stereochemistry 1634 this.stereochemistry = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1635 return value; 1636 case 1420900135: // opticalActivity 1637 this.opticalActivity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1638 return value; 1639 case 616660246: // molecularFormula 1640 this.molecularFormula = TypeConvertor.castToString(value); // StringType 1641 return value; 1642 case 1315452848: // molecularFormulaByMoiety 1643 this.molecularFormulaByMoiety = TypeConvertor.castToString(value); // StringType 1644 return value; 1645 case 635625672: // molecularWeight 1646 this.molecularWeight = (SubstanceDefinitionMolecularWeightComponent) value; // SubstanceDefinitionMolecularWeightComponent 1647 return value; 1648 case 1469675088: // technique 1649 this.getTechnique().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept 1650 return value; 1651 case -501788074: // sourceDocument 1652 this.getSourceDocument().add(TypeConvertor.castToReference(value)); // Reference 1653 return value; 1654 case -671065907: // representation 1655 this.getRepresentation().add((SubstanceDefinitionStructureRepresentationComponent) value); // SubstanceDefinitionStructureRepresentationComponent 1656 return value; 1657 default: return super.setProperty(hash, name, value); 1658 } 1659 1660 } 1661 1662 @Override 1663 public Base setProperty(String name, Base value) throws FHIRException { 1664 if (name.equals("stereochemistry")) { 1665 this.stereochemistry = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1666 } else if (name.equals("opticalActivity")) { 1667 this.opticalActivity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1668 } else if (name.equals("molecularFormula")) { 1669 this.molecularFormula = TypeConvertor.castToString(value); // StringType 1670 } else if (name.equals("molecularFormulaByMoiety")) { 1671 this.molecularFormulaByMoiety = TypeConvertor.castToString(value); // StringType 1672 } else if (name.equals("molecularWeight")) { 1673 this.molecularWeight = (SubstanceDefinitionMolecularWeightComponent) value; // SubstanceDefinitionMolecularWeightComponent 1674 } else if (name.equals("technique")) { 1675 this.getTechnique().add(TypeConvertor.castToCodeableConcept(value)); 1676 } else if (name.equals("sourceDocument")) { 1677 this.getSourceDocument().add(TypeConvertor.castToReference(value)); 1678 } else if (name.equals("representation")) { 1679 this.getRepresentation().add((SubstanceDefinitionStructureRepresentationComponent) value); 1680 } else 1681 return super.setProperty(name, value); 1682 return value; 1683 } 1684 1685 @Override 1686 public Base makeProperty(int hash, String name) throws FHIRException { 1687 switch (hash) { 1688 case 263475116: return getStereochemistry(); 1689 case 1420900135: return getOpticalActivity(); 1690 case 616660246: return getMolecularFormulaElement(); 1691 case 1315452848: return getMolecularFormulaByMoietyElement(); 1692 case 635625672: return getMolecularWeight(); 1693 case 1469675088: return addTechnique(); 1694 case -501788074: return addSourceDocument(); 1695 case -671065907: return addRepresentation(); 1696 default: return super.makeProperty(hash, name); 1697 } 1698 1699 } 1700 1701 @Override 1702 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1703 switch (hash) { 1704 case 263475116: /*stereochemistry*/ return new String[] {"CodeableConcept"}; 1705 case 1420900135: /*opticalActivity*/ return new String[] {"CodeableConcept"}; 1706 case 616660246: /*molecularFormula*/ return new String[] {"string"}; 1707 case 1315452848: /*molecularFormulaByMoiety*/ return new String[] {"string"}; 1708 case 635625672: /*molecularWeight*/ return new String[] {"@SubstanceDefinition.molecularWeight"}; 1709 case 1469675088: /*technique*/ return new String[] {"CodeableConcept"}; 1710 case -501788074: /*sourceDocument*/ return new String[] {"Reference"}; 1711 case -671065907: /*representation*/ return new String[] {}; 1712 default: return super.getTypesForProperty(hash, name); 1713 } 1714 1715 } 1716 1717 @Override 1718 public Base addChild(String name) throws FHIRException { 1719 if (name.equals("stereochemistry")) { 1720 this.stereochemistry = new CodeableConcept(); 1721 return this.stereochemistry; 1722 } 1723 else if (name.equals("opticalActivity")) { 1724 this.opticalActivity = new CodeableConcept(); 1725 return this.opticalActivity; 1726 } 1727 else if (name.equals("molecularFormula")) { 1728 throw new FHIRException("Cannot call addChild on a primitive type SubstanceDefinition.structure.molecularFormula"); 1729 } 1730 else if (name.equals("molecularFormulaByMoiety")) { 1731 throw new FHIRException("Cannot call addChild on a primitive type SubstanceDefinition.structure.molecularFormulaByMoiety"); 1732 } 1733 else if (name.equals("molecularWeight")) { 1734 this.molecularWeight = new SubstanceDefinitionMolecularWeightComponent(); 1735 return this.molecularWeight; 1736 } 1737 else if (name.equals("technique")) { 1738 return addTechnique(); 1739 } 1740 else if (name.equals("sourceDocument")) { 1741 return addSourceDocument(); 1742 } 1743 else if (name.equals("representation")) { 1744 return addRepresentation(); 1745 } 1746 else 1747 return super.addChild(name); 1748 } 1749 1750 public SubstanceDefinitionStructureComponent copy() { 1751 SubstanceDefinitionStructureComponent dst = new SubstanceDefinitionStructureComponent(); 1752 copyValues(dst); 1753 return dst; 1754 } 1755 1756 public void copyValues(SubstanceDefinitionStructureComponent dst) { 1757 super.copyValues(dst); 1758 dst.stereochemistry = stereochemistry == null ? null : stereochemistry.copy(); 1759 dst.opticalActivity = opticalActivity == null ? null : opticalActivity.copy(); 1760 dst.molecularFormula = molecularFormula == null ? null : molecularFormula.copy(); 1761 dst.molecularFormulaByMoiety = molecularFormulaByMoiety == null ? null : molecularFormulaByMoiety.copy(); 1762 dst.molecularWeight = molecularWeight == null ? null : molecularWeight.copy(); 1763 if (technique != null) { 1764 dst.technique = new ArrayList<CodeableConcept>(); 1765 for (CodeableConcept i : technique) 1766 dst.technique.add(i.copy()); 1767 }; 1768 if (sourceDocument != null) { 1769 dst.sourceDocument = new ArrayList<Reference>(); 1770 for (Reference i : sourceDocument) 1771 dst.sourceDocument.add(i.copy()); 1772 }; 1773 if (representation != null) { 1774 dst.representation = new ArrayList<SubstanceDefinitionStructureRepresentationComponent>(); 1775 for (SubstanceDefinitionStructureRepresentationComponent i : representation) 1776 dst.representation.add(i.copy()); 1777 }; 1778 } 1779 1780 @Override 1781 public boolean equalsDeep(Base other_) { 1782 if (!super.equalsDeep(other_)) 1783 return false; 1784 if (!(other_ instanceof SubstanceDefinitionStructureComponent)) 1785 return false; 1786 SubstanceDefinitionStructureComponent o = (SubstanceDefinitionStructureComponent) other_; 1787 return compareDeep(stereochemistry, o.stereochemistry, true) && compareDeep(opticalActivity, o.opticalActivity, true) 1788 && compareDeep(molecularFormula, o.molecularFormula, true) && compareDeep(molecularFormulaByMoiety, o.molecularFormulaByMoiety, true) 1789 && compareDeep(molecularWeight, o.molecularWeight, true) && compareDeep(technique, o.technique, true) 1790 && compareDeep(sourceDocument, o.sourceDocument, true) && compareDeep(representation, o.representation, true) 1791 ; 1792 } 1793 1794 @Override 1795 public boolean equalsShallow(Base other_) { 1796 if (!super.equalsShallow(other_)) 1797 return false; 1798 if (!(other_ instanceof SubstanceDefinitionStructureComponent)) 1799 return false; 1800 SubstanceDefinitionStructureComponent o = (SubstanceDefinitionStructureComponent) other_; 1801 return compareValues(molecularFormula, o.molecularFormula, true) && compareValues(molecularFormulaByMoiety, o.molecularFormulaByMoiety, true) 1802 ; 1803 } 1804 1805 public boolean isEmpty() { 1806 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(stereochemistry, opticalActivity 1807 , molecularFormula, molecularFormulaByMoiety, molecularWeight, technique, sourceDocument 1808 , representation); 1809 } 1810 1811 public String fhirType() { 1812 return "SubstanceDefinition.structure"; 1813 1814 } 1815 1816 } 1817 1818 @Block() 1819 public static class SubstanceDefinitionStructureRepresentationComponent extends BackboneElement implements IBaseBackboneElement { 1820 /** 1821 * The kind of structural representation (e.g. full, partial). 1822 */ 1823 @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 1824 @Description(shortDefinition="The kind of structural representation (e.g. full, partial)", formalDefinition="The kind of structural representation (e.g. full, partial)." ) 1825 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-representation-type") 1826 protected CodeableConcept type; 1827 1828 /** 1829 * The structural representation or characterization as a text string in a standard format. 1830 */ 1831 @Child(name = "representation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) 1832 @Description(shortDefinition="The structural representation or characterization as a text string in a standard format", formalDefinition="The structural representation or characterization as a text string in a standard format." ) 1833 protected StringType representation; 1834 1835 /** 1836 * The format of the representation e.g. InChI, SMILES, MOLFILE, CDX, SDF, PDB, mmCIF. The logical content type rather than the physical file format of a document. 1837 */ 1838 @Child(name = "format", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) 1839 @Description(shortDefinition="The format of the representation e.g. InChI, SMILES, MOLFILE (note: not the physical file format)", formalDefinition="The format of the representation e.g. InChI, SMILES, MOLFILE, CDX, SDF, PDB, mmCIF. The logical content type rather than the physical file format of a document." ) 1840 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-representation-format") 1841 protected CodeableConcept format; 1842 1843 /** 1844 * An attached file with the structural representation or characterization e.g. a molecular structure graphic of the substance, a JCAMP or AnIML file. 1845 */ 1846 @Child(name = "document", type = {DocumentReference.class}, order=4, min=0, max=1, modifier=false, summary=true) 1847 @Description(shortDefinition="An attachment with the structural representation e.g. a structure graphic or AnIML file", formalDefinition="An attached file with the structural representation or characterization e.g. a molecular structure graphic of the substance, a JCAMP or AnIML file." ) 1848 protected Reference document; 1849 1850 private static final long serialVersionUID = 138704347L; 1851 1852 /** 1853 * Constructor 1854 */ 1855 public SubstanceDefinitionStructureRepresentationComponent() { 1856 super(); 1857 } 1858 1859 /** 1860 * @return {@link #type} (The kind of structural representation (e.g. full, partial).) 1861 */ 1862 public CodeableConcept getType() { 1863 if (this.type == null) 1864 if (Configuration.errorOnAutoCreate()) 1865 throw new Error("Attempt to auto-create SubstanceDefinitionStructureRepresentationComponent.type"); 1866 else if (Configuration.doAutoCreate()) 1867 this.type = new CodeableConcept(); // cc 1868 return this.type; 1869 } 1870 1871 public boolean hasType() { 1872 return this.type != null && !this.type.isEmpty(); 1873 } 1874 1875 /** 1876 * @param value {@link #type} (The kind of structural representation (e.g. full, partial).) 1877 */ 1878 public SubstanceDefinitionStructureRepresentationComponent setType(CodeableConcept value) { 1879 this.type = value; 1880 return this; 1881 } 1882 1883 /** 1884 * @return {@link #representation} (The structural representation or characterization as a text string in a standard format.). This is the underlying object with id, value and extensions. The accessor "getRepresentation" gives direct access to the value 1885 */ 1886 public StringType getRepresentationElement() { 1887 if (this.representation == null) 1888 if (Configuration.errorOnAutoCreate()) 1889 throw new Error("Attempt to auto-create SubstanceDefinitionStructureRepresentationComponent.representation"); 1890 else if (Configuration.doAutoCreate()) 1891 this.representation = new StringType(); // bb 1892 return this.representation; 1893 } 1894 1895 public boolean hasRepresentationElement() { 1896 return this.representation != null && !this.representation.isEmpty(); 1897 } 1898 1899 public boolean hasRepresentation() { 1900 return this.representation != null && !this.representation.isEmpty(); 1901 } 1902 1903 /** 1904 * @param value {@link #representation} (The structural representation or characterization as a text string in a standard format.). This is the underlying object with id, value and extensions. The accessor "getRepresentation" gives direct access to the value 1905 */ 1906 public SubstanceDefinitionStructureRepresentationComponent setRepresentationElement(StringType value) { 1907 this.representation = value; 1908 return this; 1909 } 1910 1911 /** 1912 * @return The structural representation or characterization as a text string in a standard format. 1913 */ 1914 public String getRepresentation() { 1915 return this.representation == null ? null : this.representation.getValue(); 1916 } 1917 1918 /** 1919 * @param value The structural representation or characterization as a text string in a standard format. 1920 */ 1921 public SubstanceDefinitionStructureRepresentationComponent setRepresentation(String value) { 1922 if (Utilities.noString(value)) 1923 this.representation = null; 1924 else { 1925 if (this.representation == null) 1926 this.representation = new StringType(); 1927 this.representation.setValue(value); 1928 } 1929 return this; 1930 } 1931 1932 /** 1933 * @return {@link #format} (The format of the representation e.g. InChI, SMILES, MOLFILE, CDX, SDF, PDB, mmCIF. The logical content type rather than the physical file format of a document.) 1934 */ 1935 public CodeableConcept getFormat() { 1936 if (this.format == null) 1937 if (Configuration.errorOnAutoCreate()) 1938 throw new Error("Attempt to auto-create SubstanceDefinitionStructureRepresentationComponent.format"); 1939 else if (Configuration.doAutoCreate()) 1940 this.format = new CodeableConcept(); // cc 1941 return this.format; 1942 } 1943 1944 public boolean hasFormat() { 1945 return this.format != null && !this.format.isEmpty(); 1946 } 1947 1948 /** 1949 * @param value {@link #format} (The format of the representation e.g. InChI, SMILES, MOLFILE, CDX, SDF, PDB, mmCIF. The logical content type rather than the physical file format of a document.) 1950 */ 1951 public SubstanceDefinitionStructureRepresentationComponent setFormat(CodeableConcept value) { 1952 this.format = value; 1953 return this; 1954 } 1955 1956 /** 1957 * @return {@link #document} (An attached file with the structural representation or characterization e.g. a molecular structure graphic of the substance, a JCAMP or AnIML file.) 1958 */ 1959 public Reference getDocument() { 1960 if (this.document == null) 1961 if (Configuration.errorOnAutoCreate()) 1962 throw new Error("Attempt to auto-create SubstanceDefinitionStructureRepresentationComponent.document"); 1963 else if (Configuration.doAutoCreate()) 1964 this.document = new Reference(); // cc 1965 return this.document; 1966 } 1967 1968 public boolean hasDocument() { 1969 return this.document != null && !this.document.isEmpty(); 1970 } 1971 1972 /** 1973 * @param value {@link #document} (An attached file with the structural representation or characterization e.g. a molecular structure graphic of the substance, a JCAMP or AnIML file.) 1974 */ 1975 public SubstanceDefinitionStructureRepresentationComponent setDocument(Reference value) { 1976 this.document = value; 1977 return this; 1978 } 1979 1980 protected void listChildren(List<Property> children) { 1981 super.listChildren(children); 1982 children.add(new Property("type", "CodeableConcept", "The kind of structural representation (e.g. full, partial).", 0, 1, type)); 1983 children.add(new Property("representation", "string", "The structural representation or characterization as a text string in a standard format.", 0, 1, representation)); 1984 children.add(new Property("format", "CodeableConcept", "The format of the representation e.g. InChI, SMILES, MOLFILE, CDX, SDF, PDB, mmCIF. The logical content type rather than the physical file format of a document.", 0, 1, format)); 1985 children.add(new Property("document", "Reference(DocumentReference)", "An attached file with the structural representation or characterization e.g. a molecular structure graphic of the substance, a JCAMP or AnIML file.", 0, 1, document)); 1986 } 1987 1988 @Override 1989 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1990 switch (_hash) { 1991 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "The kind of structural representation (e.g. full, partial).", 0, 1, type); 1992 case -671065907: /*representation*/ return new Property("representation", "string", "The structural representation or characterization as a text string in a standard format.", 0, 1, representation); 1993 case -1268779017: /*format*/ return new Property("format", "CodeableConcept", "The format of the representation e.g. InChI, SMILES, MOLFILE, CDX, SDF, PDB, mmCIF. The logical content type rather than the physical file format of a document.", 0, 1, format); 1994 case 861720859: /*document*/ return new Property("document", "Reference(DocumentReference)", "An attached file with the structural representation or characterization e.g. a molecular structure graphic of the substance, a JCAMP or AnIML file.", 0, 1, document); 1995 default: return super.getNamedProperty(_hash, _name, _checkValid); 1996 } 1997 1998 } 1999 2000 @Override 2001 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 2002 switch (hash) { 2003 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 2004 case -671065907: /*representation*/ return this.representation == null ? new Base[0] : new Base[] {this.representation}; // StringType 2005 case -1268779017: /*format*/ return this.format == null ? new Base[0] : new Base[] {this.format}; // CodeableConcept 2006 case 861720859: /*document*/ return this.document == null ? new Base[0] : new Base[] {this.document}; // Reference 2007 default: return super.getProperty(hash, name, checkValid); 2008 } 2009 2010 } 2011 2012 @Override 2013 public Base setProperty(int hash, String name, Base value) throws FHIRException { 2014 switch (hash) { 2015 case 3575610: // type 2016 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 2017 return value; 2018 case -671065907: // representation 2019 this.representation = TypeConvertor.castToString(value); // StringType 2020 return value; 2021 case -1268779017: // format 2022 this.format = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 2023 return value; 2024 case 861720859: // document 2025 this.document = TypeConvertor.castToReference(value); // Reference 2026 return value; 2027 default: return super.setProperty(hash, name, value); 2028 } 2029 2030 } 2031 2032 @Override 2033 public Base setProperty(String name, Base value) throws FHIRException { 2034 if (name.equals("type")) { 2035 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 2036 } else if (name.equals("representation")) { 2037 this.representation = TypeConvertor.castToString(value); // StringType 2038 } else if (name.equals("format")) { 2039 this.format = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 2040 } else if (name.equals("document")) { 2041 this.document = TypeConvertor.castToReference(value); // Reference 2042 } else 2043 return super.setProperty(name, value); 2044 return value; 2045 } 2046 2047 @Override 2048 public Base makeProperty(int hash, String name) throws FHIRException { 2049 switch (hash) { 2050 case 3575610: return getType(); 2051 case -671065907: return getRepresentationElement(); 2052 case -1268779017: return getFormat(); 2053 case 861720859: return getDocument(); 2054 default: return super.makeProperty(hash, name); 2055 } 2056 2057 } 2058 2059 @Override 2060 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 2061 switch (hash) { 2062 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 2063 case -671065907: /*representation*/ return new String[] {"string"}; 2064 case -1268779017: /*format*/ return new String[] {"CodeableConcept"}; 2065 case 861720859: /*document*/ return new String[] {"Reference"}; 2066 default: return super.getTypesForProperty(hash, name); 2067 } 2068 2069 } 2070 2071 @Override 2072 public Base addChild(String name) throws FHIRException { 2073 if (name.equals("type")) { 2074 this.type = new CodeableConcept(); 2075 return this.type; 2076 } 2077 else if (name.equals("representation")) { 2078 throw new FHIRException("Cannot call addChild on a primitive type SubstanceDefinition.structure.representation.representation"); 2079 } 2080 else if (name.equals("format")) { 2081 this.format = new CodeableConcept(); 2082 return this.format; 2083 } 2084 else if (name.equals("document")) { 2085 this.document = new Reference(); 2086 return this.document; 2087 } 2088 else 2089 return super.addChild(name); 2090 } 2091 2092 public SubstanceDefinitionStructureRepresentationComponent copy() { 2093 SubstanceDefinitionStructureRepresentationComponent dst = new SubstanceDefinitionStructureRepresentationComponent(); 2094 copyValues(dst); 2095 return dst; 2096 } 2097 2098 public void copyValues(SubstanceDefinitionStructureRepresentationComponent dst) { 2099 super.copyValues(dst); 2100 dst.type = type == null ? null : type.copy(); 2101 dst.representation = representation == null ? null : representation.copy(); 2102 dst.format = format == null ? null : format.copy(); 2103 dst.document = document == null ? null : document.copy(); 2104 } 2105 2106 @Override 2107 public boolean equalsDeep(Base other_) { 2108 if (!super.equalsDeep(other_)) 2109 return false; 2110 if (!(other_ instanceof SubstanceDefinitionStructureRepresentationComponent)) 2111 return false; 2112 SubstanceDefinitionStructureRepresentationComponent o = (SubstanceDefinitionStructureRepresentationComponent) other_; 2113 return compareDeep(type, o.type, true) && compareDeep(representation, o.representation, true) && compareDeep(format, o.format, true) 2114 && compareDeep(document, o.document, true); 2115 } 2116 2117 @Override 2118 public boolean equalsShallow(Base other_) { 2119 if (!super.equalsShallow(other_)) 2120 return false; 2121 if (!(other_ instanceof SubstanceDefinitionStructureRepresentationComponent)) 2122 return false; 2123 SubstanceDefinitionStructureRepresentationComponent o = (SubstanceDefinitionStructureRepresentationComponent) other_; 2124 return compareValues(representation, o.representation, true); 2125 } 2126 2127 public boolean isEmpty() { 2128 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, representation, format 2129 , document); 2130 } 2131 2132 public String fhirType() { 2133 return "SubstanceDefinition.structure.representation"; 2134 2135 } 2136 2137 } 2138 2139 @Block() 2140 public static class SubstanceDefinitionCodeComponent extends BackboneElement implements IBaseBackboneElement { 2141 /** 2142 * The specific code. 2143 */ 2144 @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 2145 @Description(shortDefinition="The specific code", formalDefinition="The specific code." ) 2146 protected CodeableConcept code; 2147 2148 /** 2149 * Status of the code assignment, for example 'provisional', 'approved'. 2150 */ 2151 @Child(name = "status", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 2152 @Description(shortDefinition="Status of the code assignment, for example 'provisional', 'approved'", formalDefinition="Status of the code assignment, for example 'provisional', 'approved'." ) 2153 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status") 2154 protected CodeableConcept status; 2155 2156 /** 2157 * The date at which the code status was changed as part of the terminology maintenance. 2158 */ 2159 @Child(name = "statusDate", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true) 2160 @Description(shortDefinition="The date at which the code status was changed", formalDefinition="The date at which the code status was changed as part of the terminology maintenance." ) 2161 protected DateTimeType statusDate; 2162 2163 /** 2164 * Any comment can be provided in this field, if necessary. 2165 */ 2166 @Child(name = "note", type = {Annotation.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2167 @Description(shortDefinition="Any comment can be provided in this field", formalDefinition="Any comment can be provided in this field, if necessary." ) 2168 protected List<Annotation> note; 2169 2170 /** 2171 * Supporting literature. 2172 */ 2173 @Child(name = "source", type = {DocumentReference.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2174 @Description(shortDefinition="Supporting literature", formalDefinition="Supporting literature." ) 2175 protected List<Reference> source; 2176 2177 private static final long serialVersionUID = 1140562105L; 2178 2179 /** 2180 * Constructor 2181 */ 2182 public SubstanceDefinitionCodeComponent() { 2183 super(); 2184 } 2185 2186 /** 2187 * @return {@link #code} (The specific code.) 2188 */ 2189 public CodeableConcept getCode() { 2190 if (this.code == null) 2191 if (Configuration.errorOnAutoCreate()) 2192 throw new Error("Attempt to auto-create SubstanceDefinitionCodeComponent.code"); 2193 else if (Configuration.doAutoCreate()) 2194 this.code = new CodeableConcept(); // cc 2195 return this.code; 2196 } 2197 2198 public boolean hasCode() { 2199 return this.code != null && !this.code.isEmpty(); 2200 } 2201 2202 /** 2203 * @param value {@link #code} (The specific code.) 2204 */ 2205 public SubstanceDefinitionCodeComponent setCode(CodeableConcept value) { 2206 this.code = value; 2207 return this; 2208 } 2209 2210 /** 2211 * @return {@link #status} (Status of the code assignment, for example 'provisional', 'approved'.) 2212 */ 2213 public CodeableConcept getStatus() { 2214 if (this.status == null) 2215 if (Configuration.errorOnAutoCreate()) 2216 throw new Error("Attempt to auto-create SubstanceDefinitionCodeComponent.status"); 2217 else if (Configuration.doAutoCreate()) 2218 this.status = new CodeableConcept(); // cc 2219 return this.status; 2220 } 2221 2222 public boolean hasStatus() { 2223 return this.status != null && !this.status.isEmpty(); 2224 } 2225 2226 /** 2227 * @param value {@link #status} (Status of the code assignment, for example 'provisional', 'approved'.) 2228 */ 2229 public SubstanceDefinitionCodeComponent setStatus(CodeableConcept value) { 2230 this.status = value; 2231 return this; 2232 } 2233 2234 /** 2235 * @return {@link #statusDate} (The date at which the code status was changed as part of the terminology maintenance.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value 2236 */ 2237 public DateTimeType getStatusDateElement() { 2238 if (this.statusDate == null) 2239 if (Configuration.errorOnAutoCreate()) 2240 throw new Error("Attempt to auto-create SubstanceDefinitionCodeComponent.statusDate"); 2241 else if (Configuration.doAutoCreate()) 2242 this.statusDate = new DateTimeType(); // bb 2243 return this.statusDate; 2244 } 2245 2246 public boolean hasStatusDateElement() { 2247 return this.statusDate != null && !this.statusDate.isEmpty(); 2248 } 2249 2250 public boolean hasStatusDate() { 2251 return this.statusDate != null && !this.statusDate.isEmpty(); 2252 } 2253 2254 /** 2255 * @param value {@link #statusDate} (The date at which the code status was changed as part of the terminology maintenance.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value 2256 */ 2257 public SubstanceDefinitionCodeComponent setStatusDateElement(DateTimeType value) { 2258 this.statusDate = value; 2259 return this; 2260 } 2261 2262 /** 2263 * @return The date at which the code status was changed as part of the terminology maintenance. 2264 */ 2265 public Date getStatusDate() { 2266 return this.statusDate == null ? null : this.statusDate.getValue(); 2267 } 2268 2269 /** 2270 * @param value The date at which the code status was changed as part of the terminology maintenance. 2271 */ 2272 public SubstanceDefinitionCodeComponent setStatusDate(Date value) { 2273 if (value == null) 2274 this.statusDate = null; 2275 else { 2276 if (this.statusDate == null) 2277 this.statusDate = new DateTimeType(); 2278 this.statusDate.setValue(value); 2279 } 2280 return this; 2281 } 2282 2283 /** 2284 * @return {@link #note} (Any comment can be provided in this field, if necessary.) 2285 */ 2286 public List<Annotation> getNote() { 2287 if (this.note == null) 2288 this.note = new ArrayList<Annotation>(); 2289 return this.note; 2290 } 2291 2292 /** 2293 * @return Returns a reference to <code>this</code> for easy method chaining 2294 */ 2295 public SubstanceDefinitionCodeComponent setNote(List<Annotation> theNote) { 2296 this.note = theNote; 2297 return this; 2298 } 2299 2300 public boolean hasNote() { 2301 if (this.note == null) 2302 return false; 2303 for (Annotation item : this.note) 2304 if (!item.isEmpty()) 2305 return true; 2306 return false; 2307 } 2308 2309 public Annotation addNote() { //3 2310 Annotation t = new Annotation(); 2311 if (this.note == null) 2312 this.note = new ArrayList<Annotation>(); 2313 this.note.add(t); 2314 return t; 2315 } 2316 2317 public SubstanceDefinitionCodeComponent addNote(Annotation t) { //3 2318 if (t == null) 2319 return this; 2320 if (this.note == null) 2321 this.note = new ArrayList<Annotation>(); 2322 this.note.add(t); 2323 return this; 2324 } 2325 2326 /** 2327 * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3} 2328 */ 2329 public Annotation getNoteFirstRep() { 2330 if (getNote().isEmpty()) { 2331 addNote(); 2332 } 2333 return getNote().get(0); 2334 } 2335 2336 /** 2337 * @return {@link #source} (Supporting literature.) 2338 */ 2339 public List<Reference> getSource() { 2340 if (this.source == null) 2341 this.source = new ArrayList<Reference>(); 2342 return this.source; 2343 } 2344 2345 /** 2346 * @return Returns a reference to <code>this</code> for easy method chaining 2347 */ 2348 public SubstanceDefinitionCodeComponent setSource(List<Reference> theSource) { 2349 this.source = theSource; 2350 return this; 2351 } 2352 2353 public boolean hasSource() { 2354 if (this.source == null) 2355 return false; 2356 for (Reference item : this.source) 2357 if (!item.isEmpty()) 2358 return true; 2359 return false; 2360 } 2361 2362 public Reference addSource() { //3 2363 Reference t = new Reference(); 2364 if (this.source == null) 2365 this.source = new ArrayList<Reference>(); 2366 this.source.add(t); 2367 return t; 2368 } 2369 2370 public SubstanceDefinitionCodeComponent addSource(Reference t) { //3 2371 if (t == null) 2372 return this; 2373 if (this.source == null) 2374 this.source = new ArrayList<Reference>(); 2375 this.source.add(t); 2376 return this; 2377 } 2378 2379 /** 2380 * @return The first repetition of repeating field {@link #source}, creating it if it does not already exist {3} 2381 */ 2382 public Reference getSourceFirstRep() { 2383 if (getSource().isEmpty()) { 2384 addSource(); 2385 } 2386 return getSource().get(0); 2387 } 2388 2389 protected void listChildren(List<Property> children) { 2390 super.listChildren(children); 2391 children.add(new Property("code", "CodeableConcept", "The specific code.", 0, 1, code)); 2392 children.add(new Property("status", "CodeableConcept", "Status of the code assignment, for example 'provisional', 'approved'.", 0, 1, status)); 2393 children.add(new Property("statusDate", "dateTime", "The date at which the code status was changed as part of the terminology maintenance.", 0, 1, statusDate)); 2394 children.add(new Property("note", "Annotation", "Any comment can be provided in this field, if necessary.", 0, java.lang.Integer.MAX_VALUE, note)); 2395 children.add(new Property("source", "Reference(DocumentReference)", "Supporting literature.", 0, java.lang.Integer.MAX_VALUE, source)); 2396 } 2397 2398 @Override 2399 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 2400 switch (_hash) { 2401 case 3059181: /*code*/ return new Property("code", "CodeableConcept", "The specific code.", 0, 1, code); 2402 case -892481550: /*status*/ return new Property("status", "CodeableConcept", "Status of the code assignment, for example 'provisional', 'approved'.", 0, 1, status); 2403 case 247524032: /*statusDate*/ return new Property("statusDate", "dateTime", "The date at which the code status was changed as part of the terminology maintenance.", 0, 1, statusDate); 2404 case 3387378: /*note*/ return new Property("note", "Annotation", "Any comment can be provided in this field, if necessary.", 0, java.lang.Integer.MAX_VALUE, note); 2405 case -896505829: /*source*/ return new Property("source", "Reference(DocumentReference)", "Supporting literature.", 0, java.lang.Integer.MAX_VALUE, source); 2406 default: return super.getNamedProperty(_hash, _name, _checkValid); 2407 } 2408 2409 } 2410 2411 @Override 2412 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 2413 switch (hash) { 2414 case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept 2415 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept 2416 case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : new Base[] {this.statusDate}; // DateTimeType 2417 case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation 2418 case -896505829: /*source*/ return this.source == null ? new Base[0] : this.source.toArray(new Base[this.source.size()]); // Reference 2419 default: return super.getProperty(hash, name, checkValid); 2420 } 2421 2422 } 2423 2424 @Override 2425 public Base setProperty(int hash, String name, Base value) throws FHIRException { 2426 switch (hash) { 2427 case 3059181: // code 2428 this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 2429 return value; 2430 case -892481550: // status 2431 this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 2432 return value; 2433 case 247524032: // statusDate 2434 this.statusDate = TypeConvertor.castToDateTime(value); // DateTimeType 2435 return value; 2436 case 3387378: // note 2437 this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation 2438 return value; 2439 case -896505829: // source 2440 this.getSource().add(TypeConvertor.castToReference(value)); // Reference 2441 return value; 2442 default: return super.setProperty(hash, name, value); 2443 } 2444 2445 } 2446 2447 @Override 2448 public Base setProperty(String name, Base value) throws FHIRException { 2449 if (name.equals("code")) { 2450 this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 2451 } else if (name.equals("status")) { 2452 this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 2453 } else if (name.equals("statusDate")) { 2454 this.statusDate = TypeConvertor.castToDateTime(value); // DateTimeType 2455 } else if (name.equals("note")) { 2456 this.getNote().add(TypeConvertor.castToAnnotation(value)); 2457 } else if (name.equals("source")) { 2458 this.getSource().add(TypeConvertor.castToReference(value)); 2459 } else 2460 return super.setProperty(name, value); 2461 return value; 2462 } 2463 2464 @Override 2465 public Base makeProperty(int hash, String name) throws FHIRException { 2466 switch (hash) { 2467 case 3059181: return getCode(); 2468 case -892481550: return getStatus(); 2469 case 247524032: return getStatusDateElement(); 2470 case 3387378: return addNote(); 2471 case -896505829: return addSource(); 2472 default: return super.makeProperty(hash, name); 2473 } 2474 2475 } 2476 2477 @Override 2478 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 2479 switch (hash) { 2480 case 3059181: /*code*/ return new String[] {"CodeableConcept"}; 2481 case -892481550: /*status*/ return new String[] {"CodeableConcept"}; 2482 case 247524032: /*statusDate*/ return new String[] {"dateTime"}; 2483 case 3387378: /*note*/ return new String[] {"Annotation"}; 2484 case -896505829: /*source*/ return new String[] {"Reference"}; 2485 default: return super.getTypesForProperty(hash, name); 2486 } 2487 2488 } 2489 2490 @Override 2491 public Base addChild(String name) throws FHIRException { 2492 if (name.equals("code")) { 2493 this.code = new CodeableConcept(); 2494 return this.code; 2495 } 2496 else if (name.equals("status")) { 2497 this.status = new CodeableConcept(); 2498 return this.status; 2499 } 2500 else if (name.equals("statusDate")) { 2501 throw new FHIRException("Cannot call addChild on a primitive type SubstanceDefinition.code.statusDate"); 2502 } 2503 else if (name.equals("note")) { 2504 return addNote(); 2505 } 2506 else if (name.equals("source")) { 2507 return addSource(); 2508 } 2509 else 2510 return super.addChild(name); 2511 } 2512 2513 public SubstanceDefinitionCodeComponent copy() { 2514 SubstanceDefinitionCodeComponent dst = new SubstanceDefinitionCodeComponent(); 2515 copyValues(dst); 2516 return dst; 2517 } 2518 2519 public void copyValues(SubstanceDefinitionCodeComponent dst) { 2520 super.copyValues(dst); 2521 dst.code = code == null ? null : code.copy(); 2522 dst.status = status == null ? null : status.copy(); 2523 dst.statusDate = statusDate == null ? null : statusDate.copy(); 2524 if (note != null) { 2525 dst.note = new ArrayList<Annotation>(); 2526 for (Annotation i : note) 2527 dst.note.add(i.copy()); 2528 }; 2529 if (source != null) { 2530 dst.source = new ArrayList<Reference>(); 2531 for (Reference i : source) 2532 dst.source.add(i.copy()); 2533 }; 2534 } 2535 2536 @Override 2537 public boolean equalsDeep(Base other_) { 2538 if (!super.equalsDeep(other_)) 2539 return false; 2540 if (!(other_ instanceof SubstanceDefinitionCodeComponent)) 2541 return false; 2542 SubstanceDefinitionCodeComponent o = (SubstanceDefinitionCodeComponent) other_; 2543 return compareDeep(code, o.code, true) && compareDeep(status, o.status, true) && compareDeep(statusDate, o.statusDate, true) 2544 && compareDeep(note, o.note, true) && compareDeep(source, o.source, true); 2545 } 2546 2547 @Override 2548 public boolean equalsShallow(Base other_) { 2549 if (!super.equalsShallow(other_)) 2550 return false; 2551 if (!(other_ instanceof SubstanceDefinitionCodeComponent)) 2552 return false; 2553 SubstanceDefinitionCodeComponent o = (SubstanceDefinitionCodeComponent) other_; 2554 return compareValues(statusDate, o.statusDate, true); 2555 } 2556 2557 public boolean isEmpty() { 2558 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, status, statusDate 2559 , note, source); 2560 } 2561 2562 public String fhirType() { 2563 return "SubstanceDefinition.code"; 2564 2565 } 2566 2567 } 2568 2569 @Block() 2570 public static class SubstanceDefinitionNameComponent extends BackboneElement implements IBaseBackboneElement { 2571 /** 2572 * The actual name. 2573 */ 2574 @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) 2575 @Description(shortDefinition="The actual name", formalDefinition="The actual name." ) 2576 protected StringType name; 2577 2578 /** 2579 * Name type, for example 'systematic', 'scientific, 'brand'. 2580 */ 2581 @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 2582 @Description(shortDefinition="Name type e.g. 'systematic', 'scientific, 'brand'", formalDefinition="Name type, for example 'systematic', 'scientific, 'brand'." ) 2583 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-name-type") 2584 protected CodeableConcept type; 2585 2586 /** 2587 * The status of the name, for example 'current', 'proposed'. 2588 */ 2589 @Child(name = "status", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) 2590 @Description(shortDefinition="The status of the name e.g. 'current', 'proposed'", formalDefinition="The status of the name, for example 'current', 'proposed'." ) 2591 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status") 2592 protected CodeableConcept status; 2593 2594 /** 2595 * If this is the preferred name for this substance. 2596 */ 2597 @Child(name = "preferred", type = {BooleanType.class}, order=4, min=0, max=1, modifier=false, summary=true) 2598 @Description(shortDefinition="If this is the preferred name for this substance", formalDefinition="If this is the preferred name for this substance." ) 2599 protected BooleanType preferred; 2600 2601 /** 2602 * Human language that the name is written in. 2603 */ 2604 @Child(name = "language", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2605 @Description(shortDefinition="Human language that the name is written in", formalDefinition="Human language that the name is written in." ) 2606 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages") 2607 protected List<CodeableConcept> language; 2608 2609 /** 2610 * The use context of this name for example if there is a different name a drug active ingredient as opposed to a food colour additive. 2611 */ 2612 @Child(name = "domain", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2613 @Description(shortDefinition="The use context of this name e.g. as an active ingredient or as a food colour additive", formalDefinition="The use context of this name for example if there is a different name a drug active ingredient as opposed to a food colour additive." ) 2614 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-name-domain") 2615 protected List<CodeableConcept> domain; 2616 2617 /** 2618 * The jurisdiction where this name applies. 2619 */ 2620 @Child(name = "jurisdiction", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2621 @Description(shortDefinition="The jurisdiction where this name applies", formalDefinition="The jurisdiction where this name applies." ) 2622 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction") 2623 protected List<CodeableConcept> jurisdiction; 2624 2625 /** 2626 * A synonym of this particular name, by which the substance is also known. 2627 */ 2628 @Child(name = "synonym", type = {SubstanceDefinitionNameComponent.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2629 @Description(shortDefinition="A synonym of this particular name, by which the substance is also known", formalDefinition="A synonym of this particular name, by which the substance is also known." ) 2630 protected List<SubstanceDefinitionNameComponent> synonym; 2631 2632 /** 2633 * A translation for this name into another human language. 2634 */ 2635 @Child(name = "translation", type = {SubstanceDefinitionNameComponent.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2636 @Description(shortDefinition="A translation for this name into another human language", formalDefinition="A translation for this name into another human language." ) 2637 protected List<SubstanceDefinitionNameComponent> translation; 2638 2639 /** 2640 * Details of the official nature of this name. 2641 */ 2642 @Child(name = "official", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2643 @Description(shortDefinition="Details of the official nature of this name", formalDefinition="Details of the official nature of this name." ) 2644 protected List<SubstanceDefinitionNameOfficialComponent> official; 2645 2646 /** 2647 * Supporting literature. 2648 */ 2649 @Child(name = "source", type = {DocumentReference.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2650 @Description(shortDefinition="Supporting literature", formalDefinition="Supporting literature." ) 2651 protected List<Reference> source; 2652 2653 private static final long serialVersionUID = -1184238780L; 2654 2655 /** 2656 * Constructor 2657 */ 2658 public SubstanceDefinitionNameComponent() { 2659 super(); 2660 } 2661 2662 /** 2663 * Constructor 2664 */ 2665 public SubstanceDefinitionNameComponent(String name) { 2666 super(); 2667 this.setName(name); 2668 } 2669 2670 /** 2671 * @return {@link #name} (The actual name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 2672 */ 2673 public StringType getNameElement() { 2674 if (this.name == null) 2675 if (Configuration.errorOnAutoCreate()) 2676 throw new Error("Attempt to auto-create SubstanceDefinitionNameComponent.name"); 2677 else if (Configuration.doAutoCreate()) 2678 this.name = new StringType(); // bb 2679 return this.name; 2680 } 2681 2682 public boolean hasNameElement() { 2683 return this.name != null && !this.name.isEmpty(); 2684 } 2685 2686 public boolean hasName() { 2687 return this.name != null && !this.name.isEmpty(); 2688 } 2689 2690 /** 2691 * @param value {@link #name} (The actual name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 2692 */ 2693 public SubstanceDefinitionNameComponent setNameElement(StringType value) { 2694 this.name = value; 2695 return this; 2696 } 2697 2698 /** 2699 * @return The actual name. 2700 */ 2701 public String getName() { 2702 return this.name == null ? null : this.name.getValue(); 2703 } 2704 2705 /** 2706 * @param value The actual name. 2707 */ 2708 public SubstanceDefinitionNameComponent setName(String value) { 2709 if (this.name == null) 2710 this.name = new StringType(); 2711 this.name.setValue(value); 2712 return this; 2713 } 2714 2715 /** 2716 * @return {@link #type} (Name type, for example 'systematic', 'scientific, 'brand'.) 2717 */ 2718 public CodeableConcept getType() { 2719 if (this.type == null) 2720 if (Configuration.errorOnAutoCreate()) 2721 throw new Error("Attempt to auto-create SubstanceDefinitionNameComponent.type"); 2722 else if (Configuration.doAutoCreate()) 2723 this.type = new CodeableConcept(); // cc 2724 return this.type; 2725 } 2726 2727 public boolean hasType() { 2728 return this.type != null && !this.type.isEmpty(); 2729 } 2730 2731 /** 2732 * @param value {@link #type} (Name type, for example 'systematic', 'scientific, 'brand'.) 2733 */ 2734 public SubstanceDefinitionNameComponent setType(CodeableConcept value) { 2735 this.type = value; 2736 return this; 2737 } 2738 2739 /** 2740 * @return {@link #status} (The status of the name, for example 'current', 'proposed'.) 2741 */ 2742 public CodeableConcept getStatus() { 2743 if (this.status == null) 2744 if (Configuration.errorOnAutoCreate()) 2745 throw new Error("Attempt to auto-create SubstanceDefinitionNameComponent.status"); 2746 else if (Configuration.doAutoCreate()) 2747 this.status = new CodeableConcept(); // cc 2748 return this.status; 2749 } 2750 2751 public boolean hasStatus() { 2752 return this.status != null && !this.status.isEmpty(); 2753 } 2754 2755 /** 2756 * @param value {@link #status} (The status of the name, for example 'current', 'proposed'.) 2757 */ 2758 public SubstanceDefinitionNameComponent setStatus(CodeableConcept value) { 2759 this.status = value; 2760 return this; 2761 } 2762 2763 /** 2764 * @return {@link #preferred} (If this is the preferred name for this substance.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value 2765 */ 2766 public BooleanType getPreferredElement() { 2767 if (this.preferred == null) 2768 if (Configuration.errorOnAutoCreate()) 2769 throw new Error("Attempt to auto-create SubstanceDefinitionNameComponent.preferred"); 2770 else if (Configuration.doAutoCreate()) 2771 this.preferred = new BooleanType(); // bb 2772 return this.preferred; 2773 } 2774 2775 public boolean hasPreferredElement() { 2776 return this.preferred != null && !this.preferred.isEmpty(); 2777 } 2778 2779 public boolean hasPreferred() { 2780 return this.preferred != null && !this.preferred.isEmpty(); 2781 } 2782 2783 /** 2784 * @param value {@link #preferred} (If this is the preferred name for this substance.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value 2785 */ 2786 public SubstanceDefinitionNameComponent setPreferredElement(BooleanType value) { 2787 this.preferred = value; 2788 return this; 2789 } 2790 2791 /** 2792 * @return If this is the preferred name for this substance. 2793 */ 2794 public boolean getPreferred() { 2795 return this.preferred == null || this.preferred.isEmpty() ? false : this.preferred.getValue(); 2796 } 2797 2798 /** 2799 * @param value If this is the preferred name for this substance. 2800 */ 2801 public SubstanceDefinitionNameComponent setPreferred(boolean value) { 2802 if (this.preferred == null) 2803 this.preferred = new BooleanType(); 2804 this.preferred.setValue(value); 2805 return this; 2806 } 2807 2808 /** 2809 * @return {@link #language} (Human language that the name is written in.) 2810 */ 2811 public List<CodeableConcept> getLanguage() { 2812 if (this.language == null) 2813 this.language = new ArrayList<CodeableConcept>(); 2814 return this.language; 2815 } 2816 2817 /** 2818 * @return Returns a reference to <code>this</code> for easy method chaining 2819 */ 2820 public SubstanceDefinitionNameComponent setLanguage(List<CodeableConcept> theLanguage) { 2821 this.language = theLanguage; 2822 return this; 2823 } 2824 2825 public boolean hasLanguage() { 2826 if (this.language == null) 2827 return false; 2828 for (CodeableConcept item : this.language) 2829 if (!item.isEmpty()) 2830 return true; 2831 return false; 2832 } 2833 2834 public CodeableConcept addLanguage() { //3 2835 CodeableConcept t = new CodeableConcept(); 2836 if (this.language == null) 2837 this.language = new ArrayList<CodeableConcept>(); 2838 this.language.add(t); 2839 return t; 2840 } 2841 2842 public SubstanceDefinitionNameComponent addLanguage(CodeableConcept t) { //3 2843 if (t == null) 2844 return this; 2845 if (this.language == null) 2846 this.language = new ArrayList<CodeableConcept>(); 2847 this.language.add(t); 2848 return this; 2849 } 2850 2851 /** 2852 * @return The first repetition of repeating field {@link #language}, creating it if it does not already exist {3} 2853 */ 2854 public CodeableConcept getLanguageFirstRep() { 2855 if (getLanguage().isEmpty()) { 2856 addLanguage(); 2857 } 2858 return getLanguage().get(0); 2859 } 2860 2861 /** 2862 * @return {@link #domain} (The use context of this name for example if there is a different name a drug active ingredient as opposed to a food colour additive.) 2863 */ 2864 public List<CodeableConcept> getDomain() { 2865 if (this.domain == null) 2866 this.domain = new ArrayList<CodeableConcept>(); 2867 return this.domain; 2868 } 2869 2870 /** 2871 * @return Returns a reference to <code>this</code> for easy method chaining 2872 */ 2873 public SubstanceDefinitionNameComponent setDomain(List<CodeableConcept> theDomain) { 2874 this.domain = theDomain; 2875 return this; 2876 } 2877 2878 public boolean hasDomain() { 2879 if (this.domain == null) 2880 return false; 2881 for (CodeableConcept item : this.domain) 2882 if (!item.isEmpty()) 2883 return true; 2884 return false; 2885 } 2886 2887 public CodeableConcept addDomain() { //3 2888 CodeableConcept t = new CodeableConcept(); 2889 if (this.domain == null) 2890 this.domain = new ArrayList<CodeableConcept>(); 2891 this.domain.add(t); 2892 return t; 2893 } 2894 2895 public SubstanceDefinitionNameComponent addDomain(CodeableConcept t) { //3 2896 if (t == null) 2897 return this; 2898 if (this.domain == null) 2899 this.domain = new ArrayList<CodeableConcept>(); 2900 this.domain.add(t); 2901 return this; 2902 } 2903 2904 /** 2905 * @return The first repetition of repeating field {@link #domain}, creating it if it does not already exist {3} 2906 */ 2907 public CodeableConcept getDomainFirstRep() { 2908 if (getDomain().isEmpty()) { 2909 addDomain(); 2910 } 2911 return getDomain().get(0); 2912 } 2913 2914 /** 2915 * @return {@link #jurisdiction} (The jurisdiction where this name applies.) 2916 */ 2917 public List<CodeableConcept> getJurisdiction() { 2918 if (this.jurisdiction == null) 2919 this.jurisdiction = new ArrayList<CodeableConcept>(); 2920 return this.jurisdiction; 2921 } 2922 2923 /** 2924 * @return Returns a reference to <code>this</code> for easy method chaining 2925 */ 2926 public SubstanceDefinitionNameComponent setJurisdiction(List<CodeableConcept> theJurisdiction) { 2927 this.jurisdiction = theJurisdiction; 2928 return this; 2929 } 2930 2931 public boolean hasJurisdiction() { 2932 if (this.jurisdiction == null) 2933 return false; 2934 for (CodeableConcept item : this.jurisdiction) 2935 if (!item.isEmpty()) 2936 return true; 2937 return false; 2938 } 2939 2940 public CodeableConcept addJurisdiction() { //3 2941 CodeableConcept t = new CodeableConcept(); 2942 if (this.jurisdiction == null) 2943 this.jurisdiction = new ArrayList<CodeableConcept>(); 2944 this.jurisdiction.add(t); 2945 return t; 2946 } 2947 2948 public SubstanceDefinitionNameComponent addJurisdiction(CodeableConcept t) { //3 2949 if (t == null) 2950 return this; 2951 if (this.jurisdiction == null) 2952 this.jurisdiction = new ArrayList<CodeableConcept>(); 2953 this.jurisdiction.add(t); 2954 return this; 2955 } 2956 2957 /** 2958 * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist {3} 2959 */ 2960 public CodeableConcept getJurisdictionFirstRep() { 2961 if (getJurisdiction().isEmpty()) { 2962 addJurisdiction(); 2963 } 2964 return getJurisdiction().get(0); 2965 } 2966 2967 /** 2968 * @return {@link #synonym} (A synonym of this particular name, by which the substance is also known.) 2969 */ 2970 public List<SubstanceDefinitionNameComponent> getSynonym() { 2971 if (this.synonym == null) 2972 this.synonym = new ArrayList<SubstanceDefinitionNameComponent>(); 2973 return this.synonym; 2974 } 2975 2976 /** 2977 * @return Returns a reference to <code>this</code> for easy method chaining 2978 */ 2979 public SubstanceDefinitionNameComponent setSynonym(List<SubstanceDefinitionNameComponent> theSynonym) { 2980 this.synonym = theSynonym; 2981 return this; 2982 } 2983 2984 public boolean hasSynonym() { 2985 if (this.synonym == null) 2986 return false; 2987 for (SubstanceDefinitionNameComponent item : this.synonym) 2988 if (!item.isEmpty()) 2989 return true; 2990 return false; 2991 } 2992 2993 public SubstanceDefinitionNameComponent addSynonym() { //3 2994 SubstanceDefinitionNameComponent t = new SubstanceDefinitionNameComponent(); 2995 if (this.synonym == null) 2996 this.synonym = new ArrayList<SubstanceDefinitionNameComponent>(); 2997 this.synonym.add(t); 2998 return t; 2999 } 3000 3001 public SubstanceDefinitionNameComponent addSynonym(SubstanceDefinitionNameComponent t) { //3 3002 if (t == null) 3003 return this; 3004 if (this.synonym == null) 3005 this.synonym = new ArrayList<SubstanceDefinitionNameComponent>(); 3006 this.synonym.add(t); 3007 return this; 3008 } 3009 3010 /** 3011 * @return The first repetition of repeating field {@link #synonym}, creating it if it does not already exist {3} 3012 */ 3013 public SubstanceDefinitionNameComponent getSynonymFirstRep() { 3014 if (getSynonym().isEmpty()) { 3015 addSynonym(); 3016 } 3017 return getSynonym().get(0); 3018 } 3019 3020 /** 3021 * @return {@link #translation} (A translation for this name into another human language.) 3022 */ 3023 public List<SubstanceDefinitionNameComponent> getTranslation() { 3024 if (this.translation == null) 3025 this.translation = new ArrayList<SubstanceDefinitionNameComponent>(); 3026 return this.translation; 3027 } 3028 3029 /** 3030 * @return Returns a reference to <code>this</code> for easy method chaining 3031 */ 3032 public SubstanceDefinitionNameComponent setTranslation(List<SubstanceDefinitionNameComponent> theTranslation) { 3033 this.translation = theTranslation; 3034 return this; 3035 } 3036 3037 public boolean hasTranslation() { 3038 if (this.translation == null) 3039 return false; 3040 for (SubstanceDefinitionNameComponent item : this.translation) 3041 if (!item.isEmpty()) 3042 return true; 3043 return false; 3044 } 3045 3046 public SubstanceDefinitionNameComponent addTranslation() { //3 3047 SubstanceDefinitionNameComponent t = new SubstanceDefinitionNameComponent(); 3048 if (this.translation == null) 3049 this.translation = new ArrayList<SubstanceDefinitionNameComponent>(); 3050 this.translation.add(t); 3051 return t; 3052 } 3053 3054 public SubstanceDefinitionNameComponent addTranslation(SubstanceDefinitionNameComponent t) { //3 3055 if (t == null) 3056 return this; 3057 if (this.translation == null) 3058 this.translation = new ArrayList<SubstanceDefinitionNameComponent>(); 3059 this.translation.add(t); 3060 return this; 3061 } 3062 3063 /** 3064 * @return The first repetition of repeating field {@link #translation}, creating it if it does not already exist {3} 3065 */ 3066 public SubstanceDefinitionNameComponent getTranslationFirstRep() { 3067 if (getTranslation().isEmpty()) { 3068 addTranslation(); 3069 } 3070 return getTranslation().get(0); 3071 } 3072 3073 /** 3074 * @return {@link #official} (Details of the official nature of this name.) 3075 */ 3076 public List<SubstanceDefinitionNameOfficialComponent> getOfficial() { 3077 if (this.official == null) 3078 this.official = new ArrayList<SubstanceDefinitionNameOfficialComponent>(); 3079 return this.official; 3080 } 3081 3082 /** 3083 * @return Returns a reference to <code>this</code> for easy method chaining 3084 */ 3085 public SubstanceDefinitionNameComponent setOfficial(List<SubstanceDefinitionNameOfficialComponent> theOfficial) { 3086 this.official = theOfficial; 3087 return this; 3088 } 3089 3090 public boolean hasOfficial() { 3091 if (this.official == null) 3092 return false; 3093 for (SubstanceDefinitionNameOfficialComponent item : this.official) 3094 if (!item.isEmpty()) 3095 return true; 3096 return false; 3097 } 3098 3099 public SubstanceDefinitionNameOfficialComponent addOfficial() { //3 3100 SubstanceDefinitionNameOfficialComponent t = new SubstanceDefinitionNameOfficialComponent(); 3101 if (this.official == null) 3102 this.official = new ArrayList<SubstanceDefinitionNameOfficialComponent>(); 3103 this.official.add(t); 3104 return t; 3105 } 3106 3107 public SubstanceDefinitionNameComponent addOfficial(SubstanceDefinitionNameOfficialComponent t) { //3 3108 if (t == null) 3109 return this; 3110 if (this.official == null) 3111 this.official = new ArrayList<SubstanceDefinitionNameOfficialComponent>(); 3112 this.official.add(t); 3113 return this; 3114 } 3115 3116 /** 3117 * @return The first repetition of repeating field {@link #official}, creating it if it does not already exist {3} 3118 */ 3119 public SubstanceDefinitionNameOfficialComponent getOfficialFirstRep() { 3120 if (getOfficial().isEmpty()) { 3121 addOfficial(); 3122 } 3123 return getOfficial().get(0); 3124 } 3125 3126 /** 3127 * @return {@link #source} (Supporting literature.) 3128 */ 3129 public List<Reference> getSource() { 3130 if (this.source == null) 3131 this.source = new ArrayList<Reference>(); 3132 return this.source; 3133 } 3134 3135 /** 3136 * @return Returns a reference to <code>this</code> for easy method chaining 3137 */ 3138 public SubstanceDefinitionNameComponent setSource(List<Reference> theSource) { 3139 this.source = theSource; 3140 return this; 3141 } 3142 3143 public boolean hasSource() { 3144 if (this.source == null) 3145 return false; 3146 for (Reference item : this.source) 3147 if (!item.isEmpty()) 3148 return true; 3149 return false; 3150 } 3151 3152 public Reference addSource() { //3 3153 Reference t = new Reference(); 3154 if (this.source == null) 3155 this.source = new ArrayList<Reference>(); 3156 this.source.add(t); 3157 return t; 3158 } 3159 3160 public SubstanceDefinitionNameComponent addSource(Reference t) { //3 3161 if (t == null) 3162 return this; 3163 if (this.source == null) 3164 this.source = new ArrayList<Reference>(); 3165 this.source.add(t); 3166 return this; 3167 } 3168 3169 /** 3170 * @return The first repetition of repeating field {@link #source}, creating it if it does not already exist {3} 3171 */ 3172 public Reference getSourceFirstRep() { 3173 if (getSource().isEmpty()) { 3174 addSource(); 3175 } 3176 return getSource().get(0); 3177 } 3178 3179 protected void listChildren(List<Property> children) { 3180 super.listChildren(children); 3181 children.add(new Property("name", "string", "The actual name.", 0, 1, name)); 3182 children.add(new Property("type", "CodeableConcept", "Name type, for example 'systematic', 'scientific, 'brand'.", 0, 1, type)); 3183 children.add(new Property("status", "CodeableConcept", "The status of the name, for example 'current', 'proposed'.", 0, 1, status)); 3184 children.add(new Property("preferred", "boolean", "If this is the preferred name for this substance.", 0, 1, preferred)); 3185 children.add(new Property("language", "CodeableConcept", "Human language that the name is written in.", 0, java.lang.Integer.MAX_VALUE, language)); 3186 children.add(new Property("domain", "CodeableConcept", "The use context of this name for example if there is a different name a drug active ingredient as opposed to a food colour additive.", 0, java.lang.Integer.MAX_VALUE, domain)); 3187 children.add(new Property("jurisdiction", "CodeableConcept", "The jurisdiction where this name applies.", 0, java.lang.Integer.MAX_VALUE, jurisdiction)); 3188 children.add(new Property("synonym", "@SubstanceDefinition.name", "A synonym of this particular name, by which the substance is also known.", 0, java.lang.Integer.MAX_VALUE, synonym)); 3189 children.add(new Property("translation", "@SubstanceDefinition.name", "A translation for this name into another human language.", 0, java.lang.Integer.MAX_VALUE, translation)); 3190 children.add(new Property("official", "", "Details of the official nature of this name.", 0, java.lang.Integer.MAX_VALUE, official)); 3191 children.add(new Property("source", "Reference(DocumentReference)", "Supporting literature.", 0, java.lang.Integer.MAX_VALUE, source)); 3192 } 3193 3194 @Override 3195 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 3196 switch (_hash) { 3197 case 3373707: /*name*/ return new Property("name", "string", "The actual name.", 0, 1, name); 3198 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "Name type, for example 'systematic', 'scientific, 'brand'.", 0, 1, type); 3199 case -892481550: /*status*/ return new Property("status", "CodeableConcept", "The status of the name, for example 'current', 'proposed'.", 0, 1, status); 3200 case -1294005119: /*preferred*/ return new Property("preferred", "boolean", "If this is the preferred name for this substance.", 0, 1, preferred); 3201 case -1613589672: /*language*/ return new Property("language", "CodeableConcept", "Human language that the name is written in.", 0, java.lang.Integer.MAX_VALUE, language); 3202 case -1326197564: /*domain*/ return new Property("domain", "CodeableConcept", "The use context of this name for example if there is a different name a drug active ingredient as opposed to a food colour additive.", 0, java.lang.Integer.MAX_VALUE, domain); 3203 case -507075711: /*jurisdiction*/ return new Property("jurisdiction", "CodeableConcept", "The jurisdiction where this name applies.", 0, java.lang.Integer.MAX_VALUE, jurisdiction); 3204 case -1742128133: /*synonym*/ return new Property("synonym", "@SubstanceDefinition.name", "A synonym of this particular name, by which the substance is also known.", 0, java.lang.Integer.MAX_VALUE, synonym); 3205 case -1840647503: /*translation*/ return new Property("translation", "@SubstanceDefinition.name", "A translation for this name into another human language.", 0, java.lang.Integer.MAX_VALUE, translation); 3206 case -765289749: /*official*/ return new Property("official", "", "Details of the official nature of this name.", 0, java.lang.Integer.MAX_VALUE, official); 3207 case -896505829: /*source*/ return new Property("source", "Reference(DocumentReference)", "Supporting literature.", 0, java.lang.Integer.MAX_VALUE, source); 3208 default: return super.getNamedProperty(_hash, _name, _checkValid); 3209 } 3210 3211 } 3212 3213 @Override 3214 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 3215 switch (hash) { 3216 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 3217 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 3218 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept 3219 case -1294005119: /*preferred*/ return this.preferred == null ? new Base[0] : new Base[] {this.preferred}; // BooleanType 3220 case -1613589672: /*language*/ return this.language == null ? new Base[0] : this.language.toArray(new Base[this.language.size()]); // CodeableConcept 3221 case -1326197564: /*domain*/ return this.domain == null ? new Base[0] : this.domain.toArray(new Base[this.domain.size()]); // CodeableConcept 3222 case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept 3223 case -1742128133: /*synonym*/ return this.synonym == null ? new Base[0] : this.synonym.toArray(new Base[this.synonym.size()]); // SubstanceDefinitionNameComponent 3224 case -1840647503: /*translation*/ return this.translation == null ? new Base[0] : this.translation.toArray(new Base[this.translation.size()]); // SubstanceDefinitionNameComponent 3225 case -765289749: /*official*/ return this.official == null ? new Base[0] : this.official.toArray(new Base[this.official.size()]); // SubstanceDefinitionNameOfficialComponent 3226 case -896505829: /*source*/ return this.source == null ? new Base[0] : this.source.toArray(new Base[this.source.size()]); // Reference 3227 default: return super.getProperty(hash, name, checkValid); 3228 } 3229 3230 } 3231 3232 @Override 3233 public Base setProperty(int hash, String name, Base value) throws FHIRException { 3234 switch (hash) { 3235 case 3373707: // name 3236 this.name = TypeConvertor.castToString(value); // StringType 3237 return value; 3238 case 3575610: // type 3239 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 3240 return value; 3241 case -892481550: // status 3242 this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 3243 return value; 3244 case -1294005119: // preferred 3245 this.preferred = TypeConvertor.castToBoolean(value); // BooleanType 3246 return value; 3247 case -1613589672: // language 3248 this.getLanguage().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept 3249 return value; 3250 case -1326197564: // domain 3251 this.getDomain().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept 3252 return value; 3253 case -507075711: // jurisdiction 3254 this.getJurisdiction().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept 3255 return value; 3256 case -1742128133: // synonym 3257 this.getSynonym().add((SubstanceDefinitionNameComponent) value); // SubstanceDefinitionNameComponent 3258 return value; 3259 case -1840647503: // translation 3260 this.getTranslation().add((SubstanceDefinitionNameComponent) value); // SubstanceDefinitionNameComponent 3261 return value; 3262 case -765289749: // official 3263 this.getOfficial().add((SubstanceDefinitionNameOfficialComponent) value); // SubstanceDefinitionNameOfficialComponent 3264 return value; 3265 case -896505829: // source 3266 this.getSource().add(TypeConvertor.castToReference(value)); // Reference 3267 return value; 3268 default: return super.setProperty(hash, name, value); 3269 } 3270 3271 } 3272 3273 @Override 3274 public Base setProperty(String name, Base value) throws FHIRException { 3275 if (name.equals("name")) { 3276 this.name = TypeConvertor.castToString(value); // StringType 3277 } else if (name.equals("type")) { 3278 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 3279 } else if (name.equals("status")) { 3280 this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 3281 } else if (name.equals("preferred")) { 3282 this.preferred = TypeConvertor.castToBoolean(value); // BooleanType 3283 } else if (name.equals("language")) { 3284 this.getLanguage().add(TypeConvertor.castToCodeableConcept(value)); 3285 } else if (name.equals("domain")) { 3286 this.getDomain().add(TypeConvertor.castToCodeableConcept(value)); 3287 } else if (name.equals("jurisdiction")) { 3288 this.getJurisdiction().add(TypeConvertor.castToCodeableConcept(value)); 3289 } else if (name.equals("synonym")) { 3290 this.getSynonym().add((SubstanceDefinitionNameComponent) value); 3291 } else if (name.equals("translation")) { 3292 this.getTranslation().add((SubstanceDefinitionNameComponent) value); 3293 } else if (name.equals("official")) { 3294 this.getOfficial().add((SubstanceDefinitionNameOfficialComponent) value); 3295 } else if (name.equals("source")) { 3296 this.getSource().add(TypeConvertor.castToReference(value)); 3297 } else 3298 return super.setProperty(name, value); 3299 return value; 3300 } 3301 3302 @Override 3303 public Base makeProperty(int hash, String name) throws FHIRException { 3304 switch (hash) { 3305 case 3373707: return getNameElement(); 3306 case 3575610: return getType(); 3307 case -892481550: return getStatus(); 3308 case -1294005119: return getPreferredElement(); 3309 case -1613589672: return addLanguage(); 3310 case -1326197564: return addDomain(); 3311 case -507075711: return addJurisdiction(); 3312 case -1742128133: return addSynonym(); 3313 case -1840647503: return addTranslation(); 3314 case -765289749: return addOfficial(); 3315 case -896505829: return addSource(); 3316 default: return super.makeProperty(hash, name); 3317 } 3318 3319 } 3320 3321 @Override 3322 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 3323 switch (hash) { 3324 case 3373707: /*name*/ return new String[] {"string"}; 3325 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 3326 case -892481550: /*status*/ return new String[] {"CodeableConcept"}; 3327 case -1294005119: /*preferred*/ return new String[] {"boolean"}; 3328 case -1613589672: /*language*/ return new String[] {"CodeableConcept"}; 3329 case -1326197564: /*domain*/ return new String[] {"CodeableConcept"}; 3330 case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"}; 3331 case -1742128133: /*synonym*/ return new String[] {"@SubstanceDefinition.name"}; 3332 case -1840647503: /*translation*/ return new String[] {"@SubstanceDefinition.name"}; 3333 case -765289749: /*official*/ return new String[] {}; 3334 case -896505829: /*source*/ return new String[] {"Reference"}; 3335 default: return super.getTypesForProperty(hash, name); 3336 } 3337 3338 } 3339 3340 @Override 3341 public Base addChild(String name) throws FHIRException { 3342 if (name.equals("name")) { 3343 throw new FHIRException("Cannot call addChild on a primitive type SubstanceDefinition.name.name"); 3344 } 3345 else if (name.equals("type")) { 3346 this.type = new CodeableConcept(); 3347 return this.type; 3348 } 3349 else if (name.equals("status")) { 3350 this.status = new CodeableConcept(); 3351 return this.status; 3352 } 3353 else if (name.equals("preferred")) { 3354 throw new FHIRException("Cannot call addChild on a primitive type SubstanceDefinition.name.preferred"); 3355 } 3356 else if (name.equals("language")) { 3357 return addLanguage(); 3358 } 3359 else if (name.equals("domain")) { 3360 return addDomain(); 3361 } 3362 else if (name.equals("jurisdiction")) { 3363 return addJurisdiction(); 3364 } 3365 else if (name.equals("synonym")) { 3366 return addSynonym(); 3367 } 3368 else if (name.equals("translation")) { 3369 return addTranslation(); 3370 } 3371 else if (name.equals("official")) { 3372 return addOfficial(); 3373 } 3374 else if (name.equals("source")) { 3375 return addSource(); 3376 } 3377 else 3378 return super.addChild(name); 3379 } 3380 3381 public SubstanceDefinitionNameComponent copy() { 3382 SubstanceDefinitionNameComponent dst = new SubstanceDefinitionNameComponent(); 3383 copyValues(dst); 3384 return dst; 3385 } 3386 3387 public void copyValues(SubstanceDefinitionNameComponent dst) { 3388 super.copyValues(dst); 3389 dst.name = name == null ? null : name.copy(); 3390 dst.type = type == null ? null : type.copy(); 3391 dst.status = status == null ? null : status.copy(); 3392 dst.preferred = preferred == null ? null : preferred.copy(); 3393 if (language != null) { 3394 dst.language = new ArrayList<CodeableConcept>(); 3395 for (CodeableConcept i : language) 3396 dst.language.add(i.copy()); 3397 }; 3398 if (domain != null) { 3399 dst.domain = new ArrayList<CodeableConcept>(); 3400 for (CodeableConcept i : domain) 3401 dst.domain.add(i.copy()); 3402 }; 3403 if (jurisdiction != null) { 3404 dst.jurisdiction = new ArrayList<CodeableConcept>(); 3405 for (CodeableConcept i : jurisdiction) 3406 dst.jurisdiction.add(i.copy()); 3407 }; 3408 if (synonym != null) { 3409 dst.synonym = new ArrayList<SubstanceDefinitionNameComponent>(); 3410 for (SubstanceDefinitionNameComponent i : synonym) 3411 dst.synonym.add(i.copy()); 3412 }; 3413 if (translation != null) { 3414 dst.translation = new ArrayList<SubstanceDefinitionNameComponent>(); 3415 for (SubstanceDefinitionNameComponent i : translation) 3416 dst.translation.add(i.copy()); 3417 }; 3418 if (official != null) { 3419 dst.official = new ArrayList<SubstanceDefinitionNameOfficialComponent>(); 3420 for (SubstanceDefinitionNameOfficialComponent i : official) 3421 dst.official.add(i.copy()); 3422 }; 3423 if (source != null) { 3424 dst.source = new ArrayList<Reference>(); 3425 for (Reference i : source) 3426 dst.source.add(i.copy()); 3427 }; 3428 } 3429 3430 @Override 3431 public boolean equalsDeep(Base other_) { 3432 if (!super.equalsDeep(other_)) 3433 return false; 3434 if (!(other_ instanceof SubstanceDefinitionNameComponent)) 3435 return false; 3436 SubstanceDefinitionNameComponent o = (SubstanceDefinitionNameComponent) other_; 3437 return compareDeep(name, o.name, true) && compareDeep(type, o.type, true) && compareDeep(status, o.status, true) 3438 && compareDeep(preferred, o.preferred, true) && compareDeep(language, o.language, true) && compareDeep(domain, o.domain, true) 3439 && compareDeep(jurisdiction, o.jurisdiction, true) && compareDeep(synonym, o.synonym, true) && compareDeep(translation, o.translation, true) 3440 && compareDeep(official, o.official, true) && compareDeep(source, o.source, true); 3441 } 3442 3443 @Override 3444 public boolean equalsShallow(Base other_) { 3445 if (!super.equalsShallow(other_)) 3446 return false; 3447 if (!(other_ instanceof SubstanceDefinitionNameComponent)) 3448 return false; 3449 SubstanceDefinitionNameComponent o = (SubstanceDefinitionNameComponent) other_; 3450 return compareValues(name, o.name, true) && compareValues(preferred, o.preferred, true); 3451 } 3452 3453 public boolean isEmpty() { 3454 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, type, status, preferred 3455 , language, domain, jurisdiction, synonym, translation, official, source); 3456 } 3457 3458 public String fhirType() { 3459 return "SubstanceDefinition.name"; 3460 3461 } 3462 3463 } 3464 3465 @Block() 3466 public static class SubstanceDefinitionNameOfficialComponent extends BackboneElement implements IBaseBackboneElement { 3467 /** 3468 * Which authority uses this official name. 3469 */ 3470 @Child(name = "authority", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 3471 @Description(shortDefinition="Which authority uses this official name", formalDefinition="Which authority uses this official name." ) 3472 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-name-authority") 3473 protected CodeableConcept authority; 3474 3475 /** 3476 * The status of the official name, for example 'draft', 'active', 'retired'. 3477 */ 3478 @Child(name = "status", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 3479 @Description(shortDefinition="The status of the official name, for example 'draft', 'active'", formalDefinition="The status of the official name, for example 'draft', 'active', 'retired'." ) 3480 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status") 3481 protected CodeableConcept status; 3482 3483 /** 3484 * Date of the official name change. 3485 */ 3486 @Child(name = "date", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true) 3487 @Description(shortDefinition="Date of official name change", formalDefinition="Date of the official name change." ) 3488 protected DateTimeType date; 3489 3490 private static final long serialVersionUID = -2040011008L; 3491 3492 /** 3493 * Constructor 3494 */ 3495 public SubstanceDefinitionNameOfficialComponent() { 3496 super(); 3497 } 3498 3499 /** 3500 * @return {@link #authority} (Which authority uses this official name.) 3501 */ 3502 public CodeableConcept getAuthority() { 3503 if (this.authority == null) 3504 if (Configuration.errorOnAutoCreate()) 3505 throw new Error("Attempt to auto-create SubstanceDefinitionNameOfficialComponent.authority"); 3506 else if (Configuration.doAutoCreate()) 3507 this.authority = new CodeableConcept(); // cc 3508 return this.authority; 3509 } 3510 3511 public boolean hasAuthority() { 3512 return this.authority != null && !this.authority.isEmpty(); 3513 } 3514 3515 /** 3516 * @param value {@link #authority} (Which authority uses this official name.) 3517 */ 3518 public SubstanceDefinitionNameOfficialComponent setAuthority(CodeableConcept value) { 3519 this.authority = value; 3520 return this; 3521 } 3522 3523 /** 3524 * @return {@link #status} (The status of the official name, for example 'draft', 'active', 'retired'.) 3525 */ 3526 public CodeableConcept getStatus() { 3527 if (this.status == null) 3528 if (Configuration.errorOnAutoCreate()) 3529 throw new Error("Attempt to auto-create SubstanceDefinitionNameOfficialComponent.status"); 3530 else if (Configuration.doAutoCreate()) 3531 this.status = new CodeableConcept(); // cc 3532 return this.status; 3533 } 3534 3535 public boolean hasStatus() { 3536 return this.status != null && !this.status.isEmpty(); 3537 } 3538 3539 /** 3540 * @param value {@link #status} (The status of the official name, for example 'draft', 'active', 'retired'.) 3541 */ 3542 public SubstanceDefinitionNameOfficialComponent setStatus(CodeableConcept value) { 3543 this.status = value; 3544 return this; 3545 } 3546 3547 /** 3548 * @return {@link #date} (Date of the official name change.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value 3549 */ 3550 public DateTimeType getDateElement() { 3551 if (this.date == null) 3552 if (Configuration.errorOnAutoCreate()) 3553 throw new Error("Attempt to auto-create SubstanceDefinitionNameOfficialComponent.date"); 3554 else if (Configuration.doAutoCreate()) 3555 this.date = new DateTimeType(); // bb 3556 return this.date; 3557 } 3558 3559 public boolean hasDateElement() { 3560 return this.date != null && !this.date.isEmpty(); 3561 } 3562 3563 public boolean hasDate() { 3564 return this.date != null && !this.date.isEmpty(); 3565 } 3566 3567 /** 3568 * @param value {@link #date} (Date of the official name change.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value 3569 */ 3570 public SubstanceDefinitionNameOfficialComponent setDateElement(DateTimeType value) { 3571 this.date = value; 3572 return this; 3573 } 3574 3575 /** 3576 * @return Date of the official name change. 3577 */ 3578 public Date getDate() { 3579 return this.date == null ? null : this.date.getValue(); 3580 } 3581 3582 /** 3583 * @param value Date of the official name change. 3584 */ 3585 public SubstanceDefinitionNameOfficialComponent setDate(Date value) { 3586 if (value == null) 3587 this.date = null; 3588 else { 3589 if (this.date == null) 3590 this.date = new DateTimeType(); 3591 this.date.setValue(value); 3592 } 3593 return this; 3594 } 3595 3596 protected void listChildren(List<Property> children) { 3597 super.listChildren(children); 3598 children.add(new Property("authority", "CodeableConcept", "Which authority uses this official name.", 0, 1, authority)); 3599 children.add(new Property("status", "CodeableConcept", "The status of the official name, for example 'draft', 'active', 'retired'.", 0, 1, status)); 3600 children.add(new Property("date", "dateTime", "Date of the official name change.", 0, 1, date)); 3601 } 3602 3603 @Override 3604 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 3605 switch (_hash) { 3606 case 1475610435: /*authority*/ return new Property("authority", "CodeableConcept", "Which authority uses this official name.", 0, 1, authority); 3607 case -892481550: /*status*/ return new Property("status", "CodeableConcept", "The status of the official name, for example 'draft', 'active', 'retired'.", 0, 1, status); 3608 case 3076014: /*date*/ return new Property("date", "dateTime", "Date of the official name change.", 0, 1, date); 3609 default: return super.getNamedProperty(_hash, _name, _checkValid); 3610 } 3611 3612 } 3613 3614 @Override 3615 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 3616 switch (hash) { 3617 case 1475610435: /*authority*/ return this.authority == null ? new Base[0] : new Base[] {this.authority}; // CodeableConcept 3618 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept 3619 case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType 3620 default: return super.getProperty(hash, name, checkValid); 3621 } 3622 3623 } 3624 3625 @Override 3626 public Base setProperty(int hash, String name, Base value) throws FHIRException { 3627 switch (hash) { 3628 case 1475610435: // authority 3629 this.authority = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 3630 return value; 3631 case -892481550: // status 3632 this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 3633 return value; 3634 case 3076014: // date 3635 this.date = TypeConvertor.castToDateTime(value); // DateTimeType 3636 return value; 3637 default: return super.setProperty(hash, name, value); 3638 } 3639 3640 } 3641 3642 @Override 3643 public Base setProperty(String name, Base value) throws FHIRException { 3644 if (name.equals("authority")) { 3645 this.authority = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 3646 } else if (name.equals("status")) { 3647 this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 3648 } else if (name.equals("date")) { 3649 this.date = TypeConvertor.castToDateTime(value); // DateTimeType 3650 } else 3651 return super.setProperty(name, value); 3652 return value; 3653 } 3654 3655 @Override 3656 public Base makeProperty(int hash, String name) throws FHIRException { 3657 switch (hash) { 3658 case 1475610435: return getAuthority(); 3659 case -892481550: return getStatus(); 3660 case 3076014: return getDateElement(); 3661 default: return super.makeProperty(hash, name); 3662 } 3663 3664 } 3665 3666 @Override 3667 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 3668 switch (hash) { 3669 case 1475610435: /*authority*/ return new String[] {"CodeableConcept"}; 3670 case -892481550: /*status*/ return new String[] {"CodeableConcept"}; 3671 case 3076014: /*date*/ return new String[] {"dateTime"}; 3672 default: return super.getTypesForProperty(hash, name); 3673 } 3674 3675 } 3676 3677 @Override 3678 public Base addChild(String name) throws FHIRException { 3679 if (name.equals("authority")) { 3680 this.authority = new CodeableConcept(); 3681 return this.authority; 3682 } 3683 else if (name.equals("status")) { 3684 this.status = new CodeableConcept(); 3685 return this.status; 3686 } 3687 else if (name.equals("date")) { 3688 throw new FHIRException("Cannot call addChild on a primitive type SubstanceDefinition.name.official.date"); 3689 } 3690 else 3691 return super.addChild(name); 3692 } 3693 3694 public SubstanceDefinitionNameOfficialComponent copy() { 3695 SubstanceDefinitionNameOfficialComponent dst = new SubstanceDefinitionNameOfficialComponent(); 3696 copyValues(dst); 3697 return dst; 3698 } 3699 3700 public void copyValues(SubstanceDefinitionNameOfficialComponent dst) { 3701 super.copyValues(dst); 3702 dst.authority = authority == null ? null : authority.copy(); 3703 dst.status = status == null ? null : status.copy(); 3704 dst.date = date == null ? null : date.copy(); 3705 } 3706 3707 @Override 3708 public boolean equalsDeep(Base other_) { 3709 if (!super.equalsDeep(other_)) 3710 return false; 3711 if (!(other_ instanceof SubstanceDefinitionNameOfficialComponent)) 3712 return false; 3713 SubstanceDefinitionNameOfficialComponent o = (SubstanceDefinitionNameOfficialComponent) other_; 3714 return compareDeep(authority, o.authority, true) && compareDeep(status, o.status, true) && compareDeep(date, o.date, true) 3715 ; 3716 } 3717 3718 @Override 3719 public boolean equalsShallow(Base other_) { 3720 if (!super.equalsShallow(other_)) 3721 return false; 3722 if (!(other_ instanceof SubstanceDefinitionNameOfficialComponent)) 3723 return false; 3724 SubstanceDefinitionNameOfficialComponent o = (SubstanceDefinitionNameOfficialComponent) other_; 3725 return compareValues(date, o.date, true); 3726 } 3727 3728 public boolean isEmpty() { 3729 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(authority, status, date 3730 ); 3731 } 3732 3733 public String fhirType() { 3734 return "SubstanceDefinition.name.official"; 3735 3736 } 3737 3738 } 3739 3740 @Block() 3741 public static class SubstanceDefinitionRelationshipComponent extends BackboneElement implements IBaseBackboneElement { 3742 /** 3743 * A pointer to another substance, as a resource or just a representational code. 3744 */ 3745 @Child(name = "substanceDefinition", type = {SubstanceDefinition.class, CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 3746 @Description(shortDefinition="A pointer to another substance, as a resource or a representational code", formalDefinition="A pointer to another substance, as a resource or just a representational code." ) 3747 protected DataType substanceDefinition; 3748 3749 /** 3750 * For example "salt to parent", "active moiety", "starting material", "polymorph", "impurity of". 3751 */ 3752 @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true) 3753 @Description(shortDefinition="For example \"salt to parent\", \"active moiety\"", formalDefinition="For example \"salt to parent\", \"active moiety\", \"starting material\", \"polymorph\", \"impurity of\"." ) 3754 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-relationship-type") 3755 protected CodeableConcept type; 3756 3757 /** 3758 * For example where an enzyme strongly bonds with a particular substance, this is a defining relationship for that enzyme, out of several possible substance relationships. 3759 */ 3760 @Child(name = "isDefining", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true) 3761 @Description(shortDefinition="For example where an enzyme strongly bonds with a particular substance, this is a defining relationship for that enzyme, out of several possible relationships", formalDefinition="For example where an enzyme strongly bonds with a particular substance, this is a defining relationship for that enzyme, out of several possible substance relationships." ) 3762 protected BooleanType isDefining; 3763 3764 /** 3765 * A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other. 3766 */ 3767 @Child(name = "amount", type = {Quantity.class, Ratio.class, StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) 3768 @Description(shortDefinition="A numeric factor for the relationship, e.g. that a substance salt has some percentage of active substance in relation to some other", formalDefinition="A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other." ) 3769 protected DataType amount; 3770 3771 /** 3772 * For use when the numeric has an uncertain range. 3773 */ 3774 @Child(name = "ratioHighLimitAmount", type = {Ratio.class}, order=5, min=0, max=1, modifier=false, summary=true) 3775 @Description(shortDefinition="For use when the numeric has an uncertain range", formalDefinition="For use when the numeric has an uncertain range." ) 3776 protected Ratio ratioHighLimitAmount; 3777 3778 /** 3779 * An operator for the amount, for example "average", "approximately", "less than". 3780 */ 3781 @Child(name = "comparator", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) 3782 @Description(shortDefinition="An operator for the amount, for example \"average\", \"approximately\", \"less than\"", formalDefinition="An operator for the amount, for example \"average\", \"approximately\", \"less than\"." ) 3783 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-amount-type") 3784 protected CodeableConcept comparator; 3785 3786 /** 3787 * Supporting literature. 3788 */ 3789 @Child(name = "source", type = {DocumentReference.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 3790 @Description(shortDefinition="Supporting literature", formalDefinition="Supporting literature." ) 3791 protected List<Reference> source; 3792 3793 private static final long serialVersionUID = 192222632L; 3794 3795 /** 3796 * Constructor 3797 */ 3798 public SubstanceDefinitionRelationshipComponent() { 3799 super(); 3800 } 3801 3802 /** 3803 * Constructor 3804 */ 3805 public SubstanceDefinitionRelationshipComponent(CodeableConcept type) { 3806 super(); 3807 this.setType(type); 3808 } 3809 3810 /** 3811 * @return {@link #substanceDefinition} (A pointer to another substance, as a resource or just a representational code.) 3812 */ 3813 public DataType getSubstanceDefinition() { 3814 return this.substanceDefinition; 3815 } 3816 3817 /** 3818 * @return {@link #substanceDefinition} (A pointer to another substance, as a resource or just a representational code.) 3819 */ 3820 public Reference getSubstanceDefinitionReference() throws FHIRException { 3821 if (this.substanceDefinition == null) 3822 this.substanceDefinition = new Reference(); 3823 if (!(this.substanceDefinition instanceof Reference)) 3824 throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.substanceDefinition.getClass().getName()+" was encountered"); 3825 return (Reference) this.substanceDefinition; 3826 } 3827 3828 public boolean hasSubstanceDefinitionReference() { 3829 return this != null && this.substanceDefinition instanceof Reference; 3830 } 3831 3832 /** 3833 * @return {@link #substanceDefinition} (A pointer to another substance, as a resource or just a representational code.) 3834 */ 3835 public CodeableConcept getSubstanceDefinitionCodeableConcept() throws FHIRException { 3836 if (this.substanceDefinition == null) 3837 this.substanceDefinition = new CodeableConcept(); 3838 if (!(this.substanceDefinition instanceof CodeableConcept)) 3839 throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.substanceDefinition.getClass().getName()+" was encountered"); 3840 return (CodeableConcept) this.substanceDefinition; 3841 } 3842 3843 public boolean hasSubstanceDefinitionCodeableConcept() { 3844 return this != null && this.substanceDefinition instanceof CodeableConcept; 3845 } 3846 3847 public boolean hasSubstanceDefinition() { 3848 return this.substanceDefinition != null && !this.substanceDefinition.isEmpty(); 3849 } 3850 3851 /** 3852 * @param value {@link #substanceDefinition} (A pointer to another substance, as a resource or just a representational code.) 3853 */ 3854 public SubstanceDefinitionRelationshipComponent setSubstanceDefinition(DataType value) { 3855 if (value != null && !(value instanceof Reference || value instanceof CodeableConcept)) 3856 throw new Error("Not the right type for SubstanceDefinition.relationship.substanceDefinition[x]: "+value.fhirType()); 3857 this.substanceDefinition = value; 3858 return this; 3859 } 3860 3861 /** 3862 * @return {@link #type} (For example "salt to parent", "active moiety", "starting material", "polymorph", "impurity of".) 3863 */ 3864 public CodeableConcept getType() { 3865 if (this.type == null) 3866 if (Configuration.errorOnAutoCreate()) 3867 throw new Error("Attempt to auto-create SubstanceDefinitionRelationshipComponent.type"); 3868 else if (Configuration.doAutoCreate()) 3869 this.type = new CodeableConcept(); // cc 3870 return this.type; 3871 } 3872 3873 public boolean hasType() { 3874 return this.type != null && !this.type.isEmpty(); 3875 } 3876 3877 /** 3878 * @param value {@link #type} (For example "salt to parent", "active moiety", "starting material", "polymorph", "impurity of".) 3879 */ 3880 public SubstanceDefinitionRelationshipComponent setType(CodeableConcept value) { 3881 this.type = value; 3882 return this; 3883 } 3884 3885 /** 3886 * @return {@link #isDefining} (For example where an enzyme strongly bonds with a particular substance, this is a defining relationship for that enzyme, out of several possible substance relationships.). This is the underlying object with id, value and extensions. The accessor "getIsDefining" gives direct access to the value 3887 */ 3888 public BooleanType getIsDefiningElement() { 3889 if (this.isDefining == null) 3890 if (Configuration.errorOnAutoCreate()) 3891 throw new Error("Attempt to auto-create SubstanceDefinitionRelationshipComponent.isDefining"); 3892 else if (Configuration.doAutoCreate()) 3893 this.isDefining = new BooleanType(); // bb 3894 return this.isDefining; 3895 } 3896 3897 public boolean hasIsDefiningElement() { 3898 return this.isDefining != null && !this.isDefining.isEmpty(); 3899 } 3900 3901 public boolean hasIsDefining() { 3902 return this.isDefining != null && !this.isDefining.isEmpty(); 3903 } 3904 3905 /** 3906 * @param value {@link #isDefining} (For example where an enzyme strongly bonds with a particular substance, this is a defining relationship for that enzyme, out of several possible substance relationships.). This is the underlying object with id, value and extensions. The accessor "getIsDefining" gives direct access to the value 3907 */ 3908 public SubstanceDefinitionRelationshipComponent setIsDefiningElement(BooleanType value) { 3909 this.isDefining = value; 3910 return this; 3911 } 3912 3913 /** 3914 * @return For example where an enzyme strongly bonds with a particular substance, this is a defining relationship for that enzyme, out of several possible substance relationships. 3915 */ 3916 public boolean getIsDefining() { 3917 return this.isDefining == null || this.isDefining.isEmpty() ? false : this.isDefining.getValue(); 3918 } 3919 3920 /** 3921 * @param value For example where an enzyme strongly bonds with a particular substance, this is a defining relationship for that enzyme, out of several possible substance relationships. 3922 */ 3923 public SubstanceDefinitionRelationshipComponent setIsDefining(boolean value) { 3924 if (this.isDefining == null) 3925 this.isDefining = new BooleanType(); 3926 this.isDefining.setValue(value); 3927 return this; 3928 } 3929 3930 /** 3931 * @return {@link #amount} (A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other.) 3932 */ 3933 public DataType getAmount() { 3934 return this.amount; 3935 } 3936 3937 /** 3938 * @return {@link #amount} (A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other.) 3939 */ 3940 public Quantity getAmountQuantity() throws FHIRException { 3941 if (this.amount == null) 3942 this.amount = new Quantity(); 3943 if (!(this.amount instanceof Quantity)) 3944 throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.amount.getClass().getName()+" was encountered"); 3945 return (Quantity) this.amount; 3946 } 3947 3948 public boolean hasAmountQuantity() { 3949 return this != null && this.amount instanceof Quantity; 3950 } 3951 3952 /** 3953 * @return {@link #amount} (A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other.) 3954 */ 3955 public Ratio getAmountRatio() throws FHIRException { 3956 if (this.amount == null) 3957 this.amount = new Ratio(); 3958 if (!(this.amount instanceof Ratio)) 3959 throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.amount.getClass().getName()+" was encountered"); 3960 return (Ratio) this.amount; 3961 } 3962 3963 public boolean hasAmountRatio() { 3964 return this != null && this.amount instanceof Ratio; 3965 } 3966 3967 /** 3968 * @return {@link #amount} (A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other.) 3969 */ 3970 public StringType getAmountStringType() throws FHIRException { 3971 if (this.amount == null) 3972 this.amount = new StringType(); 3973 if (!(this.amount instanceof StringType)) 3974 throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.amount.getClass().getName()+" was encountered"); 3975 return (StringType) this.amount; 3976 } 3977 3978 public boolean hasAmountStringType() { 3979 return this != null && this.amount instanceof StringType; 3980 } 3981 3982 public boolean hasAmount() { 3983 return this.amount != null && !this.amount.isEmpty(); 3984 } 3985 3986 /** 3987 * @param value {@link #amount} (A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other.) 3988 */ 3989 public SubstanceDefinitionRelationshipComponent setAmount(DataType value) { 3990 if (value != null && !(value instanceof Quantity || value instanceof Ratio || value instanceof StringType)) 3991 throw new Error("Not the right type for SubstanceDefinition.relationship.amount[x]: "+value.fhirType()); 3992 this.amount = value; 3993 return this; 3994 } 3995 3996 /** 3997 * @return {@link #ratioHighLimitAmount} (For use when the numeric has an uncertain range.) 3998 */ 3999 public Ratio getRatioHighLimitAmount() { 4000 if (this.ratioHighLimitAmount == null) 4001 if (Configuration.errorOnAutoCreate()) 4002 throw new Error("Attempt to auto-create SubstanceDefinitionRelationshipComponent.ratioHighLimitAmount"); 4003 else if (Configuration.doAutoCreate()) 4004 this.ratioHighLimitAmount = new Ratio(); // cc 4005 return this.ratioHighLimitAmount; 4006 } 4007 4008 public boolean hasRatioHighLimitAmount() { 4009 return this.ratioHighLimitAmount != null && !this.ratioHighLimitAmount.isEmpty(); 4010 } 4011 4012 /** 4013 * @param value {@link #ratioHighLimitAmount} (For use when the numeric has an uncertain range.) 4014 */ 4015 public SubstanceDefinitionRelationshipComponent setRatioHighLimitAmount(Ratio value) { 4016 this.ratioHighLimitAmount = value; 4017 return this; 4018 } 4019 4020 /** 4021 * @return {@link #comparator} (An operator for the amount, for example "average", "approximately", "less than".) 4022 */ 4023 public CodeableConcept getComparator() { 4024 if (this.comparator == null) 4025 if (Configuration.errorOnAutoCreate()) 4026 throw new Error("Attempt to auto-create SubstanceDefinitionRelationshipComponent.comparator"); 4027 else if (Configuration.doAutoCreate()) 4028 this.comparator = new CodeableConcept(); // cc 4029 return this.comparator; 4030 } 4031 4032 public boolean hasComparator() { 4033 return this.comparator != null && !this.comparator.isEmpty(); 4034 } 4035 4036 /** 4037 * @param value {@link #comparator} (An operator for the amount, for example "average", "approximately", "less than".) 4038 */ 4039 public SubstanceDefinitionRelationshipComponent setComparator(CodeableConcept value) { 4040 this.comparator = value; 4041 return this; 4042 } 4043 4044 /** 4045 * @return {@link #source} (Supporting literature.) 4046 */ 4047 public List<Reference> getSource() { 4048 if (this.source == null) 4049 this.source = new ArrayList<Reference>(); 4050 return this.source; 4051 } 4052 4053 /** 4054 * @return Returns a reference to <code>this</code> for easy method chaining 4055 */ 4056 public SubstanceDefinitionRelationshipComponent setSource(List<Reference> theSource) { 4057 this.source = theSource; 4058 return this; 4059 } 4060 4061 public boolean hasSource() { 4062 if (this.source == null) 4063 return false; 4064 for (Reference item : this.source) 4065 if (!item.isEmpty()) 4066 return true; 4067 return false; 4068 } 4069 4070 public Reference addSource() { //3 4071 Reference t = new Reference(); 4072 if (this.source == null) 4073 this.source = new ArrayList<Reference>(); 4074 this.source.add(t); 4075 return t; 4076 } 4077 4078 public SubstanceDefinitionRelationshipComponent addSource(Reference t) { //3 4079 if (t == null) 4080 return this; 4081 if (this.source == null) 4082 this.source = new ArrayList<Reference>(); 4083 this.source.add(t); 4084 return this; 4085 } 4086 4087 /** 4088 * @return The first repetition of repeating field {@link #source}, creating it if it does not already exist {3} 4089 */ 4090 public Reference getSourceFirstRep() { 4091 if (getSource().isEmpty()) { 4092 addSource(); 4093 } 4094 return getSource().get(0); 4095 } 4096 4097 protected void listChildren(List<Property> children) { 4098 super.listChildren(children); 4099 children.add(new Property("substanceDefinition[x]", "Reference(SubstanceDefinition)|CodeableConcept", "A pointer to another substance, as a resource or just a representational code.", 0, 1, substanceDefinition)); 4100 children.add(new Property("type", "CodeableConcept", "For example \"salt to parent\", \"active moiety\", \"starting material\", \"polymorph\", \"impurity of\".", 0, 1, type)); 4101 children.add(new Property("isDefining", "boolean", "For example where an enzyme strongly bonds with a particular substance, this is a defining relationship for that enzyme, out of several possible substance relationships.", 0, 1, isDefining)); 4102 children.add(new Property("amount[x]", "Quantity|Ratio|string", "A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other.", 0, 1, amount)); 4103 children.add(new Property("ratioHighLimitAmount", "Ratio", "For use when the numeric has an uncertain range.", 0, 1, ratioHighLimitAmount)); 4104 children.add(new Property("comparator", "CodeableConcept", "An operator for the amount, for example \"average\", \"approximately\", \"less than\".", 0, 1, comparator)); 4105 children.add(new Property("source", "Reference(DocumentReference)", "Supporting literature.", 0, java.lang.Integer.MAX_VALUE, source)); 4106 } 4107 4108 @Override 4109 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 4110 switch (_hash) { 4111 case -1767011651: /*substanceDefinition[x]*/ return new Property("substanceDefinition[x]", "Reference(SubstanceDefinition)|CodeableConcept", "A pointer to another substance, as a resource or just a representational code.", 0, 1, substanceDefinition); 4112 case 718195427: /*substanceDefinition*/ return new Property("substanceDefinition[x]", "Reference(SubstanceDefinition)|CodeableConcept", "A pointer to another substance, as a resource or just a representational code.", 0, 1, substanceDefinition); 4113 case -308206680: /*substanceDefinitionReference*/ return new Property("substanceDefinition[x]", "Reference(SubstanceDefinition)", "A pointer to another substance, as a resource or just a representational code.", 0, 1, substanceDefinition); 4114 case -132490690: /*substanceDefinitionCodeableConcept*/ return new Property("substanceDefinition[x]", "CodeableConcept", "A pointer to another substance, as a resource or just a representational code.", 0, 1, substanceDefinition); 4115 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "For example \"salt to parent\", \"active moiety\", \"starting material\", \"polymorph\", \"impurity of\".", 0, 1, type); 4116 case -141812990: /*isDefining*/ return new Property("isDefining", "boolean", "For example where an enzyme strongly bonds with a particular substance, this is a defining relationship for that enzyme, out of several possible substance relationships.", 0, 1, isDefining); 4117 case 646780200: /*amount[x]*/ return new Property("amount[x]", "Quantity|Ratio|string", "A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other.", 0, 1, amount); 4118 case -1413853096: /*amount*/ return new Property("amount[x]", "Quantity|Ratio|string", "A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other.", 0, 1, amount); 4119 case 1664303363: /*amountQuantity*/ return new Property("amount[x]", "Quantity", "A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other.", 0, 1, amount); 4120 case -1223457133: /*amountRatio*/ return new Property("amount[x]", "Ratio", "A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other.", 0, 1, amount); 4121 case 773651081: /*amountString*/ return new Property("amount[x]", "string", "A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other.", 0, 1, amount); 4122 case -1708404378: /*ratioHighLimitAmount*/ return new Property("ratioHighLimitAmount", "Ratio", "For use when the numeric has an uncertain range.", 0, 1, ratioHighLimitAmount); 4123 case -844673834: /*comparator*/ return new Property("comparator", "CodeableConcept", "An operator for the amount, for example \"average\", \"approximately\", \"less than\".", 0, 1, comparator); 4124 case -896505829: /*source*/ return new Property("source", "Reference(DocumentReference)", "Supporting literature.", 0, java.lang.Integer.MAX_VALUE, source); 4125 default: return super.getNamedProperty(_hash, _name, _checkValid); 4126 } 4127 4128 } 4129 4130 @Override 4131 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 4132 switch (hash) { 4133 case 718195427: /*substanceDefinition*/ return this.substanceDefinition == null ? new Base[0] : new Base[] {this.substanceDefinition}; // DataType 4134 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 4135 case -141812990: /*isDefining*/ return this.isDefining == null ? new Base[0] : new Base[] {this.isDefining}; // BooleanType 4136 case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // DataType 4137 case -1708404378: /*ratioHighLimitAmount*/ return this.ratioHighLimitAmount == null ? new Base[0] : new Base[] {this.ratioHighLimitAmount}; // Ratio 4138 case -844673834: /*comparator*/ return this.comparator == null ? new Base[0] : new Base[] {this.comparator}; // CodeableConcept 4139 case -896505829: /*source*/ return this.source == null ? new Base[0] : this.source.toArray(new Base[this.source.size()]); // Reference 4140 default: return super.getProperty(hash, name, checkValid); 4141 } 4142 4143 } 4144 4145 @Override 4146 public Base setProperty(int hash, String name, Base value) throws FHIRException { 4147 switch (hash) { 4148 case 718195427: // substanceDefinition 4149 this.substanceDefinition = TypeConvertor.castToType(value); // DataType 4150 return value; 4151 case 3575610: // type 4152 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 4153 return value; 4154 case -141812990: // isDefining 4155 this.isDefining = TypeConvertor.castToBoolean(value); // BooleanType 4156 return value; 4157 case -1413853096: // amount 4158 this.amount = TypeConvertor.castToType(value); // DataType 4159 return value; 4160 case -1708404378: // ratioHighLimitAmount 4161 this.ratioHighLimitAmount = TypeConvertor.castToRatio(value); // Ratio 4162 return value; 4163 case -844673834: // comparator 4164 this.comparator = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 4165 return value; 4166 case -896505829: // source 4167 this.getSource().add(TypeConvertor.castToReference(value)); // Reference 4168 return value; 4169 default: return super.setProperty(hash, name, value); 4170 } 4171 4172 } 4173 4174 @Override 4175 public Base setProperty(String name, Base value) throws FHIRException { 4176 if (name.equals("substanceDefinition[x]")) { 4177 this.substanceDefinition = TypeConvertor.castToType(value); // DataType 4178 } else if (name.equals("type")) { 4179 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 4180 } else if (name.equals("isDefining")) { 4181 this.isDefining = TypeConvertor.castToBoolean(value); // BooleanType 4182 } else if (name.equals("amount[x]")) { 4183 this.amount = TypeConvertor.castToType(value); // DataType 4184 } else if (name.equals("ratioHighLimitAmount")) { 4185 this.ratioHighLimitAmount = TypeConvertor.castToRatio(value); // Ratio 4186 } else if (name.equals("comparator")) { 4187 this.comparator = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 4188 } else if (name.equals("source")) { 4189 this.getSource().add(TypeConvertor.castToReference(value)); 4190 } else 4191 return super.setProperty(name, value); 4192 return value; 4193 } 4194 4195 @Override 4196 public Base makeProperty(int hash, String name) throws FHIRException { 4197 switch (hash) { 4198 case -1767011651: return getSubstanceDefinition(); 4199 case 718195427: return getSubstanceDefinition(); 4200 case 3575610: return getType(); 4201 case -141812990: return getIsDefiningElement(); 4202 case 646780200: return getAmount(); 4203 case -1413853096: return getAmount(); 4204 case -1708404378: return getRatioHighLimitAmount(); 4205 case -844673834: return getComparator(); 4206 case -896505829: return addSource(); 4207 default: return super.makeProperty(hash, name); 4208 } 4209 4210 } 4211 4212 @Override 4213 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 4214 switch (hash) { 4215 case 718195427: /*substanceDefinition*/ return new String[] {"Reference", "CodeableConcept"}; 4216 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 4217 case -141812990: /*isDefining*/ return new String[] {"boolean"}; 4218 case -1413853096: /*amount*/ return new String[] {"Quantity", "Ratio", "string"}; 4219 case -1708404378: /*ratioHighLimitAmount*/ return new String[] {"Ratio"}; 4220 case -844673834: /*comparator*/ return new String[] {"CodeableConcept"}; 4221 case -896505829: /*source*/ return new String[] {"Reference"}; 4222 default: return super.getTypesForProperty(hash, name); 4223 } 4224 4225 } 4226 4227 @Override 4228 public Base addChild(String name) throws FHIRException { 4229 if (name.equals("substanceDefinitionReference")) { 4230 this.substanceDefinition = new Reference(); 4231 return this.substanceDefinition; 4232 } 4233 else if (name.equals("substanceDefinitionCodeableConcept")) { 4234 this.substanceDefinition = new CodeableConcept(); 4235 return this.substanceDefinition; 4236 } 4237 else if (name.equals("type")) { 4238 this.type = new CodeableConcept(); 4239 return this.type; 4240 } 4241 else if (name.equals("isDefining")) { 4242 throw new FHIRException("Cannot call addChild on a primitive type SubstanceDefinition.relationship.isDefining"); 4243 } 4244 else if (name.equals("amountQuantity")) { 4245 this.amount = new Quantity(); 4246 return this.amount; 4247 } 4248 else if (name.equals("amountRatio")) { 4249 this.amount = new Ratio(); 4250 return this.amount; 4251 } 4252 else if (name.equals("amountString")) { 4253 this.amount = new StringType(); 4254 return this.amount; 4255 } 4256 else if (name.equals("ratioHighLimitAmount")) { 4257 this.ratioHighLimitAmount = new Ratio(); 4258 return this.ratioHighLimitAmount; 4259 } 4260 else if (name.equals("comparator")) { 4261 this.comparator = new CodeableConcept(); 4262 return this.comparator; 4263 } 4264 else if (name.equals("source")) { 4265 return addSource(); 4266 } 4267 else 4268 return super.addChild(name); 4269 } 4270 4271 public SubstanceDefinitionRelationshipComponent copy() { 4272 SubstanceDefinitionRelationshipComponent dst = new SubstanceDefinitionRelationshipComponent(); 4273 copyValues(dst); 4274 return dst; 4275 } 4276 4277 public void copyValues(SubstanceDefinitionRelationshipComponent dst) { 4278 super.copyValues(dst); 4279 dst.substanceDefinition = substanceDefinition == null ? null : substanceDefinition.copy(); 4280 dst.type = type == null ? null : type.copy(); 4281 dst.isDefining = isDefining == null ? null : isDefining.copy(); 4282 dst.amount = amount == null ? null : amount.copy(); 4283 dst.ratioHighLimitAmount = ratioHighLimitAmount == null ? null : ratioHighLimitAmount.copy(); 4284 dst.comparator = comparator == null ? null : comparator.copy(); 4285 if (source != null) { 4286 dst.source = new ArrayList<Reference>(); 4287 for (Reference i : source) 4288 dst.source.add(i.copy()); 4289 }; 4290 } 4291 4292 @Override 4293 public boolean equalsDeep(Base other_) { 4294 if (!super.equalsDeep(other_)) 4295 return false; 4296 if (!(other_ instanceof SubstanceDefinitionRelationshipComponent)) 4297 return false; 4298 SubstanceDefinitionRelationshipComponent o = (SubstanceDefinitionRelationshipComponent) other_; 4299 return compareDeep(substanceDefinition, o.substanceDefinition, true) && compareDeep(type, o.type, true) 4300 && compareDeep(isDefining, o.isDefining, true) && compareDeep(amount, o.amount, true) && compareDeep(ratioHighLimitAmount, o.ratioHighLimitAmount, true) 4301 && compareDeep(comparator, o.comparator, true) && compareDeep(source, o.source, true); 4302 } 4303 4304 @Override 4305 public boolean equalsShallow(Base other_) { 4306 if (!super.equalsShallow(other_)) 4307 return false; 4308 if (!(other_ instanceof SubstanceDefinitionRelationshipComponent)) 4309 return false; 4310 SubstanceDefinitionRelationshipComponent o = (SubstanceDefinitionRelationshipComponent) other_; 4311 return compareValues(isDefining, o.isDefining, true); 4312 } 4313 4314 public boolean isEmpty() { 4315 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(substanceDefinition, type 4316 , isDefining, amount, ratioHighLimitAmount, comparator, source); 4317 } 4318 4319 public String fhirType() { 4320 return "SubstanceDefinition.relationship"; 4321 4322 } 4323 4324 } 4325 4326 @Block() 4327 public static class SubstanceDefinitionSourceMaterialComponent extends BackboneElement implements IBaseBackboneElement { 4328 /** 4329 * A classification that provides the origin of the raw material. Example: cat hair would be an Animal source type. 4330 */ 4331 @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 4332 @Description(shortDefinition="Classification of the origin of the raw material. e.g. cat hair is an Animal source type", formalDefinition="A classification that provides the origin of the raw material. Example: cat hair would be an Animal source type." ) 4333 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-source-material-type") 4334 protected CodeableConcept type; 4335 4336 /** 4337 * The genus of an organism, typically referring to the Latin epithet of the genus element of the plant/animal scientific name. 4338 */ 4339 @Child(name = "genus", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 4340 @Description(shortDefinition="The genus of an organism e.g. the Latin epithet of the plant/animal scientific name", formalDefinition="The genus of an organism, typically referring to the Latin epithet of the genus element of the plant/animal scientific name." ) 4341 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-source-material-genus") 4342 protected CodeableConcept genus; 4343 4344 /** 4345 * The species of an organism, typically referring to the Latin epithet of the species of the plant/animal. 4346 */ 4347 @Child(name = "species", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) 4348 @Description(shortDefinition="The species of an organism e.g. the Latin epithet of the species of the plant/animal", formalDefinition="The species of an organism, typically referring to the Latin epithet of the species of the plant/animal." ) 4349 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-source-material-species") 4350 protected CodeableConcept species; 4351 4352 /** 4353 * An anatomical origin of the source material within an organism. 4354 */ 4355 @Child(name = "part", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) 4356 @Description(shortDefinition="An anatomical origin of the source material within an organism", formalDefinition="An anatomical origin of the source material within an organism." ) 4357 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-source-material-part") 4358 protected CodeableConcept part; 4359 4360 /** 4361 * The country or countries where the material is harvested. 4362 */ 4363 @Child(name = "countryOfOrigin", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4364 @Description(shortDefinition="The country or countries where the material is harvested", formalDefinition="The country or countries where the material is harvested." ) 4365 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/country") 4366 protected List<CodeableConcept> countryOfOrigin; 4367 4368 private static final long serialVersionUID = 569352795L; 4369 4370 /** 4371 * Constructor 4372 */ 4373 public SubstanceDefinitionSourceMaterialComponent() { 4374 super(); 4375 } 4376 4377 /** 4378 * @return {@link #type} (A classification that provides the origin of the raw material. Example: cat hair would be an Animal source type.) 4379 */ 4380 public CodeableConcept getType() { 4381 if (this.type == null) 4382 if (Configuration.errorOnAutoCreate()) 4383 throw new Error("Attempt to auto-create SubstanceDefinitionSourceMaterialComponent.type"); 4384 else if (Configuration.doAutoCreate()) 4385 this.type = new CodeableConcept(); // cc 4386 return this.type; 4387 } 4388 4389 public boolean hasType() { 4390 return this.type != null && !this.type.isEmpty(); 4391 } 4392 4393 /** 4394 * @param value {@link #type} (A classification that provides the origin of the raw material. Example: cat hair would be an Animal source type.) 4395 */ 4396 public SubstanceDefinitionSourceMaterialComponent setType(CodeableConcept value) { 4397 this.type = value; 4398 return this; 4399 } 4400 4401 /** 4402 * @return {@link #genus} (The genus of an organism, typically referring to the Latin epithet of the genus element of the plant/animal scientific name.) 4403 */ 4404 public CodeableConcept getGenus() { 4405 if (this.genus == null) 4406 if (Configuration.errorOnAutoCreate()) 4407 throw new Error("Attempt to auto-create SubstanceDefinitionSourceMaterialComponent.genus"); 4408 else if (Configuration.doAutoCreate()) 4409 this.genus = new CodeableConcept(); // cc 4410 return this.genus; 4411 } 4412 4413 public boolean hasGenus() { 4414 return this.genus != null && !this.genus.isEmpty(); 4415 } 4416 4417 /** 4418 * @param value {@link #genus} (The genus of an organism, typically referring to the Latin epithet of the genus element of the plant/animal scientific name.) 4419 */ 4420 public SubstanceDefinitionSourceMaterialComponent setGenus(CodeableConcept value) { 4421 this.genus = value; 4422 return this; 4423 } 4424 4425 /** 4426 * @return {@link #species} (The species of an organism, typically referring to the Latin epithet of the species of the plant/animal.) 4427 */ 4428 public CodeableConcept getSpecies() { 4429 if (this.species == null) 4430 if (Configuration.errorOnAutoCreate()) 4431 throw new Error("Attempt to auto-create SubstanceDefinitionSourceMaterialComponent.species"); 4432 else if (Configuration.doAutoCreate()) 4433 this.species = new CodeableConcept(); // cc 4434 return this.species; 4435 } 4436 4437 public boolean hasSpecies() { 4438 return this.species != null && !this.species.isEmpty(); 4439 } 4440 4441 /** 4442 * @param value {@link #species} (The species of an organism, typically referring to the Latin epithet of the species of the plant/animal.) 4443 */ 4444 public SubstanceDefinitionSourceMaterialComponent setSpecies(CodeableConcept value) { 4445 this.species = value; 4446 return this; 4447 } 4448 4449 /** 4450 * @return {@link #part} (An anatomical origin of the source material within an organism.) 4451 */ 4452 public CodeableConcept getPart() { 4453 if (this.part == null) 4454 if (Configuration.errorOnAutoCreate()) 4455 throw new Error("Attempt to auto-create SubstanceDefinitionSourceMaterialComponent.part"); 4456 else if (Configuration.doAutoCreate()) 4457 this.part = new CodeableConcept(); // cc 4458 return this.part; 4459 } 4460 4461 public boolean hasPart() { 4462 return this.part != null && !this.part.isEmpty(); 4463 } 4464 4465 /** 4466 * @param value {@link #part} (An anatomical origin of the source material within an organism.) 4467 */ 4468 public SubstanceDefinitionSourceMaterialComponent setPart(CodeableConcept value) { 4469 this.part = value; 4470 return this; 4471 } 4472 4473 /** 4474 * @return {@link #countryOfOrigin} (The country or countries where the material is harvested.) 4475 */ 4476 public List<CodeableConcept> getCountryOfOrigin() { 4477 if (this.countryOfOrigin == null) 4478 this.countryOfOrigin = new ArrayList<CodeableConcept>(); 4479 return this.countryOfOrigin; 4480 } 4481 4482 /** 4483 * @return Returns a reference to <code>this</code> for easy method chaining 4484 */ 4485 public SubstanceDefinitionSourceMaterialComponent setCountryOfOrigin(List<CodeableConcept> theCountryOfOrigin) { 4486 this.countryOfOrigin = theCountryOfOrigin; 4487 return this; 4488 } 4489 4490 public boolean hasCountryOfOrigin() { 4491 if (this.countryOfOrigin == null) 4492 return false; 4493 for (CodeableConcept item : this.countryOfOrigin) 4494 if (!item.isEmpty()) 4495 return true; 4496 return false; 4497 } 4498 4499 public CodeableConcept addCountryOfOrigin() { //3 4500 CodeableConcept t = new CodeableConcept(); 4501 if (this.countryOfOrigin == null) 4502 this.countryOfOrigin = new ArrayList<CodeableConcept>(); 4503 this.countryOfOrigin.add(t); 4504 return t; 4505 } 4506 4507 public SubstanceDefinitionSourceMaterialComponent addCountryOfOrigin(CodeableConcept t) { //3 4508 if (t == null) 4509 return this; 4510 if (this.countryOfOrigin == null) 4511 this.countryOfOrigin = new ArrayList<CodeableConcept>(); 4512 this.countryOfOrigin.add(t); 4513 return this; 4514 } 4515 4516 /** 4517 * @return The first repetition of repeating field {@link #countryOfOrigin}, creating it if it does not already exist {3} 4518 */ 4519 public CodeableConcept getCountryOfOriginFirstRep() { 4520 if (getCountryOfOrigin().isEmpty()) { 4521 addCountryOfOrigin(); 4522 } 4523 return getCountryOfOrigin().get(0); 4524 } 4525 4526 protected void listChildren(List<Property> children) { 4527 super.listChildren(children); 4528 children.add(new Property("type", "CodeableConcept", "A classification that provides the origin of the raw material. Example: cat hair would be an Animal source type.", 0, 1, type)); 4529 children.add(new Property("genus", "CodeableConcept", "The genus of an organism, typically referring to the Latin epithet of the genus element of the plant/animal scientific name.", 0, 1, genus)); 4530 children.add(new Property("species", "CodeableConcept", "The species of an organism, typically referring to the Latin epithet of the species of the plant/animal.", 0, 1, species)); 4531 children.add(new Property("part", "CodeableConcept", "An anatomical origin of the source material within an organism.", 0, 1, part)); 4532 children.add(new Property("countryOfOrigin", "CodeableConcept", "The country or countries where the material is harvested.", 0, java.lang.Integer.MAX_VALUE, countryOfOrigin)); 4533 } 4534 4535 @Override 4536 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 4537 switch (_hash) { 4538 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "A classification that provides the origin of the raw material. Example: cat hair would be an Animal source type.", 0, 1, type); 4539 case 98241006: /*genus*/ return new Property("genus", "CodeableConcept", "The genus of an organism, typically referring to the Latin epithet of the genus element of the plant/animal scientific name.", 0, 1, genus); 4540 case -2008465092: /*species*/ return new Property("species", "CodeableConcept", "The species of an organism, typically referring to the Latin epithet of the species of the plant/animal.", 0, 1, species); 4541 case 3433459: /*part*/ return new Property("part", "CodeableConcept", "An anatomical origin of the source material within an organism.", 0, 1, part); 4542 case 57176467: /*countryOfOrigin*/ return new Property("countryOfOrigin", "CodeableConcept", "The country or countries where the material is harvested.", 0, java.lang.Integer.MAX_VALUE, countryOfOrigin); 4543 default: return super.getNamedProperty(_hash, _name, _checkValid); 4544 } 4545 4546 } 4547 4548 @Override 4549 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 4550 switch (hash) { 4551 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 4552 case 98241006: /*genus*/ return this.genus == null ? new Base[0] : new Base[] {this.genus}; // CodeableConcept 4553 case -2008465092: /*species*/ return this.species == null ? new Base[0] : new Base[] {this.species}; // CodeableConcept 4554 case 3433459: /*part*/ return this.part == null ? new Base[0] : new Base[] {this.part}; // CodeableConcept 4555 case 57176467: /*countryOfOrigin*/ return this.countryOfOrigin == null ? new Base[0] : this.countryOfOrigin.toArray(new Base[this.countryOfOrigin.size()]); // CodeableConcept 4556 default: return super.getProperty(hash, name, checkValid); 4557 } 4558 4559 } 4560 4561 @Override 4562 public Base setProperty(int hash, String name, Base value) throws FHIRException { 4563 switch (hash) { 4564 case 3575610: // type 4565 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 4566 return value; 4567 case 98241006: // genus 4568 this.genus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 4569 return value; 4570 case -2008465092: // species 4571 this.species = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 4572 return value; 4573 case 3433459: // part 4574 this.part = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 4575 return value; 4576 case 57176467: // countryOfOrigin 4577 this.getCountryOfOrigin().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept 4578 return value; 4579 default: return super.setProperty(hash, name, value); 4580 } 4581 4582 } 4583 4584 @Override 4585 public Base setProperty(String name, Base value) throws FHIRException { 4586 if (name.equals("type")) { 4587 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 4588 } else if (name.equals("genus")) { 4589 this.genus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 4590 } else if (name.equals("species")) { 4591 this.species = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 4592 } else if (name.equals("part")) { 4593 this.part = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 4594 } else if (name.equals("countryOfOrigin")) { 4595 this.getCountryOfOrigin().add(TypeConvertor.castToCodeableConcept(value)); 4596 } else 4597 return super.setProperty(name, value); 4598 return value; 4599 } 4600 4601 @Override 4602 public Base makeProperty(int hash, String name) throws FHIRException { 4603 switch (hash) { 4604 case 3575610: return getType(); 4605 case 98241006: return getGenus(); 4606 case -2008465092: return getSpecies(); 4607 case 3433459: return getPart(); 4608 case 57176467: return addCountryOfOrigin(); 4609 default: return super.makeProperty(hash, name); 4610 } 4611 4612 } 4613 4614 @Override 4615 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 4616 switch (hash) { 4617 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 4618 case 98241006: /*genus*/ return new String[] {"CodeableConcept"}; 4619 case -2008465092: /*species*/ return new String[] {"CodeableConcept"}; 4620 case 3433459: /*part*/ return new String[] {"CodeableConcept"}; 4621 case 57176467: /*countryOfOrigin*/ return new String[] {"CodeableConcept"}; 4622 default: return super.getTypesForProperty(hash, name); 4623 } 4624 4625 } 4626 4627 @Override 4628 public Base addChild(String name) throws FHIRException { 4629 if (name.equals("type")) { 4630 this.type = new CodeableConcept(); 4631 return this.type; 4632 } 4633 else if (name.equals("genus")) { 4634 this.genus = new CodeableConcept(); 4635 return this.genus; 4636 } 4637 else if (name.equals("species")) { 4638 this.species = new CodeableConcept(); 4639 return this.species; 4640 } 4641 else if (name.equals("part")) { 4642 this.part = new CodeableConcept(); 4643 return this.part; 4644 } 4645 else if (name.equals("countryOfOrigin")) { 4646 return addCountryOfOrigin(); 4647 } 4648 else 4649 return super.addChild(name); 4650 } 4651 4652 public SubstanceDefinitionSourceMaterialComponent copy() { 4653 SubstanceDefinitionSourceMaterialComponent dst = new SubstanceDefinitionSourceMaterialComponent(); 4654 copyValues(dst); 4655 return dst; 4656 } 4657 4658 public void copyValues(SubstanceDefinitionSourceMaterialComponent dst) { 4659 super.copyValues(dst); 4660 dst.type = type == null ? null : type.copy(); 4661 dst.genus = genus == null ? null : genus.copy(); 4662 dst.species = species == null ? null : species.copy(); 4663 dst.part = part == null ? null : part.copy(); 4664 if (countryOfOrigin != null) { 4665 dst.countryOfOrigin = new ArrayList<CodeableConcept>(); 4666 for (CodeableConcept i : countryOfOrigin) 4667 dst.countryOfOrigin.add(i.copy()); 4668 }; 4669 } 4670 4671 @Override 4672 public boolean equalsDeep(Base other_) { 4673 if (!super.equalsDeep(other_)) 4674 return false; 4675 if (!(other_ instanceof SubstanceDefinitionSourceMaterialComponent)) 4676 return false; 4677 SubstanceDefinitionSourceMaterialComponent o = (SubstanceDefinitionSourceMaterialComponent) other_; 4678 return compareDeep(type, o.type, true) && compareDeep(genus, o.genus, true) && compareDeep(species, o.species, true) 4679 && compareDeep(part, o.part, true) && compareDeep(countryOfOrigin, o.countryOfOrigin, true); 4680 } 4681 4682 @Override 4683 public boolean equalsShallow(Base other_) { 4684 if (!super.equalsShallow(other_)) 4685 return false; 4686 if (!(other_ instanceof SubstanceDefinitionSourceMaterialComponent)) 4687 return false; 4688 SubstanceDefinitionSourceMaterialComponent o = (SubstanceDefinitionSourceMaterialComponent) other_; 4689 return true; 4690 } 4691 4692 public boolean isEmpty() { 4693 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, genus, species, part 4694 , countryOfOrigin); 4695 } 4696 4697 public String fhirType() { 4698 return "SubstanceDefinition.sourceMaterial"; 4699 4700 } 4701 4702 } 4703 4704 /** 4705 * Identifier by which this substance is known. 4706 */ 4707 @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4708 @Description(shortDefinition="Identifier by which this substance is known", formalDefinition="Identifier by which this substance is known." ) 4709 protected List<Identifier> identifier; 4710 4711 /** 4712 * A business level version identifier of the substance. 4713 */ 4714 @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) 4715 @Description(shortDefinition="A business level version identifier of the substance", formalDefinition="A business level version identifier of the substance." ) 4716 protected StringType version; 4717 4718 /** 4719 * Status of substance within the catalogue e.g. active, retired. 4720 */ 4721 @Child(name = "status", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 4722 @Description(shortDefinition="Status of substance within the catalogue e.g. active, retired", formalDefinition="Status of substance within the catalogue e.g. active, retired." ) 4723 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status") 4724 protected CodeableConcept status; 4725 4726 /** 4727 * A high level categorization, e.g. polymer or nucleic acid, or food, chemical, biological, or a lower level such as the general types of polymer (linear or branch chain) or type of impurity (process related or contaminant). 4728 */ 4729 @Child(name = "classification", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4730 @Description(shortDefinition="A categorization, high level e.g. polymer or nucleic acid, or food, chemical, biological, or lower e.g. polymer linear or branch chain, or type of impurity", formalDefinition="A high level categorization, e.g. polymer or nucleic acid, or food, chemical, biological, or a lower level such as the general types of polymer (linear or branch chain) or type of impurity (process related or contaminant)." ) 4731 protected List<CodeableConcept> classification; 4732 4733 /** 4734 * If the substance applies to human or veterinary use. 4735 */ 4736 @Child(name = "domain", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) 4737 @Description(shortDefinition="If the substance applies to human or veterinary use", formalDefinition="If the substance applies to human or veterinary use." ) 4738 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/medicinal-product-domain") 4739 protected CodeableConcept domain; 4740 4741 /** 4742 * The quality standard, established benchmark, to which substance complies (e.g. USP/NF, Ph. Eur, JP, BP, Company Standard). 4743 */ 4744 @Child(name = "grade", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4745 @Description(shortDefinition="The quality standard, established benchmark, to which substance complies (e.g. USP/NF, BP)", formalDefinition="The quality standard, established benchmark, to which substance complies (e.g. USP/NF, Ph. Eur, JP, BP, Company Standard)." ) 4746 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-grade") 4747 protected List<CodeableConcept> grade; 4748 4749 /** 4750 * Textual description of the substance. 4751 */ 4752 @Child(name = "description", type = {MarkdownType.class}, order=6, min=0, max=1, modifier=false, summary=true) 4753 @Description(shortDefinition="Textual description of the substance", formalDefinition="Textual description of the substance." ) 4754 protected MarkdownType description; 4755 4756 /** 4757 * Supporting literature. 4758 */ 4759 @Child(name = "informationSource", type = {Citation.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4760 @Description(shortDefinition="Supporting literature", formalDefinition="Supporting literature." ) 4761 protected List<Reference> informationSource; 4762 4763 /** 4764 * Textual comment about the substance's catalogue or registry record. 4765 */ 4766 @Child(name = "note", type = {Annotation.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4767 @Description(shortDefinition="Textual comment about the substance's catalogue or registry record", formalDefinition="Textual comment about the substance's catalogue or registry record." ) 4768 protected List<Annotation> note; 4769 4770 /** 4771 * The entity that creates, makes, produces or fabricates the substance. This is a set of potential manufacturers but is not necessarily comprehensive. 4772 */ 4773 @Child(name = "manufacturer", type = {Organization.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4774 @Description(shortDefinition="The entity that creates, makes, produces or fabricates the substance", formalDefinition="The entity that creates, makes, produces or fabricates the substance. This is a set of potential manufacturers but is not necessarily comprehensive." ) 4775 protected List<Reference> manufacturer; 4776 4777 /** 4778 * An entity that is the source for the substance. It may be different from the manufacturer. Supplier is synonymous to a distributor. 4779 */ 4780 @Child(name = "supplier", type = {Organization.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4781 @Description(shortDefinition="An entity that is the source for the substance. It may be different from the manufacturer", formalDefinition="An entity that is the source for the substance. It may be different from the manufacturer. Supplier is synonymous to a distributor." ) 4782 protected List<Reference> supplier; 4783 4784 /** 4785 * Moiety, for structural modifications. 4786 */ 4787 @Child(name = "moiety", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4788 @Description(shortDefinition="Moiety, for structural modifications", formalDefinition="Moiety, for structural modifications." ) 4789 protected List<SubstanceDefinitionMoietyComponent> moiety; 4790 4791 /** 4792 * General specifications for this substance. 4793 */ 4794 @Child(name = "property", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4795 @Description(shortDefinition="General specifications for this substance", formalDefinition="General specifications for this substance." ) 4796 protected List<SubstanceDefinitionPropertyComponent> property; 4797 4798 /** 4799 * General information detailing this substance. 4800 */ 4801 @Child(name = "referenceInformation", type = {SubstanceReferenceInformation.class}, order=13, min=0, max=1, modifier=false, summary=true) 4802 @Description(shortDefinition="General information detailing this substance", formalDefinition="General information detailing this substance." ) 4803 protected Reference referenceInformation; 4804 4805 /** 4806 * The molecular weight or weight range (for proteins, polymers or nucleic acids). 4807 */ 4808 @Child(name = "molecularWeight", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4809 @Description(shortDefinition="The molecular weight or weight range", formalDefinition="The molecular weight or weight range (for proteins, polymers or nucleic acids)." ) 4810 protected List<SubstanceDefinitionMolecularWeightComponent> molecularWeight; 4811 4812 /** 4813 * Structural information. 4814 */ 4815 @Child(name = "structure", type = {}, order=15, min=0, max=1, modifier=false, summary=true) 4816 @Description(shortDefinition="Structural information", formalDefinition="Structural information." ) 4817 protected SubstanceDefinitionStructureComponent structure; 4818 4819 /** 4820 * Codes associated with the substance. 4821 */ 4822 @Child(name = "code", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4823 @Description(shortDefinition="Codes associated with the substance", formalDefinition="Codes associated with the substance." ) 4824 protected List<SubstanceDefinitionCodeComponent> code; 4825 4826 /** 4827 * Names applicable to this substance. 4828 */ 4829 @Child(name = "name", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4830 @Description(shortDefinition="Names applicable to this substance", formalDefinition="Names applicable to this substance." ) 4831 protected List<SubstanceDefinitionNameComponent> name; 4832 4833 /** 4834 * A link between this substance and another, with details of the relationship. 4835 */ 4836 @Child(name = "relationship", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 4837 @Description(shortDefinition="A link between this substance and another", formalDefinition="A link between this substance and another, with details of the relationship." ) 4838 protected List<SubstanceDefinitionRelationshipComponent> relationship; 4839 4840 /** 4841 * Data items specific to nucleic acids. 4842 */ 4843 @Child(name = "nucleicAcid", type = {SubstanceNucleicAcid.class}, order=19, min=0, max=1, modifier=false, summary=true) 4844 @Description(shortDefinition="Data items specific to nucleic acids", formalDefinition="Data items specific to nucleic acids." ) 4845 protected Reference nucleicAcid; 4846 4847 /** 4848 * Data items specific to polymers. 4849 */ 4850 @Child(name = "polymer", type = {SubstancePolymer.class}, order=20, min=0, max=1, modifier=false, summary=true) 4851 @Description(shortDefinition="Data items specific to polymers", formalDefinition="Data items specific to polymers." ) 4852 protected Reference polymer; 4853 4854 /** 4855 * Data items specific to proteins. 4856 */ 4857 @Child(name = "protein", type = {SubstanceProtein.class}, order=21, min=0, max=1, modifier=false, summary=true) 4858 @Description(shortDefinition="Data items specific to proteins", formalDefinition="Data items specific to proteins." ) 4859 protected Reference protein; 4860 4861 /** 4862 * Material or taxonomic/anatomical source for the substance. 4863 */ 4864 @Child(name = "sourceMaterial", type = {}, order=22, min=0, max=1, modifier=false, summary=true) 4865 @Description(shortDefinition="Material or taxonomic/anatomical source", formalDefinition="Material or taxonomic/anatomical source for the substance." ) 4866 protected SubstanceDefinitionSourceMaterialComponent sourceMaterial; 4867 4868 private static final long serialVersionUID = 23576785L; 4869 4870 /** 4871 * Constructor 4872 */ 4873 public SubstanceDefinition() { 4874 super(); 4875 } 4876 4877 /** 4878 * @return {@link #identifier} (Identifier by which this substance is known.) 4879 */ 4880 public List<Identifier> getIdentifier() { 4881 if (this.identifier == null) 4882 this.identifier = new ArrayList<Identifier>(); 4883 return this.identifier; 4884 } 4885 4886 /** 4887 * @return Returns a reference to <code>this</code> for easy method chaining 4888 */ 4889 public SubstanceDefinition setIdentifier(List<Identifier> theIdentifier) { 4890 this.identifier = theIdentifier; 4891 return this; 4892 } 4893 4894 public boolean hasIdentifier() { 4895 if (this.identifier == null) 4896 return false; 4897 for (Identifier item : this.identifier) 4898 if (!item.isEmpty()) 4899 return true; 4900 return false; 4901 } 4902 4903 public Identifier addIdentifier() { //3 4904 Identifier t = new Identifier(); 4905 if (this.identifier == null) 4906 this.identifier = new ArrayList<Identifier>(); 4907 this.identifier.add(t); 4908 return t; 4909 } 4910 4911 public SubstanceDefinition addIdentifier(Identifier t) { //3 4912 if (t == null) 4913 return this; 4914 if (this.identifier == null) 4915 this.identifier = new ArrayList<Identifier>(); 4916 this.identifier.add(t); 4917 return this; 4918 } 4919 4920 /** 4921 * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3} 4922 */ 4923 public Identifier getIdentifierFirstRep() { 4924 if (getIdentifier().isEmpty()) { 4925 addIdentifier(); 4926 } 4927 return getIdentifier().get(0); 4928 } 4929 4930 /** 4931 * @return {@link #version} (A business level version identifier of the substance.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value 4932 */ 4933 public StringType getVersionElement() { 4934 if (this.version == null) 4935 if (Configuration.errorOnAutoCreate()) 4936 throw new Error("Attempt to auto-create SubstanceDefinition.version"); 4937 else if (Configuration.doAutoCreate()) 4938 this.version = new StringType(); // bb 4939 return this.version; 4940 } 4941 4942 public boolean hasVersionElement() { 4943 return this.version != null && !this.version.isEmpty(); 4944 } 4945 4946 public boolean hasVersion() { 4947 return this.version != null && !this.version.isEmpty(); 4948 } 4949 4950 /** 4951 * @param value {@link #version} (A business level version identifier of the substance.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value 4952 */ 4953 public SubstanceDefinition setVersionElement(StringType value) { 4954 this.version = value; 4955 return this; 4956 } 4957 4958 /** 4959 * @return A business level version identifier of the substance. 4960 */ 4961 public String getVersion() { 4962 return this.version == null ? null : this.version.getValue(); 4963 } 4964 4965 /** 4966 * @param value A business level version identifier of the substance. 4967 */ 4968 public SubstanceDefinition setVersion(String value) { 4969 if (Utilities.noString(value)) 4970 this.version = null; 4971 else { 4972 if (this.version == null) 4973 this.version = new StringType(); 4974 this.version.setValue(value); 4975 } 4976 return this; 4977 } 4978 4979 /** 4980 * @return {@link #status} (Status of substance within the catalogue e.g. active, retired.) 4981 */ 4982 public CodeableConcept getStatus() { 4983 if (this.status == null) 4984 if (Configuration.errorOnAutoCreate()) 4985 throw new Error("Attempt to auto-create SubstanceDefinition.status"); 4986 else if (Configuration.doAutoCreate()) 4987 this.status = new CodeableConcept(); // cc 4988 return this.status; 4989 } 4990 4991 public boolean hasStatus() { 4992 return this.status != null && !this.status.isEmpty(); 4993 } 4994 4995 /** 4996 * @param value {@link #status} (Status of substance within the catalogue e.g. active, retired.) 4997 */ 4998 public SubstanceDefinition setStatus(CodeableConcept value) { 4999 this.status = value; 5000 return this; 5001 } 5002 5003 /** 5004 * @return {@link #classification} (A high level categorization, e.g. polymer or nucleic acid, or food, chemical, biological, or a lower level such as the general types of polymer (linear or branch chain) or type of impurity (process related or contaminant).) 5005 */ 5006 public List<CodeableConcept> getClassification() { 5007 if (this.classification == null) 5008 this.classification = new ArrayList<CodeableConcept>(); 5009 return this.classification; 5010 } 5011 5012 /** 5013 * @return Returns a reference to <code>this</code> for easy method chaining 5014 */ 5015 public SubstanceDefinition setClassification(List<CodeableConcept> theClassification) { 5016 this.classification = theClassification; 5017 return this; 5018 } 5019 5020 public boolean hasClassification() { 5021 if (this.classification == null) 5022 return false; 5023 for (CodeableConcept item : this.classification) 5024 if (!item.isEmpty()) 5025 return true; 5026 return false; 5027 } 5028 5029 public CodeableConcept addClassification() { //3 5030 CodeableConcept t = new CodeableConcept(); 5031 if (this.classification == null) 5032 this.classification = new ArrayList<CodeableConcept>(); 5033 this.classification.add(t); 5034 return t; 5035 } 5036 5037 public SubstanceDefinition addClassification(CodeableConcept t) { //3 5038 if (t == null) 5039 return this; 5040 if (this.classification == null) 5041 this.classification = new ArrayList<CodeableConcept>(); 5042 this.classification.add(t); 5043 return this; 5044 } 5045 5046 /** 5047 * @return The first repetition of repeating field {@link #classification}, creating it if it does not already exist {3} 5048 */ 5049 public CodeableConcept getClassificationFirstRep() { 5050 if (getClassification().isEmpty()) { 5051 addClassification(); 5052 } 5053 return getClassification().get(0); 5054 } 5055 5056 /** 5057 * @return {@link #domain} (If the substance applies to human or veterinary use.) 5058 */ 5059 public CodeableConcept getDomain() { 5060 if (this.domain == null) 5061 if (Configuration.errorOnAutoCreate()) 5062 throw new Error("Attempt to auto-create SubstanceDefinition.domain"); 5063 else if (Configuration.doAutoCreate()) 5064 this.domain = new CodeableConcept(); // cc 5065 return this.domain; 5066 } 5067 5068 public boolean hasDomain() { 5069 return this.domain != null && !this.domain.isEmpty(); 5070 } 5071 5072 /** 5073 * @param value {@link #domain} (If the substance applies to human or veterinary use.) 5074 */ 5075 public SubstanceDefinition setDomain(CodeableConcept value) { 5076 this.domain = value; 5077 return this; 5078 } 5079 5080 /** 5081 * @return {@link #grade} (The quality standard, established benchmark, to which substance complies (e.g. USP/NF, Ph. Eur, JP, BP, Company Standard).) 5082 */ 5083 public List<CodeableConcept> getGrade() { 5084 if (this.grade == null) 5085 this.grade = new ArrayList<CodeableConcept>(); 5086 return this.grade; 5087 } 5088 5089 /** 5090 * @return Returns a reference to <code>this</code> for easy method chaining 5091 */ 5092 public SubstanceDefinition setGrade(List<CodeableConcept> theGrade) { 5093 this.grade = theGrade; 5094 return this; 5095 } 5096 5097 public boolean hasGrade() { 5098 if (this.grade == null) 5099 return false; 5100 for (CodeableConcept item : this.grade) 5101 if (!item.isEmpty()) 5102 return true; 5103 return false; 5104 } 5105 5106 public CodeableConcept addGrade() { //3 5107 CodeableConcept t = new CodeableConcept(); 5108 if (this.grade == null) 5109 this.grade = new ArrayList<CodeableConcept>(); 5110 this.grade.add(t); 5111 return t; 5112 } 5113 5114 public SubstanceDefinition addGrade(CodeableConcept t) { //3 5115 if (t == null) 5116 return this; 5117 if (this.grade == null) 5118 this.grade = new ArrayList<CodeableConcept>(); 5119 this.grade.add(t); 5120 return this; 5121 } 5122 5123 /** 5124 * @return The first repetition of repeating field {@link #grade}, creating it if it does not already exist {3} 5125 */ 5126 public CodeableConcept getGradeFirstRep() { 5127 if (getGrade().isEmpty()) { 5128 addGrade(); 5129 } 5130 return getGrade().get(0); 5131 } 5132 5133 /** 5134 * @return {@link #description} (Textual description of the substance.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 5135 */ 5136 public MarkdownType getDescriptionElement() { 5137 if (this.description == null) 5138 if (Configuration.errorOnAutoCreate()) 5139 throw new Error("Attempt to auto-create SubstanceDefinition.description"); 5140 else if (Configuration.doAutoCreate()) 5141 this.description = new MarkdownType(); // bb 5142 return this.description; 5143 } 5144 5145 public boolean hasDescriptionElement() { 5146 return this.description != null && !this.description.isEmpty(); 5147 } 5148 5149 public boolean hasDescription() { 5150 return this.description != null && !this.description.isEmpty(); 5151 } 5152 5153 /** 5154 * @param value {@link #description} (Textual description of the substance.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 5155 */ 5156 public SubstanceDefinition setDescriptionElement(MarkdownType value) { 5157 this.description = value; 5158 return this; 5159 } 5160 5161 /** 5162 * @return Textual description of the substance. 5163 */ 5164 public String getDescription() { 5165 return this.description == null ? null : this.description.getValue(); 5166 } 5167 5168 /** 5169 * @param value Textual description of the substance. 5170 */ 5171 public SubstanceDefinition setDescription(String value) { 5172 if (value == null) 5173 this.description = null; 5174 else { 5175 if (this.description == null) 5176 this.description = new MarkdownType(); 5177 this.description.setValue(value); 5178 } 5179 return this; 5180 } 5181 5182 /** 5183 * @return {@link #informationSource} (Supporting literature.) 5184 */ 5185 public List<Reference> getInformationSource() { 5186 if (this.informationSource == null) 5187 this.informationSource = new ArrayList<Reference>(); 5188 return this.informationSource; 5189 } 5190 5191 /** 5192 * @return Returns a reference to <code>this</code> for easy method chaining 5193 */ 5194 public SubstanceDefinition setInformationSource(List<Reference> theInformationSource) { 5195 this.informationSource = theInformationSource; 5196 return this; 5197 } 5198 5199 public boolean hasInformationSource() { 5200 if (this.informationSource == null) 5201 return false; 5202 for (Reference item : this.informationSource) 5203 if (!item.isEmpty()) 5204 return true; 5205 return false; 5206 } 5207 5208 public Reference addInformationSource() { //3 5209 Reference t = new Reference(); 5210 if (this.informationSource == null) 5211 this.informationSource = new ArrayList<Reference>(); 5212 this.informationSource.add(t); 5213 return t; 5214 } 5215 5216 public SubstanceDefinition addInformationSource(Reference t) { //3 5217 if (t == null) 5218 return this; 5219 if (this.informationSource == null) 5220 this.informationSource = new ArrayList<Reference>(); 5221 this.informationSource.add(t); 5222 return this; 5223 } 5224 5225 /** 5226 * @return The first repetition of repeating field {@link #informationSource}, creating it if it does not already exist {3} 5227 */ 5228 public Reference getInformationSourceFirstRep() { 5229 if (getInformationSource().isEmpty()) { 5230 addInformationSource(); 5231 } 5232 return getInformationSource().get(0); 5233 } 5234 5235 /** 5236 * @return {@link #note} (Textual comment about the substance's catalogue or registry record.) 5237 */ 5238 public List<Annotation> getNote() { 5239 if (this.note == null) 5240 this.note = new ArrayList<Annotation>(); 5241 return this.note; 5242 } 5243 5244 /** 5245 * @return Returns a reference to <code>this</code> for easy method chaining 5246 */ 5247 public SubstanceDefinition setNote(List<Annotation> theNote) { 5248 this.note = theNote; 5249 return this; 5250 } 5251 5252 public boolean hasNote() { 5253 if (this.note == null) 5254 return false; 5255 for (Annotation item : this.note) 5256 if (!item.isEmpty()) 5257 return true; 5258 return false; 5259 } 5260 5261 public Annotation addNote() { //3 5262 Annotation t = new Annotation(); 5263 if (this.note == null) 5264 this.note = new ArrayList<Annotation>(); 5265 this.note.add(t); 5266 return t; 5267 } 5268 5269 public SubstanceDefinition addNote(Annotation t) { //3 5270 if (t == null) 5271 return this; 5272 if (this.note == null) 5273 this.note = new ArrayList<Annotation>(); 5274 this.note.add(t); 5275 return this; 5276 } 5277 5278 /** 5279 * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3} 5280 */ 5281 public Annotation getNoteFirstRep() { 5282 if (getNote().isEmpty()) { 5283 addNote(); 5284 } 5285 return getNote().get(0); 5286 } 5287 5288 /** 5289 * @return {@link #manufacturer} (The entity that creates, makes, produces or fabricates the substance. This is a set of potential manufacturers but is not necessarily comprehensive.) 5290 */ 5291 public List<Reference> getManufacturer() { 5292 if (this.manufacturer == null) 5293 this.manufacturer = new ArrayList<Reference>(); 5294 return this.manufacturer; 5295 } 5296 5297 /** 5298 * @return Returns a reference to <code>this</code> for easy method chaining 5299 */ 5300 public SubstanceDefinition setManufacturer(List<Reference> theManufacturer) { 5301 this.manufacturer = theManufacturer; 5302 return this; 5303 } 5304 5305 public boolean hasManufacturer() { 5306 if (this.manufacturer == null) 5307 return false; 5308 for (Reference item : this.manufacturer) 5309 if (!item.isEmpty()) 5310 return true; 5311 return false; 5312 } 5313 5314 public Reference addManufacturer() { //3 5315 Reference t = new Reference(); 5316 if (this.manufacturer == null) 5317 this.manufacturer = new ArrayList<Reference>(); 5318 this.manufacturer.add(t); 5319 return t; 5320 } 5321 5322 public SubstanceDefinition addManufacturer(Reference t) { //3 5323 if (t == null) 5324 return this; 5325 if (this.manufacturer == null) 5326 this.manufacturer = new ArrayList<Reference>(); 5327 this.manufacturer.add(t); 5328 return this; 5329 } 5330 5331 /** 5332 * @return The first repetition of repeating field {@link #manufacturer}, creating it if it does not already exist {3} 5333 */ 5334 public Reference getManufacturerFirstRep() { 5335 if (getManufacturer().isEmpty()) { 5336 addManufacturer(); 5337 } 5338 return getManufacturer().get(0); 5339 } 5340 5341 /** 5342 * @return {@link #supplier} (An entity that is the source for the substance. It may be different from the manufacturer. Supplier is synonymous to a distributor.) 5343 */ 5344 public List<Reference> getSupplier() { 5345 if (this.supplier == null) 5346 this.supplier = new ArrayList<Reference>(); 5347 return this.supplier; 5348 } 5349 5350 /** 5351 * @return Returns a reference to <code>this</code> for easy method chaining 5352 */ 5353 public SubstanceDefinition setSupplier(List<Reference> theSupplier) { 5354 this.supplier = theSupplier; 5355 return this; 5356 } 5357 5358 public boolean hasSupplier() { 5359 if (this.supplier == null) 5360 return false; 5361 for (Reference item : this.supplier) 5362 if (!item.isEmpty()) 5363 return true; 5364 return false; 5365 } 5366 5367 public Reference addSupplier() { //3 5368 Reference t = new Reference(); 5369 if (this.supplier == null) 5370 this.supplier = new ArrayList<Reference>(); 5371 this.supplier.add(t); 5372 return t; 5373 } 5374 5375 public SubstanceDefinition addSupplier(Reference t) { //3 5376 if (t == null) 5377 return this; 5378 if (this.supplier == null) 5379 this.supplier = new ArrayList<Reference>(); 5380 this.supplier.add(t); 5381 return this; 5382 } 5383 5384 /** 5385 * @return The first repetition of repeating field {@link #supplier}, creating it if it does not already exist {3} 5386 */ 5387 public Reference getSupplierFirstRep() { 5388 if (getSupplier().isEmpty()) { 5389 addSupplier(); 5390 } 5391 return getSupplier().get(0); 5392 } 5393 5394 /** 5395 * @return {@link #moiety} (Moiety, for structural modifications.) 5396 */ 5397 public List<SubstanceDefinitionMoietyComponent> getMoiety() { 5398 if (this.moiety == null) 5399 this.moiety = new ArrayList<SubstanceDefinitionMoietyComponent>(); 5400 return this.moiety; 5401 } 5402 5403 /** 5404 * @return Returns a reference to <code>this</code> for easy method chaining 5405 */ 5406 public SubstanceDefinition setMoiety(List<SubstanceDefinitionMoietyComponent> theMoiety) { 5407 this.moiety = theMoiety; 5408 return this; 5409 } 5410 5411 public boolean hasMoiety() { 5412 if (this.moiety == null) 5413 return false; 5414 for (SubstanceDefinitionMoietyComponent item : this.moiety) 5415 if (!item.isEmpty()) 5416 return true; 5417 return false; 5418 } 5419 5420 public SubstanceDefinitionMoietyComponent addMoiety() { //3 5421 SubstanceDefinitionMoietyComponent t = new SubstanceDefinitionMoietyComponent(); 5422 if (this.moiety == null) 5423 this.moiety = new ArrayList<SubstanceDefinitionMoietyComponent>(); 5424 this.moiety.add(t); 5425 return t; 5426 } 5427 5428 public SubstanceDefinition addMoiety(SubstanceDefinitionMoietyComponent t) { //3 5429 if (t == null) 5430 return this; 5431 if (this.moiety == null) 5432 this.moiety = new ArrayList<SubstanceDefinitionMoietyComponent>(); 5433 this.moiety.add(t); 5434 return this; 5435 } 5436 5437 /** 5438 * @return The first repetition of repeating field {@link #moiety}, creating it if it does not already exist {3} 5439 */ 5440 public SubstanceDefinitionMoietyComponent getMoietyFirstRep() { 5441 if (getMoiety().isEmpty()) { 5442 addMoiety(); 5443 } 5444 return getMoiety().get(0); 5445 } 5446 5447 /** 5448 * @return {@link #property} (General specifications for this substance.) 5449 */ 5450 public List<SubstanceDefinitionPropertyComponent> getProperty() { 5451 if (this.property == null) 5452 this.property = new ArrayList<SubstanceDefinitionPropertyComponent>(); 5453 return this.property; 5454 } 5455 5456 /** 5457 * @return Returns a reference to <code>this</code> for easy method chaining 5458 */ 5459 public SubstanceDefinition setProperty(List<SubstanceDefinitionPropertyComponent> theProperty) { 5460 this.property = theProperty; 5461 return this; 5462 } 5463 5464 public boolean hasProperty() { 5465 if (this.property == null) 5466 return false; 5467 for (SubstanceDefinitionPropertyComponent item : this.property) 5468 if (!item.isEmpty()) 5469 return true; 5470 return false; 5471 } 5472 5473 public SubstanceDefinitionPropertyComponent addProperty() { //3 5474 SubstanceDefinitionPropertyComponent t = new SubstanceDefinitionPropertyComponent(); 5475 if (this.property == null) 5476 this.property = new ArrayList<SubstanceDefinitionPropertyComponent>(); 5477 this.property.add(t); 5478 return t; 5479 } 5480 5481 public SubstanceDefinition addProperty(SubstanceDefinitionPropertyComponent t) { //3 5482 if (t == null) 5483 return this; 5484 if (this.property == null) 5485 this.property = new ArrayList<SubstanceDefinitionPropertyComponent>(); 5486 this.property.add(t); 5487 return this; 5488 } 5489 5490 /** 5491 * @return The first repetition of repeating field {@link #property}, creating it if it does not already exist {3} 5492 */ 5493 public SubstanceDefinitionPropertyComponent getPropertyFirstRep() { 5494 if (getProperty().isEmpty()) { 5495 addProperty(); 5496 } 5497 return getProperty().get(0); 5498 } 5499 5500 /** 5501 * @return {@link #referenceInformation} (General information detailing this substance.) 5502 */ 5503 public Reference getReferenceInformation() { 5504 if (this.referenceInformation == null) 5505 if (Configuration.errorOnAutoCreate()) 5506 throw new Error("Attempt to auto-create SubstanceDefinition.referenceInformation"); 5507 else if (Configuration.doAutoCreate()) 5508 this.referenceInformation = new Reference(); // cc 5509 return this.referenceInformation; 5510 } 5511 5512 public boolean hasReferenceInformation() { 5513 return this.referenceInformation != null && !this.referenceInformation.isEmpty(); 5514 } 5515 5516 /** 5517 * @param value {@link #referenceInformation} (General information detailing this substance.) 5518 */ 5519 public SubstanceDefinition setReferenceInformation(Reference value) { 5520 this.referenceInformation = value; 5521 return this; 5522 } 5523 5524 /** 5525 * @return {@link #molecularWeight} (The molecular weight or weight range (for proteins, polymers or nucleic acids).) 5526 */ 5527 public List<SubstanceDefinitionMolecularWeightComponent> getMolecularWeight() { 5528 if (this.molecularWeight == null) 5529 this.molecularWeight = new ArrayList<SubstanceDefinitionMolecularWeightComponent>(); 5530 return this.molecularWeight; 5531 } 5532 5533 /** 5534 * @return Returns a reference to <code>this</code> for easy method chaining 5535 */ 5536 public SubstanceDefinition setMolecularWeight(List<SubstanceDefinitionMolecularWeightComponent> theMolecularWeight) { 5537 this.molecularWeight = theMolecularWeight; 5538 return this; 5539 } 5540 5541 public boolean hasMolecularWeight() { 5542 if (this.molecularWeight == null) 5543 return false; 5544 for (SubstanceDefinitionMolecularWeightComponent item : this.molecularWeight) 5545 if (!item.isEmpty()) 5546 return true; 5547 return false; 5548 } 5549 5550 public SubstanceDefinitionMolecularWeightComponent addMolecularWeight() { //3 5551 SubstanceDefinitionMolecularWeightComponent t = new SubstanceDefinitionMolecularWeightComponent(); 5552 if (this.molecularWeight == null) 5553 this.molecularWeight = new ArrayList<SubstanceDefinitionMolecularWeightComponent>(); 5554 this.molecularWeight.add(t); 5555 return t; 5556 } 5557 5558 public SubstanceDefinition addMolecularWeight(SubstanceDefinitionMolecularWeightComponent t) { //3 5559 if (t == null) 5560 return this; 5561 if (this.molecularWeight == null) 5562 this.molecularWeight = new ArrayList<SubstanceDefinitionMolecularWeightComponent>(); 5563 this.molecularWeight.add(t); 5564 return this; 5565 } 5566 5567 /** 5568 * @return The first repetition of repeating field {@link #molecularWeight}, creating it if it does not already exist {3} 5569 */ 5570 public SubstanceDefinitionMolecularWeightComponent getMolecularWeightFirstRep() { 5571 if (getMolecularWeight().isEmpty()) { 5572 addMolecularWeight(); 5573 } 5574 return getMolecularWeight().get(0); 5575 } 5576 5577 /** 5578 * @return {@link #structure} (Structural information.) 5579 */ 5580 public SubstanceDefinitionStructureComponent getStructure() { 5581 if (this.structure == null) 5582 if (Configuration.errorOnAutoCreate()) 5583 throw new Error("Attempt to auto-create SubstanceDefinition.structure"); 5584 else if (Configuration.doAutoCreate()) 5585 this.structure = new SubstanceDefinitionStructureComponent(); // cc 5586 return this.structure; 5587 } 5588 5589 public boolean hasStructure() { 5590 return this.structure != null && !this.structure.isEmpty(); 5591 } 5592 5593 /** 5594 * @param value {@link #structure} (Structural information.) 5595 */ 5596 public SubstanceDefinition setStructure(SubstanceDefinitionStructureComponent value) { 5597 this.structure = value; 5598 return this; 5599 } 5600 5601 /** 5602 * @return {@link #code} (Codes associated with the substance.) 5603 */ 5604 public List<SubstanceDefinitionCodeComponent> getCode() { 5605 if (this.code == null) 5606 this.code = new ArrayList<SubstanceDefinitionCodeComponent>(); 5607 return this.code; 5608 } 5609 5610 /** 5611 * @return Returns a reference to <code>this</code> for easy method chaining 5612 */ 5613 public SubstanceDefinition setCode(List<SubstanceDefinitionCodeComponent> theCode) { 5614 this.code = theCode; 5615 return this; 5616 } 5617 5618 public boolean hasCode() { 5619 if (this.code == null) 5620 return false; 5621 for (SubstanceDefinitionCodeComponent item : this.code) 5622 if (!item.isEmpty()) 5623 return true; 5624 return false; 5625 } 5626 5627 public SubstanceDefinitionCodeComponent addCode() { //3 5628 SubstanceDefinitionCodeComponent t = new SubstanceDefinitionCodeComponent(); 5629 if (this.code == null) 5630 this.code = new ArrayList<SubstanceDefinitionCodeComponent>(); 5631 this.code.add(t); 5632 return t; 5633 } 5634 5635 public SubstanceDefinition addCode(SubstanceDefinitionCodeComponent t) { //3 5636 if (t == null) 5637 return this; 5638 if (this.code == null) 5639 this.code = new ArrayList<SubstanceDefinitionCodeComponent>(); 5640 this.code.add(t); 5641 return this; 5642 } 5643 5644 /** 5645 * @return The first repetition of repeating field {@link #code}, creating it if it does not already exist {3} 5646 */ 5647 public SubstanceDefinitionCodeComponent getCodeFirstRep() { 5648 if (getCode().isEmpty()) { 5649 addCode(); 5650 } 5651 return getCode().get(0); 5652 } 5653 5654 /** 5655 * @return {@link #name} (Names applicable to this substance.) 5656 */ 5657 public List<SubstanceDefinitionNameComponent> getName() { 5658 if (this.name == null) 5659 this.name = new ArrayList<SubstanceDefinitionNameComponent>(); 5660 return this.name; 5661 } 5662 5663 /** 5664 * @return Returns a reference to <code>this</code> for easy method chaining 5665 */ 5666 public SubstanceDefinition setName(List<SubstanceDefinitionNameComponent> theName) { 5667 this.name = theName; 5668 return this; 5669 } 5670 5671 public boolean hasName() { 5672 if (this.name == null) 5673 return false; 5674 for (SubstanceDefinitionNameComponent item : this.name) 5675 if (!item.isEmpty()) 5676 return true; 5677 return false; 5678 } 5679 5680 public SubstanceDefinitionNameComponent addName() { //3 5681 SubstanceDefinitionNameComponent t = new SubstanceDefinitionNameComponent(); 5682 if (this.name == null) 5683 this.name = new ArrayList<SubstanceDefinitionNameComponent>(); 5684 this.name.add(t); 5685 return t; 5686 } 5687 5688 public SubstanceDefinition addName(SubstanceDefinitionNameComponent t) { //3 5689 if (t == null) 5690 return this; 5691 if (this.name == null) 5692 this.name = new ArrayList<SubstanceDefinitionNameComponent>(); 5693 this.name.add(t); 5694 return this; 5695 } 5696 5697 /** 5698 * @return The first repetition of repeating field {@link #name}, creating it if it does not already exist {3} 5699 */ 5700 public SubstanceDefinitionNameComponent getNameFirstRep() { 5701 if (getName().isEmpty()) { 5702 addName(); 5703 } 5704 return getName().get(0); 5705 } 5706 5707 /** 5708 * @return {@link #relationship} (A link between this substance and another, with details of the relationship.) 5709 */ 5710 public List<SubstanceDefinitionRelationshipComponent> getRelationship() { 5711 if (this.relationship == null) 5712 this.relationship = new ArrayList<SubstanceDefinitionRelationshipComponent>(); 5713 return this.relationship; 5714 } 5715 5716 /** 5717 * @return Returns a reference to <code>this</code> for easy method chaining 5718 */ 5719 public SubstanceDefinition setRelationship(List<SubstanceDefinitionRelationshipComponent> theRelationship) { 5720 this.relationship = theRelationship; 5721 return this; 5722 } 5723 5724 public boolean hasRelationship() { 5725 if (this.relationship == null) 5726 return false; 5727 for (SubstanceDefinitionRelationshipComponent item : this.relationship) 5728 if (!item.isEmpty()) 5729 return true; 5730 return false; 5731 } 5732 5733 public SubstanceDefinitionRelationshipComponent addRelationship() { //3 5734 SubstanceDefinitionRelationshipComponent t = new SubstanceDefinitionRelationshipComponent(); 5735 if (this.relationship == null) 5736 this.relationship = new ArrayList<SubstanceDefinitionRelationshipComponent>(); 5737 this.relationship.add(t); 5738 return t; 5739 } 5740 5741 public SubstanceDefinition addRelationship(SubstanceDefinitionRelationshipComponent t) { //3 5742 if (t == null) 5743 return this; 5744 if (this.relationship == null) 5745 this.relationship = new ArrayList<SubstanceDefinitionRelationshipComponent>(); 5746 this.relationship.add(t); 5747 return this; 5748 } 5749 5750 /** 5751 * @return The first repetition of repeating field {@link #relationship}, creating it if it does not already exist {3} 5752 */ 5753 public SubstanceDefinitionRelationshipComponent getRelationshipFirstRep() { 5754 if (getRelationship().isEmpty()) { 5755 addRelationship(); 5756 } 5757 return getRelationship().get(0); 5758 } 5759 5760 /** 5761 * @return {@link #nucleicAcid} (Data items specific to nucleic acids.) 5762 */ 5763 public Reference getNucleicAcid() { 5764 if (this.nucleicAcid == null) 5765 if (Configuration.errorOnAutoCreate()) 5766 throw new Error("Attempt to auto-create SubstanceDefinition.nucleicAcid"); 5767 else if (Configuration.doAutoCreate()) 5768 this.nucleicAcid = new Reference(); // cc 5769 return this.nucleicAcid; 5770 } 5771 5772 public boolean hasNucleicAcid() { 5773 return this.nucleicAcid != null && !this.nucleicAcid.isEmpty(); 5774 } 5775 5776 /** 5777 * @param value {@link #nucleicAcid} (Data items specific to nucleic acids.) 5778 */ 5779 public SubstanceDefinition setNucleicAcid(Reference value) { 5780 this.nucleicAcid = value; 5781 return this; 5782 } 5783 5784 /** 5785 * @return {@link #polymer} (Data items specific to polymers.) 5786 */ 5787 public Reference getPolymer() { 5788 if (this.polymer == null) 5789 if (Configuration.errorOnAutoCreate()) 5790 throw new Error("Attempt to auto-create SubstanceDefinition.polymer"); 5791 else if (Configuration.doAutoCreate()) 5792 this.polymer = new Reference(); // cc 5793 return this.polymer; 5794 } 5795 5796 public boolean hasPolymer() { 5797 return this.polymer != null && !this.polymer.isEmpty(); 5798 } 5799 5800 /** 5801 * @param value {@link #polymer} (Data items specific to polymers.) 5802 */ 5803 public SubstanceDefinition setPolymer(Reference value) { 5804 this.polymer = value; 5805 return this; 5806 } 5807 5808 /** 5809 * @return {@link #protein} (Data items specific to proteins.) 5810 */ 5811 public Reference getProtein() { 5812 if (this.protein == null) 5813 if (Configuration.errorOnAutoCreate()) 5814 throw new Error("Attempt to auto-create SubstanceDefinition.protein"); 5815 else if (Configuration.doAutoCreate()) 5816 this.protein = new Reference(); // cc 5817 return this.protein; 5818 } 5819 5820 public boolean hasProtein() { 5821 return this.protein != null && !this.protein.isEmpty(); 5822 } 5823 5824 /** 5825 * @param value {@link #protein} (Data items specific to proteins.) 5826 */ 5827 public SubstanceDefinition setProtein(Reference value) { 5828 this.protein = value; 5829 return this; 5830 } 5831 5832 /** 5833 * @return {@link #sourceMaterial} (Material or taxonomic/anatomical source for the substance.) 5834 */ 5835 public SubstanceDefinitionSourceMaterialComponent getSourceMaterial() { 5836 if (this.sourceMaterial == null) 5837 if (Configuration.errorOnAutoCreate()) 5838 throw new Error("Attempt to auto-create SubstanceDefinition.sourceMaterial"); 5839 else if (Configuration.doAutoCreate()) 5840 this.sourceMaterial = new SubstanceDefinitionSourceMaterialComponent(); // cc 5841 return this.sourceMaterial; 5842 } 5843 5844 public boolean hasSourceMaterial() { 5845 return this.sourceMaterial != null && !this.sourceMaterial.isEmpty(); 5846 } 5847 5848 /** 5849 * @param value {@link #sourceMaterial} (Material or taxonomic/anatomical source for the substance.) 5850 */ 5851 public SubstanceDefinition setSourceMaterial(SubstanceDefinitionSourceMaterialComponent value) { 5852 this.sourceMaterial = value; 5853 return this; 5854 } 5855 5856 protected void listChildren(List<Property> children) { 5857 super.listChildren(children); 5858 children.add(new Property("identifier", "Identifier", "Identifier by which this substance is known.", 0, java.lang.Integer.MAX_VALUE, identifier)); 5859 children.add(new Property("version", "string", "A business level version identifier of the substance.", 0, 1, version)); 5860 children.add(new Property("status", "CodeableConcept", "Status of substance within the catalogue e.g. active, retired.", 0, 1, status)); 5861 children.add(new Property("classification", "CodeableConcept", "A high level categorization, e.g. polymer or nucleic acid, or food, chemical, biological, or a lower level such as the general types of polymer (linear or branch chain) or type of impurity (process related or contaminant).", 0, java.lang.Integer.MAX_VALUE, classification)); 5862 children.add(new Property("domain", "CodeableConcept", "If the substance applies to human or veterinary use.", 0, 1, domain)); 5863 children.add(new Property("grade", "CodeableConcept", "The quality standard, established benchmark, to which substance complies (e.g. USP/NF, Ph. Eur, JP, BP, Company Standard).", 0, java.lang.Integer.MAX_VALUE, grade)); 5864 children.add(new Property("description", "markdown", "Textual description of the substance.", 0, 1, description)); 5865 children.add(new Property("informationSource", "Reference(Citation)", "Supporting literature.", 0, java.lang.Integer.MAX_VALUE, informationSource)); 5866 children.add(new Property("note", "Annotation", "Textual comment about the substance's catalogue or registry record.", 0, java.lang.Integer.MAX_VALUE, note)); 5867 children.add(new Property("manufacturer", "Reference(Organization)", "The entity that creates, makes, produces or fabricates the substance. This is a set of potential manufacturers but is not necessarily comprehensive.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); 5868 children.add(new Property("supplier", "Reference(Organization)", "An entity that is the source for the substance. It may be different from the manufacturer. Supplier is synonymous to a distributor.", 0, java.lang.Integer.MAX_VALUE, supplier)); 5869 children.add(new Property("moiety", "", "Moiety, for structural modifications.", 0, java.lang.Integer.MAX_VALUE, moiety)); 5870 children.add(new Property("property", "", "General specifications for this substance.", 0, java.lang.Integer.MAX_VALUE, property)); 5871 children.add(new Property("referenceInformation", "Reference(SubstanceReferenceInformation)", "General information detailing this substance.", 0, 1, referenceInformation)); 5872 children.add(new Property("molecularWeight", "", "The molecular weight or weight range (for proteins, polymers or nucleic acids).", 0, java.lang.Integer.MAX_VALUE, molecularWeight)); 5873 children.add(new Property("structure", "", "Structural information.", 0, 1, structure)); 5874 children.add(new Property("code", "", "Codes associated with the substance.", 0, java.lang.Integer.MAX_VALUE, code)); 5875 children.add(new Property("name", "", "Names applicable to this substance.", 0, java.lang.Integer.MAX_VALUE, name)); 5876 children.add(new Property("relationship", "", "A link between this substance and another, with details of the relationship.", 0, java.lang.Integer.MAX_VALUE, relationship)); 5877 children.add(new Property("nucleicAcid", "Reference(SubstanceNucleicAcid)", "Data items specific to nucleic acids.", 0, 1, nucleicAcid)); 5878 children.add(new Property("polymer", "Reference(SubstancePolymer)", "Data items specific to polymers.", 0, 1, polymer)); 5879 children.add(new Property("protein", "Reference(SubstanceProtein)", "Data items specific to proteins.", 0, 1, protein)); 5880 children.add(new Property("sourceMaterial", "", "Material or taxonomic/anatomical source for the substance.", 0, 1, sourceMaterial)); 5881 } 5882 5883 @Override 5884 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 5885 switch (_hash) { 5886 case -1618432855: /*identifier*/ return new Property("identifier", "Identifier", "Identifier by which this substance is known.", 0, java.lang.Integer.MAX_VALUE, identifier); 5887 case 351608024: /*version*/ return new Property("version", "string", "A business level version identifier of the substance.", 0, 1, version); 5888 case -892481550: /*status*/ return new Property("status", "CodeableConcept", "Status of substance within the catalogue e.g. active, retired.", 0, 1, status); 5889 case 382350310: /*classification*/ return new Property("classification", "CodeableConcept", "A high level categorization, e.g. polymer or nucleic acid, or food, chemical, biological, or a lower level such as the general types of polymer (linear or branch chain) or type of impurity (process related or contaminant).", 0, java.lang.Integer.MAX_VALUE, classification); 5890 case -1326197564: /*domain*/ return new Property("domain", "CodeableConcept", "If the substance applies to human or veterinary use.", 0, 1, domain); 5891 case 98615255: /*grade*/ return new Property("grade", "CodeableConcept", "The quality standard, established benchmark, to which substance complies (e.g. USP/NF, Ph. Eur, JP, BP, Company Standard).", 0, java.lang.Integer.MAX_VALUE, grade); 5892 case -1724546052: /*description*/ return new Property("description", "markdown", "Textual description of the substance.", 0, 1, description); 5893 case -2123220889: /*informationSource*/ return new Property("informationSource", "Reference(Citation)", "Supporting literature.", 0, java.lang.Integer.MAX_VALUE, informationSource); 5894 case 3387378: /*note*/ return new Property("note", "Annotation", "Textual comment about the substance's catalogue or registry record.", 0, java.lang.Integer.MAX_VALUE, note); 5895 case -1969347631: /*manufacturer*/ return new Property("manufacturer", "Reference(Organization)", "The entity that creates, makes, produces or fabricates the substance. This is a set of potential manufacturers but is not necessarily comprehensive.", 0, java.lang.Integer.MAX_VALUE, manufacturer); 5896 case -1663305268: /*supplier*/ return new Property("supplier", "Reference(Organization)", "An entity that is the source for the substance. It may be different from the manufacturer. Supplier is synonymous to a distributor.", 0, java.lang.Integer.MAX_VALUE, supplier); 5897 case -1068650173: /*moiety*/ return new Property("moiety", "", "Moiety, for structural modifications.", 0, java.lang.Integer.MAX_VALUE, moiety); 5898 case -993141291: /*property*/ return new Property("property", "", "General specifications for this substance.", 0, java.lang.Integer.MAX_VALUE, property); 5899 case -2117930783: /*referenceInformation*/ return new Property("referenceInformation", "Reference(SubstanceReferenceInformation)", "General information detailing this substance.", 0, 1, referenceInformation); 5900 case 635625672: /*molecularWeight*/ return new Property("molecularWeight", "", "The molecular weight or weight range (for proteins, polymers or nucleic acids).", 0, java.lang.Integer.MAX_VALUE, molecularWeight); 5901 case 144518515: /*structure*/ return new Property("structure", "", "Structural information.", 0, 1, structure); 5902 case 3059181: /*code*/ return new Property("code", "", "Codes associated with the substance.", 0, java.lang.Integer.MAX_VALUE, code); 5903 case 3373707: /*name*/ return new Property("name", "", "Names applicable to this substance.", 0, java.lang.Integer.MAX_VALUE, name); 5904 case -261851592: /*relationship*/ return new Property("relationship", "", "A link between this substance and another, with details of the relationship.", 0, java.lang.Integer.MAX_VALUE, relationship); 5905 case 1625275180: /*nucleicAcid*/ return new Property("nucleicAcid", "Reference(SubstanceNucleicAcid)", "Data items specific to nucleic acids.", 0, 1, nucleicAcid); 5906 case -397514098: /*polymer*/ return new Property("polymer", "Reference(SubstancePolymer)", "Data items specific to polymers.", 0, 1, polymer); 5907 case -309012605: /*protein*/ return new Property("protein", "Reference(SubstanceProtein)", "Data items specific to proteins.", 0, 1, protein); 5908 case -1064442270: /*sourceMaterial*/ return new Property("sourceMaterial", "", "Material or taxonomic/anatomical source for the substance.", 0, 1, sourceMaterial); 5909 default: return super.getNamedProperty(_hash, _name, _checkValid); 5910 } 5911 5912 } 5913 5914 @Override 5915 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 5916 switch (hash) { 5917 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier 5918 case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType 5919 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept 5920 case 382350310: /*classification*/ return this.classification == null ? new Base[0] : this.classification.toArray(new Base[this.classification.size()]); // CodeableConcept 5921 case -1326197564: /*domain*/ return this.domain == null ? new Base[0] : new Base[] {this.domain}; // CodeableConcept 5922 case 98615255: /*grade*/ return this.grade == null ? new Base[0] : this.grade.toArray(new Base[this.grade.size()]); // CodeableConcept 5923 case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType 5924 case -2123220889: /*informationSource*/ return this.informationSource == null ? new Base[0] : this.informationSource.toArray(new Base[this.informationSource.size()]); // Reference 5925 case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation 5926 case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : this.manufacturer.toArray(new Base[this.manufacturer.size()]); // Reference 5927 case -1663305268: /*supplier*/ return this.supplier == null ? new Base[0] : this.supplier.toArray(new Base[this.supplier.size()]); // Reference 5928 case -1068650173: /*moiety*/ return this.moiety == null ? new Base[0] : this.moiety.toArray(new Base[this.moiety.size()]); // SubstanceDefinitionMoietyComponent 5929 case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // SubstanceDefinitionPropertyComponent 5930 case -2117930783: /*referenceInformation*/ return this.referenceInformation == null ? new Base[0] : new Base[] {this.referenceInformation}; // Reference 5931 case 635625672: /*molecularWeight*/ return this.molecularWeight == null ? new Base[0] : this.molecularWeight.toArray(new Base[this.molecularWeight.size()]); // SubstanceDefinitionMolecularWeightComponent 5932 case 144518515: /*structure*/ return this.structure == null ? new Base[0] : new Base[] {this.structure}; // SubstanceDefinitionStructureComponent 5933 case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // SubstanceDefinitionCodeComponent 5934 case 3373707: /*name*/ return this.name == null ? new Base[0] : this.name.toArray(new Base[this.name.size()]); // SubstanceDefinitionNameComponent 5935 case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : this.relationship.toArray(new Base[this.relationship.size()]); // SubstanceDefinitionRelationshipComponent 5936 case 1625275180: /*nucleicAcid*/ return this.nucleicAcid == null ? new Base[0] : new Base[] {this.nucleicAcid}; // Reference 5937 case -397514098: /*polymer*/ return this.polymer == null ? new Base[0] : new Base[] {this.polymer}; // Reference 5938 case -309012605: /*protein*/ return this.protein == null ? new Base[0] : new Base[] {this.protein}; // Reference 5939 case -1064442270: /*sourceMaterial*/ return this.sourceMaterial == null ? new Base[0] : new Base[] {this.sourceMaterial}; // SubstanceDefinitionSourceMaterialComponent 5940 default: return super.getProperty(hash, name, checkValid); 5941 } 5942 5943 } 5944 5945 @Override 5946 public Base setProperty(int hash, String name, Base value) throws FHIRException { 5947 switch (hash) { 5948 case -1618432855: // identifier 5949 this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier 5950 return value; 5951 case 351608024: // version 5952 this.version = TypeConvertor.castToString(value); // StringType 5953 return value; 5954 case -892481550: // status 5955 this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 5956 return value; 5957 case 382350310: // classification 5958 this.getClassification().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept 5959 return value; 5960 case -1326197564: // domain 5961 this.domain = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 5962 return value; 5963 case 98615255: // grade 5964 this.getGrade().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept 5965 return value; 5966 case -1724546052: // description 5967 this.description = TypeConvertor.castToMarkdown(value); // MarkdownType 5968 return value; 5969 case -2123220889: // informationSource 5970 this.getInformationSource().add(TypeConvertor.castToReference(value)); // Reference 5971 return value; 5972 case 3387378: // note 5973 this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation 5974 return value; 5975 case -1969347631: // manufacturer 5976 this.getManufacturer().add(TypeConvertor.castToReference(value)); // Reference 5977 return value; 5978 case -1663305268: // supplier 5979 this.getSupplier().add(TypeConvertor.castToReference(value)); // Reference 5980 return value; 5981 case -1068650173: // moiety 5982 this.getMoiety().add((SubstanceDefinitionMoietyComponent) value); // SubstanceDefinitionMoietyComponent 5983 return value; 5984 case -993141291: // property 5985 this.getProperty().add((SubstanceDefinitionPropertyComponent) value); // SubstanceDefinitionPropertyComponent 5986 return value; 5987 case -2117930783: // referenceInformation 5988 this.referenceInformation = TypeConvertor.castToReference(value); // Reference 5989 return value; 5990 case 635625672: // molecularWeight 5991 this.getMolecularWeight().add((SubstanceDefinitionMolecularWeightComponent) value); // SubstanceDefinitionMolecularWeightComponent 5992 return value; 5993 case 144518515: // structure 5994 this.structure = (SubstanceDefinitionStructureComponent) value; // SubstanceDefinitionStructureComponent 5995 return value; 5996 case 3059181: // code 5997 this.getCode().add((SubstanceDefinitionCodeComponent) value); // SubstanceDefinitionCodeComponent 5998 return value; 5999 case 3373707: // name 6000 this.getName().add((SubstanceDefinitionNameComponent) value); // SubstanceDefinitionNameComponent 6001 return value; 6002 case -261851592: // relationship 6003 this.getRelationship().add((SubstanceDefinitionRelationshipComponent) value); // SubstanceDefinitionRelationshipComponent 6004 return value; 6005 case 1625275180: // nucleicAcid 6006 this.nucleicAcid = TypeConvertor.castToReference(value); // Reference 6007 return value; 6008 case -397514098: // polymer 6009 this.polymer = TypeConvertor.castToReference(value); // Reference 6010 return value; 6011 case -309012605: // protein 6012 this.protein = TypeConvertor.castToReference(value); // Reference 6013 return value; 6014 case -1064442270: // sourceMaterial 6015 this.sourceMaterial = (SubstanceDefinitionSourceMaterialComponent) value; // SubstanceDefinitionSourceMaterialComponent 6016 return value; 6017 default: return super.setProperty(hash, name, value); 6018 } 6019 6020 } 6021 6022 @Override 6023 public Base setProperty(String name, Base value) throws FHIRException { 6024 if (name.equals("identifier")) { 6025 this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); 6026 } else if (name.equals("version")) { 6027 this.version = TypeConvertor.castToString(value); // StringType 6028 } else if (name.equals("status")) { 6029 this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 6030 } else if (name.equals("classification")) { 6031 this.getClassification().add(TypeConvertor.castToCodeableConcept(value)); 6032 } else if (name.equals("domain")) { 6033 this.domain = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 6034 } else if (name.equals("grade")) { 6035 this.getGrade().add(TypeConvertor.castToCodeableConcept(value)); 6036 } else if (name.equals("description")) { 6037 this.description = TypeConvertor.castToMarkdown(value); // MarkdownType 6038 } else if (name.equals("informationSource")) { 6039 this.getInformationSource().add(TypeConvertor.castToReference(value)); 6040 } else if (name.equals("note")) { 6041 this.getNote().add(TypeConvertor.castToAnnotation(value)); 6042 } else if (name.equals("manufacturer")) { 6043 this.getManufacturer().add(TypeConvertor.castToReference(value)); 6044 } else if (name.equals("supplier")) { 6045 this.getSupplier().add(TypeConvertor.castToReference(value)); 6046 } else if (name.equals("moiety")) { 6047 this.getMoiety().add((SubstanceDefinitionMoietyComponent) value); 6048 } else if (name.equals("property")) { 6049 this.getProperty().add((SubstanceDefinitionPropertyComponent) value); 6050 } else if (name.equals("referenceInformation")) { 6051 this.referenceInformation = TypeConvertor.castToReference(value); // Reference 6052 } else if (name.equals("molecularWeight")) { 6053 this.getMolecularWeight().add((SubstanceDefinitionMolecularWeightComponent) value); 6054 } else if (name.equals("structure")) { 6055 this.structure = (SubstanceDefinitionStructureComponent) value; // SubstanceDefinitionStructureComponent 6056 } else if (name.equals("code")) { 6057 this.getCode().add((SubstanceDefinitionCodeComponent) value); 6058 } else if (name.equals("name")) { 6059 this.getName().add((SubstanceDefinitionNameComponent) value); 6060 } else if (name.equals("relationship")) { 6061 this.getRelationship().add((SubstanceDefinitionRelationshipComponent) value); 6062 } else if (name.equals("nucleicAcid")) { 6063 this.nucleicAcid = TypeConvertor.castToReference(value); // Reference 6064 } else if (name.equals("polymer")) { 6065 this.polymer = TypeConvertor.castToReference(value); // Reference 6066 } else if (name.equals("protein")) { 6067 this.protein = TypeConvertor.castToReference(value); // Reference 6068 } else if (name.equals("sourceMaterial")) { 6069 this.sourceMaterial = (SubstanceDefinitionSourceMaterialComponent) value; // SubstanceDefinitionSourceMaterialComponent 6070 } else 6071 return super.setProperty(name, value); 6072 return value; 6073 } 6074 6075 @Override 6076 public Base makeProperty(int hash, String name) throws FHIRException { 6077 switch (hash) { 6078 case -1618432855: return addIdentifier(); 6079 case 351608024: return getVersionElement(); 6080 case -892481550: return getStatus(); 6081 case 382350310: return addClassification(); 6082 case -1326197564: return getDomain(); 6083 case 98615255: return addGrade(); 6084 case -1724546052: return getDescriptionElement(); 6085 case -2123220889: return addInformationSource(); 6086 case 3387378: return addNote(); 6087 case -1969347631: return addManufacturer(); 6088 case -1663305268: return addSupplier(); 6089 case -1068650173: return addMoiety(); 6090 case -993141291: return addProperty(); 6091 case -2117930783: return getReferenceInformation(); 6092 case 635625672: return addMolecularWeight(); 6093 case 144518515: return getStructure(); 6094 case 3059181: return addCode(); 6095 case 3373707: return addName(); 6096 case -261851592: return addRelationship(); 6097 case 1625275180: return getNucleicAcid(); 6098 case -397514098: return getPolymer(); 6099 case -309012605: return getProtein(); 6100 case -1064442270: return getSourceMaterial(); 6101 default: return super.makeProperty(hash, name); 6102 } 6103 6104 } 6105 6106 @Override 6107 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 6108 switch (hash) { 6109 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 6110 case 351608024: /*version*/ return new String[] {"string"}; 6111 case -892481550: /*status*/ return new String[] {"CodeableConcept"}; 6112 case 382350310: /*classification*/ return new String[] {"CodeableConcept"}; 6113 case -1326197564: /*domain*/ return new String[] {"CodeableConcept"}; 6114 case 98615255: /*grade*/ return new String[] {"CodeableConcept"}; 6115 case -1724546052: /*description*/ return new String[] {"markdown"}; 6116 case -2123220889: /*informationSource*/ return new String[] {"Reference"}; 6117 case 3387378: /*note*/ return new String[] {"Annotation"}; 6118 case -1969347631: /*manufacturer*/ return new String[] {"Reference"}; 6119 case -1663305268: /*supplier*/ return new String[] {"Reference"}; 6120 case -1068650173: /*moiety*/ return new String[] {}; 6121 case -993141291: /*property*/ return new String[] {}; 6122 case -2117930783: /*referenceInformation*/ return new String[] {"Reference"}; 6123 case 635625672: /*molecularWeight*/ return new String[] {}; 6124 case 144518515: /*structure*/ return new String[] {}; 6125 case 3059181: /*code*/ return new String[] {}; 6126 case 3373707: /*name*/ return new String[] {}; 6127 case -261851592: /*relationship*/ return new String[] {}; 6128 case 1625275180: /*nucleicAcid*/ return new String[] {"Reference"}; 6129 case -397514098: /*polymer*/ return new String[] {"Reference"}; 6130 case -309012605: /*protein*/ return new String[] {"Reference"}; 6131 case -1064442270: /*sourceMaterial*/ return new String[] {}; 6132 default: return super.getTypesForProperty(hash, name); 6133 } 6134 6135 } 6136 6137 @Override 6138 public Base addChild(String name) throws FHIRException { 6139 if (name.equals("identifier")) { 6140 return addIdentifier(); 6141 } 6142 else if (name.equals("version")) { 6143 throw new FHIRException("Cannot call addChild on a primitive type SubstanceDefinition.version"); 6144 } 6145 else if (name.equals("status")) { 6146 this.status = new CodeableConcept(); 6147 return this.status; 6148 } 6149 else if (name.equals("classification")) { 6150 return addClassification(); 6151 } 6152 else if (name.equals("domain")) { 6153 this.domain = new CodeableConcept(); 6154 return this.domain; 6155 } 6156 else if (name.equals("grade")) { 6157 return addGrade(); 6158 } 6159 else if (name.equals("description")) { 6160 throw new FHIRException("Cannot call addChild on a primitive type SubstanceDefinition.description"); 6161 } 6162 else if (name.equals("informationSource")) { 6163 return addInformationSource(); 6164 } 6165 else if (name.equals("note")) { 6166 return addNote(); 6167 } 6168 else if (name.equals("manufacturer")) { 6169 return addManufacturer(); 6170 } 6171 else if (name.equals("supplier")) { 6172 return addSupplier(); 6173 } 6174 else if (name.equals("moiety")) { 6175 return addMoiety(); 6176 } 6177 else if (name.equals("property")) { 6178 return addProperty(); 6179 } 6180 else if (name.equals("referenceInformation")) { 6181 this.referenceInformation = new Reference(); 6182 return this.referenceInformation; 6183 } 6184 else if (name.equals("molecularWeight")) { 6185 return addMolecularWeight(); 6186 } 6187 else if (name.equals("structure")) { 6188 this.structure = new SubstanceDefinitionStructureComponent(); 6189 return this.structure; 6190 } 6191 else if (name.equals("code")) { 6192 return addCode(); 6193 } 6194 else if (name.equals("name")) { 6195 return addName(); 6196 } 6197 else if (name.equals("relationship")) { 6198 return addRelationship(); 6199 } 6200 else if (name.equals("nucleicAcid")) { 6201 this.nucleicAcid = new Reference(); 6202 return this.nucleicAcid; 6203 } 6204 else if (name.equals("polymer")) { 6205 this.polymer = new Reference(); 6206 return this.polymer; 6207 } 6208 else if (name.equals("protein")) { 6209 this.protein = new Reference(); 6210 return this.protein; 6211 } 6212 else if (name.equals("sourceMaterial")) { 6213 this.sourceMaterial = new SubstanceDefinitionSourceMaterialComponent(); 6214 return this.sourceMaterial; 6215 } 6216 else 6217 return super.addChild(name); 6218 } 6219 6220 public String fhirType() { 6221 return "SubstanceDefinition"; 6222 6223 } 6224 6225 public SubstanceDefinition copy() { 6226 SubstanceDefinition dst = new SubstanceDefinition(); 6227 copyValues(dst); 6228 return dst; 6229 } 6230 6231 public void copyValues(SubstanceDefinition dst) { 6232 super.copyValues(dst); 6233 if (identifier != null) { 6234 dst.identifier = new ArrayList<Identifier>(); 6235 for (Identifier i : identifier) 6236 dst.identifier.add(i.copy()); 6237 }; 6238 dst.version = version == null ? null : version.copy(); 6239 dst.status = status == null ? null : status.copy(); 6240 if (classification != null) { 6241 dst.classification = new ArrayList<CodeableConcept>(); 6242 for (CodeableConcept i : classification) 6243 dst.classification.add(i.copy()); 6244 }; 6245 dst.domain = domain == null ? null : domain.copy(); 6246 if (grade != null) { 6247 dst.grade = new ArrayList<CodeableConcept>(); 6248 for (CodeableConcept i : grade) 6249 dst.grade.add(i.copy()); 6250 }; 6251 dst.description = description == null ? null : description.copy(); 6252 if (informationSource != null) { 6253 dst.informationSource = new ArrayList<Reference>(); 6254 for (Reference i : informationSource) 6255 dst.informationSource.add(i.copy()); 6256 }; 6257 if (note != null) { 6258 dst.note = new ArrayList<Annotation>(); 6259 for (Annotation i : note) 6260 dst.note.add(i.copy()); 6261 }; 6262 if (manufacturer != null) { 6263 dst.manufacturer = new ArrayList<Reference>(); 6264 for (Reference i : manufacturer) 6265 dst.manufacturer.add(i.copy()); 6266 }; 6267 if (supplier != null) { 6268 dst.supplier = new ArrayList<Reference>(); 6269 for (Reference i : supplier) 6270 dst.supplier.add(i.copy()); 6271 }; 6272 if (moiety != null) { 6273 dst.moiety = new ArrayList<SubstanceDefinitionMoietyComponent>(); 6274 for (SubstanceDefinitionMoietyComponent i : moiety) 6275 dst.moiety.add(i.copy()); 6276 }; 6277 if (property != null) { 6278 dst.property = new ArrayList<SubstanceDefinitionPropertyComponent>(); 6279 for (SubstanceDefinitionPropertyComponent i : property) 6280 dst.property.add(i.copy()); 6281 }; 6282 dst.referenceInformation = referenceInformation == null ? null : referenceInformation.copy(); 6283 if (molecularWeight != null) { 6284 dst.molecularWeight = new ArrayList<SubstanceDefinitionMolecularWeightComponent>(); 6285 for (SubstanceDefinitionMolecularWeightComponent i : molecularWeight) 6286 dst.molecularWeight.add(i.copy()); 6287 }; 6288 dst.structure = structure == null ? null : structure.copy(); 6289 if (code != null) { 6290 dst.code = new ArrayList<SubstanceDefinitionCodeComponent>(); 6291 for (SubstanceDefinitionCodeComponent i : code) 6292 dst.code.add(i.copy()); 6293 }; 6294 if (name != null) { 6295 dst.name = new ArrayList<SubstanceDefinitionNameComponent>(); 6296 for (SubstanceDefinitionNameComponent i : name) 6297 dst.name.add(i.copy()); 6298 }; 6299 if (relationship != null) { 6300 dst.relationship = new ArrayList<SubstanceDefinitionRelationshipComponent>(); 6301 for (SubstanceDefinitionRelationshipComponent i : relationship) 6302 dst.relationship.add(i.copy()); 6303 }; 6304 dst.nucleicAcid = nucleicAcid == null ? null : nucleicAcid.copy(); 6305 dst.polymer = polymer == null ? null : polymer.copy(); 6306 dst.protein = protein == null ? null : protein.copy(); 6307 dst.sourceMaterial = sourceMaterial == null ? null : sourceMaterial.copy(); 6308 } 6309 6310 protected SubstanceDefinition typedCopy() { 6311 return copy(); 6312 } 6313 6314 @Override 6315 public boolean equalsDeep(Base other_) { 6316 if (!super.equalsDeep(other_)) 6317 return false; 6318 if (!(other_ instanceof SubstanceDefinition)) 6319 return false; 6320 SubstanceDefinition o = (SubstanceDefinition) other_; 6321 return compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) && compareDeep(status, o.status, true) 6322 && compareDeep(classification, o.classification, true) && compareDeep(domain, o.domain, true) && compareDeep(grade, o.grade, true) 6323 && compareDeep(description, o.description, true) && compareDeep(informationSource, o.informationSource, true) 6324 && compareDeep(note, o.note, true) && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(supplier, o.supplier, true) 6325 && compareDeep(moiety, o.moiety, true) && compareDeep(property, o.property, true) && compareDeep(referenceInformation, o.referenceInformation, true) 6326 && compareDeep(molecularWeight, o.molecularWeight, true) && compareDeep(structure, o.structure, true) 6327 && compareDeep(code, o.code, true) && compareDeep(name, o.name, true) && compareDeep(relationship, o.relationship, true) 6328 && compareDeep(nucleicAcid, o.nucleicAcid, true) && compareDeep(polymer, o.polymer, true) && compareDeep(protein, o.protein, true) 6329 && compareDeep(sourceMaterial, o.sourceMaterial, true); 6330 } 6331 6332 @Override 6333 public boolean equalsShallow(Base other_) { 6334 if (!super.equalsShallow(other_)) 6335 return false; 6336 if (!(other_ instanceof SubstanceDefinition)) 6337 return false; 6338 SubstanceDefinition o = (SubstanceDefinition) other_; 6339 return compareValues(version, o.version, true) && compareValues(description, o.description, true); 6340 } 6341 6342 public boolean isEmpty() { 6343 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, version, status 6344 , classification, domain, grade, description, informationSource, note, manufacturer 6345 , supplier, moiety, property, referenceInformation, molecularWeight, structure, code 6346 , name, relationship, nucleicAcid, polymer, protein, sourceMaterial); 6347 } 6348 6349 @Override 6350 public ResourceType getResourceType() { 6351 return ResourceType.SubstanceDefinition; 6352 } 6353 6354 /** 6355 * Search parameter: <b>classification</b> 6356 * <p> 6357 * Description: <b>High or low level categorization, e.g. polymer vs. nucleic acid or linear vs. branch chain</b><br> 6358 * Type: <b>token</b><br> 6359 * Path: <b>SubstanceDefinition.classification</b><br> 6360 * </p> 6361 */ 6362 @SearchParamDefinition(name="classification", path="SubstanceDefinition.classification", description="High or low level categorization, e.g. polymer vs. nucleic acid or linear vs. branch chain", type="token" ) 6363 public static final String SP_CLASSIFICATION = "classification"; 6364 /** 6365 * <b>Fluent Client</b> search parameter constant for <b>classification</b> 6366 * <p> 6367 * Description: <b>High or low level categorization, e.g. polymer vs. nucleic acid or linear vs. branch chain</b><br> 6368 * Type: <b>token</b><br> 6369 * Path: <b>SubstanceDefinition.classification</b><br> 6370 * </p> 6371 */ 6372 public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLASSIFICATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLASSIFICATION); 6373 6374 /** 6375 * Search parameter: <b>code</b> 6376 * <p> 6377 * Description: <b>The specific code</b><br> 6378 * Type: <b>token</b><br> 6379 * Path: <b>SubstanceDefinition.code.code</b><br> 6380 * </p> 6381 */ 6382 @SearchParamDefinition(name="code", path="SubstanceDefinition.code.code", description="The specific code", type="token" ) 6383 public static final String SP_CODE = "code"; 6384 /** 6385 * <b>Fluent Client</b> search parameter constant for <b>code</b> 6386 * <p> 6387 * Description: <b>The specific code</b><br> 6388 * Type: <b>token</b><br> 6389 * Path: <b>SubstanceDefinition.code.code</b><br> 6390 * </p> 6391 */ 6392 public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); 6393 6394 /** 6395 * Search parameter: <b>domain</b> 6396 * <p> 6397 * Description: <b>If the substance applies to only human or veterinary use</b><br> 6398 * Type: <b>token</b><br> 6399 * Path: <b>SubstanceDefinition.domain</b><br> 6400 * </p> 6401 */ 6402 @SearchParamDefinition(name="domain", path="SubstanceDefinition.domain", description="If the substance applies to only human or veterinary use", type="token" ) 6403 public static final String SP_DOMAIN = "domain"; 6404 /** 6405 * <b>Fluent Client</b> search parameter constant for <b>domain</b> 6406 * <p> 6407 * Description: <b>If the substance applies to only human or veterinary use</b><br> 6408 * Type: <b>token</b><br> 6409 * Path: <b>SubstanceDefinition.domain</b><br> 6410 * </p> 6411 */ 6412 public static final ca.uhn.fhir.rest.gclient.TokenClientParam DOMAIN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DOMAIN); 6413 6414 /** 6415 * Search parameter: <b>identifier</b> 6416 * <p> 6417 * Description: <b>Identifier by which this substance is known</b><br> 6418 * Type: <b>token</b><br> 6419 * Path: <b>SubstanceDefinition.identifier</b><br> 6420 * </p> 6421 */ 6422 @SearchParamDefinition(name="identifier", path="SubstanceDefinition.identifier", description="Identifier by which this substance is known", type="token" ) 6423 public static final String SP_IDENTIFIER = "identifier"; 6424 /** 6425 * <b>Fluent Client</b> search parameter constant for <b>identifier</b> 6426 * <p> 6427 * Description: <b>Identifier by which this substance is known</b><br> 6428 * Type: <b>token</b><br> 6429 * Path: <b>SubstanceDefinition.identifier</b><br> 6430 * </p> 6431 */ 6432 public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); 6433 6434 /** 6435 * Search parameter: <b>name</b> 6436 * <p> 6437 * Description: <b>The actual name</b><br> 6438 * Type: <b>string</b><br> 6439 * Path: <b>SubstanceDefinition.name.name</b><br> 6440 * </p> 6441 */ 6442 @SearchParamDefinition(name="name", path="SubstanceDefinition.name.name", description="The actual name", type="string" ) 6443 public static final String SP_NAME = "name"; 6444 /** 6445 * <b>Fluent Client</b> search parameter constant for <b>name</b> 6446 * <p> 6447 * Description: <b>The actual name</b><br> 6448 * Type: <b>string</b><br> 6449 * Path: <b>SubstanceDefinition.name.name</b><br> 6450 * </p> 6451 */ 6452 public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); 6453 6454 6455} 6456