001package org.hl7.fhir.dstu3.model; 002 003/* 004 Copyright (c) 2011+, HL7, Inc. 005 All rights reserved. 006 007 Redistribution and use in source and binary forms, with or without modification, 008 are permitted provided that the following conditions are met: 009 010 * Redistributions of source code must retain the above copyright notice, this 011 list of conditions and the following disclaimer. 012 * Redistributions in binary form must reproduce the above copyright notice, 013 this list of conditions and the following disclaimer in the documentation 014 and/or other materials provided with the distribution. 015 * Neither the name of HL7 nor the names of its contributors may be used to 016 endorse or promote products derived from this software without specific 017 prior written permission. 018 019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 022 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 023 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 024 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 025 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 026 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 027 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 028 POSSIBILITY OF SUCH DAMAGE. 029 030*/ 031 032// Generated on Mon, Apr 17, 2017 17:38-0400 for FHIR v3.0.1 033 034import java.util.*; 035 036import org.hl7.fhir.utilities.Utilities; 037import ca.uhn.fhir.model.api.annotation.ResourceDef; 038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 039import ca.uhn.fhir.model.api.annotation.Child; 040import ca.uhn.fhir.model.api.annotation.ChildOrder; 041import ca.uhn.fhir.model.api.annotation.Description; 042import ca.uhn.fhir.model.api.annotation.Block; 043import org.hl7.fhir.instance.model.api.*; 044import org.hl7.fhir.exceptions.FHIRException; 045/** 046 * A homogeneous material with a definite composition. 047 */ 048@ResourceDef(name="Substance", profile="http://hl7.org/fhir/Profile/Substance") 049public class Substance extends DomainResource { 050 051 public enum FHIRSubstanceStatus { 052 /** 053 * The substance is considered for use or reference 054 */ 055 ACTIVE, 056 /** 057 * The substance is considered for reference, but not for use 058 */ 059 INACTIVE, 060 /** 061 * The substance was entered in error 062 */ 063 ENTEREDINERROR, 064 /** 065 * added to help the parsers with the generic types 066 */ 067 NULL; 068 public static FHIRSubstanceStatus fromCode(String codeString) throws FHIRException { 069 if (codeString == null || "".equals(codeString)) 070 return null; 071 if ("active".equals(codeString)) 072 return ACTIVE; 073 if ("inactive".equals(codeString)) 074 return INACTIVE; 075 if ("entered-in-error".equals(codeString)) 076 return ENTEREDINERROR; 077 if (Configuration.isAcceptInvalidEnums()) 078 return null; 079 else 080 throw new FHIRException("Unknown FHIRSubstanceStatus code '"+codeString+"'"); 081 } 082 public String toCode() { 083 switch (this) { 084 case ACTIVE: return "active"; 085 case INACTIVE: return "inactive"; 086 case ENTEREDINERROR: return "entered-in-error"; 087 default: return "?"; 088 } 089 } 090 public String getSystem() { 091 switch (this) { 092 case ACTIVE: return "http://hl7.org/fhir/substance-status"; 093 case INACTIVE: return "http://hl7.org/fhir/substance-status"; 094 case ENTEREDINERROR: return "http://hl7.org/fhir/substance-status"; 095 default: return "?"; 096 } 097 } 098 public String getDefinition() { 099 switch (this) { 100 case ACTIVE: return "The substance is considered for use or reference"; 101 case INACTIVE: return "The substance is considered for reference, but not for use"; 102 case ENTEREDINERROR: return "The substance was entered in error"; 103 default: return "?"; 104 } 105 } 106 public String getDisplay() { 107 switch (this) { 108 case ACTIVE: return "Active"; 109 case INACTIVE: return "Inactive"; 110 case ENTEREDINERROR: return "Entered in Error"; 111 default: return "?"; 112 } 113 } 114 } 115 116 public static class FHIRSubstanceStatusEnumFactory implements EnumFactory<FHIRSubstanceStatus> { 117 public FHIRSubstanceStatus fromCode(String codeString) throws IllegalArgumentException { 118 if (codeString == null || "".equals(codeString)) 119 if (codeString == null || "".equals(codeString)) 120 return null; 121 if ("active".equals(codeString)) 122 return FHIRSubstanceStatus.ACTIVE; 123 if ("inactive".equals(codeString)) 124 return FHIRSubstanceStatus.INACTIVE; 125 if ("entered-in-error".equals(codeString)) 126 return FHIRSubstanceStatus.ENTEREDINERROR; 127 throw new IllegalArgumentException("Unknown FHIRSubstanceStatus code '"+codeString+"'"); 128 } 129 public Enumeration<FHIRSubstanceStatus> fromType(Base code) throws FHIRException { 130 if (code == null) 131 return null; 132 if (code.isEmpty()) 133 return new Enumeration<FHIRSubstanceStatus>(this); 134 String codeString = ((PrimitiveType) code).asStringValue(); 135 if (codeString == null || "".equals(codeString)) 136 return null; 137 if ("active".equals(codeString)) 138 return new Enumeration<FHIRSubstanceStatus>(this, FHIRSubstanceStatus.ACTIVE); 139 if ("inactive".equals(codeString)) 140 return new Enumeration<FHIRSubstanceStatus>(this, FHIRSubstanceStatus.INACTIVE); 141 if ("entered-in-error".equals(codeString)) 142 return new Enumeration<FHIRSubstanceStatus>(this, FHIRSubstanceStatus.ENTEREDINERROR); 143 throw new FHIRException("Unknown FHIRSubstanceStatus code '"+codeString+"'"); 144 } 145 public String toCode(FHIRSubstanceStatus code) { 146 if (code == FHIRSubstanceStatus.ACTIVE) 147 return "active"; 148 if (code == FHIRSubstanceStatus.INACTIVE) 149 return "inactive"; 150 if (code == FHIRSubstanceStatus.ENTEREDINERROR) 151 return "entered-in-error"; 152 return "?"; 153 } 154 public String toSystem(FHIRSubstanceStatus code) { 155 return code.getSystem(); 156 } 157 } 158 159 @Block() 160 public static class SubstanceInstanceComponent extends BackboneElement implements IBaseBackboneElement { 161 /** 162 * Identifier associated with the package/container (usually a label affixed directly). 163 */ 164 @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) 165 @Description(shortDefinition="Identifier of the package/container", formalDefinition="Identifier associated with the package/container (usually a label affixed directly)." ) 166 protected Identifier identifier; 167 168 /** 169 * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. 170 */ 171 @Child(name = "expiry", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) 172 @Description(shortDefinition="When no longer valid to use", formalDefinition="When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry." ) 173 protected DateTimeType expiry; 174 175 /** 176 * The amount of the substance. 177 */ 178 @Child(name = "quantity", type = {SimpleQuantity.class}, order=3, min=0, max=1, modifier=false, summary=true) 179 @Description(shortDefinition="Amount of substance in the package", formalDefinition="The amount of the substance." ) 180 protected SimpleQuantity quantity; 181 182 private static final long serialVersionUID = -794314734L; 183 184 /** 185 * Constructor 186 */ 187 public SubstanceInstanceComponent() { 188 super(); 189 } 190 191 /** 192 * @return {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) 193 */ 194 public Identifier getIdentifier() { 195 if (this.identifier == null) 196 if (Configuration.errorOnAutoCreate()) 197 throw new Error("Attempt to auto-create SubstanceInstanceComponent.identifier"); 198 else if (Configuration.doAutoCreate()) 199 this.identifier = new Identifier(); // cc 200 return this.identifier; 201 } 202 203 public boolean hasIdentifier() { 204 return this.identifier != null && !this.identifier.isEmpty(); 205 } 206 207 /** 208 * @param value {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) 209 */ 210 public SubstanceInstanceComponent setIdentifier(Identifier value) { 211 this.identifier = value; 212 return this; 213 } 214 215 /** 216 * @return {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value 217 */ 218 public DateTimeType getExpiryElement() { 219 if (this.expiry == null) 220 if (Configuration.errorOnAutoCreate()) 221 throw new Error("Attempt to auto-create SubstanceInstanceComponent.expiry"); 222 else if (Configuration.doAutoCreate()) 223 this.expiry = new DateTimeType(); // bb 224 return this.expiry; 225 } 226 227 public boolean hasExpiryElement() { 228 return this.expiry != null && !this.expiry.isEmpty(); 229 } 230 231 public boolean hasExpiry() { 232 return this.expiry != null && !this.expiry.isEmpty(); 233 } 234 235 /** 236 * @param value {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value 237 */ 238 public SubstanceInstanceComponent setExpiryElement(DateTimeType value) { 239 this.expiry = value; 240 return this; 241 } 242 243 /** 244 * @return When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. 245 */ 246 public Date getExpiry() { 247 return this.expiry == null ? null : this.expiry.getValue(); 248 } 249 250 /** 251 * @param value When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. 252 */ 253 public SubstanceInstanceComponent setExpiry(Date value) { 254 if (value == null) 255 this.expiry = null; 256 else { 257 if (this.expiry == null) 258 this.expiry = new DateTimeType(); 259 this.expiry.setValue(value); 260 } 261 return this; 262 } 263 264 /** 265 * @return {@link #quantity} (The amount of the substance.) 266 */ 267 public SimpleQuantity getQuantity() { 268 if (this.quantity == null) 269 if (Configuration.errorOnAutoCreate()) 270 throw new Error("Attempt to auto-create SubstanceInstanceComponent.quantity"); 271 else if (Configuration.doAutoCreate()) 272 this.quantity = new SimpleQuantity(); // cc 273 return this.quantity; 274 } 275 276 public boolean hasQuantity() { 277 return this.quantity != null && !this.quantity.isEmpty(); 278 } 279 280 /** 281 * @param value {@link #quantity} (The amount of the substance.) 282 */ 283 public SubstanceInstanceComponent setQuantity(SimpleQuantity value) { 284 this.quantity = value; 285 return this; 286 } 287 288 protected void listChildren(List<Property> childrenList) { 289 super.listChildren(childrenList); 290 childrenList.add(new Property("identifier", "Identifier", "Identifier associated with the package/container (usually a label affixed directly).", 0, java.lang.Integer.MAX_VALUE, identifier)); 291 childrenList.add(new Property("expiry", "dateTime", "When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.", 0, java.lang.Integer.MAX_VALUE, expiry)); 292 childrenList.add(new Property("quantity", "SimpleQuantity", "The amount of the substance.", 0, java.lang.Integer.MAX_VALUE, quantity)); 293 } 294 295 @Override 296 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 297 switch (hash) { 298 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier 299 case -1289159373: /*expiry*/ return this.expiry == null ? new Base[0] : new Base[] {this.expiry}; // DateTimeType 300 case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity 301 default: return super.getProperty(hash, name, checkValid); 302 } 303 304 } 305 306 @Override 307 public Base setProperty(int hash, String name, Base value) throws FHIRException { 308 switch (hash) { 309 case -1618432855: // identifier 310 this.identifier = castToIdentifier(value); // Identifier 311 return value; 312 case -1289159373: // expiry 313 this.expiry = castToDateTime(value); // DateTimeType 314 return value; 315 case -1285004149: // quantity 316 this.quantity = castToSimpleQuantity(value); // SimpleQuantity 317 return value; 318 default: return super.setProperty(hash, name, value); 319 } 320 321 } 322 323 @Override 324 public Base setProperty(String name, Base value) throws FHIRException { 325 if (name.equals("identifier")) { 326 this.identifier = castToIdentifier(value); // Identifier 327 } else if (name.equals("expiry")) { 328 this.expiry = castToDateTime(value); // DateTimeType 329 } else if (name.equals("quantity")) { 330 this.quantity = castToSimpleQuantity(value); // SimpleQuantity 331 } else 332 return super.setProperty(name, value); 333 return value; 334 } 335 336 @Override 337 public Base makeProperty(int hash, String name) throws FHIRException { 338 switch (hash) { 339 case -1618432855: return getIdentifier(); 340 case -1289159373: return getExpiryElement(); 341 case -1285004149: return getQuantity(); 342 default: return super.makeProperty(hash, name); 343 } 344 345 } 346 347 @Override 348 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 349 switch (hash) { 350 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 351 case -1289159373: /*expiry*/ return new String[] {"dateTime"}; 352 case -1285004149: /*quantity*/ return new String[] {"SimpleQuantity"}; 353 default: return super.getTypesForProperty(hash, name); 354 } 355 356 } 357 358 @Override 359 public Base addChild(String name) throws FHIRException { 360 if (name.equals("identifier")) { 361 this.identifier = new Identifier(); 362 return this.identifier; 363 } 364 else if (name.equals("expiry")) { 365 throw new FHIRException("Cannot call addChild on a primitive type Substance.expiry"); 366 } 367 else if (name.equals("quantity")) { 368 this.quantity = new SimpleQuantity(); 369 return this.quantity; 370 } 371 else 372 return super.addChild(name); 373 } 374 375 public SubstanceInstanceComponent copy() { 376 SubstanceInstanceComponent dst = new SubstanceInstanceComponent(); 377 copyValues(dst); 378 dst.identifier = identifier == null ? null : identifier.copy(); 379 dst.expiry = expiry == null ? null : expiry.copy(); 380 dst.quantity = quantity == null ? null : quantity.copy(); 381 return dst; 382 } 383 384 @Override 385 public boolean equalsDeep(Base other) { 386 if (!super.equalsDeep(other)) 387 return false; 388 if (!(other instanceof SubstanceInstanceComponent)) 389 return false; 390 SubstanceInstanceComponent o = (SubstanceInstanceComponent) other; 391 return compareDeep(identifier, o.identifier, true) && compareDeep(expiry, o.expiry, true) && compareDeep(quantity, o.quantity, true) 392 ; 393 } 394 395 @Override 396 public boolean equalsShallow(Base other) { 397 if (!super.equalsShallow(other)) 398 return false; 399 if (!(other instanceof SubstanceInstanceComponent)) 400 return false; 401 SubstanceInstanceComponent o = (SubstanceInstanceComponent) other; 402 return compareValues(expiry, o.expiry, true); 403 } 404 405 public boolean isEmpty() { 406 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, expiry, quantity 407 ); 408 } 409 410 public String fhirType() { 411 return "Substance.instance"; 412 413 } 414 415 } 416 417 @Block() 418 public static class SubstanceIngredientComponent extends BackboneElement implements IBaseBackboneElement { 419 /** 420 * The amount of the ingredient in the substance - a concentration ratio. 421 */ 422 @Child(name = "quantity", type = {Ratio.class}, order=1, min=0, max=1, modifier=false, summary=true) 423 @Description(shortDefinition="Optional amount (concentration)", formalDefinition="The amount of the ingredient in the substance - a concentration ratio." ) 424 protected Ratio quantity; 425 426 /** 427 * Another substance that is a component of this substance. 428 */ 429 @Child(name = "substance", type = {CodeableConcept.class, Substance.class}, order=2, min=1, max=1, modifier=false, summary=true) 430 @Description(shortDefinition="A component of the substance", formalDefinition="Another substance that is a component of this substance." ) 431 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-code") 432 protected Type substance; 433 434 private static final long serialVersionUID = -469805322L; 435 436 /** 437 * Constructor 438 */ 439 public SubstanceIngredientComponent() { 440 super(); 441 } 442 443 /** 444 * Constructor 445 */ 446 public SubstanceIngredientComponent(Type substance) { 447 super(); 448 this.substance = substance; 449 } 450 451 /** 452 * @return {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) 453 */ 454 public Ratio getQuantity() { 455 if (this.quantity == null) 456 if (Configuration.errorOnAutoCreate()) 457 throw new Error("Attempt to auto-create SubstanceIngredientComponent.quantity"); 458 else if (Configuration.doAutoCreate()) 459 this.quantity = new Ratio(); // cc 460 return this.quantity; 461 } 462 463 public boolean hasQuantity() { 464 return this.quantity != null && !this.quantity.isEmpty(); 465 } 466 467 /** 468 * @param value {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) 469 */ 470 public SubstanceIngredientComponent setQuantity(Ratio value) { 471 this.quantity = value; 472 return this; 473 } 474 475 /** 476 * @return {@link #substance} (Another substance that is a component of this substance.) 477 */ 478 public Type getSubstance() { 479 return this.substance; 480 } 481 482 /** 483 * @return {@link #substance} (Another substance that is a component of this substance.) 484 */ 485 public CodeableConcept getSubstanceCodeableConcept() throws FHIRException { 486 if (!(this.substance instanceof CodeableConcept)) 487 throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.substance.getClass().getName()+" was encountered"); 488 return (CodeableConcept) this.substance; 489 } 490 491 public boolean hasSubstanceCodeableConcept() { 492 return this.substance instanceof CodeableConcept; 493 } 494 495 /** 496 * @return {@link #substance} (Another substance that is a component of this substance.) 497 */ 498 public Reference getSubstanceReference() throws FHIRException { 499 if (!(this.substance instanceof Reference)) 500 throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.substance.getClass().getName()+" was encountered"); 501 return (Reference) this.substance; 502 } 503 504 public boolean hasSubstanceReference() { 505 return this.substance instanceof Reference; 506 } 507 508 public boolean hasSubstance() { 509 return this.substance != null && !this.substance.isEmpty(); 510 } 511 512 /** 513 * @param value {@link #substance} (Another substance that is a component of this substance.) 514 */ 515 public SubstanceIngredientComponent setSubstance(Type value) { 516 this.substance = value; 517 return this; 518 } 519 520 protected void listChildren(List<Property> childrenList) { 521 super.listChildren(childrenList); 522 childrenList.add(new Property("quantity", "Ratio", "The amount of the ingredient in the substance - a concentration ratio.", 0, java.lang.Integer.MAX_VALUE, quantity)); 523 childrenList.add(new Property("substance[x]", "CodeableConcept|Reference(Substance)", "Another substance that is a component of this substance.", 0, java.lang.Integer.MAX_VALUE, substance)); 524 } 525 526 @Override 527 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 528 switch (hash) { 529 case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Ratio 530 case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // Type 531 default: return super.getProperty(hash, name, checkValid); 532 } 533 534 } 535 536 @Override 537 public Base setProperty(int hash, String name, Base value) throws FHIRException { 538 switch (hash) { 539 case -1285004149: // quantity 540 this.quantity = castToRatio(value); // Ratio 541 return value; 542 case 530040176: // substance 543 this.substance = castToType(value); // Type 544 return value; 545 default: return super.setProperty(hash, name, value); 546 } 547 548 } 549 550 @Override 551 public Base setProperty(String name, Base value) throws FHIRException { 552 if (name.equals("quantity")) { 553 this.quantity = castToRatio(value); // Ratio 554 } else if (name.equals("substance[x]")) { 555 this.substance = castToType(value); // Type 556 } else 557 return super.setProperty(name, value); 558 return value; 559 } 560 561 @Override 562 public Base makeProperty(int hash, String name) throws FHIRException { 563 switch (hash) { 564 case -1285004149: return getQuantity(); 565 case 2127194384: return getSubstance(); 566 case 530040176: return getSubstance(); 567 default: return super.makeProperty(hash, name); 568 } 569 570 } 571 572 @Override 573 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 574 switch (hash) { 575 case -1285004149: /*quantity*/ return new String[] {"Ratio"}; 576 case 530040176: /*substance*/ return new String[] {"CodeableConcept", "Reference"}; 577 default: return super.getTypesForProperty(hash, name); 578 } 579 580 } 581 582 @Override 583 public Base addChild(String name) throws FHIRException { 584 if (name.equals("quantity")) { 585 this.quantity = new Ratio(); 586 return this.quantity; 587 } 588 else if (name.equals("substanceCodeableConcept")) { 589 this.substance = new CodeableConcept(); 590 return this.substance; 591 } 592 else if (name.equals("substanceReference")) { 593 this.substance = new Reference(); 594 return this.substance; 595 } 596 else 597 return super.addChild(name); 598 } 599 600 public SubstanceIngredientComponent copy() { 601 SubstanceIngredientComponent dst = new SubstanceIngredientComponent(); 602 copyValues(dst); 603 dst.quantity = quantity == null ? null : quantity.copy(); 604 dst.substance = substance == null ? null : substance.copy(); 605 return dst; 606 } 607 608 @Override 609 public boolean equalsDeep(Base other) { 610 if (!super.equalsDeep(other)) 611 return false; 612 if (!(other instanceof SubstanceIngredientComponent)) 613 return false; 614 SubstanceIngredientComponent o = (SubstanceIngredientComponent) other; 615 return compareDeep(quantity, o.quantity, true) && compareDeep(substance, o.substance, true); 616 } 617 618 @Override 619 public boolean equalsShallow(Base other) { 620 if (!super.equalsShallow(other)) 621 return false; 622 if (!(other instanceof SubstanceIngredientComponent)) 623 return false; 624 SubstanceIngredientComponent o = (SubstanceIngredientComponent) other; 625 return true; 626 } 627 628 public boolean isEmpty() { 629 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(quantity, substance); 630 } 631 632 public String fhirType() { 633 return "Substance.ingredient"; 634 635 } 636 637 } 638 639 /** 640 * Unique identifier for the substance. 641 */ 642 @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 643 @Description(shortDefinition="Unique identifier", formalDefinition="Unique identifier for the substance." ) 644 protected List<Identifier> identifier; 645 646 /** 647 * A code to indicate if the substance is actively used. 648 */ 649 @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) 650 @Description(shortDefinition="active | inactive | entered-in-error", formalDefinition="A code to indicate if the substance is actively used." ) 651 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-status") 652 protected Enumeration<FHIRSubstanceStatus> status; 653 654 /** 655 * A code that classifies the general type of substance. This is used for searching, sorting and display purposes. 656 */ 657 @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 658 @Description(shortDefinition="What class/type of substance this is", formalDefinition="A code that classifies the general type of substance. This is used for searching, sorting and display purposes." ) 659 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-category") 660 protected List<CodeableConcept> category; 661 662 /** 663 * A code (or set of codes) that identify this substance. 664 */ 665 @Child(name = "code", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true) 666 @Description(shortDefinition="What substance this is", formalDefinition="A code (or set of codes) that identify this substance." ) 667 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-code") 668 protected CodeableConcept code; 669 670 /** 671 * A description of the substance - its appearance, handling requirements, and other usage notes. 672 */ 673 @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) 674 @Description(shortDefinition="Textual description of the substance, comments", formalDefinition="A description of the substance - its appearance, handling requirements, and other usage notes." ) 675 protected StringType description; 676 677 /** 678 * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance. 679 */ 680 @Child(name = "instance", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 681 @Description(shortDefinition="If this describes a specific package/container of the substance", formalDefinition="Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance." ) 682 protected List<SubstanceInstanceComponent> instance; 683 684 /** 685 * A substance can be composed of other substances. 686 */ 687 @Child(name = "ingredient", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 688 @Description(shortDefinition="Composition information about the substance", formalDefinition="A substance can be composed of other substances." ) 689 protected List<SubstanceIngredientComponent> ingredient; 690 691 private static final long serialVersionUID = -1467626602L; 692 693 /** 694 * Constructor 695 */ 696 public Substance() { 697 super(); 698 } 699 700 /** 701 * Constructor 702 */ 703 public Substance(CodeableConcept code) { 704 super(); 705 this.code = code; 706 } 707 708 /** 709 * @return {@link #identifier} (Unique identifier for the substance.) 710 */ 711 public List<Identifier> getIdentifier() { 712 if (this.identifier == null) 713 this.identifier = new ArrayList<Identifier>(); 714 return this.identifier; 715 } 716 717 /** 718 * @return Returns a reference to <code>this</code> for easy method chaining 719 */ 720 public Substance setIdentifier(List<Identifier> theIdentifier) { 721 this.identifier = theIdentifier; 722 return this; 723 } 724 725 public boolean hasIdentifier() { 726 if (this.identifier == null) 727 return false; 728 for (Identifier item : this.identifier) 729 if (!item.isEmpty()) 730 return true; 731 return false; 732 } 733 734 public Identifier addIdentifier() { //3 735 Identifier t = new Identifier(); 736 if (this.identifier == null) 737 this.identifier = new ArrayList<Identifier>(); 738 this.identifier.add(t); 739 return t; 740 } 741 742 public Substance addIdentifier(Identifier t) { //3 743 if (t == null) 744 return this; 745 if (this.identifier == null) 746 this.identifier = new ArrayList<Identifier>(); 747 this.identifier.add(t); 748 return this; 749 } 750 751 /** 752 * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist 753 */ 754 public Identifier getIdentifierFirstRep() { 755 if (getIdentifier().isEmpty()) { 756 addIdentifier(); 757 } 758 return getIdentifier().get(0); 759 } 760 761 /** 762 * @return {@link #status} (A code to indicate if the substance is actively used.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 763 */ 764 public Enumeration<FHIRSubstanceStatus> getStatusElement() { 765 if (this.status == null) 766 if (Configuration.errorOnAutoCreate()) 767 throw new Error("Attempt to auto-create Substance.status"); 768 else if (Configuration.doAutoCreate()) 769 this.status = new Enumeration<FHIRSubstanceStatus>(new FHIRSubstanceStatusEnumFactory()); // bb 770 return this.status; 771 } 772 773 public boolean hasStatusElement() { 774 return this.status != null && !this.status.isEmpty(); 775 } 776 777 public boolean hasStatus() { 778 return this.status != null && !this.status.isEmpty(); 779 } 780 781 /** 782 * @param value {@link #status} (A code to indicate if the substance is actively used.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 783 */ 784 public Substance setStatusElement(Enumeration<FHIRSubstanceStatus> value) { 785 this.status = value; 786 return this; 787 } 788 789 /** 790 * @return A code to indicate if the substance is actively used. 791 */ 792 public FHIRSubstanceStatus getStatus() { 793 return this.status == null ? null : this.status.getValue(); 794 } 795 796 /** 797 * @param value A code to indicate if the substance is actively used. 798 */ 799 public Substance setStatus(FHIRSubstanceStatus value) { 800 if (value == null) 801 this.status = null; 802 else { 803 if (this.status == null) 804 this.status = new Enumeration<FHIRSubstanceStatus>(new FHIRSubstanceStatusEnumFactory()); 805 this.status.setValue(value); 806 } 807 return this; 808 } 809 810 /** 811 * @return {@link #category} (A code that classifies the general type of substance. This is used for searching, sorting and display purposes.) 812 */ 813 public List<CodeableConcept> getCategory() { 814 if (this.category == null) 815 this.category = new ArrayList<CodeableConcept>(); 816 return this.category; 817 } 818 819 /** 820 * @return Returns a reference to <code>this</code> for easy method chaining 821 */ 822 public Substance setCategory(List<CodeableConcept> theCategory) { 823 this.category = theCategory; 824 return this; 825 } 826 827 public boolean hasCategory() { 828 if (this.category == null) 829 return false; 830 for (CodeableConcept item : this.category) 831 if (!item.isEmpty()) 832 return true; 833 return false; 834 } 835 836 public CodeableConcept addCategory() { //3 837 CodeableConcept t = new CodeableConcept(); 838 if (this.category == null) 839 this.category = new ArrayList<CodeableConcept>(); 840 this.category.add(t); 841 return t; 842 } 843 844 public Substance addCategory(CodeableConcept t) { //3 845 if (t == null) 846 return this; 847 if (this.category == null) 848 this.category = new ArrayList<CodeableConcept>(); 849 this.category.add(t); 850 return this; 851 } 852 853 /** 854 * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist 855 */ 856 public CodeableConcept getCategoryFirstRep() { 857 if (getCategory().isEmpty()) { 858 addCategory(); 859 } 860 return getCategory().get(0); 861 } 862 863 /** 864 * @return {@link #code} (A code (or set of codes) that identify this substance.) 865 */ 866 public CodeableConcept getCode() { 867 if (this.code == null) 868 if (Configuration.errorOnAutoCreate()) 869 throw new Error("Attempt to auto-create Substance.code"); 870 else if (Configuration.doAutoCreate()) 871 this.code = new CodeableConcept(); // cc 872 return this.code; 873 } 874 875 public boolean hasCode() { 876 return this.code != null && !this.code.isEmpty(); 877 } 878 879 /** 880 * @param value {@link #code} (A code (or set of codes) that identify this substance.) 881 */ 882 public Substance setCode(CodeableConcept value) { 883 this.code = value; 884 return this; 885 } 886 887 /** 888 * @return {@link #description} (A description of the substance - its appearance, handling requirements, and other usage notes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 889 */ 890 public StringType getDescriptionElement() { 891 if (this.description == null) 892 if (Configuration.errorOnAutoCreate()) 893 throw new Error("Attempt to auto-create Substance.description"); 894 else if (Configuration.doAutoCreate()) 895 this.description = new StringType(); // bb 896 return this.description; 897 } 898 899 public boolean hasDescriptionElement() { 900 return this.description != null && !this.description.isEmpty(); 901 } 902 903 public boolean hasDescription() { 904 return this.description != null && !this.description.isEmpty(); 905 } 906 907 /** 908 * @param value {@link #description} (A description of the substance - its appearance, handling requirements, and other usage notes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 909 */ 910 public Substance setDescriptionElement(StringType value) { 911 this.description = value; 912 return this; 913 } 914 915 /** 916 * @return A description of the substance - its appearance, handling requirements, and other usage notes. 917 */ 918 public String getDescription() { 919 return this.description == null ? null : this.description.getValue(); 920 } 921 922 /** 923 * @param value A description of the substance - its appearance, handling requirements, and other usage notes. 924 */ 925 public Substance setDescription(String value) { 926 if (Utilities.noString(value)) 927 this.description = null; 928 else { 929 if (this.description == null) 930 this.description = new StringType(); 931 this.description.setValue(value); 932 } 933 return this; 934 } 935 936 /** 937 * @return {@link #instance} (Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.) 938 */ 939 public List<SubstanceInstanceComponent> getInstance() { 940 if (this.instance == null) 941 this.instance = new ArrayList<SubstanceInstanceComponent>(); 942 return this.instance; 943 } 944 945 /** 946 * @return Returns a reference to <code>this</code> for easy method chaining 947 */ 948 public Substance setInstance(List<SubstanceInstanceComponent> theInstance) { 949 this.instance = theInstance; 950 return this; 951 } 952 953 public boolean hasInstance() { 954 if (this.instance == null) 955 return false; 956 for (SubstanceInstanceComponent item : this.instance) 957 if (!item.isEmpty()) 958 return true; 959 return false; 960 } 961 962 public SubstanceInstanceComponent addInstance() { //3 963 SubstanceInstanceComponent t = new SubstanceInstanceComponent(); 964 if (this.instance == null) 965 this.instance = new ArrayList<SubstanceInstanceComponent>(); 966 this.instance.add(t); 967 return t; 968 } 969 970 public Substance addInstance(SubstanceInstanceComponent t) { //3 971 if (t == null) 972 return this; 973 if (this.instance == null) 974 this.instance = new ArrayList<SubstanceInstanceComponent>(); 975 this.instance.add(t); 976 return this; 977 } 978 979 /** 980 * @return The first repetition of repeating field {@link #instance}, creating it if it does not already exist 981 */ 982 public SubstanceInstanceComponent getInstanceFirstRep() { 983 if (getInstance().isEmpty()) { 984 addInstance(); 985 } 986 return getInstance().get(0); 987 } 988 989 /** 990 * @return {@link #ingredient} (A substance can be composed of other substances.) 991 */ 992 public List<SubstanceIngredientComponent> getIngredient() { 993 if (this.ingredient == null) 994 this.ingredient = new ArrayList<SubstanceIngredientComponent>(); 995 return this.ingredient; 996 } 997 998 /** 999 * @return Returns a reference to <code>this</code> for easy method chaining 1000 */ 1001 public Substance setIngredient(List<SubstanceIngredientComponent> theIngredient) { 1002 this.ingredient = theIngredient; 1003 return this; 1004 } 1005 1006 public boolean hasIngredient() { 1007 if (this.ingredient == null) 1008 return false; 1009 for (SubstanceIngredientComponent item : this.ingredient) 1010 if (!item.isEmpty()) 1011 return true; 1012 return false; 1013 } 1014 1015 public SubstanceIngredientComponent addIngredient() { //3 1016 SubstanceIngredientComponent t = new SubstanceIngredientComponent(); 1017 if (this.ingredient == null) 1018 this.ingredient = new ArrayList<SubstanceIngredientComponent>(); 1019 this.ingredient.add(t); 1020 return t; 1021 } 1022 1023 public Substance addIngredient(SubstanceIngredientComponent t) { //3 1024 if (t == null) 1025 return this; 1026 if (this.ingredient == null) 1027 this.ingredient = new ArrayList<SubstanceIngredientComponent>(); 1028 this.ingredient.add(t); 1029 return this; 1030 } 1031 1032 /** 1033 * @return The first repetition of repeating field {@link #ingredient}, creating it if it does not already exist 1034 */ 1035 public SubstanceIngredientComponent getIngredientFirstRep() { 1036 if (getIngredient().isEmpty()) { 1037 addIngredient(); 1038 } 1039 return getIngredient().get(0); 1040 } 1041 1042 protected void listChildren(List<Property> childrenList) { 1043 super.listChildren(childrenList); 1044 childrenList.add(new Property("identifier", "Identifier", "Unique identifier for the substance.", 0, java.lang.Integer.MAX_VALUE, identifier)); 1045 childrenList.add(new Property("status", "code", "A code to indicate if the substance is actively used.", 0, java.lang.Integer.MAX_VALUE, status)); 1046 childrenList.add(new Property("category", "CodeableConcept", "A code that classifies the general type of substance. This is used for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, category)); 1047 childrenList.add(new Property("code", "CodeableConcept", "A code (or set of codes) that identify this substance.", 0, java.lang.Integer.MAX_VALUE, code)); 1048 childrenList.add(new Property("description", "string", "A description of the substance - its appearance, handling requirements, and other usage notes.", 0, java.lang.Integer.MAX_VALUE, description)); 1049 childrenList.add(new Property("instance", "", "Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.", 0, java.lang.Integer.MAX_VALUE, instance)); 1050 childrenList.add(new Property("ingredient", "", "A substance can be composed of other substances.", 0, java.lang.Integer.MAX_VALUE, ingredient)); 1051 } 1052 1053 @Override 1054 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1055 switch (hash) { 1056 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier 1057 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FHIRSubstanceStatus> 1058 case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept 1059 case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept 1060 case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType 1061 case 555127957: /*instance*/ return this.instance == null ? new Base[0] : this.instance.toArray(new Base[this.instance.size()]); // SubstanceInstanceComponent 1062 case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // SubstanceIngredientComponent 1063 default: return super.getProperty(hash, name, checkValid); 1064 } 1065 1066 } 1067 1068 @Override 1069 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1070 switch (hash) { 1071 case -1618432855: // identifier 1072 this.getIdentifier().add(castToIdentifier(value)); // Identifier 1073 return value; 1074 case -892481550: // status 1075 value = new FHIRSubstanceStatusEnumFactory().fromType(castToCode(value)); 1076 this.status = (Enumeration) value; // Enumeration<FHIRSubstanceStatus> 1077 return value; 1078 case 50511102: // category 1079 this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept 1080 return value; 1081 case 3059181: // code 1082 this.code = castToCodeableConcept(value); // CodeableConcept 1083 return value; 1084 case -1724546052: // description 1085 this.description = castToString(value); // StringType 1086 return value; 1087 case 555127957: // instance 1088 this.getInstance().add((SubstanceInstanceComponent) value); // SubstanceInstanceComponent 1089 return value; 1090 case -206409263: // ingredient 1091 this.getIngredient().add((SubstanceIngredientComponent) value); // SubstanceIngredientComponent 1092 return value; 1093 default: return super.setProperty(hash, name, value); 1094 } 1095 1096 } 1097 1098 @Override 1099 public Base setProperty(String name, Base value) throws FHIRException { 1100 if (name.equals("identifier")) { 1101 this.getIdentifier().add(castToIdentifier(value)); 1102 } else if (name.equals("status")) { 1103 value = new FHIRSubstanceStatusEnumFactory().fromType(castToCode(value)); 1104 this.status = (Enumeration) value; // Enumeration<FHIRSubstanceStatus> 1105 } else if (name.equals("category")) { 1106 this.getCategory().add(castToCodeableConcept(value)); 1107 } else if (name.equals("code")) { 1108 this.code = castToCodeableConcept(value); // CodeableConcept 1109 } else if (name.equals("description")) { 1110 this.description = castToString(value); // StringType 1111 } else if (name.equals("instance")) { 1112 this.getInstance().add((SubstanceInstanceComponent) value); 1113 } else if (name.equals("ingredient")) { 1114 this.getIngredient().add((SubstanceIngredientComponent) value); 1115 } else 1116 return super.setProperty(name, value); 1117 return value; 1118 } 1119 1120 @Override 1121 public Base makeProperty(int hash, String name) throws FHIRException { 1122 switch (hash) { 1123 case -1618432855: return addIdentifier(); 1124 case -892481550: return getStatusElement(); 1125 case 50511102: return addCategory(); 1126 case 3059181: return getCode(); 1127 case -1724546052: return getDescriptionElement(); 1128 case 555127957: return addInstance(); 1129 case -206409263: return addIngredient(); 1130 default: return super.makeProperty(hash, name); 1131 } 1132 1133 } 1134 1135 @Override 1136 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1137 switch (hash) { 1138 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 1139 case -892481550: /*status*/ return new String[] {"code"}; 1140 case 50511102: /*category*/ return new String[] {"CodeableConcept"}; 1141 case 3059181: /*code*/ return new String[] {"CodeableConcept"}; 1142 case -1724546052: /*description*/ return new String[] {"string"}; 1143 case 555127957: /*instance*/ return new String[] {}; 1144 case -206409263: /*ingredient*/ return new String[] {}; 1145 default: return super.getTypesForProperty(hash, name); 1146 } 1147 1148 } 1149 1150 @Override 1151 public Base addChild(String name) throws FHIRException { 1152 if (name.equals("identifier")) { 1153 return addIdentifier(); 1154 } 1155 else if (name.equals("status")) { 1156 throw new FHIRException("Cannot call addChild on a primitive type Substance.status"); 1157 } 1158 else if (name.equals("category")) { 1159 return addCategory(); 1160 } 1161 else if (name.equals("code")) { 1162 this.code = new CodeableConcept(); 1163 return this.code; 1164 } 1165 else if (name.equals("description")) { 1166 throw new FHIRException("Cannot call addChild on a primitive type Substance.description"); 1167 } 1168 else if (name.equals("instance")) { 1169 return addInstance(); 1170 } 1171 else if (name.equals("ingredient")) { 1172 return addIngredient(); 1173 } 1174 else 1175 return super.addChild(name); 1176 } 1177 1178 public String fhirType() { 1179 return "Substance"; 1180 1181 } 1182 1183 public Substance copy() { 1184 Substance dst = new Substance(); 1185 copyValues(dst); 1186 if (identifier != null) { 1187 dst.identifier = new ArrayList<Identifier>(); 1188 for (Identifier i : identifier) 1189 dst.identifier.add(i.copy()); 1190 }; 1191 dst.status = status == null ? null : status.copy(); 1192 if (category != null) { 1193 dst.category = new ArrayList<CodeableConcept>(); 1194 for (CodeableConcept i : category) 1195 dst.category.add(i.copy()); 1196 }; 1197 dst.code = code == null ? null : code.copy(); 1198 dst.description = description == null ? null : description.copy(); 1199 if (instance != null) { 1200 dst.instance = new ArrayList<SubstanceInstanceComponent>(); 1201 for (SubstanceInstanceComponent i : instance) 1202 dst.instance.add(i.copy()); 1203 }; 1204 if (ingredient != null) { 1205 dst.ingredient = new ArrayList<SubstanceIngredientComponent>(); 1206 for (SubstanceIngredientComponent i : ingredient) 1207 dst.ingredient.add(i.copy()); 1208 }; 1209 return dst; 1210 } 1211 1212 protected Substance typedCopy() { 1213 return copy(); 1214 } 1215 1216 @Override 1217 public boolean equalsDeep(Base other) { 1218 if (!super.equalsDeep(other)) 1219 return false; 1220 if (!(other instanceof Substance)) 1221 return false; 1222 Substance o = (Substance) other; 1223 return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(category, o.category, true) 1224 && compareDeep(code, o.code, true) && compareDeep(description, o.description, true) && compareDeep(instance, o.instance, true) 1225 && compareDeep(ingredient, o.ingredient, true); 1226 } 1227 1228 @Override 1229 public boolean equalsShallow(Base other) { 1230 if (!super.equalsShallow(other)) 1231 return false; 1232 if (!(other instanceof Substance)) 1233 return false; 1234 Substance o = (Substance) other; 1235 return compareValues(status, o.status, true) && compareValues(description, o.description, true); 1236 } 1237 1238 public boolean isEmpty() { 1239 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, category 1240 , code, description, instance, ingredient); 1241 } 1242 1243 @Override 1244 public ResourceType getResourceType() { 1245 return ResourceType.Substance; 1246 } 1247 1248 /** 1249 * Search parameter: <b>identifier</b> 1250 * <p> 1251 * Description: <b>Unique identifier for the substance</b><br> 1252 * Type: <b>token</b><br> 1253 * Path: <b>Substance.identifier</b><br> 1254 * </p> 1255 */ 1256 @SearchParamDefinition(name="identifier", path="Substance.identifier", description="Unique identifier for the substance", type="token" ) 1257 public static final String SP_IDENTIFIER = "identifier"; 1258 /** 1259 * <b>Fluent Client</b> search parameter constant for <b>identifier</b> 1260 * <p> 1261 * Description: <b>Unique identifier for the substance</b><br> 1262 * Type: <b>token</b><br> 1263 * Path: <b>Substance.identifier</b><br> 1264 * </p> 1265 */ 1266 public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); 1267 1268 /** 1269 * Search parameter: <b>container-identifier</b> 1270 * <p> 1271 * Description: <b>Identifier of the package/container</b><br> 1272 * Type: <b>token</b><br> 1273 * Path: <b>Substance.instance.identifier</b><br> 1274 * </p> 1275 */ 1276 @SearchParamDefinition(name="container-identifier", path="Substance.instance.identifier", description="Identifier of the package/container", type="token" ) 1277 public static final String SP_CONTAINER_IDENTIFIER = "container-identifier"; 1278 /** 1279 * <b>Fluent Client</b> search parameter constant for <b>container-identifier</b> 1280 * <p> 1281 * Description: <b>Identifier of the package/container</b><br> 1282 * Type: <b>token</b><br> 1283 * Path: <b>Substance.instance.identifier</b><br> 1284 * </p> 1285 */ 1286 public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTAINER_IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTAINER_IDENTIFIER); 1287 1288 /** 1289 * Search parameter: <b>code</b> 1290 * <p> 1291 * Description: <b>The code of the substance or ingredient</b><br> 1292 * Type: <b>token</b><br> 1293 * Path: <b>Substance.code, Substance.ingredient.substanceCodeableConcept</b><br> 1294 * </p> 1295 */ 1296 @SearchParamDefinition(name="code", path="Substance.code | Substance.ingredient.substance.as(CodeableConcept)", description="The code of the substance or ingredient", type="token" ) 1297 public static final String SP_CODE = "code"; 1298 /** 1299 * <b>Fluent Client</b> search parameter constant for <b>code</b> 1300 * <p> 1301 * Description: <b>The code of the substance or ingredient</b><br> 1302 * Type: <b>token</b><br> 1303 * Path: <b>Substance.code, Substance.ingredient.substanceCodeableConcept</b><br> 1304 * </p> 1305 */ 1306 public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); 1307 1308 /** 1309 * Search parameter: <b>quantity</b> 1310 * <p> 1311 * Description: <b>Amount of substance in the package</b><br> 1312 * Type: <b>quantity</b><br> 1313 * Path: <b>Substance.instance.quantity</b><br> 1314 * </p> 1315 */ 1316 @SearchParamDefinition(name="quantity", path="Substance.instance.quantity", description="Amount of substance in the package", type="quantity" ) 1317 public static final String SP_QUANTITY = "quantity"; 1318 /** 1319 * <b>Fluent Client</b> search parameter constant for <b>quantity</b> 1320 * <p> 1321 * Description: <b>Amount of substance in the package</b><br> 1322 * Type: <b>quantity</b><br> 1323 * Path: <b>Substance.instance.quantity</b><br> 1324 * </p> 1325 */ 1326 public static final ca.uhn.fhir.rest.gclient.QuantityClientParam QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_QUANTITY); 1327 1328 /** 1329 * Search parameter: <b>substance-reference</b> 1330 * <p> 1331 * Description: <b>A component of the substance</b><br> 1332 * Type: <b>reference</b><br> 1333 * Path: <b>Substance.ingredient.substanceReference</b><br> 1334 * </p> 1335 */ 1336 @SearchParamDefinition(name="substance-reference", path="Substance.ingredient.substance.as(Reference)", description="A component of the substance", type="reference", target={Substance.class } ) 1337 public static final String SP_SUBSTANCE_REFERENCE = "substance-reference"; 1338 /** 1339 * <b>Fluent Client</b> search parameter constant for <b>substance-reference</b> 1340 * <p> 1341 * Description: <b>A component of the substance</b><br> 1342 * Type: <b>reference</b><br> 1343 * Path: <b>Substance.ingredient.substanceReference</b><br> 1344 * </p> 1345 */ 1346 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBSTANCE_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBSTANCE_REFERENCE); 1347 1348/** 1349 * Constant for fluent queries to be used to add include statements. Specifies 1350 * the path value of "<b>Substance:substance-reference</b>". 1351 */ 1352 public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBSTANCE_REFERENCE = new ca.uhn.fhir.model.api.Include("Substance:substance-reference").toLocked(); 1353 1354 /** 1355 * Search parameter: <b>expiry</b> 1356 * <p> 1357 * Description: <b>Expiry date of package or container of substance</b><br> 1358 * Type: <b>date</b><br> 1359 * Path: <b>Substance.instance.expiry</b><br> 1360 * </p> 1361 */ 1362 @SearchParamDefinition(name="expiry", path="Substance.instance.expiry", description="Expiry date of package or container of substance", type="date" ) 1363 public static final String SP_EXPIRY = "expiry"; 1364 /** 1365 * <b>Fluent Client</b> search parameter constant for <b>expiry</b> 1366 * <p> 1367 * Description: <b>Expiry date of package or container of substance</b><br> 1368 * Type: <b>date</b><br> 1369 * Path: <b>Substance.instance.expiry</b><br> 1370 * </p> 1371 */ 1372 public static final ca.uhn.fhir.rest.gclient.DateClientParam EXPIRY = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EXPIRY); 1373 1374 /** 1375 * Search parameter: <b>category</b> 1376 * <p> 1377 * Description: <b>The category of the substance</b><br> 1378 * Type: <b>token</b><br> 1379 * Path: <b>Substance.category</b><br> 1380 * </p> 1381 */ 1382 @SearchParamDefinition(name="category", path="Substance.category", description="The category of the substance", type="token" ) 1383 public static final String SP_CATEGORY = "category"; 1384 /** 1385 * <b>Fluent Client</b> search parameter constant for <b>category</b> 1386 * <p> 1387 * Description: <b>The category of the substance</b><br> 1388 * Type: <b>token</b><br> 1389 * Path: <b>Substance.category</b><br> 1390 * </p> 1391 */ 1392 public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); 1393 1394 /** 1395 * Search parameter: <b>status</b> 1396 * <p> 1397 * Description: <b>active | inactive | entered-in-error</b><br> 1398 * Type: <b>token</b><br> 1399 * Path: <b>Substance.status</b><br> 1400 * </p> 1401 */ 1402 @SearchParamDefinition(name="status", path="Substance.status", description="active | inactive | entered-in-error", type="token" ) 1403 public static final String SP_STATUS = "status"; 1404 /** 1405 * <b>Fluent Client</b> search parameter constant for <b>status</b> 1406 * <p> 1407 * Description: <b>active | inactive | entered-in-error</b><br> 1408 * Type: <b>token</b><br> 1409 * Path: <b>Substance.status</b><br> 1410 * </p> 1411 */ 1412 public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); 1413 1414 1415} 1416