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 * Describe the undesirable effects of the medicinal product. 046 */ 047@ResourceDef(name="MedicinalProductUndesirableEffect", profile="http://hl7.org/fhir/StructureDefinition/MedicinalProductUndesirableEffect") 048public class MedicinalProductUndesirableEffect extends DomainResource { 049 050 @Block() 051 public static class MedicinalProductUndesirableEffectPopulationComponent extends BackboneElement implements IBaseBackboneElement { 052 /** 053 * The age of the specific population. 054 */ 055 @Child(name = "age", type = {Range.class, CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 056 @Description(shortDefinition="The age of the specific population", formalDefinition="The age of the specific population." ) 057 protected Type age; 058 059 /** 060 * The gender of the specific population. 061 */ 062 @Child(name = "gender", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 063 @Description(shortDefinition="The gender of the specific population", formalDefinition="The gender of the specific population." ) 064 protected CodeableConcept gender; 065 066 /** 067 * Race of the specific population. 068 */ 069 @Child(name = "race", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) 070 @Description(shortDefinition="Race of the specific population", formalDefinition="Race of the specific population." ) 071 protected CodeableConcept race; 072 073 /** 074 * The existing physiological conditions of the specific population to which this applies. 075 */ 076 @Child(name = "physiologicalCondition", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) 077 @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." ) 078 protected CodeableConcept physiologicalCondition; 079 080 private static final long serialVersionUID = -394311584L; 081 082 /** 083 * Constructor 084 */ 085 public MedicinalProductUndesirableEffectPopulationComponent() { 086 super(); 087 } 088 089 /** 090 * @return {@link #age} (The age of the specific population.) 091 */ 092 public Type getAge() { 093 return this.age; 094 } 095 096 /** 097 * @return {@link #age} (The age of the specific population.) 098 */ 099 public Range getAgeRange() throws FHIRException { 100 if (this.age == null) 101 return null; 102 if (!(this.age instanceof Range)) 103 throw new FHIRException("Type mismatch: the type Range was expected, but "+this.age.getClass().getName()+" was encountered"); 104 return (Range) this.age; 105 } 106 107 public boolean hasAgeRange() { 108 return this != null && this.age instanceof Range; 109 } 110 111 /** 112 * @return {@link #age} (The age of the specific population.) 113 */ 114 public CodeableConcept getAgeCodeableConcept() throws FHIRException { 115 if (this.age == null) 116 return null; 117 if (!(this.age instanceof CodeableConcept)) 118 throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.age.getClass().getName()+" was encountered"); 119 return (CodeableConcept) this.age; 120 } 121 122 public boolean hasAgeCodeableConcept() { 123 return this != null && this.age instanceof CodeableConcept; 124 } 125 126 public boolean hasAge() { 127 return this.age != null && !this.age.isEmpty(); 128 } 129 130 /** 131 * @param value {@link #age} (The age of the specific population.) 132 */ 133 public MedicinalProductUndesirableEffectPopulationComponent setAge(Type value) { 134 if (value != null && !(value instanceof Range || value instanceof CodeableConcept)) 135 throw new Error("Not the right type for MedicinalProductUndesirableEffect.population.age[x]: "+value.fhirType()); 136 this.age = value; 137 return this; 138 } 139 140 /** 141 * @return {@link #gender} (The gender of the specific population.) 142 */ 143 public CodeableConcept getGender() { 144 if (this.gender == null) 145 if (Configuration.errorOnAutoCreate()) 146 throw new Error("Attempt to auto-create MedicinalProductUndesirableEffectPopulationComponent.gender"); 147 else if (Configuration.doAutoCreate()) 148 this.gender = new CodeableConcept(); // cc 149 return this.gender; 150 } 151 152 public boolean hasGender() { 153 return this.gender != null && !this.gender.isEmpty(); 154 } 155 156 /** 157 * @param value {@link #gender} (The gender of the specific population.) 158 */ 159 public MedicinalProductUndesirableEffectPopulationComponent setGender(CodeableConcept value) { 160 this.gender = value; 161 return this; 162 } 163 164 /** 165 * @return {@link #race} (Race of the specific population.) 166 */ 167 public CodeableConcept getRace() { 168 if (this.race == null) 169 if (Configuration.errorOnAutoCreate()) 170 throw new Error("Attempt to auto-create MedicinalProductUndesirableEffectPopulationComponent.race"); 171 else if (Configuration.doAutoCreate()) 172 this.race = new CodeableConcept(); // cc 173 return this.race; 174 } 175 176 public boolean hasRace() { 177 return this.race != null && !this.race.isEmpty(); 178 } 179 180 /** 181 * @param value {@link #race} (Race of the specific population.) 182 */ 183 public MedicinalProductUndesirableEffectPopulationComponent setRace(CodeableConcept value) { 184 this.race = value; 185 return this; 186 } 187 188 /** 189 * @return {@link #physiologicalCondition} (The existing physiological conditions of the specific population to which this applies.) 190 */ 191 public CodeableConcept getPhysiologicalCondition() { 192 if (this.physiologicalCondition == null) 193 if (Configuration.errorOnAutoCreate()) 194 throw new Error("Attempt to auto-create MedicinalProductUndesirableEffectPopulationComponent.physiologicalCondition"); 195 else if (Configuration.doAutoCreate()) 196 this.physiologicalCondition = new CodeableConcept(); // cc 197 return this.physiologicalCondition; 198 } 199 200 public boolean hasPhysiologicalCondition() { 201 return this.physiologicalCondition != null && !this.physiologicalCondition.isEmpty(); 202 } 203 204 /** 205 * @param value {@link #physiologicalCondition} (The existing physiological conditions of the specific population to which this applies.) 206 */ 207 public MedicinalProductUndesirableEffectPopulationComponent setPhysiologicalCondition(CodeableConcept value) { 208 this.physiologicalCondition = value; 209 return this; 210 } 211 212 protected void listChildren(List<Property> children) { 213 super.listChildren(children); 214 children.add(new Property("age[x]", "Range|CodeableConcept", "The age of the specific population.", 0, 1, age)); 215 children.add(new Property("gender", "CodeableConcept", "The gender of the specific population.", 0, 1, gender)); 216 children.add(new Property("race", "CodeableConcept", "Race of the specific population.", 0, 1, race)); 217 children.add(new Property("physiologicalCondition", "CodeableConcept", "The existing physiological conditions of the specific population to which this applies.", 0, 1, physiologicalCondition)); 218 } 219 220 @Override 221 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 222 switch (_hash) { 223 case -1419716831: /*age[x]*/ return new Property("age[x]", "Range|CodeableConcept", "The age of the specific population.", 0, 1, age); 224 case 96511: /*age*/ return new Property("age[x]", "Range|CodeableConcept", "The age of the specific population.", 0, 1, age); 225 case 1442748286: /*ageRange*/ return new Property("age[x]", "Range|CodeableConcept", "The age of the specific population.", 0, 1, age); 226 case -1452658526: /*ageCodeableConcept*/ return new Property("age[x]", "Range|CodeableConcept", "The age of the specific population.", 0, 1, age); 227 case -1249512767: /*gender*/ return new Property("gender", "CodeableConcept", "The gender of the specific population.", 0, 1, gender); 228 case 3492561: /*race*/ return new Property("race", "CodeableConcept", "Race of the specific population.", 0, 1, race); 229 case -62715190: /*physiologicalCondition*/ return new Property("physiologicalCondition", "CodeableConcept", "The existing physiological conditions of the specific population to which this applies.", 0, 1, physiologicalCondition); 230 default: return super.getNamedProperty(_hash, _name, _checkValid); 231 } 232 233 } 234 235 @Override 236 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 237 switch (hash) { 238 case 96511: /*age*/ return this.age == null ? new Base[0] : new Base[] {this.age}; // Type 239 case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // CodeableConcept 240 case 3492561: /*race*/ return this.race == null ? new Base[0] : new Base[] {this.race}; // CodeableConcept 241 case -62715190: /*physiologicalCondition*/ return this.physiologicalCondition == null ? new Base[0] : new Base[] {this.physiologicalCondition}; // CodeableConcept 242 default: return super.getProperty(hash, name, checkValid); 243 } 244 245 } 246 247 @Override 248 public Base setProperty(int hash, String name, Base value) throws FHIRException { 249 switch (hash) { 250 case 96511: // age 251 this.age = castToType(value); // Type 252 return value; 253 case -1249512767: // gender 254 this.gender = castToCodeableConcept(value); // CodeableConcept 255 return value; 256 case 3492561: // race 257 this.race = castToCodeableConcept(value); // CodeableConcept 258 return value; 259 case -62715190: // physiologicalCondition 260 this.physiologicalCondition = castToCodeableConcept(value); // CodeableConcept 261 return value; 262 default: return super.setProperty(hash, name, value); 263 } 264 265 } 266 267 @Override 268 public Base setProperty(String name, Base value) throws FHIRException { 269 if (name.equals("age[x]")) { 270 this.age = castToType(value); // Type 271 } else if (name.equals("gender")) { 272 this.gender = castToCodeableConcept(value); // CodeableConcept 273 } else if (name.equals("race")) { 274 this.race = castToCodeableConcept(value); // CodeableConcept 275 } else if (name.equals("physiologicalCondition")) { 276 this.physiologicalCondition = castToCodeableConcept(value); // CodeableConcept 277 } else 278 return super.setProperty(name, value); 279 return value; 280 } 281 282 @Override 283 public Base makeProperty(int hash, String name) throws FHIRException { 284 switch (hash) { 285 case -1419716831: return getAge(); 286 case 96511: return getAge(); 287 case -1249512767: return getGender(); 288 case 3492561: return getRace(); 289 case -62715190: return getPhysiologicalCondition(); 290 default: return super.makeProperty(hash, name); 291 } 292 293 } 294 295 @Override 296 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 297 switch (hash) { 298 case 96511: /*age*/ return new String[] {"Range", "CodeableConcept"}; 299 case -1249512767: /*gender*/ return new String[] {"CodeableConcept"}; 300 case 3492561: /*race*/ return new String[] {"CodeableConcept"}; 301 case -62715190: /*physiologicalCondition*/ return new String[] {"CodeableConcept"}; 302 default: return super.getTypesForProperty(hash, name); 303 } 304 305 } 306 307 @Override 308 public Base addChild(String name) throws FHIRException { 309 if (name.equals("ageRange")) { 310 this.age = new Range(); 311 return this.age; 312 } 313 else if (name.equals("ageCodeableConcept")) { 314 this.age = new CodeableConcept(); 315 return this.age; 316 } 317 else if (name.equals("gender")) { 318 this.gender = new CodeableConcept(); 319 return this.gender; 320 } 321 else if (name.equals("race")) { 322 this.race = new CodeableConcept(); 323 return this.race; 324 } 325 else if (name.equals("physiologicalCondition")) { 326 this.physiologicalCondition = new CodeableConcept(); 327 return this.physiologicalCondition; 328 } 329 else 330 return super.addChild(name); 331 } 332 333 public MedicinalProductUndesirableEffectPopulationComponent copy() { 334 MedicinalProductUndesirableEffectPopulationComponent dst = new MedicinalProductUndesirableEffectPopulationComponent(); 335 copyValues(dst); 336 dst.age = age == null ? null : age.copy(); 337 dst.gender = gender == null ? null : gender.copy(); 338 dst.race = race == null ? null : race.copy(); 339 dst.physiologicalCondition = physiologicalCondition == null ? null : physiologicalCondition.copy(); 340 return dst; 341 } 342 343 @Override 344 public boolean equalsDeep(Base other_) { 345 if (!super.equalsDeep(other_)) 346 return false; 347 if (!(other_ instanceof MedicinalProductUndesirableEffectPopulationComponent)) 348 return false; 349 MedicinalProductUndesirableEffectPopulationComponent o = (MedicinalProductUndesirableEffectPopulationComponent) other_; 350 return compareDeep(age, o.age, true) && compareDeep(gender, o.gender, true) && compareDeep(race, o.race, true) 351 && compareDeep(physiologicalCondition, o.physiologicalCondition, true); 352 } 353 354 @Override 355 public boolean equalsShallow(Base other_) { 356 if (!super.equalsShallow(other_)) 357 return false; 358 if (!(other_ instanceof MedicinalProductUndesirableEffectPopulationComponent)) 359 return false; 360 MedicinalProductUndesirableEffectPopulationComponent o = (MedicinalProductUndesirableEffectPopulationComponent) other_; 361 return true; 362 } 363 364 public boolean isEmpty() { 365 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(age, gender, race, physiologicalCondition 366 ); 367 } 368 369 public String fhirType() { 370 return "MedicinalProductUndesirableEffect.population"; 371 372 } 373 374 } 375 376 /** 377 * The medication for which this is an indication. 378 */ 379 @Child(name = "subject", type = {MedicinalProduct.class, Medication.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 380 @Description(shortDefinition="The medication for which this is an indication", formalDefinition="The medication for which this is an indication." ) 381 protected List<Reference> subject; 382 /** 383 * The actual objects that are the target of the reference (The medication for which this is an indication.) 384 */ 385 protected List<Resource> subjectTarget; 386 387 388 /** 389 * The symptom, condition or undesirable effect. 390 */ 391 @Child(name = "symptomConditionEffect", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 392 @Description(shortDefinition="The symptom, condition or undesirable effect", formalDefinition="The symptom, condition or undesirable effect." ) 393 protected CodeableConcept symptomConditionEffect; 394 395 /** 396 * Classification of the effect. 397 */ 398 @Child(name = "classification", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 399 @Description(shortDefinition="Classification of the effect", formalDefinition="Classification of the effect." ) 400 protected CodeableConcept classification; 401 402 /** 403 * The frequency of occurrence of the effect. 404 */ 405 @Child(name = "frequencyOfOccurrence", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) 406 @Description(shortDefinition="The frequency of occurrence of the effect", formalDefinition="The frequency of occurrence of the effect." ) 407 protected CodeableConcept frequencyOfOccurrence; 408 409 /** 410 * The population group to which this applies. 411 */ 412 @Child(name = "population", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 413 @Description(shortDefinition="The population group to which this applies", formalDefinition="The population group to which this applies." ) 414 protected List<MedicinalProductUndesirableEffectPopulationComponent> population; 415 416 private static final long serialVersionUID = 522261133L; 417 418 /** 419 * Constructor 420 */ 421 public MedicinalProductUndesirableEffect() { 422 super(); 423 } 424 425 /** 426 * @return {@link #subject} (The medication for which this is an indication.) 427 */ 428 public List<Reference> getSubject() { 429 if (this.subject == null) 430 this.subject = new ArrayList<Reference>(); 431 return this.subject; 432 } 433 434 /** 435 * @return Returns a reference to <code>this</code> for easy method chaining 436 */ 437 public MedicinalProductUndesirableEffect setSubject(List<Reference> theSubject) { 438 this.subject = theSubject; 439 return this; 440 } 441 442 public boolean hasSubject() { 443 if (this.subject == null) 444 return false; 445 for (Reference item : this.subject) 446 if (!item.isEmpty()) 447 return true; 448 return false; 449 } 450 451 public Reference addSubject() { //3 452 Reference t = new Reference(); 453 if (this.subject == null) 454 this.subject = new ArrayList<Reference>(); 455 this.subject.add(t); 456 return t; 457 } 458 459 public MedicinalProductUndesirableEffect addSubject(Reference t) { //3 460 if (t == null) 461 return this; 462 if (this.subject == null) 463 this.subject = new ArrayList<Reference>(); 464 this.subject.add(t); 465 return this; 466 } 467 468 /** 469 * @return The first repetition of repeating field {@link #subject}, creating it if it does not already exist 470 */ 471 public Reference getSubjectFirstRep() { 472 if (getSubject().isEmpty()) { 473 addSubject(); 474 } 475 return getSubject().get(0); 476 } 477 478 /** 479 * @deprecated Use Reference#setResource(IBaseResource) instead 480 */ 481 @Deprecated 482 public List<Resource> getSubjectTarget() { 483 if (this.subjectTarget == null) 484 this.subjectTarget = new ArrayList<Resource>(); 485 return this.subjectTarget; 486 } 487 488 /** 489 * @return {@link #symptomConditionEffect} (The symptom, condition or undesirable effect.) 490 */ 491 public CodeableConcept getSymptomConditionEffect() { 492 if (this.symptomConditionEffect == null) 493 if (Configuration.errorOnAutoCreate()) 494 throw new Error("Attempt to auto-create MedicinalProductUndesirableEffect.symptomConditionEffect"); 495 else if (Configuration.doAutoCreate()) 496 this.symptomConditionEffect = new CodeableConcept(); // cc 497 return this.symptomConditionEffect; 498 } 499 500 public boolean hasSymptomConditionEffect() { 501 return this.symptomConditionEffect != null && !this.symptomConditionEffect.isEmpty(); 502 } 503 504 /** 505 * @param value {@link #symptomConditionEffect} (The symptom, condition or undesirable effect.) 506 */ 507 public MedicinalProductUndesirableEffect setSymptomConditionEffect(CodeableConcept value) { 508 this.symptomConditionEffect = value; 509 return this; 510 } 511 512 /** 513 * @return {@link #classification} (Classification of the effect.) 514 */ 515 public CodeableConcept getClassification() { 516 if (this.classification == null) 517 if (Configuration.errorOnAutoCreate()) 518 throw new Error("Attempt to auto-create MedicinalProductUndesirableEffect.classification"); 519 else if (Configuration.doAutoCreate()) 520 this.classification = new CodeableConcept(); // cc 521 return this.classification; 522 } 523 524 public boolean hasClassification() { 525 return this.classification != null && !this.classification.isEmpty(); 526 } 527 528 /** 529 * @param value {@link #classification} (Classification of the effect.) 530 */ 531 public MedicinalProductUndesirableEffect setClassification(CodeableConcept value) { 532 this.classification = value; 533 return this; 534 } 535 536 /** 537 * @return {@link #frequencyOfOccurrence} (The frequency of occurrence of the effect.) 538 */ 539 public CodeableConcept getFrequencyOfOccurrence() { 540 if (this.frequencyOfOccurrence == null) 541 if (Configuration.errorOnAutoCreate()) 542 throw new Error("Attempt to auto-create MedicinalProductUndesirableEffect.frequencyOfOccurrence"); 543 else if (Configuration.doAutoCreate()) 544 this.frequencyOfOccurrence = new CodeableConcept(); // cc 545 return this.frequencyOfOccurrence; 546 } 547 548 public boolean hasFrequencyOfOccurrence() { 549 return this.frequencyOfOccurrence != null && !this.frequencyOfOccurrence.isEmpty(); 550 } 551 552 /** 553 * @param value {@link #frequencyOfOccurrence} (The frequency of occurrence of the effect.) 554 */ 555 public MedicinalProductUndesirableEffect setFrequencyOfOccurrence(CodeableConcept value) { 556 this.frequencyOfOccurrence = value; 557 return this; 558 } 559 560 /** 561 * @return {@link #population} (The population group to which this applies.) 562 */ 563 public List<MedicinalProductUndesirableEffectPopulationComponent> getPopulation() { 564 if (this.population == null) 565 this.population = new ArrayList<MedicinalProductUndesirableEffectPopulationComponent>(); 566 return this.population; 567 } 568 569 /** 570 * @return Returns a reference to <code>this</code> for easy method chaining 571 */ 572 public MedicinalProductUndesirableEffect setPopulation(List<MedicinalProductUndesirableEffectPopulationComponent> thePopulation) { 573 this.population = thePopulation; 574 return this; 575 } 576 577 public boolean hasPopulation() { 578 if (this.population == null) 579 return false; 580 for (MedicinalProductUndesirableEffectPopulationComponent item : this.population) 581 if (!item.isEmpty()) 582 return true; 583 return false; 584 } 585 586 public MedicinalProductUndesirableEffectPopulationComponent addPopulation() { //3 587 MedicinalProductUndesirableEffectPopulationComponent t = new MedicinalProductUndesirableEffectPopulationComponent(); 588 if (this.population == null) 589 this.population = new ArrayList<MedicinalProductUndesirableEffectPopulationComponent>(); 590 this.population.add(t); 591 return t; 592 } 593 594 public MedicinalProductUndesirableEffect addPopulation(MedicinalProductUndesirableEffectPopulationComponent t) { //3 595 if (t == null) 596 return this; 597 if (this.population == null) 598 this.population = new ArrayList<MedicinalProductUndesirableEffectPopulationComponent>(); 599 this.population.add(t); 600 return this; 601 } 602 603 /** 604 * @return The first repetition of repeating field {@link #population}, creating it if it does not already exist 605 */ 606 public MedicinalProductUndesirableEffectPopulationComponent getPopulationFirstRep() { 607 if (getPopulation().isEmpty()) { 608 addPopulation(); 609 } 610 return getPopulation().get(0); 611 } 612 613 protected void listChildren(List<Property> children) { 614 super.listChildren(children); 615 children.add(new Property("subject", "Reference(MedicinalProduct|Medication)", "The medication for which this is an indication.", 0, java.lang.Integer.MAX_VALUE, subject)); 616 children.add(new Property("symptomConditionEffect", "CodeableConcept", "The symptom, condition or undesirable effect.", 0, 1, symptomConditionEffect)); 617 children.add(new Property("classification", "CodeableConcept", "Classification of the effect.", 0, 1, classification)); 618 children.add(new Property("frequencyOfOccurrence", "CodeableConcept", "The frequency of occurrence of the effect.", 0, 1, frequencyOfOccurrence)); 619 children.add(new Property("population", "", "The population group to which this applies.", 0, java.lang.Integer.MAX_VALUE, population)); 620 } 621 622 @Override 623 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 624 switch (_hash) { 625 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); 626 case -650549981: /*symptomConditionEffect*/ return new Property("symptomConditionEffect", "CodeableConcept", "The symptom, condition or undesirable effect.", 0, 1, symptomConditionEffect); 627 case 382350310: /*classification*/ return new Property("classification", "CodeableConcept", "Classification of the effect.", 0, 1, classification); 628 case 791175812: /*frequencyOfOccurrence*/ return new Property("frequencyOfOccurrence", "CodeableConcept", "The frequency of occurrence of the effect.", 0, 1, frequencyOfOccurrence); 629 case -2023558323: /*population*/ return new Property("population", "", "The population group to which this applies.", 0, java.lang.Integer.MAX_VALUE, population); 630 default: return super.getNamedProperty(_hash, _name, _checkValid); 631 } 632 633 } 634 635 @Override 636 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 637 switch (hash) { 638 case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // Reference 639 case -650549981: /*symptomConditionEffect*/ return this.symptomConditionEffect == null ? new Base[0] : new Base[] {this.symptomConditionEffect}; // CodeableConcept 640 case 382350310: /*classification*/ return this.classification == null ? new Base[0] : new Base[] {this.classification}; // CodeableConcept 641 case 791175812: /*frequencyOfOccurrence*/ return this.frequencyOfOccurrence == null ? new Base[0] : new Base[] {this.frequencyOfOccurrence}; // CodeableConcept 642 case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // MedicinalProductUndesirableEffectPopulationComponent 643 default: return super.getProperty(hash, name, checkValid); 644 } 645 646 } 647 648 @Override 649 public Base setProperty(int hash, String name, Base value) throws FHIRException { 650 switch (hash) { 651 case -1867885268: // subject 652 this.getSubject().add(castToReference(value)); // Reference 653 return value; 654 case -650549981: // symptomConditionEffect 655 this.symptomConditionEffect = castToCodeableConcept(value); // CodeableConcept 656 return value; 657 case 382350310: // classification 658 this.classification = castToCodeableConcept(value); // CodeableConcept 659 return value; 660 case 791175812: // frequencyOfOccurrence 661 this.frequencyOfOccurrence = castToCodeableConcept(value); // CodeableConcept 662 return value; 663 case -2023558323: // population 664 this.getPopulation().add((MedicinalProductUndesirableEffectPopulationComponent) value); // MedicinalProductUndesirableEffectPopulationComponent 665 return value; 666 default: return super.setProperty(hash, name, value); 667 } 668 669 } 670 671 @Override 672 public Base setProperty(String name, Base value) throws FHIRException { 673 if (name.equals("subject")) { 674 this.getSubject().add(castToReference(value)); 675 } else if (name.equals("symptomConditionEffect")) { 676 this.symptomConditionEffect = castToCodeableConcept(value); // CodeableConcept 677 } else if (name.equals("classification")) { 678 this.classification = castToCodeableConcept(value); // CodeableConcept 679 } else if (name.equals("frequencyOfOccurrence")) { 680 this.frequencyOfOccurrence = castToCodeableConcept(value); // CodeableConcept 681 } else if (name.equals("population")) { 682 this.getPopulation().add((MedicinalProductUndesirableEffectPopulationComponent) value); 683 } else 684 return super.setProperty(name, value); 685 return value; 686 } 687 688 @Override 689 public Base makeProperty(int hash, String name) throws FHIRException { 690 switch (hash) { 691 case -1867885268: return addSubject(); 692 case -650549981: return getSymptomConditionEffect(); 693 case 382350310: return getClassification(); 694 case 791175812: return getFrequencyOfOccurrence(); 695 case -2023558323: return addPopulation(); 696 default: return super.makeProperty(hash, name); 697 } 698 699 } 700 701 @Override 702 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 703 switch (hash) { 704 case -1867885268: /*subject*/ return new String[] {"Reference"}; 705 case -650549981: /*symptomConditionEffect*/ return new String[] {"CodeableConcept"}; 706 case 382350310: /*classification*/ return new String[] {"CodeableConcept"}; 707 case 791175812: /*frequencyOfOccurrence*/ return new String[] {"CodeableConcept"}; 708 case -2023558323: /*population*/ return new String[] {}; 709 default: return super.getTypesForProperty(hash, name); 710 } 711 712 } 713 714 @Override 715 public Base addChild(String name) throws FHIRException { 716 if (name.equals("subject")) { 717 return addSubject(); 718 } 719 else if (name.equals("symptomConditionEffect")) { 720 this.symptomConditionEffect = new CodeableConcept(); 721 return this.symptomConditionEffect; 722 } 723 else if (name.equals("classification")) { 724 this.classification = new CodeableConcept(); 725 return this.classification; 726 } 727 else if (name.equals("frequencyOfOccurrence")) { 728 this.frequencyOfOccurrence = new CodeableConcept(); 729 return this.frequencyOfOccurrence; 730 } 731 else if (name.equals("population")) { 732 return addPopulation(); 733 } 734 else 735 return super.addChild(name); 736 } 737 738 public String fhirType() { 739 return "MedicinalProductUndesirableEffect"; 740 741 } 742 743 public MedicinalProductUndesirableEffect copy() { 744 MedicinalProductUndesirableEffect dst = new MedicinalProductUndesirableEffect(); 745 copyValues(dst); 746 if (subject != null) { 747 dst.subject = new ArrayList<Reference>(); 748 for (Reference i : subject) 749 dst.subject.add(i.copy()); 750 }; 751 dst.symptomConditionEffect = symptomConditionEffect == null ? null : symptomConditionEffect.copy(); 752 dst.classification = classification == null ? null : classification.copy(); 753 dst.frequencyOfOccurrence = frequencyOfOccurrence == null ? null : frequencyOfOccurrence.copy(); 754 if (population != null) { 755 dst.population = new ArrayList<MedicinalProductUndesirableEffectPopulationComponent>(); 756 for (MedicinalProductUndesirableEffectPopulationComponent i : population) 757 dst.population.add(i.copy()); 758 }; 759 return dst; 760 } 761 762 protected MedicinalProductUndesirableEffect typedCopy() { 763 return copy(); 764 } 765 766 @Override 767 public boolean equalsDeep(Base other_) { 768 if (!super.equalsDeep(other_)) 769 return false; 770 if (!(other_ instanceof MedicinalProductUndesirableEffect)) 771 return false; 772 MedicinalProductUndesirableEffect o = (MedicinalProductUndesirableEffect) other_; 773 return compareDeep(subject, o.subject, true) && compareDeep(symptomConditionEffect, o.symptomConditionEffect, true) 774 && compareDeep(classification, o.classification, true) && compareDeep(frequencyOfOccurrence, o.frequencyOfOccurrence, true) 775 && compareDeep(population, o.population, true); 776 } 777 778 @Override 779 public boolean equalsShallow(Base other_) { 780 if (!super.equalsShallow(other_)) 781 return false; 782 if (!(other_ instanceof MedicinalProductUndesirableEffect)) 783 return false; 784 MedicinalProductUndesirableEffect o = (MedicinalProductUndesirableEffect) other_; 785 return true; 786 } 787 788 public boolean isEmpty() { 789 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(subject, symptomConditionEffect 790 , classification, frequencyOfOccurrence, population); 791 } 792 793 @Override 794 public ResourceType getResourceType() { 795 return ResourceType.MedicinalProductUndesirableEffect; 796 } 797 798 /** 799 * Search parameter: <b>subject</b> 800 * <p> 801 * Description: <b>The medication for which this is an undesirable effect</b><br> 802 * Type: <b>reference</b><br> 803 * Path: <b>MedicinalProductUndesirableEffect.subject</b><br> 804 * </p> 805 */ 806 @SearchParamDefinition(name="subject", path="MedicinalProductUndesirableEffect.subject", description="The medication for which this is an undesirable effect", type="reference", target={Medication.class, MedicinalProduct.class } ) 807 public static final String SP_SUBJECT = "subject"; 808 /** 809 * <b>Fluent Client</b> search parameter constant for <b>subject</b> 810 * <p> 811 * Description: <b>The medication for which this is an undesirable effect</b><br> 812 * Type: <b>reference</b><br> 813 * Path: <b>MedicinalProductUndesirableEffect.subject</b><br> 814 * </p> 815 */ 816 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); 817 818/** 819 * Constant for fluent queries to be used to add include statements. Specifies 820 * the path value of "<b>MedicinalProductUndesirableEffect:subject</b>". 821 */ 822 public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("MedicinalProductUndesirableEffect:subject").toLocked(); 823 824 825} 826