001package org.hl7.fhir.r4.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 Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0 033 034import java.util.*; 035 036import ca.uhn.fhir.model.api.annotation.ResourceDef; 037import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 038import ca.uhn.fhir.model.api.annotation.Child; 039import ca.uhn.fhir.model.api.annotation.ChildOrder; 040import ca.uhn.fhir.model.api.annotation.Description; 041import ca.uhn.fhir.model.api.annotation.Block; 042import org.hl7.fhir.instance.model.api.*; 043import org.hl7.fhir.exceptions.FHIRException; 044/** 045 * The clinical particulars - indications, contraindications etc. of a medicinal product, including for regulatory purposes. 046 */ 047@ResourceDef(name="MedicinalProductContraindication", profile="http://hl7.org/fhir/StructureDefinition/MedicinalProductContraindication") 048public class MedicinalProductContraindication extends DomainResource { 049 050 @Block() 051 public static class MedicinalProductContraindicationOtherTherapyComponent extends BackboneElement implements IBaseBackboneElement { 052 /** 053 * The type of relationship between the medicinal product indication or contraindication and another therapy. 054 */ 055 @Child(name = "therapyRelationshipType", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) 056 @Description(shortDefinition="The type of relationship between the medicinal product indication or contraindication and another therapy", formalDefinition="The type of relationship between the medicinal product indication or contraindication and another therapy." ) 057 protected CodeableConcept therapyRelationshipType; 058 059 /** 060 * Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication. 061 */ 062 @Child(name = "medication", type = {CodeableConcept.class, MedicinalProduct.class, Medication.class, Substance.class, SubstanceSpecification.class}, order=2, min=1, max=1, modifier=false, summary=true) 063 @Description(shortDefinition="Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication", formalDefinition="Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication." ) 064 protected Type medication; 065 066 private static final long serialVersionUID = 1438478115L; 067 068 /** 069 * Constructor 070 */ 071 public MedicinalProductContraindicationOtherTherapyComponent() { 072 super(); 073 } 074 075 /** 076 * Constructor 077 */ 078 public MedicinalProductContraindicationOtherTherapyComponent(CodeableConcept therapyRelationshipType, Type medication) { 079 super(); 080 this.therapyRelationshipType = therapyRelationshipType; 081 this.medication = medication; 082 } 083 084 /** 085 * @return {@link #therapyRelationshipType} (The type of relationship between the medicinal product indication or contraindication and another therapy.) 086 */ 087 public CodeableConcept getTherapyRelationshipType() { 088 if (this.therapyRelationshipType == null) 089 if (Configuration.errorOnAutoCreate()) 090 throw new Error("Attempt to auto-create MedicinalProductContraindicationOtherTherapyComponent.therapyRelationshipType"); 091 else if (Configuration.doAutoCreate()) 092 this.therapyRelationshipType = new CodeableConcept(); // cc 093 return this.therapyRelationshipType; 094 } 095 096 public boolean hasTherapyRelationshipType() { 097 return this.therapyRelationshipType != null && !this.therapyRelationshipType.isEmpty(); 098 } 099 100 /** 101 * @param value {@link #therapyRelationshipType} (The type of relationship between the medicinal product indication or contraindication and another therapy.) 102 */ 103 public MedicinalProductContraindicationOtherTherapyComponent setTherapyRelationshipType(CodeableConcept value) { 104 this.therapyRelationshipType = value; 105 return this; 106 } 107 108 /** 109 * @return {@link #medication} (Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.) 110 */ 111 public Type getMedication() { 112 return this.medication; 113 } 114 115 /** 116 * @return {@link #medication} (Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.) 117 */ 118 public CodeableConcept getMedicationCodeableConcept() throws FHIRException { 119 if (this.medication == null) 120 return null; 121 if (!(this.medication instanceof CodeableConcept)) 122 throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); 123 return (CodeableConcept) this.medication; 124 } 125 126 public boolean hasMedicationCodeableConcept() { 127 return this != null && this.medication instanceof CodeableConcept; 128 } 129 130 /** 131 * @return {@link #medication} (Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.) 132 */ 133 public Reference getMedicationReference() throws FHIRException { 134 if (this.medication == null) 135 return null; 136 if (!(this.medication instanceof Reference)) 137 throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); 138 return (Reference) this.medication; 139 } 140 141 public boolean hasMedicationReference() { 142 return this != null && this.medication instanceof Reference; 143 } 144 145 public boolean hasMedication() { 146 return this.medication != null && !this.medication.isEmpty(); 147 } 148 149 /** 150 * @param value {@link #medication} (Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.) 151 */ 152 public MedicinalProductContraindicationOtherTherapyComponent setMedication(Type value) { 153 if (value != null && !(value instanceof CodeableConcept || value instanceof Reference)) 154 throw new Error("Not the right type for MedicinalProductContraindication.otherTherapy.medication[x]: "+value.fhirType()); 155 this.medication = value; 156 return this; 157 } 158 159 protected void listChildren(List<Property> children) { 160 super.listChildren(children); 161 children.add(new Property("therapyRelationshipType", "CodeableConcept", "The type of relationship between the medicinal product indication or contraindication and another therapy.", 0, 1, therapyRelationshipType)); 162 children.add(new Property("medication[x]", "CodeableConcept|Reference(MedicinalProduct|Medication|Substance|SubstanceSpecification)", "Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.", 0, 1, medication)); 163 } 164 165 @Override 166 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 167 switch (_hash) { 168 case -551658469: /*therapyRelationshipType*/ return new Property("therapyRelationshipType", "CodeableConcept", "The type of relationship between the medicinal product indication or contraindication and another therapy.", 0, 1, therapyRelationshipType); 169 case 1458402129: /*medication[x]*/ return new Property("medication[x]", "CodeableConcept|Reference(MedicinalProduct|Medication|Substance|SubstanceSpecification)", "Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.", 0, 1, medication); 170 case 1998965455: /*medication*/ return new Property("medication[x]", "CodeableConcept|Reference(MedicinalProduct|Medication|Substance|SubstanceSpecification)", "Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.", 0, 1, medication); 171 case -209845038: /*medicationCodeableConcept*/ return new Property("medication[x]", "CodeableConcept|Reference(MedicinalProduct|Medication|Substance|SubstanceSpecification)", "Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.", 0, 1, medication); 172 case 2104315196: /*medicationReference*/ return new Property("medication[x]", "CodeableConcept|Reference(MedicinalProduct|Medication|Substance|SubstanceSpecification)", "Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.", 0, 1, medication); 173 default: return super.getNamedProperty(_hash, _name, _checkValid); 174 } 175 176 } 177 178 @Override 179 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 180 switch (hash) { 181 case -551658469: /*therapyRelationshipType*/ return this.therapyRelationshipType == null ? new Base[0] : new Base[] {this.therapyRelationshipType}; // CodeableConcept 182 case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // Type 183 default: return super.getProperty(hash, name, checkValid); 184 } 185 186 } 187 188 @Override 189 public Base setProperty(int hash, String name, Base value) throws FHIRException { 190 switch (hash) { 191 case -551658469: // therapyRelationshipType 192 this.therapyRelationshipType = castToCodeableConcept(value); // CodeableConcept 193 return value; 194 case 1998965455: // medication 195 this.medication = castToType(value); // Type 196 return value; 197 default: return super.setProperty(hash, name, value); 198 } 199 200 } 201 202 @Override 203 public Base setProperty(String name, Base value) throws FHIRException { 204 if (name.equals("therapyRelationshipType")) { 205 this.therapyRelationshipType = castToCodeableConcept(value); // CodeableConcept 206 } else if (name.equals("medication[x]")) { 207 this.medication = castToType(value); // Type 208 } else 209 return super.setProperty(name, value); 210 return value; 211 } 212 213 @Override 214 public Base makeProperty(int hash, String name) throws FHIRException { 215 switch (hash) { 216 case -551658469: return getTherapyRelationshipType(); 217 case 1458402129: return getMedication(); 218 case 1998965455: return getMedication(); 219 default: return super.makeProperty(hash, name); 220 } 221 222 } 223 224 @Override 225 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 226 switch (hash) { 227 case -551658469: /*therapyRelationshipType*/ return new String[] {"CodeableConcept"}; 228 case 1998965455: /*medication*/ return new String[] {"CodeableConcept", "Reference"}; 229 default: return super.getTypesForProperty(hash, name); 230 } 231 232 } 233 234 @Override 235 public Base addChild(String name) throws FHIRException { 236 if (name.equals("therapyRelationshipType")) { 237 this.therapyRelationshipType = new CodeableConcept(); 238 return this.therapyRelationshipType; 239 } 240 else if (name.equals("medicationCodeableConcept")) { 241 this.medication = new CodeableConcept(); 242 return this.medication; 243 } 244 else if (name.equals("medicationReference")) { 245 this.medication = new Reference(); 246 return this.medication; 247 } 248 else 249 return super.addChild(name); 250 } 251 252 public MedicinalProductContraindicationOtherTherapyComponent copy() { 253 MedicinalProductContraindicationOtherTherapyComponent dst = new MedicinalProductContraindicationOtherTherapyComponent(); 254 copyValues(dst); 255 dst.therapyRelationshipType = therapyRelationshipType == null ? null : therapyRelationshipType.copy(); 256 dst.medication = medication == null ? null : medication.copy(); 257 return dst; 258 } 259 260 @Override 261 public boolean equalsDeep(Base other_) { 262 if (!super.equalsDeep(other_)) 263 return false; 264 if (!(other_ instanceof MedicinalProductContraindicationOtherTherapyComponent)) 265 return false; 266 MedicinalProductContraindicationOtherTherapyComponent o = (MedicinalProductContraindicationOtherTherapyComponent) other_; 267 return compareDeep(therapyRelationshipType, o.therapyRelationshipType, true) && compareDeep(medication, o.medication, true) 268 ; 269 } 270 271 @Override 272 public boolean equalsShallow(Base other_) { 273 if (!super.equalsShallow(other_)) 274 return false; 275 if (!(other_ instanceof MedicinalProductContraindicationOtherTherapyComponent)) 276 return false; 277 MedicinalProductContraindicationOtherTherapyComponent o = (MedicinalProductContraindicationOtherTherapyComponent) other_; 278 return true; 279 } 280 281 public boolean isEmpty() { 282 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(therapyRelationshipType, medication 283 ); 284 } 285 286 public String fhirType() { 287 return "MedicinalProductContraindication.otherTherapy"; 288 289 } 290 291 } 292 293 @Block() 294 public static class MedicinalProductContraindicationPopulationComponent extends BackboneElement implements IBaseBackboneElement { 295 /** 296 * The age of the specific population. 297 */ 298 @Child(name = "age", type = {Range.class, CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 299 @Description(shortDefinition="The age of the specific population", formalDefinition="The age of the specific population." ) 300 protected Type age; 301 302 /** 303 * The gender of the specific population. 304 */ 305 @Child(name = "gender", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 306 @Description(shortDefinition="The gender of the specific population", formalDefinition="The gender of the specific population." ) 307 protected CodeableConcept gender; 308 309 /** 310 * Race of the specific population. 311 */ 312 @Child(name = "race", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) 313 @Description(shortDefinition="Race of the specific population", formalDefinition="Race of the specific population." ) 314 protected CodeableConcept race; 315 316 /** 317 * The existing physiological conditions of the specific population to which this applies. 318 */ 319 @Child(name = "physiologicalCondition", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) 320 @Description(shortDefinition="The existing physiological conditions of the specific population to which this applies", formalDefinition="The existing physiological conditions of the specific population to which this applies." ) 321 protected CodeableConcept physiologicalCondition; 322 323 private static final long serialVersionUID = -394311584L; 324 325 /** 326 * Constructor 327 */ 328 public MedicinalProductContraindicationPopulationComponent() { 329 super(); 330 } 331 332 /** 333 * @return {@link #age} (The age of the specific population.) 334 */ 335 public Type getAge() { 336 return this.age; 337 } 338 339 /** 340 * @return {@link #age} (The age of the specific population.) 341 */ 342 public Range getAgeRange() throws FHIRException { 343 if (this.age == null) 344 return null; 345 if (!(this.age instanceof Range)) 346 throw new FHIRException("Type mismatch: the type Range was expected, but "+this.age.getClass().getName()+" was encountered"); 347 return (Range) this.age; 348 } 349 350 public boolean hasAgeRange() { 351 return this != null && this.age instanceof Range; 352 } 353 354 /** 355 * @return {@link #age} (The age of the specific population.) 356 */ 357 public CodeableConcept getAgeCodeableConcept() throws FHIRException { 358 if (this.age == null) 359 return null; 360 if (!(this.age instanceof CodeableConcept)) 361 throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.age.getClass().getName()+" was encountered"); 362 return (CodeableConcept) this.age; 363 } 364 365 public boolean hasAgeCodeableConcept() { 366 return this != null && this.age instanceof CodeableConcept; 367 } 368 369 public boolean hasAge() { 370 return this.age != null && !this.age.isEmpty(); 371 } 372 373 /** 374 * @param value {@link #age} (The age of the specific population.) 375 */ 376 public MedicinalProductContraindicationPopulationComponent setAge(Type value) { 377 if (value != null && !(value instanceof Range || value instanceof CodeableConcept)) 378 throw new Error("Not the right type for MedicinalProductContraindication.population.age[x]: "+value.fhirType()); 379 this.age = value; 380 return this; 381 } 382 383 /** 384 * @return {@link #gender} (The gender of the specific population.) 385 */ 386 public CodeableConcept getGender() { 387 if (this.gender == null) 388 if (Configuration.errorOnAutoCreate()) 389 throw new Error("Attempt to auto-create MedicinalProductContraindicationPopulationComponent.gender"); 390 else if (Configuration.doAutoCreate()) 391 this.gender = new CodeableConcept(); // cc 392 return this.gender; 393 } 394 395 public boolean hasGender() { 396 return this.gender != null && !this.gender.isEmpty(); 397 } 398 399 /** 400 * @param value {@link #gender} (The gender of the specific population.) 401 */ 402 public MedicinalProductContraindicationPopulationComponent setGender(CodeableConcept value) { 403 this.gender = value; 404 return this; 405 } 406 407 /** 408 * @return {@link #race} (Race of the specific population.) 409 */ 410 public CodeableConcept getRace() { 411 if (this.race == null) 412 if (Configuration.errorOnAutoCreate()) 413 throw new Error("Attempt to auto-create MedicinalProductContraindicationPopulationComponent.race"); 414 else if (Configuration.doAutoCreate()) 415 this.race = new CodeableConcept(); // cc 416 return this.race; 417 } 418 419 public boolean hasRace() { 420 return this.race != null && !this.race.isEmpty(); 421 } 422 423 /** 424 * @param value {@link #race} (Race of the specific population.) 425 */ 426 public MedicinalProductContraindicationPopulationComponent setRace(CodeableConcept value) { 427 this.race = value; 428 return this; 429 } 430 431 /** 432 * @return {@link #physiologicalCondition} (The existing physiological conditions of the specific population to which this applies.) 433 */ 434 public CodeableConcept getPhysiologicalCondition() { 435 if (this.physiologicalCondition == null) 436 if (Configuration.errorOnAutoCreate()) 437 throw new Error("Attempt to auto-create MedicinalProductContraindicationPopulationComponent.physiologicalCondition"); 438 else if (Configuration.doAutoCreate()) 439 this.physiologicalCondition = new CodeableConcept(); // cc 440 return this.physiologicalCondition; 441 } 442 443 public boolean hasPhysiologicalCondition() { 444 return this.physiologicalCondition != null && !this.physiologicalCondition.isEmpty(); 445 } 446 447 /** 448 * @param value {@link #physiologicalCondition} (The existing physiological conditions of the specific population to which this applies.) 449 */ 450 public MedicinalProductContraindicationPopulationComponent setPhysiologicalCondition(CodeableConcept value) { 451 this.physiologicalCondition = value; 452 return this; 453 } 454 455 protected void listChildren(List<Property> children) { 456 super.listChildren(children); 457 children.add(new Property("age[x]", "Range|CodeableConcept", "The age of the specific population.", 0, 1, age)); 458 children.add(new Property("gender", "CodeableConcept", "The gender of the specific population.", 0, 1, gender)); 459 children.add(new Property("race", "CodeableConcept", "Race of the specific population.", 0, 1, race)); 460 children.add(new Property("physiologicalCondition", "CodeableConcept", "The existing physiological conditions of the specific population to which this applies.", 0, 1, physiologicalCondition)); 461 } 462 463 @Override 464 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 465 switch (_hash) { 466 case -1419716831: /*age[x]*/ return new Property("age[x]", "Range|CodeableConcept", "The age of the specific population.", 0, 1, age); 467 case 96511: /*age*/ return new Property("age[x]", "Range|CodeableConcept", "The age of the specific population.", 0, 1, age); 468 case 1442748286: /*ageRange*/ return new Property("age[x]", "Range|CodeableConcept", "The age of the specific population.", 0, 1, age); 469 case -1452658526: /*ageCodeableConcept*/ return new Property("age[x]", "Range|CodeableConcept", "The age of the specific population.", 0, 1, age); 470 case -1249512767: /*gender*/ return new Property("gender", "CodeableConcept", "The gender of the specific population.", 0, 1, gender); 471 case 3492561: /*race*/ return new Property("race", "CodeableConcept", "Race of the specific population.", 0, 1, race); 472 case -62715190: /*physiologicalCondition*/ return new Property("physiologicalCondition", "CodeableConcept", "The existing physiological conditions of the specific population to which this applies.", 0, 1, physiologicalCondition); 473 default: return super.getNamedProperty(_hash, _name, _checkValid); 474 } 475 476 } 477 478 @Override 479 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 480 switch (hash) { 481 case 96511: /*age*/ return this.age == null ? new Base[0] : new Base[] {this.age}; // Type 482 case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // CodeableConcept 483 case 3492561: /*race*/ return this.race == null ? new Base[0] : new Base[] {this.race}; // CodeableConcept 484 case -62715190: /*physiologicalCondition*/ return this.physiologicalCondition == null ? new Base[0] : new Base[] {this.physiologicalCondition}; // CodeableConcept 485 default: return super.getProperty(hash, name, checkValid); 486 } 487 488 } 489 490 @Override 491 public Base setProperty(int hash, String name, Base value) throws FHIRException { 492 switch (hash) { 493 case 96511: // age 494 this.age = castToType(value); // Type 495 return value; 496 case -1249512767: // gender 497 this.gender = castToCodeableConcept(value); // CodeableConcept 498 return value; 499 case 3492561: // race 500 this.race = castToCodeableConcept(value); // CodeableConcept 501 return value; 502 case -62715190: // physiologicalCondition 503 this.physiologicalCondition = castToCodeableConcept(value); // CodeableConcept 504 return value; 505 default: return super.setProperty(hash, name, value); 506 } 507 508 } 509 510 @Override 511 public Base setProperty(String name, Base value) throws FHIRException { 512 if (name.equals("age[x]")) { 513 this.age = castToType(value); // Type 514 } else if (name.equals("gender")) { 515 this.gender = castToCodeableConcept(value); // CodeableConcept 516 } else if (name.equals("race")) { 517 this.race = castToCodeableConcept(value); // CodeableConcept 518 } else if (name.equals("physiologicalCondition")) { 519 this.physiologicalCondition = castToCodeableConcept(value); // CodeableConcept 520 } else 521 return super.setProperty(name, value); 522 return value; 523 } 524 525 @Override 526 public Base makeProperty(int hash, String name) throws FHIRException { 527 switch (hash) { 528 case -1419716831: return getAge(); 529 case 96511: return getAge(); 530 case -1249512767: return getGender(); 531 case 3492561: return getRace(); 532 case -62715190: return getPhysiologicalCondition(); 533 default: return super.makeProperty(hash, name); 534 } 535 536 } 537 538 @Override 539 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 540 switch (hash) { 541 case 96511: /*age*/ return new String[] {"Range", "CodeableConcept"}; 542 case -1249512767: /*gender*/ return new String[] {"CodeableConcept"}; 543 case 3492561: /*race*/ return new String[] {"CodeableConcept"}; 544 case -62715190: /*physiologicalCondition*/ return new String[] {"CodeableConcept"}; 545 default: return super.getTypesForProperty(hash, name); 546 } 547 548 } 549 550 @Override 551 public Base addChild(String name) throws FHIRException { 552 if (name.equals("ageRange")) { 553 this.age = new Range(); 554 return this.age; 555 } 556 else if (name.equals("ageCodeableConcept")) { 557 this.age = new CodeableConcept(); 558 return this.age; 559 } 560 else if (name.equals("gender")) { 561 this.gender = new CodeableConcept(); 562 return this.gender; 563 } 564 else if (name.equals("race")) { 565 this.race = new CodeableConcept(); 566 return this.race; 567 } 568 else if (name.equals("physiologicalCondition")) { 569 this.physiologicalCondition = new CodeableConcept(); 570 return this.physiologicalCondition; 571 } 572 else 573 return super.addChild(name); 574 } 575 576 public MedicinalProductContraindicationPopulationComponent copy() { 577 MedicinalProductContraindicationPopulationComponent dst = new MedicinalProductContraindicationPopulationComponent(); 578 copyValues(dst); 579 dst.age = age == null ? null : age.copy(); 580 dst.gender = gender == null ? null : gender.copy(); 581 dst.race = race == null ? null : race.copy(); 582 dst.physiologicalCondition = physiologicalCondition == null ? null : physiologicalCondition.copy(); 583 return dst; 584 } 585 586 @Override 587 public boolean equalsDeep(Base other_) { 588 if (!super.equalsDeep(other_)) 589 return false; 590 if (!(other_ instanceof MedicinalProductContraindicationPopulationComponent)) 591 return false; 592 MedicinalProductContraindicationPopulationComponent o = (MedicinalProductContraindicationPopulationComponent) other_; 593 return compareDeep(age, o.age, true) && compareDeep(gender, o.gender, true) && compareDeep(race, o.race, true) 594 && compareDeep(physiologicalCondition, o.physiologicalCondition, true); 595 } 596 597 @Override 598 public boolean equalsShallow(Base other_) { 599 if (!super.equalsShallow(other_)) 600 return false; 601 if (!(other_ instanceof MedicinalProductContraindicationPopulationComponent)) 602 return false; 603 MedicinalProductContraindicationPopulationComponent o = (MedicinalProductContraindicationPopulationComponent) other_; 604 return true; 605 } 606 607 public boolean isEmpty() { 608 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(age, gender, race, physiologicalCondition 609 ); 610 } 611 612 public String fhirType() { 613 return "MedicinalProductContraindication.population"; 614 615 } 616 617 } 618 619 /** 620 * The medication for which this is an indication. 621 */ 622 @Child(name = "subject", type = {MedicinalProduct.class, Medication.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 623 @Description(shortDefinition="The medication for which this is an indication", formalDefinition="The medication for which this is an indication." ) 624 protected List<Reference> subject; 625 /** 626 * The actual objects that are the target of the reference (The medication for which this is an indication.) 627 */ 628 protected List<Resource> subjectTarget; 629 630 631 /** 632 * The disease, symptom or procedure for the contraindication. 633 */ 634 @Child(name = "disease", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 635 @Description(shortDefinition="The disease, symptom or procedure for the contraindication", formalDefinition="The disease, symptom or procedure for the contraindication." ) 636 protected CodeableConcept disease; 637 638 /** 639 * The status of the disease or symptom for the contraindication. 640 */ 641 @Child(name = "diseaseStatus", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 642 @Description(shortDefinition="The status of the disease or symptom for the contraindication", formalDefinition="The status of the disease or symptom for the contraindication." ) 643 protected CodeableConcept diseaseStatus; 644 645 /** 646 * A comorbidity (concurrent condition) or coinfection. 647 */ 648 @Child(name = "comorbidity", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 649 @Description(shortDefinition="A comorbidity (concurrent condition) or coinfection", formalDefinition="A comorbidity (concurrent condition) or coinfection." ) 650 protected List<CodeableConcept> comorbidity; 651 652 /** 653 * Information about the use of the medicinal product in relation to other therapies as part of the indication. 654 */ 655 @Child(name = "therapeuticIndication", type = {MedicinalProductIndication.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 656 @Description(shortDefinition="Information about the use of the medicinal product in relation to other therapies as part of the indication", formalDefinition="Information about the use of the medicinal product in relation to other therapies as part of the indication." ) 657 protected List<Reference> therapeuticIndication; 658 /** 659 * The actual objects that are the target of the reference (Information about the use of the medicinal product in relation to other therapies as part of the indication.) 660 */ 661 protected List<MedicinalProductIndication> therapeuticIndicationTarget; 662 663 664 /** 665 * Information about the use of the medicinal product in relation to other therapies described as part of the indication. 666 */ 667 @Child(name = "otherTherapy", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 668 @Description(shortDefinition="Information about the use of the medicinal product in relation to other therapies described as part of the indication", formalDefinition="Information about the use of the medicinal product in relation to other therapies described as part of the indication." ) 669 protected List<MedicinalProductContraindicationOtherTherapyComponent> otherTherapy; 670 671 /** 672 * The population group to which this applies. 673 */ 674 @Child(name = "population", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 675 @Description(shortDefinition="The population group to which this applies", formalDefinition="The population group to which this applies." ) 676 protected List<MedicinalProductContraindicationPopulationComponent> population; 677 678 private static final long serialVersionUID = 1540231813L; 679 680 /** 681 * Constructor 682 */ 683 public MedicinalProductContraindication() { 684 super(); 685 } 686 687 /** 688 * @return {@link #subject} (The medication for which this is an indication.) 689 */ 690 public List<Reference> getSubject() { 691 if (this.subject == null) 692 this.subject = new ArrayList<Reference>(); 693 return this.subject; 694 } 695 696 /** 697 * @return Returns a reference to <code>this</code> for easy method chaining 698 */ 699 public MedicinalProductContraindication setSubject(List<Reference> theSubject) { 700 this.subject = theSubject; 701 return this; 702 } 703 704 public boolean hasSubject() { 705 if (this.subject == null) 706 return false; 707 for (Reference item : this.subject) 708 if (!item.isEmpty()) 709 return true; 710 return false; 711 } 712 713 public Reference addSubject() { //3 714 Reference t = new Reference(); 715 if (this.subject == null) 716 this.subject = new ArrayList<Reference>(); 717 this.subject.add(t); 718 return t; 719 } 720 721 public MedicinalProductContraindication addSubject(Reference t) { //3 722 if (t == null) 723 return this; 724 if (this.subject == null) 725 this.subject = new ArrayList<Reference>(); 726 this.subject.add(t); 727 return this; 728 } 729 730 /** 731 * @return The first repetition of repeating field {@link #subject}, creating it if it does not already exist 732 */ 733 public Reference getSubjectFirstRep() { 734 if (getSubject().isEmpty()) { 735 addSubject(); 736 } 737 return getSubject().get(0); 738 } 739 740 /** 741 * @deprecated Use Reference#setResource(IBaseResource) instead 742 */ 743 @Deprecated 744 public List<Resource> getSubjectTarget() { 745 if (this.subjectTarget == null) 746 this.subjectTarget = new ArrayList<Resource>(); 747 return this.subjectTarget; 748 } 749 750 /** 751 * @return {@link #disease} (The disease, symptom or procedure for the contraindication.) 752 */ 753 public CodeableConcept getDisease() { 754 if (this.disease == null) 755 if (Configuration.errorOnAutoCreate()) 756 throw new Error("Attempt to auto-create MedicinalProductContraindication.disease"); 757 else if (Configuration.doAutoCreate()) 758 this.disease = new CodeableConcept(); // cc 759 return this.disease; 760 } 761 762 public boolean hasDisease() { 763 return this.disease != null && !this.disease.isEmpty(); 764 } 765 766 /** 767 * @param value {@link #disease} (The disease, symptom or procedure for the contraindication.) 768 */ 769 public MedicinalProductContraindication setDisease(CodeableConcept value) { 770 this.disease = value; 771 return this; 772 } 773 774 /** 775 * @return {@link #diseaseStatus} (The status of the disease or symptom for the contraindication.) 776 */ 777 public CodeableConcept getDiseaseStatus() { 778 if (this.diseaseStatus == null) 779 if (Configuration.errorOnAutoCreate()) 780 throw new Error("Attempt to auto-create MedicinalProductContraindication.diseaseStatus"); 781 else if (Configuration.doAutoCreate()) 782 this.diseaseStatus = new CodeableConcept(); // cc 783 return this.diseaseStatus; 784 } 785 786 public boolean hasDiseaseStatus() { 787 return this.diseaseStatus != null && !this.diseaseStatus.isEmpty(); 788 } 789 790 /** 791 * @param value {@link #diseaseStatus} (The status of the disease or symptom for the contraindication.) 792 */ 793 public MedicinalProductContraindication setDiseaseStatus(CodeableConcept value) { 794 this.diseaseStatus = value; 795 return this; 796 } 797 798 /** 799 * @return {@link #comorbidity} (A comorbidity (concurrent condition) or coinfection.) 800 */ 801 public List<CodeableConcept> getComorbidity() { 802 if (this.comorbidity == null) 803 this.comorbidity = new ArrayList<CodeableConcept>(); 804 return this.comorbidity; 805 } 806 807 /** 808 * @return Returns a reference to <code>this</code> for easy method chaining 809 */ 810 public MedicinalProductContraindication setComorbidity(List<CodeableConcept> theComorbidity) { 811 this.comorbidity = theComorbidity; 812 return this; 813 } 814 815 public boolean hasComorbidity() { 816 if (this.comorbidity == null) 817 return false; 818 for (CodeableConcept item : this.comorbidity) 819 if (!item.isEmpty()) 820 return true; 821 return false; 822 } 823 824 public CodeableConcept addComorbidity() { //3 825 CodeableConcept t = new CodeableConcept(); 826 if (this.comorbidity == null) 827 this.comorbidity = new ArrayList<CodeableConcept>(); 828 this.comorbidity.add(t); 829 return t; 830 } 831 832 public MedicinalProductContraindication addComorbidity(CodeableConcept t) { //3 833 if (t == null) 834 return this; 835 if (this.comorbidity == null) 836 this.comorbidity = new ArrayList<CodeableConcept>(); 837 this.comorbidity.add(t); 838 return this; 839 } 840 841 /** 842 * @return The first repetition of repeating field {@link #comorbidity}, creating it if it does not already exist 843 */ 844 public CodeableConcept getComorbidityFirstRep() { 845 if (getComorbidity().isEmpty()) { 846 addComorbidity(); 847 } 848 return getComorbidity().get(0); 849 } 850 851 /** 852 * @return {@link #therapeuticIndication} (Information about the use of the medicinal product in relation to other therapies as part of the indication.) 853 */ 854 public List<Reference> getTherapeuticIndication() { 855 if (this.therapeuticIndication == null) 856 this.therapeuticIndication = new ArrayList<Reference>(); 857 return this.therapeuticIndication; 858 } 859 860 /** 861 * @return Returns a reference to <code>this</code> for easy method chaining 862 */ 863 public MedicinalProductContraindication setTherapeuticIndication(List<Reference> theTherapeuticIndication) { 864 this.therapeuticIndication = theTherapeuticIndication; 865 return this; 866 } 867 868 public boolean hasTherapeuticIndication() { 869 if (this.therapeuticIndication == null) 870 return false; 871 for (Reference item : this.therapeuticIndication) 872 if (!item.isEmpty()) 873 return true; 874 return false; 875 } 876 877 public Reference addTherapeuticIndication() { //3 878 Reference t = new Reference(); 879 if (this.therapeuticIndication == null) 880 this.therapeuticIndication = new ArrayList<Reference>(); 881 this.therapeuticIndication.add(t); 882 return t; 883 } 884 885 public MedicinalProductContraindication addTherapeuticIndication(Reference t) { //3 886 if (t == null) 887 return this; 888 if (this.therapeuticIndication == null) 889 this.therapeuticIndication = new ArrayList<Reference>(); 890 this.therapeuticIndication.add(t); 891 return this; 892 } 893 894 /** 895 * @return The first repetition of repeating field {@link #therapeuticIndication}, creating it if it does not already exist 896 */ 897 public Reference getTherapeuticIndicationFirstRep() { 898 if (getTherapeuticIndication().isEmpty()) { 899 addTherapeuticIndication(); 900 } 901 return getTherapeuticIndication().get(0); 902 } 903 904 /** 905 * @deprecated Use Reference#setResource(IBaseResource) instead 906 */ 907 @Deprecated 908 public List<MedicinalProductIndication> getTherapeuticIndicationTarget() { 909 if (this.therapeuticIndicationTarget == null) 910 this.therapeuticIndicationTarget = new ArrayList<MedicinalProductIndication>(); 911 return this.therapeuticIndicationTarget; 912 } 913 914 /** 915 * @deprecated Use Reference#setResource(IBaseResource) instead 916 */ 917 @Deprecated 918 public MedicinalProductIndication addTherapeuticIndicationTarget() { 919 MedicinalProductIndication r = new MedicinalProductIndication(); 920 if (this.therapeuticIndicationTarget == null) 921 this.therapeuticIndicationTarget = new ArrayList<MedicinalProductIndication>(); 922 this.therapeuticIndicationTarget.add(r); 923 return r; 924 } 925 926 /** 927 * @return {@link #otherTherapy} (Information about the use of the medicinal product in relation to other therapies described as part of the indication.) 928 */ 929 public List<MedicinalProductContraindicationOtherTherapyComponent> getOtherTherapy() { 930 if (this.otherTherapy == null) 931 this.otherTherapy = new ArrayList<MedicinalProductContraindicationOtherTherapyComponent>(); 932 return this.otherTherapy; 933 } 934 935 /** 936 * @return Returns a reference to <code>this</code> for easy method chaining 937 */ 938 public MedicinalProductContraindication setOtherTherapy(List<MedicinalProductContraindicationOtherTherapyComponent> theOtherTherapy) { 939 this.otherTherapy = theOtherTherapy; 940 return this; 941 } 942 943 public boolean hasOtherTherapy() { 944 if (this.otherTherapy == null) 945 return false; 946 for (MedicinalProductContraindicationOtherTherapyComponent item : this.otherTherapy) 947 if (!item.isEmpty()) 948 return true; 949 return false; 950 } 951 952 public MedicinalProductContraindicationOtherTherapyComponent addOtherTherapy() { //3 953 MedicinalProductContraindicationOtherTherapyComponent t = new MedicinalProductContraindicationOtherTherapyComponent(); 954 if (this.otherTherapy == null) 955 this.otherTherapy = new ArrayList<MedicinalProductContraindicationOtherTherapyComponent>(); 956 this.otherTherapy.add(t); 957 return t; 958 } 959 960 public MedicinalProductContraindication addOtherTherapy(MedicinalProductContraindicationOtherTherapyComponent t) { //3 961 if (t == null) 962 return this; 963 if (this.otherTherapy == null) 964 this.otherTherapy = new ArrayList<MedicinalProductContraindicationOtherTherapyComponent>(); 965 this.otherTherapy.add(t); 966 return this; 967 } 968 969 /** 970 * @return The first repetition of repeating field {@link #otherTherapy}, creating it if it does not already exist 971 */ 972 public MedicinalProductContraindicationOtherTherapyComponent getOtherTherapyFirstRep() { 973 if (getOtherTherapy().isEmpty()) { 974 addOtherTherapy(); 975 } 976 return getOtherTherapy().get(0); 977 } 978 979 /** 980 * @return {@link #population} (The population group to which this applies.) 981 */ 982 public List<MedicinalProductContraindicationPopulationComponent> getPopulation() { 983 if (this.population == null) 984 this.population = new ArrayList<MedicinalProductContraindicationPopulationComponent>(); 985 return this.population; 986 } 987 988 /** 989 * @return Returns a reference to <code>this</code> for easy method chaining 990 */ 991 public MedicinalProductContraindication setPopulation(List<MedicinalProductContraindicationPopulationComponent> thePopulation) { 992 this.population = thePopulation; 993 return this; 994 } 995 996 public boolean hasPopulation() { 997 if (this.population == null) 998 return false; 999 for (MedicinalProductContraindicationPopulationComponent item : this.population) 1000 if (!item.isEmpty()) 1001 return true; 1002 return false; 1003 } 1004 1005 public MedicinalProductContraindicationPopulationComponent addPopulation() { //3 1006 MedicinalProductContraindicationPopulationComponent t = new MedicinalProductContraindicationPopulationComponent(); 1007 if (this.population == null) 1008 this.population = new ArrayList<MedicinalProductContraindicationPopulationComponent>(); 1009 this.population.add(t); 1010 return t; 1011 } 1012 1013 public MedicinalProductContraindication addPopulation(MedicinalProductContraindicationPopulationComponent t) { //3 1014 if (t == null) 1015 return this; 1016 if (this.population == null) 1017 this.population = new ArrayList<MedicinalProductContraindicationPopulationComponent>(); 1018 this.population.add(t); 1019 return this; 1020 } 1021 1022 /** 1023 * @return The first repetition of repeating field {@link #population}, creating it if it does not already exist 1024 */ 1025 public MedicinalProductContraindicationPopulationComponent getPopulationFirstRep() { 1026 if (getPopulation().isEmpty()) { 1027 addPopulation(); 1028 } 1029 return getPopulation().get(0); 1030 } 1031 1032 protected void listChildren(List<Property> children) { 1033 super.listChildren(children); 1034 children.add(new Property("subject", "Reference(MedicinalProduct|Medication)", "The medication for which this is an indication.", 0, java.lang.Integer.MAX_VALUE, subject)); 1035 children.add(new Property("disease", "CodeableConcept", "The disease, symptom or procedure for the contraindication.", 0, 1, disease)); 1036 children.add(new Property("diseaseStatus", "CodeableConcept", "The status of the disease or symptom for the contraindication.", 0, 1, diseaseStatus)); 1037 children.add(new Property("comorbidity", "CodeableConcept", "A comorbidity (concurrent condition) or coinfection.", 0, java.lang.Integer.MAX_VALUE, comorbidity)); 1038 children.add(new Property("therapeuticIndication", "Reference(MedicinalProductIndication)", "Information about the use of the medicinal product in relation to other therapies as part of the indication.", 0, java.lang.Integer.MAX_VALUE, therapeuticIndication)); 1039 children.add(new Property("otherTherapy", "", "Information about the use of the medicinal product in relation to other therapies described as part of the indication.", 0, java.lang.Integer.MAX_VALUE, otherTherapy)); 1040 children.add(new Property("population", "", "The population group to which this applies.", 0, java.lang.Integer.MAX_VALUE, population)); 1041 } 1042 1043 @Override 1044 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1045 switch (_hash) { 1046 case -1867885268: /*subject*/ return new Property("subject", "Reference(MedicinalProduct|Medication)", "The medication for which this is an indication.", 0, java.lang.Integer.MAX_VALUE, subject); 1047 case 1671426428: /*disease*/ return new Property("disease", "CodeableConcept", "The disease, symptom or procedure for the contraindication.", 0, 1, disease); 1048 case -505503602: /*diseaseStatus*/ return new Property("diseaseStatus", "CodeableConcept", "The status of the disease or symptom for the contraindication.", 0, 1, diseaseStatus); 1049 case -406395211: /*comorbidity*/ return new Property("comorbidity", "CodeableConcept", "A comorbidity (concurrent condition) or coinfection.", 0, java.lang.Integer.MAX_VALUE, comorbidity); 1050 case -1925150262: /*therapeuticIndication*/ return new Property("therapeuticIndication", "Reference(MedicinalProductIndication)", "Information about the use of the medicinal product in relation to other therapies as part of the indication.", 0, java.lang.Integer.MAX_VALUE, therapeuticIndication); 1051 case -544509127: /*otherTherapy*/ return new Property("otherTherapy", "", "Information about the use of the medicinal product in relation to other therapies described as part of the indication.", 0, java.lang.Integer.MAX_VALUE, otherTherapy); 1052 case -2023558323: /*population*/ return new Property("population", "", "The population group to which this applies.", 0, java.lang.Integer.MAX_VALUE, population); 1053 default: return super.getNamedProperty(_hash, _name, _checkValid); 1054 } 1055 1056 } 1057 1058 @Override 1059 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1060 switch (hash) { 1061 case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // Reference 1062 case 1671426428: /*disease*/ return this.disease == null ? new Base[0] : new Base[] {this.disease}; // CodeableConcept 1063 case -505503602: /*diseaseStatus*/ return this.diseaseStatus == null ? new Base[0] : new Base[] {this.diseaseStatus}; // CodeableConcept 1064 case -406395211: /*comorbidity*/ return this.comorbidity == null ? new Base[0] : this.comorbidity.toArray(new Base[this.comorbidity.size()]); // CodeableConcept 1065 case -1925150262: /*therapeuticIndication*/ return this.therapeuticIndication == null ? new Base[0] : this.therapeuticIndication.toArray(new Base[this.therapeuticIndication.size()]); // Reference 1066 case -544509127: /*otherTherapy*/ return this.otherTherapy == null ? new Base[0] : this.otherTherapy.toArray(new Base[this.otherTherapy.size()]); // MedicinalProductContraindicationOtherTherapyComponent 1067 case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // MedicinalProductContraindicationPopulationComponent 1068 default: return super.getProperty(hash, name, checkValid); 1069 } 1070 1071 } 1072 1073 @Override 1074 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1075 switch (hash) { 1076 case -1867885268: // subject 1077 this.getSubject().add(castToReference(value)); // Reference 1078 return value; 1079 case 1671426428: // disease 1080 this.disease = castToCodeableConcept(value); // CodeableConcept 1081 return value; 1082 case -505503602: // diseaseStatus 1083 this.diseaseStatus = castToCodeableConcept(value); // CodeableConcept 1084 return value; 1085 case -406395211: // comorbidity 1086 this.getComorbidity().add(castToCodeableConcept(value)); // CodeableConcept 1087 return value; 1088 case -1925150262: // therapeuticIndication 1089 this.getTherapeuticIndication().add(castToReference(value)); // Reference 1090 return value; 1091 case -544509127: // otherTherapy 1092 this.getOtherTherapy().add((MedicinalProductContraindicationOtherTherapyComponent) value); // MedicinalProductContraindicationOtherTherapyComponent 1093 return value; 1094 case -2023558323: // population 1095 this.getPopulation().add((MedicinalProductContraindicationPopulationComponent) value); // MedicinalProductContraindicationPopulationComponent 1096 return value; 1097 default: return super.setProperty(hash, name, value); 1098 } 1099 1100 } 1101 1102 @Override 1103 public Base setProperty(String name, Base value) throws FHIRException { 1104 if (name.equals("subject")) { 1105 this.getSubject().add(castToReference(value)); 1106 } else if (name.equals("disease")) { 1107 this.disease = castToCodeableConcept(value); // CodeableConcept 1108 } else if (name.equals("diseaseStatus")) { 1109 this.diseaseStatus = castToCodeableConcept(value); // CodeableConcept 1110 } else if (name.equals("comorbidity")) { 1111 this.getComorbidity().add(castToCodeableConcept(value)); 1112 } else if (name.equals("therapeuticIndication")) { 1113 this.getTherapeuticIndication().add(castToReference(value)); 1114 } else if (name.equals("otherTherapy")) { 1115 this.getOtherTherapy().add((MedicinalProductContraindicationOtherTherapyComponent) value); 1116 } else if (name.equals("population")) { 1117 this.getPopulation().add((MedicinalProductContraindicationPopulationComponent) value); 1118 } else 1119 return super.setProperty(name, value); 1120 return value; 1121 } 1122 1123 @Override 1124 public Base makeProperty(int hash, String name) throws FHIRException { 1125 switch (hash) { 1126 case -1867885268: return addSubject(); 1127 case 1671426428: return getDisease(); 1128 case -505503602: return getDiseaseStatus(); 1129 case -406395211: return addComorbidity(); 1130 case -1925150262: return addTherapeuticIndication(); 1131 case -544509127: return addOtherTherapy(); 1132 case -2023558323: return addPopulation(); 1133 default: return super.makeProperty(hash, name); 1134 } 1135 1136 } 1137 1138 @Override 1139 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1140 switch (hash) { 1141 case -1867885268: /*subject*/ return new String[] {"Reference"}; 1142 case 1671426428: /*disease*/ return new String[] {"CodeableConcept"}; 1143 case -505503602: /*diseaseStatus*/ return new String[] {"CodeableConcept"}; 1144 case -406395211: /*comorbidity*/ return new String[] {"CodeableConcept"}; 1145 case -1925150262: /*therapeuticIndication*/ return new String[] {"Reference"}; 1146 case -544509127: /*otherTherapy*/ return new String[] {}; 1147 case -2023558323: /*population*/ return new String[] {}; 1148 default: return super.getTypesForProperty(hash, name); 1149 } 1150 1151 } 1152 1153 @Override 1154 public Base addChild(String name) throws FHIRException { 1155 if (name.equals("subject")) { 1156 return addSubject(); 1157 } 1158 else if (name.equals("disease")) { 1159 this.disease = new CodeableConcept(); 1160 return this.disease; 1161 } 1162 else if (name.equals("diseaseStatus")) { 1163 this.diseaseStatus = new CodeableConcept(); 1164 return this.diseaseStatus; 1165 } 1166 else if (name.equals("comorbidity")) { 1167 return addComorbidity(); 1168 } 1169 else if (name.equals("therapeuticIndication")) { 1170 return addTherapeuticIndication(); 1171 } 1172 else if (name.equals("otherTherapy")) { 1173 return addOtherTherapy(); 1174 } 1175 else if (name.equals("population")) { 1176 return addPopulation(); 1177 } 1178 else 1179 return super.addChild(name); 1180 } 1181 1182 public String fhirType() { 1183 return "MedicinalProductContraindication"; 1184 1185 } 1186 1187 public MedicinalProductContraindication copy() { 1188 MedicinalProductContraindication dst = new MedicinalProductContraindication(); 1189 copyValues(dst); 1190 if (subject != null) { 1191 dst.subject = new ArrayList<Reference>(); 1192 for (Reference i : subject) 1193 dst.subject.add(i.copy()); 1194 }; 1195 dst.disease = disease == null ? null : disease.copy(); 1196 dst.diseaseStatus = diseaseStatus == null ? null : diseaseStatus.copy(); 1197 if (comorbidity != null) { 1198 dst.comorbidity = new ArrayList<CodeableConcept>(); 1199 for (CodeableConcept i : comorbidity) 1200 dst.comorbidity.add(i.copy()); 1201 }; 1202 if (therapeuticIndication != null) { 1203 dst.therapeuticIndication = new ArrayList<Reference>(); 1204 for (Reference i : therapeuticIndication) 1205 dst.therapeuticIndication.add(i.copy()); 1206 }; 1207 if (otherTherapy != null) { 1208 dst.otherTherapy = new ArrayList<MedicinalProductContraindicationOtherTherapyComponent>(); 1209 for (MedicinalProductContraindicationOtherTherapyComponent i : otherTherapy) 1210 dst.otherTherapy.add(i.copy()); 1211 }; 1212 if (population != null) { 1213 dst.population = new ArrayList<MedicinalProductContraindicationPopulationComponent>(); 1214 for (MedicinalProductContraindicationPopulationComponent i : population) 1215 dst.population.add(i.copy()); 1216 }; 1217 return dst; 1218 } 1219 1220 protected MedicinalProductContraindication typedCopy() { 1221 return copy(); 1222 } 1223 1224 @Override 1225 public boolean equalsDeep(Base other_) { 1226 if (!super.equalsDeep(other_)) 1227 return false; 1228 if (!(other_ instanceof MedicinalProductContraindication)) 1229 return false; 1230 MedicinalProductContraindication o = (MedicinalProductContraindication) other_; 1231 return compareDeep(subject, o.subject, true) && compareDeep(disease, o.disease, true) && compareDeep(diseaseStatus, o.diseaseStatus, true) 1232 && compareDeep(comorbidity, o.comorbidity, true) && compareDeep(therapeuticIndication, o.therapeuticIndication, true) 1233 && compareDeep(otherTherapy, o.otherTherapy, true) && compareDeep(population, o.population, true) 1234 ; 1235 } 1236 1237 @Override 1238 public boolean equalsShallow(Base other_) { 1239 if (!super.equalsShallow(other_)) 1240 return false; 1241 if (!(other_ instanceof MedicinalProductContraindication)) 1242 return false; 1243 MedicinalProductContraindication o = (MedicinalProductContraindication) other_; 1244 return true; 1245 } 1246 1247 public boolean isEmpty() { 1248 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(subject, disease, diseaseStatus 1249 , comorbidity, therapeuticIndication, otherTherapy, population); 1250 } 1251 1252 @Override 1253 public ResourceType getResourceType() { 1254 return ResourceType.MedicinalProductContraindication; 1255 } 1256 1257 /** 1258 * Search parameter: <b>subject</b> 1259 * <p> 1260 * Description: <b>The medication for which this is an contraindication</b><br> 1261 * Type: <b>reference</b><br> 1262 * Path: <b>MedicinalProductContraindication.subject</b><br> 1263 * </p> 1264 */ 1265 @SearchParamDefinition(name="subject", path="MedicinalProductContraindication.subject", description="The medication for which this is an contraindication", type="reference", target={Medication.class, MedicinalProduct.class } ) 1266 public static final String SP_SUBJECT = "subject"; 1267 /** 1268 * <b>Fluent Client</b> search parameter constant for <b>subject</b> 1269 * <p> 1270 * Description: <b>The medication for which this is an contraindication</b><br> 1271 * Type: <b>reference</b><br> 1272 * Path: <b>MedicinalProductContraindication.subject</b><br> 1273 * </p> 1274 */ 1275 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); 1276 1277/** 1278 * Constant for fluent queries to be used to add include statements. Specifies 1279 * the path value of "<b>MedicinalProductContraindication:subject</b>". 1280 */ 1281 public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("MedicinalProductContraindication:subject").toLocked(); 1282 1283 1284} 1285