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