
001package org.hl7.fhir.r5.model; 002 003 004/* 005 Copyright (c) 2011+, HL7, Inc. 006 All rights reserved. 007 008 Redistribution and use in source and binary forms, with or without modification, \ 009 are permitted provided that the following conditions are met: 010 011 * Redistributions of source code must retain the above copyright notice, this \ 012 list of conditions and the following disclaimer. 013 * Redistributions in binary form must reproduce the above copyright notice, \ 014 this list of conditions and the following disclaimer in the documentation \ 015 and/or other materials provided with the distribution. 016 * Neither the name of HL7 nor the names of its contributors may be used to 017 endorse or promote products derived from this software without specific 018 prior written permission. 019 020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \ 021 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \ 022 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \ 023 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \ 024 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \ 025 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \ 026 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \ 027 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \ 028 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \ 029 POSSIBILITY OF SUCH DAMAGE. 030 */ 031 032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1 033 034import java.util.ArrayList; 035import java.util.Date; 036import java.util.List; 037import org.hl7.fhir.utilities.Utilities; 038import org.hl7.fhir.r5.model.Enumerations.*; 039import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 040import org.hl7.fhir.exceptions.FHIRException; 041import org.hl7.fhir.instance.model.api.ICompositeType; 042import ca.uhn.fhir.model.api.annotation.ResourceDef; 043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 044import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 045import ca.uhn.fhir.model.api.annotation.Child; 046import ca.uhn.fhir.model.api.annotation.ChildOrder; 047import ca.uhn.fhir.model.api.annotation.Description; 048import ca.uhn.fhir.model.api.annotation.Block; 049 050/** 051 * A single issue - either an indication, contraindication, interaction or an undesirable effect for a medicinal product, medication, device or procedure. 052 */ 053@ResourceDef(name="ClinicalUseIssue", profile="http://hl7.org/fhir/StructureDefinition/ClinicalUseIssue") 054public class ClinicalUseIssue extends DomainResource { 055 056 @Block() 057 public static class ClinicalUseIssueContraindicationComponent extends BackboneElement implements IBaseBackboneElement { 058 /** 059 * The situation that is being documented as contraindicating against this item. 060 */ 061 @Child(name = "diseaseSymptomProcedure", type = {CodeableReference.class}, order=1, min=0, max=1, modifier=false, summary=true) 062 @Description(shortDefinition="The situation that is being documented as contraindicating against this item", formalDefinition="The situation that is being documented as contraindicating against this item." ) 063 protected CodeableReference diseaseSymptomProcedure; 064 065 /** 066 * The status of the disease or symptom for the contraindication. 067 */ 068 @Child(name = "diseaseStatus", type = {CodeableReference.class}, order=2, min=0, max=1, modifier=false, summary=true) 069 @Description(shortDefinition="The status of the disease or symptom for the contraindication", formalDefinition="The status of the disease or symptom for the contraindication." ) 070 protected CodeableReference diseaseStatus; 071 072 /** 073 * A comorbidity (concurrent condition) or coinfection. 074 */ 075 @Child(name = "comorbidity", type = {CodeableReference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 076 @Description(shortDefinition="A comorbidity (concurrent condition) or coinfection", formalDefinition="A comorbidity (concurrent condition) or coinfection." ) 077 protected List<CodeableReference> comorbidity; 078 079 /** 080 * The indication which this is a contraidication for. 081 */ 082 @Child(name = "indication", type = {ClinicalUseIssue.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 083 @Description(shortDefinition="The indication which this is a contraidication for", formalDefinition="The indication which this is a contraidication for." ) 084 protected List<Reference> indication; 085 086 /** 087 * Information about the use of the medicinal product in relation to other therapies described as part of the contraindication. 088 */ 089 @Child(name = "otherTherapy", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 090 @Description(shortDefinition="Information about the use of the medicinal product in relation to other therapies described as part of the contraindication", formalDefinition="Information about the use of the medicinal product in relation to other therapies described as part of the contraindication." ) 091 protected List<ClinicalUseIssueContraindicationOtherTherapyComponent> otherTherapy; 092 093 private static final long serialVersionUID = 1347024193L; 094 095 /** 096 * Constructor 097 */ 098 public ClinicalUseIssueContraindicationComponent() { 099 super(); 100 } 101 102 /** 103 * @return {@link #diseaseSymptomProcedure} (The situation that is being documented as contraindicating against this item.) 104 */ 105 public CodeableReference getDiseaseSymptomProcedure() { 106 if (this.diseaseSymptomProcedure == null) 107 if (Configuration.errorOnAutoCreate()) 108 throw new Error("Attempt to auto-create ClinicalUseIssueContraindicationComponent.diseaseSymptomProcedure"); 109 else if (Configuration.doAutoCreate()) 110 this.diseaseSymptomProcedure = new CodeableReference(); // cc 111 return this.diseaseSymptomProcedure; 112 } 113 114 public boolean hasDiseaseSymptomProcedure() { 115 return this.diseaseSymptomProcedure != null && !this.diseaseSymptomProcedure.isEmpty(); 116 } 117 118 /** 119 * @param value {@link #diseaseSymptomProcedure} (The situation that is being documented as contraindicating against this item.) 120 */ 121 public ClinicalUseIssueContraindicationComponent setDiseaseSymptomProcedure(CodeableReference value) { 122 this.diseaseSymptomProcedure = value; 123 return this; 124 } 125 126 /** 127 * @return {@link #diseaseStatus} (The status of the disease or symptom for the contraindication.) 128 */ 129 public CodeableReference getDiseaseStatus() { 130 if (this.diseaseStatus == null) 131 if (Configuration.errorOnAutoCreate()) 132 throw new Error("Attempt to auto-create ClinicalUseIssueContraindicationComponent.diseaseStatus"); 133 else if (Configuration.doAutoCreate()) 134 this.diseaseStatus = new CodeableReference(); // cc 135 return this.diseaseStatus; 136 } 137 138 public boolean hasDiseaseStatus() { 139 return this.diseaseStatus != null && !this.diseaseStatus.isEmpty(); 140 } 141 142 /** 143 * @param value {@link #diseaseStatus} (The status of the disease or symptom for the contraindication.) 144 */ 145 public ClinicalUseIssueContraindicationComponent setDiseaseStatus(CodeableReference value) { 146 this.diseaseStatus = value; 147 return this; 148 } 149 150 /** 151 * @return {@link #comorbidity} (A comorbidity (concurrent condition) or coinfection.) 152 */ 153 public List<CodeableReference> getComorbidity() { 154 if (this.comorbidity == null) 155 this.comorbidity = new ArrayList<CodeableReference>(); 156 return this.comorbidity; 157 } 158 159 /** 160 * @return Returns a reference to <code>this</code> for easy method chaining 161 */ 162 public ClinicalUseIssueContraindicationComponent setComorbidity(List<CodeableReference> theComorbidity) { 163 this.comorbidity = theComorbidity; 164 return this; 165 } 166 167 public boolean hasComorbidity() { 168 if (this.comorbidity == null) 169 return false; 170 for (CodeableReference item : this.comorbidity) 171 if (!item.isEmpty()) 172 return true; 173 return false; 174 } 175 176 public CodeableReference addComorbidity() { //3 177 CodeableReference t = new CodeableReference(); 178 if (this.comorbidity == null) 179 this.comorbidity = new ArrayList<CodeableReference>(); 180 this.comorbidity.add(t); 181 return t; 182 } 183 184 public ClinicalUseIssueContraindicationComponent addComorbidity(CodeableReference t) { //3 185 if (t == null) 186 return this; 187 if (this.comorbidity == null) 188 this.comorbidity = new ArrayList<CodeableReference>(); 189 this.comorbidity.add(t); 190 return this; 191 } 192 193 /** 194 * @return The first repetition of repeating field {@link #comorbidity}, creating it if it does not already exist {3} 195 */ 196 public CodeableReference getComorbidityFirstRep() { 197 if (getComorbidity().isEmpty()) { 198 addComorbidity(); 199 } 200 return getComorbidity().get(0); 201 } 202 203 /** 204 * @return {@link #indication} (The indication which this is a contraidication for.) 205 */ 206 public List<Reference> getIndication() { 207 if (this.indication == null) 208 this.indication = new ArrayList<Reference>(); 209 return this.indication; 210 } 211 212 /** 213 * @return Returns a reference to <code>this</code> for easy method chaining 214 */ 215 public ClinicalUseIssueContraindicationComponent setIndication(List<Reference> theIndication) { 216 this.indication = theIndication; 217 return this; 218 } 219 220 public boolean hasIndication() { 221 if (this.indication == null) 222 return false; 223 for (Reference item : this.indication) 224 if (!item.isEmpty()) 225 return true; 226 return false; 227 } 228 229 public Reference addIndication() { //3 230 Reference t = new Reference(); 231 if (this.indication == null) 232 this.indication = new ArrayList<Reference>(); 233 this.indication.add(t); 234 return t; 235 } 236 237 public ClinicalUseIssueContraindicationComponent addIndication(Reference t) { //3 238 if (t == null) 239 return this; 240 if (this.indication == null) 241 this.indication = new ArrayList<Reference>(); 242 this.indication.add(t); 243 return this; 244 } 245 246 /** 247 * @return The first repetition of repeating field {@link #indication}, creating it if it does not already exist {3} 248 */ 249 public Reference getIndicationFirstRep() { 250 if (getIndication().isEmpty()) { 251 addIndication(); 252 } 253 return getIndication().get(0); 254 } 255 256 /** 257 * @return {@link #otherTherapy} (Information about the use of the medicinal product in relation to other therapies described as part of the contraindication.) 258 */ 259 public List<ClinicalUseIssueContraindicationOtherTherapyComponent> getOtherTherapy() { 260 if (this.otherTherapy == null) 261 this.otherTherapy = new ArrayList<ClinicalUseIssueContraindicationOtherTherapyComponent>(); 262 return this.otherTherapy; 263 } 264 265 /** 266 * @return Returns a reference to <code>this</code> for easy method chaining 267 */ 268 public ClinicalUseIssueContraindicationComponent setOtherTherapy(List<ClinicalUseIssueContraindicationOtherTherapyComponent> theOtherTherapy) { 269 this.otherTherapy = theOtherTherapy; 270 return this; 271 } 272 273 public boolean hasOtherTherapy() { 274 if (this.otherTherapy == null) 275 return false; 276 for (ClinicalUseIssueContraindicationOtherTherapyComponent item : this.otherTherapy) 277 if (!item.isEmpty()) 278 return true; 279 return false; 280 } 281 282 public ClinicalUseIssueContraindicationOtherTherapyComponent addOtherTherapy() { //3 283 ClinicalUseIssueContraindicationOtherTherapyComponent t = new ClinicalUseIssueContraindicationOtherTherapyComponent(); 284 if (this.otherTherapy == null) 285 this.otherTherapy = new ArrayList<ClinicalUseIssueContraindicationOtherTherapyComponent>(); 286 this.otherTherapy.add(t); 287 return t; 288 } 289 290 public ClinicalUseIssueContraindicationComponent addOtherTherapy(ClinicalUseIssueContraindicationOtherTherapyComponent t) { //3 291 if (t == null) 292 return this; 293 if (this.otherTherapy == null) 294 this.otherTherapy = new ArrayList<ClinicalUseIssueContraindicationOtherTherapyComponent>(); 295 this.otherTherapy.add(t); 296 return this; 297 } 298 299 /** 300 * @return The first repetition of repeating field {@link #otherTherapy}, creating it if it does not already exist {3} 301 */ 302 public ClinicalUseIssueContraindicationOtherTherapyComponent getOtherTherapyFirstRep() { 303 if (getOtherTherapy().isEmpty()) { 304 addOtherTherapy(); 305 } 306 return getOtherTherapy().get(0); 307 } 308 309 protected void listChildren(List<Property> children) { 310 super.listChildren(children); 311 children.add(new Property("diseaseSymptomProcedure", "CodeableReference(ObservationDefinition)", "The situation that is being documented as contraindicating against this item.", 0, 1, diseaseSymptomProcedure)); 312 children.add(new Property("diseaseStatus", "CodeableReference(ObservationDefinition)", "The status of the disease or symptom for the contraindication.", 0, 1, diseaseStatus)); 313 children.add(new Property("comorbidity", "CodeableReference(ObservationDefinition)", "A comorbidity (concurrent condition) or coinfection.", 0, java.lang.Integer.MAX_VALUE, comorbidity)); 314 children.add(new Property("indication", "Reference(ClinicalUseIssue)", "The indication which this is a contraidication for.", 0, java.lang.Integer.MAX_VALUE, indication)); 315 children.add(new Property("otherTherapy", "", "Information about the use of the medicinal product in relation to other therapies described as part of the contraindication.", 0, java.lang.Integer.MAX_VALUE, otherTherapy)); 316 } 317 318 @Override 319 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 320 switch (_hash) { 321 case -1497395130: /*diseaseSymptomProcedure*/ return new Property("diseaseSymptomProcedure", "CodeableReference(ObservationDefinition)", "The situation that is being documented as contraindicating against this item.", 0, 1, diseaseSymptomProcedure); 322 case -505503602: /*diseaseStatus*/ return new Property("diseaseStatus", "CodeableReference(ObservationDefinition)", "The status of the disease or symptom for the contraindication.", 0, 1, diseaseStatus); 323 case -406395211: /*comorbidity*/ return new Property("comorbidity", "CodeableReference(ObservationDefinition)", "A comorbidity (concurrent condition) or coinfection.", 0, java.lang.Integer.MAX_VALUE, comorbidity); 324 case -597168804: /*indication*/ return new Property("indication", "Reference(ClinicalUseIssue)", "The indication which this is a contraidication for.", 0, java.lang.Integer.MAX_VALUE, indication); 325 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 contraindication.", 0, java.lang.Integer.MAX_VALUE, otherTherapy); 326 default: return super.getNamedProperty(_hash, _name, _checkValid); 327 } 328 329 } 330 331 @Override 332 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 333 switch (hash) { 334 case -1497395130: /*diseaseSymptomProcedure*/ return this.diseaseSymptomProcedure == null ? new Base[0] : new Base[] {this.diseaseSymptomProcedure}; // CodeableReference 335 case -505503602: /*diseaseStatus*/ return this.diseaseStatus == null ? new Base[0] : new Base[] {this.diseaseStatus}; // CodeableReference 336 case -406395211: /*comorbidity*/ return this.comorbidity == null ? new Base[0] : this.comorbidity.toArray(new Base[this.comorbidity.size()]); // CodeableReference 337 case -597168804: /*indication*/ return this.indication == null ? new Base[0] : this.indication.toArray(new Base[this.indication.size()]); // Reference 338 case -544509127: /*otherTherapy*/ return this.otherTherapy == null ? new Base[0] : this.otherTherapy.toArray(new Base[this.otherTherapy.size()]); // ClinicalUseIssueContraindicationOtherTherapyComponent 339 default: return super.getProperty(hash, name, checkValid); 340 } 341 342 } 343 344 @Override 345 public Base setProperty(int hash, String name, Base value) throws FHIRException { 346 switch (hash) { 347 case -1497395130: // diseaseSymptomProcedure 348 this.diseaseSymptomProcedure = TypeConvertor.castToCodeableReference(value); // CodeableReference 349 return value; 350 case -505503602: // diseaseStatus 351 this.diseaseStatus = TypeConvertor.castToCodeableReference(value); // CodeableReference 352 return value; 353 case -406395211: // comorbidity 354 this.getComorbidity().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference 355 return value; 356 case -597168804: // indication 357 this.getIndication().add(TypeConvertor.castToReference(value)); // Reference 358 return value; 359 case -544509127: // otherTherapy 360 this.getOtherTherapy().add((ClinicalUseIssueContraindicationOtherTherapyComponent) value); // ClinicalUseIssueContraindicationOtherTherapyComponent 361 return value; 362 default: return super.setProperty(hash, name, value); 363 } 364 365 } 366 367 @Override 368 public Base setProperty(String name, Base value) throws FHIRException { 369 if (name.equals("diseaseSymptomProcedure")) { 370 this.diseaseSymptomProcedure = TypeConvertor.castToCodeableReference(value); // CodeableReference 371 } else if (name.equals("diseaseStatus")) { 372 this.diseaseStatus = TypeConvertor.castToCodeableReference(value); // CodeableReference 373 } else if (name.equals("comorbidity")) { 374 this.getComorbidity().add(TypeConvertor.castToCodeableReference(value)); 375 } else if (name.equals("indication")) { 376 this.getIndication().add(TypeConvertor.castToReference(value)); 377 } else if (name.equals("otherTherapy")) { 378 this.getOtherTherapy().add((ClinicalUseIssueContraindicationOtherTherapyComponent) value); 379 } else 380 return super.setProperty(name, value); 381 return value; 382 } 383 384 @Override 385 public Base makeProperty(int hash, String name) throws FHIRException { 386 switch (hash) { 387 case -1497395130: return getDiseaseSymptomProcedure(); 388 case -505503602: return getDiseaseStatus(); 389 case -406395211: return addComorbidity(); 390 case -597168804: return addIndication(); 391 case -544509127: return addOtherTherapy(); 392 default: return super.makeProperty(hash, name); 393 } 394 395 } 396 397 @Override 398 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 399 switch (hash) { 400 case -1497395130: /*diseaseSymptomProcedure*/ return new String[] {"CodeableReference"}; 401 case -505503602: /*diseaseStatus*/ return new String[] {"CodeableReference"}; 402 case -406395211: /*comorbidity*/ return new String[] {"CodeableReference"}; 403 case -597168804: /*indication*/ return new String[] {"Reference"}; 404 case -544509127: /*otherTherapy*/ return new String[] {}; 405 default: return super.getTypesForProperty(hash, name); 406 } 407 408 } 409 410 @Override 411 public Base addChild(String name) throws FHIRException { 412 if (name.equals("diseaseSymptomProcedure")) { 413 this.diseaseSymptomProcedure = new CodeableReference(); 414 return this.diseaseSymptomProcedure; 415 } 416 else if (name.equals("diseaseStatus")) { 417 this.diseaseStatus = new CodeableReference(); 418 return this.diseaseStatus; 419 } 420 else if (name.equals("comorbidity")) { 421 return addComorbidity(); 422 } 423 else if (name.equals("indication")) { 424 return addIndication(); 425 } 426 else if (name.equals("otherTherapy")) { 427 return addOtherTherapy(); 428 } 429 else 430 return super.addChild(name); 431 } 432 433 public ClinicalUseIssueContraindicationComponent copy() { 434 ClinicalUseIssueContraindicationComponent dst = new ClinicalUseIssueContraindicationComponent(); 435 copyValues(dst); 436 return dst; 437 } 438 439 public void copyValues(ClinicalUseIssueContraindicationComponent dst) { 440 super.copyValues(dst); 441 dst.diseaseSymptomProcedure = diseaseSymptomProcedure == null ? null : diseaseSymptomProcedure.copy(); 442 dst.diseaseStatus = diseaseStatus == null ? null : diseaseStatus.copy(); 443 if (comorbidity != null) { 444 dst.comorbidity = new ArrayList<CodeableReference>(); 445 for (CodeableReference i : comorbidity) 446 dst.comorbidity.add(i.copy()); 447 }; 448 if (indication != null) { 449 dst.indication = new ArrayList<Reference>(); 450 for (Reference i : indication) 451 dst.indication.add(i.copy()); 452 }; 453 if (otherTherapy != null) { 454 dst.otherTherapy = new ArrayList<ClinicalUseIssueContraindicationOtherTherapyComponent>(); 455 for (ClinicalUseIssueContraindicationOtherTherapyComponent i : otherTherapy) 456 dst.otherTherapy.add(i.copy()); 457 }; 458 } 459 460 @Override 461 public boolean equalsDeep(Base other_) { 462 if (!super.equalsDeep(other_)) 463 return false; 464 if (!(other_ instanceof ClinicalUseIssueContraindicationComponent)) 465 return false; 466 ClinicalUseIssueContraindicationComponent o = (ClinicalUseIssueContraindicationComponent) other_; 467 return compareDeep(diseaseSymptomProcedure, o.diseaseSymptomProcedure, true) && compareDeep(diseaseStatus, o.diseaseStatus, true) 468 && compareDeep(comorbidity, o.comorbidity, true) && compareDeep(indication, o.indication, true) 469 && compareDeep(otherTherapy, o.otherTherapy, true); 470 } 471 472 @Override 473 public boolean equalsShallow(Base other_) { 474 if (!super.equalsShallow(other_)) 475 return false; 476 if (!(other_ instanceof ClinicalUseIssueContraindicationComponent)) 477 return false; 478 ClinicalUseIssueContraindicationComponent o = (ClinicalUseIssueContraindicationComponent) other_; 479 return true; 480 } 481 482 public boolean isEmpty() { 483 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(diseaseSymptomProcedure, diseaseStatus 484 , comorbidity, indication, otherTherapy); 485 } 486 487 public String fhirType() { 488 return "ClinicalUseIssue.contraindication"; 489 490 } 491 492 } 493 494 @Block() 495 public static class ClinicalUseIssueContraindicationOtherTherapyComponent extends BackboneElement implements IBaseBackboneElement { 496 /** 497 * The type of relationship between the medicinal product indication or contraindication and another therapy. 498 */ 499 @Child(name = "relationshipType", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) 500 @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." ) 501 protected CodeableConcept relationshipType; 502 503 /** 504 * Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication. 505 */ 506 @Child(name = "therapy", type = {CodeableReference.class}, order=2, min=1, max=1, modifier=false, summary=true) 507 @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." ) 508 protected CodeableReference therapy; 509 510 private static final long serialVersionUID = -363440718L; 511 512 /** 513 * Constructor 514 */ 515 public ClinicalUseIssueContraindicationOtherTherapyComponent() { 516 super(); 517 } 518 519 /** 520 * Constructor 521 */ 522 public ClinicalUseIssueContraindicationOtherTherapyComponent(CodeableConcept relationshipType, CodeableReference therapy) { 523 super(); 524 this.setRelationshipType(relationshipType); 525 this.setTherapy(therapy); 526 } 527 528 /** 529 * @return {@link #relationshipType} (The type of relationship between the medicinal product indication or contraindication and another therapy.) 530 */ 531 public CodeableConcept getRelationshipType() { 532 if (this.relationshipType == null) 533 if (Configuration.errorOnAutoCreate()) 534 throw new Error("Attempt to auto-create ClinicalUseIssueContraindicationOtherTherapyComponent.relationshipType"); 535 else if (Configuration.doAutoCreate()) 536 this.relationshipType = new CodeableConcept(); // cc 537 return this.relationshipType; 538 } 539 540 public boolean hasRelationshipType() { 541 return this.relationshipType != null && !this.relationshipType.isEmpty(); 542 } 543 544 /** 545 * @param value {@link #relationshipType} (The type of relationship between the medicinal product indication or contraindication and another therapy.) 546 */ 547 public ClinicalUseIssueContraindicationOtherTherapyComponent setRelationshipType(CodeableConcept value) { 548 this.relationshipType = value; 549 return this; 550 } 551 552 /** 553 * @return {@link #therapy} (Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.) 554 */ 555 public CodeableReference getTherapy() { 556 if (this.therapy == null) 557 if (Configuration.errorOnAutoCreate()) 558 throw new Error("Attempt to auto-create ClinicalUseIssueContraindicationOtherTherapyComponent.therapy"); 559 else if (Configuration.doAutoCreate()) 560 this.therapy = new CodeableReference(); // cc 561 return this.therapy; 562 } 563 564 public boolean hasTherapy() { 565 return this.therapy != null && !this.therapy.isEmpty(); 566 } 567 568 /** 569 * @param value {@link #therapy} (Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.) 570 */ 571 public ClinicalUseIssueContraindicationOtherTherapyComponent setTherapy(CodeableReference value) { 572 this.therapy = value; 573 return this; 574 } 575 576 protected void listChildren(List<Property> children) { 577 super.listChildren(children); 578 children.add(new Property("relationshipType", "CodeableConcept", "The type of relationship between the medicinal product indication or contraindication and another therapy.", 0, 1, relationshipType)); 579 children.add(new Property("therapy", "CodeableReference(MedicinalProductDefinition|Medication|Substance|SubstanceDefinition|ActivityDefinition)", "Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.", 0, 1, therapy)); 580 } 581 582 @Override 583 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 584 switch (_hash) { 585 case -1602839150: /*relationshipType*/ return new Property("relationshipType", "CodeableConcept", "The type of relationship between the medicinal product indication or contraindication and another therapy.", 0, 1, relationshipType); 586 case -1349555095: /*therapy*/ return new Property("therapy", "CodeableReference(MedicinalProductDefinition|Medication|Substance|SubstanceDefinition|ActivityDefinition)", "Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.", 0, 1, therapy); 587 default: return super.getNamedProperty(_hash, _name, _checkValid); 588 } 589 590 } 591 592 @Override 593 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 594 switch (hash) { 595 case -1602839150: /*relationshipType*/ return this.relationshipType == null ? new Base[0] : new Base[] {this.relationshipType}; // CodeableConcept 596 case -1349555095: /*therapy*/ return this.therapy == null ? new Base[0] : new Base[] {this.therapy}; // CodeableReference 597 default: return super.getProperty(hash, name, checkValid); 598 } 599 600 } 601 602 @Override 603 public Base setProperty(int hash, String name, Base value) throws FHIRException { 604 switch (hash) { 605 case -1602839150: // relationshipType 606 this.relationshipType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 607 return value; 608 case -1349555095: // therapy 609 this.therapy = TypeConvertor.castToCodeableReference(value); // CodeableReference 610 return value; 611 default: return super.setProperty(hash, name, value); 612 } 613 614 } 615 616 @Override 617 public Base setProperty(String name, Base value) throws FHIRException { 618 if (name.equals("relationshipType")) { 619 this.relationshipType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 620 } else if (name.equals("therapy")) { 621 this.therapy = TypeConvertor.castToCodeableReference(value); // CodeableReference 622 } else 623 return super.setProperty(name, value); 624 return value; 625 } 626 627 @Override 628 public Base makeProperty(int hash, String name) throws FHIRException { 629 switch (hash) { 630 case -1602839150: return getRelationshipType(); 631 case -1349555095: return getTherapy(); 632 default: return super.makeProperty(hash, name); 633 } 634 635 } 636 637 @Override 638 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 639 switch (hash) { 640 case -1602839150: /*relationshipType*/ return new String[] {"CodeableConcept"}; 641 case -1349555095: /*therapy*/ return new String[] {"CodeableReference"}; 642 default: return super.getTypesForProperty(hash, name); 643 } 644 645 } 646 647 @Override 648 public Base addChild(String name) throws FHIRException { 649 if (name.equals("relationshipType")) { 650 this.relationshipType = new CodeableConcept(); 651 return this.relationshipType; 652 } 653 else if (name.equals("therapy")) { 654 this.therapy = new CodeableReference(); 655 return this.therapy; 656 } 657 else 658 return super.addChild(name); 659 } 660 661 public ClinicalUseIssueContraindicationOtherTherapyComponent copy() { 662 ClinicalUseIssueContraindicationOtherTherapyComponent dst = new ClinicalUseIssueContraindicationOtherTherapyComponent(); 663 copyValues(dst); 664 return dst; 665 } 666 667 public void copyValues(ClinicalUseIssueContraindicationOtherTherapyComponent dst) { 668 super.copyValues(dst); 669 dst.relationshipType = relationshipType == null ? null : relationshipType.copy(); 670 dst.therapy = therapy == null ? null : therapy.copy(); 671 } 672 673 @Override 674 public boolean equalsDeep(Base other_) { 675 if (!super.equalsDeep(other_)) 676 return false; 677 if (!(other_ instanceof ClinicalUseIssueContraindicationOtherTherapyComponent)) 678 return false; 679 ClinicalUseIssueContraindicationOtherTherapyComponent o = (ClinicalUseIssueContraindicationOtherTherapyComponent) other_; 680 return compareDeep(relationshipType, o.relationshipType, true) && compareDeep(therapy, o.therapy, true) 681 ; 682 } 683 684 @Override 685 public boolean equalsShallow(Base other_) { 686 if (!super.equalsShallow(other_)) 687 return false; 688 if (!(other_ instanceof ClinicalUseIssueContraindicationOtherTherapyComponent)) 689 return false; 690 ClinicalUseIssueContraindicationOtherTherapyComponent o = (ClinicalUseIssueContraindicationOtherTherapyComponent) other_; 691 return true; 692 } 693 694 public boolean isEmpty() { 695 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(relationshipType, therapy 696 ); 697 } 698 699 public String fhirType() { 700 return "ClinicalUseIssue.contraindication.otherTherapy"; 701 702 } 703 704 } 705 706 @Block() 707 public static class ClinicalUseIssueIndicationComponent extends BackboneElement implements IBaseBackboneElement { 708 /** 709 * The situation that is being documented as an indicaton for this item. 710 */ 711 @Child(name = "diseaseSymptomProcedure", type = {CodeableReference.class}, order=1, min=0, max=1, modifier=false, summary=true) 712 @Description(shortDefinition="The situation that is being documented as an indicaton for this item", formalDefinition="The situation that is being documented as an indicaton for this item." ) 713 protected CodeableReference diseaseSymptomProcedure; 714 715 /** 716 * The status of the disease or symptom for the indication. 717 */ 718 @Child(name = "diseaseStatus", type = {CodeableReference.class}, order=2, min=0, max=1, modifier=false, summary=true) 719 @Description(shortDefinition="The status of the disease or symptom for the indication", formalDefinition="The status of the disease or symptom for the indication." ) 720 protected CodeableReference diseaseStatus; 721 722 /** 723 * A comorbidity (concurrent condition) or coinfection as part of the indication. 724 */ 725 @Child(name = "comorbidity", type = {CodeableReference.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 726 @Description(shortDefinition="A comorbidity (concurrent condition) or coinfection as part of the indication", formalDefinition="A comorbidity (concurrent condition) or coinfection as part of the indication." ) 727 protected List<CodeableReference> comorbidity; 728 729 /** 730 * The intended effect, aim or strategy to be achieved. 731 */ 732 @Child(name = "intendedEffect", type = {CodeableReference.class}, order=4, min=0, max=1, modifier=false, summary=true) 733 @Description(shortDefinition="The intended effect, aim or strategy to be achieved", formalDefinition="The intended effect, aim or strategy to be achieved." ) 734 protected CodeableReference intendedEffect; 735 736 /** 737 * Timing or duration information. 738 */ 739 @Child(name = "duration", type = {Quantity.class}, order=5, min=0, max=1, modifier=false, summary=true) 740 @Description(shortDefinition="Timing or duration information", formalDefinition="Timing or duration information." ) 741 protected Quantity duration; 742 743 /** 744 * The specific undesirable effects of the medicinal product. 745 */ 746 @Child(name = "undesirableEffect", type = {ClinicalUseIssue.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 747 @Description(shortDefinition="The specific undesirable effects of the medicinal product", formalDefinition="The specific undesirable effects of the medicinal product." ) 748 protected List<Reference> undesirableEffect; 749 750 /** 751 * Information about the use of the medicinal product in relation to other therapies described as part of the indication. 752 */ 753 @Child(name = "otherTherapy", type = {ClinicalUseIssueContraindicationOtherTherapyComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 754 @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." ) 755 protected List<ClinicalUseIssueContraindicationOtherTherapyComponent> otherTherapy; 756 757 private static final long serialVersionUID = 1637864097L; 758 759 /** 760 * Constructor 761 */ 762 public ClinicalUseIssueIndicationComponent() { 763 super(); 764 } 765 766 /** 767 * @return {@link #diseaseSymptomProcedure} (The situation that is being documented as an indicaton for this item.) 768 */ 769 public CodeableReference getDiseaseSymptomProcedure() { 770 if (this.diseaseSymptomProcedure == null) 771 if (Configuration.errorOnAutoCreate()) 772 throw new Error("Attempt to auto-create ClinicalUseIssueIndicationComponent.diseaseSymptomProcedure"); 773 else if (Configuration.doAutoCreate()) 774 this.diseaseSymptomProcedure = new CodeableReference(); // cc 775 return this.diseaseSymptomProcedure; 776 } 777 778 public boolean hasDiseaseSymptomProcedure() { 779 return this.diseaseSymptomProcedure != null && !this.diseaseSymptomProcedure.isEmpty(); 780 } 781 782 /** 783 * @param value {@link #diseaseSymptomProcedure} (The situation that is being documented as an indicaton for this item.) 784 */ 785 public ClinicalUseIssueIndicationComponent setDiseaseSymptomProcedure(CodeableReference value) { 786 this.diseaseSymptomProcedure = value; 787 return this; 788 } 789 790 /** 791 * @return {@link #diseaseStatus} (The status of the disease or symptom for the indication.) 792 */ 793 public CodeableReference getDiseaseStatus() { 794 if (this.diseaseStatus == null) 795 if (Configuration.errorOnAutoCreate()) 796 throw new Error("Attempt to auto-create ClinicalUseIssueIndicationComponent.diseaseStatus"); 797 else if (Configuration.doAutoCreate()) 798 this.diseaseStatus = new CodeableReference(); // cc 799 return this.diseaseStatus; 800 } 801 802 public boolean hasDiseaseStatus() { 803 return this.diseaseStatus != null && !this.diseaseStatus.isEmpty(); 804 } 805 806 /** 807 * @param value {@link #diseaseStatus} (The status of the disease or symptom for the indication.) 808 */ 809 public ClinicalUseIssueIndicationComponent setDiseaseStatus(CodeableReference value) { 810 this.diseaseStatus = value; 811 return this; 812 } 813 814 /** 815 * @return {@link #comorbidity} (A comorbidity (concurrent condition) or coinfection as part of the indication.) 816 */ 817 public List<CodeableReference> getComorbidity() { 818 if (this.comorbidity == null) 819 this.comorbidity = new ArrayList<CodeableReference>(); 820 return this.comorbidity; 821 } 822 823 /** 824 * @return Returns a reference to <code>this</code> for easy method chaining 825 */ 826 public ClinicalUseIssueIndicationComponent setComorbidity(List<CodeableReference> theComorbidity) { 827 this.comorbidity = theComorbidity; 828 return this; 829 } 830 831 public boolean hasComorbidity() { 832 if (this.comorbidity == null) 833 return false; 834 for (CodeableReference item : this.comorbidity) 835 if (!item.isEmpty()) 836 return true; 837 return false; 838 } 839 840 public CodeableReference addComorbidity() { //3 841 CodeableReference t = new CodeableReference(); 842 if (this.comorbidity == null) 843 this.comorbidity = new ArrayList<CodeableReference>(); 844 this.comorbidity.add(t); 845 return t; 846 } 847 848 public ClinicalUseIssueIndicationComponent addComorbidity(CodeableReference t) { //3 849 if (t == null) 850 return this; 851 if (this.comorbidity == null) 852 this.comorbidity = new ArrayList<CodeableReference>(); 853 this.comorbidity.add(t); 854 return this; 855 } 856 857 /** 858 * @return The first repetition of repeating field {@link #comorbidity}, creating it if it does not already exist {3} 859 */ 860 public CodeableReference getComorbidityFirstRep() { 861 if (getComorbidity().isEmpty()) { 862 addComorbidity(); 863 } 864 return getComorbidity().get(0); 865 } 866 867 /** 868 * @return {@link #intendedEffect} (The intended effect, aim or strategy to be achieved.) 869 */ 870 public CodeableReference getIntendedEffect() { 871 if (this.intendedEffect == null) 872 if (Configuration.errorOnAutoCreate()) 873 throw new Error("Attempt to auto-create ClinicalUseIssueIndicationComponent.intendedEffect"); 874 else if (Configuration.doAutoCreate()) 875 this.intendedEffect = new CodeableReference(); // cc 876 return this.intendedEffect; 877 } 878 879 public boolean hasIntendedEffect() { 880 return this.intendedEffect != null && !this.intendedEffect.isEmpty(); 881 } 882 883 /** 884 * @param value {@link #intendedEffect} (The intended effect, aim or strategy to be achieved.) 885 */ 886 public ClinicalUseIssueIndicationComponent setIntendedEffect(CodeableReference value) { 887 this.intendedEffect = value; 888 return this; 889 } 890 891 /** 892 * @return {@link #duration} (Timing or duration information.) 893 */ 894 public Quantity getDuration() { 895 if (this.duration == null) 896 if (Configuration.errorOnAutoCreate()) 897 throw new Error("Attempt to auto-create ClinicalUseIssueIndicationComponent.duration"); 898 else if (Configuration.doAutoCreate()) 899 this.duration = new Quantity(); // cc 900 return this.duration; 901 } 902 903 public boolean hasDuration() { 904 return this.duration != null && !this.duration.isEmpty(); 905 } 906 907 /** 908 * @param value {@link #duration} (Timing or duration information.) 909 */ 910 public ClinicalUseIssueIndicationComponent setDuration(Quantity value) { 911 this.duration = value; 912 return this; 913 } 914 915 /** 916 * @return {@link #undesirableEffect} (The specific undesirable effects of the medicinal product.) 917 */ 918 public List<Reference> getUndesirableEffect() { 919 if (this.undesirableEffect == null) 920 this.undesirableEffect = new ArrayList<Reference>(); 921 return this.undesirableEffect; 922 } 923 924 /** 925 * @return Returns a reference to <code>this</code> for easy method chaining 926 */ 927 public ClinicalUseIssueIndicationComponent setUndesirableEffect(List<Reference> theUndesirableEffect) { 928 this.undesirableEffect = theUndesirableEffect; 929 return this; 930 } 931 932 public boolean hasUndesirableEffect() { 933 if (this.undesirableEffect == null) 934 return false; 935 for (Reference item : this.undesirableEffect) 936 if (!item.isEmpty()) 937 return true; 938 return false; 939 } 940 941 public Reference addUndesirableEffect() { //3 942 Reference t = new Reference(); 943 if (this.undesirableEffect == null) 944 this.undesirableEffect = new ArrayList<Reference>(); 945 this.undesirableEffect.add(t); 946 return t; 947 } 948 949 public ClinicalUseIssueIndicationComponent addUndesirableEffect(Reference t) { //3 950 if (t == null) 951 return this; 952 if (this.undesirableEffect == null) 953 this.undesirableEffect = new ArrayList<Reference>(); 954 this.undesirableEffect.add(t); 955 return this; 956 } 957 958 /** 959 * @return The first repetition of repeating field {@link #undesirableEffect}, creating it if it does not already exist {3} 960 */ 961 public Reference getUndesirableEffectFirstRep() { 962 if (getUndesirableEffect().isEmpty()) { 963 addUndesirableEffect(); 964 } 965 return getUndesirableEffect().get(0); 966 } 967 968 /** 969 * @return {@link #otherTherapy} (Information about the use of the medicinal product in relation to other therapies described as part of the indication.) 970 */ 971 public List<ClinicalUseIssueContraindicationOtherTherapyComponent> getOtherTherapy() { 972 if (this.otherTherapy == null) 973 this.otherTherapy = new ArrayList<ClinicalUseIssueContraindicationOtherTherapyComponent>(); 974 return this.otherTherapy; 975 } 976 977 /** 978 * @return Returns a reference to <code>this</code> for easy method chaining 979 */ 980 public ClinicalUseIssueIndicationComponent setOtherTherapy(List<ClinicalUseIssueContraindicationOtherTherapyComponent> theOtherTherapy) { 981 this.otherTherapy = theOtherTherapy; 982 return this; 983 } 984 985 public boolean hasOtherTherapy() { 986 if (this.otherTherapy == null) 987 return false; 988 for (ClinicalUseIssueContraindicationOtherTherapyComponent item : this.otherTherapy) 989 if (!item.isEmpty()) 990 return true; 991 return false; 992 } 993 994 public ClinicalUseIssueContraindicationOtherTherapyComponent addOtherTherapy() { //3 995 ClinicalUseIssueContraindicationOtherTherapyComponent t = new ClinicalUseIssueContraindicationOtherTherapyComponent(); 996 if (this.otherTherapy == null) 997 this.otherTherapy = new ArrayList<ClinicalUseIssueContraindicationOtherTherapyComponent>(); 998 this.otherTherapy.add(t); 999 return t; 1000 } 1001 1002 public ClinicalUseIssueIndicationComponent addOtherTherapy(ClinicalUseIssueContraindicationOtherTherapyComponent t) { //3 1003 if (t == null) 1004 return this; 1005 if (this.otherTherapy == null) 1006 this.otherTherapy = new ArrayList<ClinicalUseIssueContraindicationOtherTherapyComponent>(); 1007 this.otherTherapy.add(t); 1008 return this; 1009 } 1010 1011 /** 1012 * @return The first repetition of repeating field {@link #otherTherapy}, creating it if it does not already exist {3} 1013 */ 1014 public ClinicalUseIssueContraindicationOtherTherapyComponent getOtherTherapyFirstRep() { 1015 if (getOtherTherapy().isEmpty()) { 1016 addOtherTherapy(); 1017 } 1018 return getOtherTherapy().get(0); 1019 } 1020 1021 protected void listChildren(List<Property> children) { 1022 super.listChildren(children); 1023 children.add(new Property("diseaseSymptomProcedure", "CodeableReference(ObservationDefinition)", "The situation that is being documented as an indicaton for this item.", 0, 1, diseaseSymptomProcedure)); 1024 children.add(new Property("diseaseStatus", "CodeableReference(ObservationDefinition)", "The status of the disease or symptom for the indication.", 0, 1, diseaseStatus)); 1025 children.add(new Property("comorbidity", "CodeableReference(ObservationDefinition)", "A comorbidity (concurrent condition) or coinfection as part of the indication.", 0, java.lang.Integer.MAX_VALUE, comorbidity)); 1026 children.add(new Property("intendedEffect", "CodeableReference(ObservationDefinition)", "The intended effect, aim or strategy to be achieved.", 0, 1, intendedEffect)); 1027 children.add(new Property("duration", "Quantity", "Timing or duration information.", 0, 1, duration)); 1028 children.add(new Property("undesirableEffect", "Reference(ClinicalUseIssue)", "The specific undesirable effects of the medicinal product.", 0, java.lang.Integer.MAX_VALUE, undesirableEffect)); 1029 children.add(new Property("otherTherapy", "@ClinicalUseIssue.contraindication.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)); 1030 } 1031 1032 @Override 1033 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1034 switch (_hash) { 1035 case -1497395130: /*diseaseSymptomProcedure*/ return new Property("diseaseSymptomProcedure", "CodeableReference(ObservationDefinition)", "The situation that is being documented as an indicaton for this item.", 0, 1, diseaseSymptomProcedure); 1036 case -505503602: /*diseaseStatus*/ return new Property("diseaseStatus", "CodeableReference(ObservationDefinition)", "The status of the disease or symptom for the indication.", 0, 1, diseaseStatus); 1037 case -406395211: /*comorbidity*/ return new Property("comorbidity", "CodeableReference(ObservationDefinition)", "A comorbidity (concurrent condition) or coinfection as part of the indication.", 0, java.lang.Integer.MAX_VALUE, comorbidity); 1038 case 1587112348: /*intendedEffect*/ return new Property("intendedEffect", "CodeableReference(ObservationDefinition)", "The intended effect, aim or strategy to be achieved.", 0, 1, intendedEffect); 1039 case -1992012396: /*duration*/ return new Property("duration", "Quantity", "Timing or duration information.", 0, 1, duration); 1040 case 444367565: /*undesirableEffect*/ return new Property("undesirableEffect", "Reference(ClinicalUseIssue)", "The specific undesirable effects of the medicinal product.", 0, java.lang.Integer.MAX_VALUE, undesirableEffect); 1041 case -544509127: /*otherTherapy*/ return new Property("otherTherapy", "@ClinicalUseIssue.contraindication.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); 1042 default: return super.getNamedProperty(_hash, _name, _checkValid); 1043 } 1044 1045 } 1046 1047 @Override 1048 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1049 switch (hash) { 1050 case -1497395130: /*diseaseSymptomProcedure*/ return this.diseaseSymptomProcedure == null ? new Base[0] : new Base[] {this.diseaseSymptomProcedure}; // CodeableReference 1051 case -505503602: /*diseaseStatus*/ return this.diseaseStatus == null ? new Base[0] : new Base[] {this.diseaseStatus}; // CodeableReference 1052 case -406395211: /*comorbidity*/ return this.comorbidity == null ? new Base[0] : this.comorbidity.toArray(new Base[this.comorbidity.size()]); // CodeableReference 1053 case 1587112348: /*intendedEffect*/ return this.intendedEffect == null ? new Base[0] : new Base[] {this.intendedEffect}; // CodeableReference 1054 case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // Quantity 1055 case 444367565: /*undesirableEffect*/ return this.undesirableEffect == null ? new Base[0] : this.undesirableEffect.toArray(new Base[this.undesirableEffect.size()]); // Reference 1056 case -544509127: /*otherTherapy*/ return this.otherTherapy == null ? new Base[0] : this.otherTherapy.toArray(new Base[this.otherTherapy.size()]); // ClinicalUseIssueContraindicationOtherTherapyComponent 1057 default: return super.getProperty(hash, name, checkValid); 1058 } 1059 1060 } 1061 1062 @Override 1063 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1064 switch (hash) { 1065 case -1497395130: // diseaseSymptomProcedure 1066 this.diseaseSymptomProcedure = TypeConvertor.castToCodeableReference(value); // CodeableReference 1067 return value; 1068 case -505503602: // diseaseStatus 1069 this.diseaseStatus = TypeConvertor.castToCodeableReference(value); // CodeableReference 1070 return value; 1071 case -406395211: // comorbidity 1072 this.getComorbidity().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference 1073 return value; 1074 case 1587112348: // intendedEffect 1075 this.intendedEffect = TypeConvertor.castToCodeableReference(value); // CodeableReference 1076 return value; 1077 case -1992012396: // duration 1078 this.duration = TypeConvertor.castToQuantity(value); // Quantity 1079 return value; 1080 case 444367565: // undesirableEffect 1081 this.getUndesirableEffect().add(TypeConvertor.castToReference(value)); // Reference 1082 return value; 1083 case -544509127: // otherTherapy 1084 this.getOtherTherapy().add((ClinicalUseIssueContraindicationOtherTherapyComponent) value); // ClinicalUseIssueContraindicationOtherTherapyComponent 1085 return value; 1086 default: return super.setProperty(hash, name, value); 1087 } 1088 1089 } 1090 1091 @Override 1092 public Base setProperty(String name, Base value) throws FHIRException { 1093 if (name.equals("diseaseSymptomProcedure")) { 1094 this.diseaseSymptomProcedure = TypeConvertor.castToCodeableReference(value); // CodeableReference 1095 } else if (name.equals("diseaseStatus")) { 1096 this.diseaseStatus = TypeConvertor.castToCodeableReference(value); // CodeableReference 1097 } else if (name.equals("comorbidity")) { 1098 this.getComorbidity().add(TypeConvertor.castToCodeableReference(value)); 1099 } else if (name.equals("intendedEffect")) { 1100 this.intendedEffect = TypeConvertor.castToCodeableReference(value); // CodeableReference 1101 } else if (name.equals("duration")) { 1102 this.duration = TypeConvertor.castToQuantity(value); // Quantity 1103 } else if (name.equals("undesirableEffect")) { 1104 this.getUndesirableEffect().add(TypeConvertor.castToReference(value)); 1105 } else if (name.equals("otherTherapy")) { 1106 this.getOtherTherapy().add((ClinicalUseIssueContraindicationOtherTherapyComponent) value); 1107 } else 1108 return super.setProperty(name, value); 1109 return value; 1110 } 1111 1112 @Override 1113 public Base makeProperty(int hash, String name) throws FHIRException { 1114 switch (hash) { 1115 case -1497395130: return getDiseaseSymptomProcedure(); 1116 case -505503602: return getDiseaseStatus(); 1117 case -406395211: return addComorbidity(); 1118 case 1587112348: return getIntendedEffect(); 1119 case -1992012396: return getDuration(); 1120 case 444367565: return addUndesirableEffect(); 1121 case -544509127: return addOtherTherapy(); 1122 default: return super.makeProperty(hash, name); 1123 } 1124 1125 } 1126 1127 @Override 1128 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1129 switch (hash) { 1130 case -1497395130: /*diseaseSymptomProcedure*/ return new String[] {"CodeableReference"}; 1131 case -505503602: /*diseaseStatus*/ return new String[] {"CodeableReference"}; 1132 case -406395211: /*comorbidity*/ return new String[] {"CodeableReference"}; 1133 case 1587112348: /*intendedEffect*/ return new String[] {"CodeableReference"}; 1134 case -1992012396: /*duration*/ return new String[] {"Quantity"}; 1135 case 444367565: /*undesirableEffect*/ return new String[] {"Reference"}; 1136 case -544509127: /*otherTherapy*/ return new String[] {"@ClinicalUseIssue.contraindication.otherTherapy"}; 1137 default: return super.getTypesForProperty(hash, name); 1138 } 1139 1140 } 1141 1142 @Override 1143 public Base addChild(String name) throws FHIRException { 1144 if (name.equals("diseaseSymptomProcedure")) { 1145 this.diseaseSymptomProcedure = new CodeableReference(); 1146 return this.diseaseSymptomProcedure; 1147 } 1148 else if (name.equals("diseaseStatus")) { 1149 this.diseaseStatus = new CodeableReference(); 1150 return this.diseaseStatus; 1151 } 1152 else if (name.equals("comorbidity")) { 1153 return addComorbidity(); 1154 } 1155 else if (name.equals("intendedEffect")) { 1156 this.intendedEffect = new CodeableReference(); 1157 return this.intendedEffect; 1158 } 1159 else if (name.equals("duration")) { 1160 this.duration = new Quantity(); 1161 return this.duration; 1162 } 1163 else if (name.equals("undesirableEffect")) { 1164 return addUndesirableEffect(); 1165 } 1166 else if (name.equals("otherTherapy")) { 1167 return addOtherTherapy(); 1168 } 1169 else 1170 return super.addChild(name); 1171 } 1172 1173 public ClinicalUseIssueIndicationComponent copy() { 1174 ClinicalUseIssueIndicationComponent dst = new ClinicalUseIssueIndicationComponent(); 1175 copyValues(dst); 1176 return dst; 1177 } 1178 1179 public void copyValues(ClinicalUseIssueIndicationComponent dst) { 1180 super.copyValues(dst); 1181 dst.diseaseSymptomProcedure = diseaseSymptomProcedure == null ? null : diseaseSymptomProcedure.copy(); 1182 dst.diseaseStatus = diseaseStatus == null ? null : diseaseStatus.copy(); 1183 if (comorbidity != null) { 1184 dst.comorbidity = new ArrayList<CodeableReference>(); 1185 for (CodeableReference i : comorbidity) 1186 dst.comorbidity.add(i.copy()); 1187 }; 1188 dst.intendedEffect = intendedEffect == null ? null : intendedEffect.copy(); 1189 dst.duration = duration == null ? null : duration.copy(); 1190 if (undesirableEffect != null) { 1191 dst.undesirableEffect = new ArrayList<Reference>(); 1192 for (Reference i : undesirableEffect) 1193 dst.undesirableEffect.add(i.copy()); 1194 }; 1195 if (otherTherapy != null) { 1196 dst.otherTherapy = new ArrayList<ClinicalUseIssueContraindicationOtherTherapyComponent>(); 1197 for (ClinicalUseIssueContraindicationOtherTherapyComponent i : otherTherapy) 1198 dst.otherTherapy.add(i.copy()); 1199 }; 1200 } 1201 1202 @Override 1203 public boolean equalsDeep(Base other_) { 1204 if (!super.equalsDeep(other_)) 1205 return false; 1206 if (!(other_ instanceof ClinicalUseIssueIndicationComponent)) 1207 return false; 1208 ClinicalUseIssueIndicationComponent o = (ClinicalUseIssueIndicationComponent) other_; 1209 return compareDeep(diseaseSymptomProcedure, o.diseaseSymptomProcedure, true) && compareDeep(diseaseStatus, o.diseaseStatus, true) 1210 && compareDeep(comorbidity, o.comorbidity, true) && compareDeep(intendedEffect, o.intendedEffect, true) 1211 && compareDeep(duration, o.duration, true) && compareDeep(undesirableEffect, o.undesirableEffect, true) 1212 && compareDeep(otherTherapy, o.otherTherapy, true); 1213 } 1214 1215 @Override 1216 public boolean equalsShallow(Base other_) { 1217 if (!super.equalsShallow(other_)) 1218 return false; 1219 if (!(other_ instanceof ClinicalUseIssueIndicationComponent)) 1220 return false; 1221 ClinicalUseIssueIndicationComponent o = (ClinicalUseIssueIndicationComponent) other_; 1222 return true; 1223 } 1224 1225 public boolean isEmpty() { 1226 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(diseaseSymptomProcedure, diseaseStatus 1227 , comorbidity, intendedEffect, duration, undesirableEffect, otherTherapy); 1228 } 1229 1230 public String fhirType() { 1231 return "ClinicalUseIssue.indication"; 1232 1233 } 1234 1235 } 1236 1237 @Block() 1238 public static class ClinicalUseIssueInteractionComponent extends BackboneElement implements IBaseBackboneElement { 1239 /** 1240 * The specific medication, food, substance or laboratory test that interacts. 1241 */ 1242 @Child(name = "interactant", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1243 @Description(shortDefinition="The specific medication, food, substance or laboratory test that interacts", formalDefinition="The specific medication, food, substance or laboratory test that interacts." ) 1244 protected List<ClinicalUseIssueInteractionInteractantComponent> interactant; 1245 1246 /** 1247 * The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction. 1248 */ 1249 @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 1250 @Description(shortDefinition="The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction", formalDefinition="The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction." ) 1251 protected CodeableConcept type; 1252 1253 /** 1254 * The effect of the interaction, for example "reduced gastric absorption of primary medication". 1255 */ 1256 @Child(name = "effect", type = {CodeableReference.class}, order=3, min=0, max=1, modifier=false, summary=true) 1257 @Description(shortDefinition="The effect of the interaction, for example \"reduced gastric absorption of primary medication\"", formalDefinition="The effect of the interaction, for example \"reduced gastric absorption of primary medication\"." ) 1258 protected CodeableReference effect; 1259 1260 /** 1261 * The incidence of the interaction, e.g. theoretical, observed. 1262 */ 1263 @Child(name = "incidence", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) 1264 @Description(shortDefinition="The incidence of the interaction, e.g. theoretical, observed", formalDefinition="The incidence of the interaction, e.g. theoretical, observed." ) 1265 protected CodeableConcept incidence; 1266 1267 /** 1268 * Actions for managing the interaction. 1269 */ 1270 @Child(name = "management", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1271 @Description(shortDefinition="Actions for managing the interaction", formalDefinition="Actions for managing the interaction." ) 1272 protected List<CodeableConcept> management; 1273 1274 private static final long serialVersionUID = 1233301463L; 1275 1276 /** 1277 * Constructor 1278 */ 1279 public ClinicalUseIssueInteractionComponent() { 1280 super(); 1281 } 1282 1283 /** 1284 * @return {@link #interactant} (The specific medication, food, substance or laboratory test that interacts.) 1285 */ 1286 public List<ClinicalUseIssueInteractionInteractantComponent> getInteractant() { 1287 if (this.interactant == null) 1288 this.interactant = new ArrayList<ClinicalUseIssueInteractionInteractantComponent>(); 1289 return this.interactant; 1290 } 1291 1292 /** 1293 * @return Returns a reference to <code>this</code> for easy method chaining 1294 */ 1295 public ClinicalUseIssueInteractionComponent setInteractant(List<ClinicalUseIssueInteractionInteractantComponent> theInteractant) { 1296 this.interactant = theInteractant; 1297 return this; 1298 } 1299 1300 public boolean hasInteractant() { 1301 if (this.interactant == null) 1302 return false; 1303 for (ClinicalUseIssueInteractionInteractantComponent item : this.interactant) 1304 if (!item.isEmpty()) 1305 return true; 1306 return false; 1307 } 1308 1309 public ClinicalUseIssueInteractionInteractantComponent addInteractant() { //3 1310 ClinicalUseIssueInteractionInteractantComponent t = new ClinicalUseIssueInteractionInteractantComponent(); 1311 if (this.interactant == null) 1312 this.interactant = new ArrayList<ClinicalUseIssueInteractionInteractantComponent>(); 1313 this.interactant.add(t); 1314 return t; 1315 } 1316 1317 public ClinicalUseIssueInteractionComponent addInteractant(ClinicalUseIssueInteractionInteractantComponent t) { //3 1318 if (t == null) 1319 return this; 1320 if (this.interactant == null) 1321 this.interactant = new ArrayList<ClinicalUseIssueInteractionInteractantComponent>(); 1322 this.interactant.add(t); 1323 return this; 1324 } 1325 1326 /** 1327 * @return The first repetition of repeating field {@link #interactant}, creating it if it does not already exist {3} 1328 */ 1329 public ClinicalUseIssueInteractionInteractantComponent getInteractantFirstRep() { 1330 if (getInteractant().isEmpty()) { 1331 addInteractant(); 1332 } 1333 return getInteractant().get(0); 1334 } 1335 1336 /** 1337 * @return {@link #type} (The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction.) 1338 */ 1339 public CodeableConcept getType() { 1340 if (this.type == null) 1341 if (Configuration.errorOnAutoCreate()) 1342 throw new Error("Attempt to auto-create ClinicalUseIssueInteractionComponent.type"); 1343 else if (Configuration.doAutoCreate()) 1344 this.type = new CodeableConcept(); // cc 1345 return this.type; 1346 } 1347 1348 public boolean hasType() { 1349 return this.type != null && !this.type.isEmpty(); 1350 } 1351 1352 /** 1353 * @param value {@link #type} (The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction.) 1354 */ 1355 public ClinicalUseIssueInteractionComponent setType(CodeableConcept value) { 1356 this.type = value; 1357 return this; 1358 } 1359 1360 /** 1361 * @return {@link #effect} (The effect of the interaction, for example "reduced gastric absorption of primary medication".) 1362 */ 1363 public CodeableReference getEffect() { 1364 if (this.effect == null) 1365 if (Configuration.errorOnAutoCreate()) 1366 throw new Error("Attempt to auto-create ClinicalUseIssueInteractionComponent.effect"); 1367 else if (Configuration.doAutoCreate()) 1368 this.effect = new CodeableReference(); // cc 1369 return this.effect; 1370 } 1371 1372 public boolean hasEffect() { 1373 return this.effect != null && !this.effect.isEmpty(); 1374 } 1375 1376 /** 1377 * @param value {@link #effect} (The effect of the interaction, for example "reduced gastric absorption of primary medication".) 1378 */ 1379 public ClinicalUseIssueInteractionComponent setEffect(CodeableReference value) { 1380 this.effect = value; 1381 return this; 1382 } 1383 1384 /** 1385 * @return {@link #incidence} (The incidence of the interaction, e.g. theoretical, observed.) 1386 */ 1387 public CodeableConcept getIncidence() { 1388 if (this.incidence == null) 1389 if (Configuration.errorOnAutoCreate()) 1390 throw new Error("Attempt to auto-create ClinicalUseIssueInteractionComponent.incidence"); 1391 else if (Configuration.doAutoCreate()) 1392 this.incidence = new CodeableConcept(); // cc 1393 return this.incidence; 1394 } 1395 1396 public boolean hasIncidence() { 1397 return this.incidence != null && !this.incidence.isEmpty(); 1398 } 1399 1400 /** 1401 * @param value {@link #incidence} (The incidence of the interaction, e.g. theoretical, observed.) 1402 */ 1403 public ClinicalUseIssueInteractionComponent setIncidence(CodeableConcept value) { 1404 this.incidence = value; 1405 return this; 1406 } 1407 1408 /** 1409 * @return {@link #management} (Actions for managing the interaction.) 1410 */ 1411 public List<CodeableConcept> getManagement() { 1412 if (this.management == null) 1413 this.management = new ArrayList<CodeableConcept>(); 1414 return this.management; 1415 } 1416 1417 /** 1418 * @return Returns a reference to <code>this</code> for easy method chaining 1419 */ 1420 public ClinicalUseIssueInteractionComponent setManagement(List<CodeableConcept> theManagement) { 1421 this.management = theManagement; 1422 return this; 1423 } 1424 1425 public boolean hasManagement() { 1426 if (this.management == null) 1427 return false; 1428 for (CodeableConcept item : this.management) 1429 if (!item.isEmpty()) 1430 return true; 1431 return false; 1432 } 1433 1434 public CodeableConcept addManagement() { //3 1435 CodeableConcept t = new CodeableConcept(); 1436 if (this.management == null) 1437 this.management = new ArrayList<CodeableConcept>(); 1438 this.management.add(t); 1439 return t; 1440 } 1441 1442 public ClinicalUseIssueInteractionComponent addManagement(CodeableConcept t) { //3 1443 if (t == null) 1444 return this; 1445 if (this.management == null) 1446 this.management = new ArrayList<CodeableConcept>(); 1447 this.management.add(t); 1448 return this; 1449 } 1450 1451 /** 1452 * @return The first repetition of repeating field {@link #management}, creating it if it does not already exist {3} 1453 */ 1454 public CodeableConcept getManagementFirstRep() { 1455 if (getManagement().isEmpty()) { 1456 addManagement(); 1457 } 1458 return getManagement().get(0); 1459 } 1460 1461 protected void listChildren(List<Property> children) { 1462 super.listChildren(children); 1463 children.add(new Property("interactant", "", "The specific medication, food, substance or laboratory test that interacts.", 0, java.lang.Integer.MAX_VALUE, interactant)); 1464 children.add(new Property("type", "CodeableConcept", "The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction.", 0, 1, type)); 1465 children.add(new Property("effect", "CodeableReference(ObservationDefinition)", "The effect of the interaction, for example \"reduced gastric absorption of primary medication\".", 0, 1, effect)); 1466 children.add(new Property("incidence", "CodeableConcept", "The incidence of the interaction, e.g. theoretical, observed.", 0, 1, incidence)); 1467 children.add(new Property("management", "CodeableConcept", "Actions for managing the interaction.", 0, java.lang.Integer.MAX_VALUE, management)); 1468 } 1469 1470 @Override 1471 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1472 switch (_hash) { 1473 case 1844097009: /*interactant*/ return new Property("interactant", "", "The specific medication, food, substance or laboratory test that interacts.", 0, java.lang.Integer.MAX_VALUE, interactant); 1474 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction.", 0, 1, type); 1475 case -1306084975: /*effect*/ return new Property("effect", "CodeableReference(ObservationDefinition)", "The effect of the interaction, for example \"reduced gastric absorption of primary medication\".", 0, 1, effect); 1476 case -1598467132: /*incidence*/ return new Property("incidence", "CodeableConcept", "The incidence of the interaction, e.g. theoretical, observed.", 0, 1, incidence); 1477 case -1799980989: /*management*/ return new Property("management", "CodeableConcept", "Actions for managing the interaction.", 0, java.lang.Integer.MAX_VALUE, management); 1478 default: return super.getNamedProperty(_hash, _name, _checkValid); 1479 } 1480 1481 } 1482 1483 @Override 1484 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1485 switch (hash) { 1486 case 1844097009: /*interactant*/ return this.interactant == null ? new Base[0] : this.interactant.toArray(new Base[this.interactant.size()]); // ClinicalUseIssueInteractionInteractantComponent 1487 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 1488 case -1306084975: /*effect*/ return this.effect == null ? new Base[0] : new Base[] {this.effect}; // CodeableReference 1489 case -1598467132: /*incidence*/ return this.incidence == null ? new Base[0] : new Base[] {this.incidence}; // CodeableConcept 1490 case -1799980989: /*management*/ return this.management == null ? new Base[0] : this.management.toArray(new Base[this.management.size()]); // CodeableConcept 1491 default: return super.getProperty(hash, name, checkValid); 1492 } 1493 1494 } 1495 1496 @Override 1497 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1498 switch (hash) { 1499 case 1844097009: // interactant 1500 this.getInteractant().add((ClinicalUseIssueInteractionInteractantComponent) value); // ClinicalUseIssueInteractionInteractantComponent 1501 return value; 1502 case 3575610: // type 1503 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1504 return value; 1505 case -1306084975: // effect 1506 this.effect = TypeConvertor.castToCodeableReference(value); // CodeableReference 1507 return value; 1508 case -1598467132: // incidence 1509 this.incidence = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1510 return value; 1511 case -1799980989: // management 1512 this.getManagement().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept 1513 return value; 1514 default: return super.setProperty(hash, name, value); 1515 } 1516 1517 } 1518 1519 @Override 1520 public Base setProperty(String name, Base value) throws FHIRException { 1521 if (name.equals("interactant")) { 1522 this.getInteractant().add((ClinicalUseIssueInteractionInteractantComponent) value); 1523 } else if (name.equals("type")) { 1524 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1525 } else if (name.equals("effect")) { 1526 this.effect = TypeConvertor.castToCodeableReference(value); // CodeableReference 1527 } else if (name.equals("incidence")) { 1528 this.incidence = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1529 } else if (name.equals("management")) { 1530 this.getManagement().add(TypeConvertor.castToCodeableConcept(value)); 1531 } else 1532 return super.setProperty(name, value); 1533 return value; 1534 } 1535 1536 @Override 1537 public Base makeProperty(int hash, String name) throws FHIRException { 1538 switch (hash) { 1539 case 1844097009: return addInteractant(); 1540 case 3575610: return getType(); 1541 case -1306084975: return getEffect(); 1542 case -1598467132: return getIncidence(); 1543 case -1799980989: return addManagement(); 1544 default: return super.makeProperty(hash, name); 1545 } 1546 1547 } 1548 1549 @Override 1550 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1551 switch (hash) { 1552 case 1844097009: /*interactant*/ return new String[] {}; 1553 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 1554 case -1306084975: /*effect*/ return new String[] {"CodeableReference"}; 1555 case -1598467132: /*incidence*/ return new String[] {"CodeableConcept"}; 1556 case -1799980989: /*management*/ return new String[] {"CodeableConcept"}; 1557 default: return super.getTypesForProperty(hash, name); 1558 } 1559 1560 } 1561 1562 @Override 1563 public Base addChild(String name) throws FHIRException { 1564 if (name.equals("interactant")) { 1565 return addInteractant(); 1566 } 1567 else if (name.equals("type")) { 1568 this.type = new CodeableConcept(); 1569 return this.type; 1570 } 1571 else if (name.equals("effect")) { 1572 this.effect = new CodeableReference(); 1573 return this.effect; 1574 } 1575 else if (name.equals("incidence")) { 1576 this.incidence = new CodeableConcept(); 1577 return this.incidence; 1578 } 1579 else if (name.equals("management")) { 1580 return addManagement(); 1581 } 1582 else 1583 return super.addChild(name); 1584 } 1585 1586 public ClinicalUseIssueInteractionComponent copy() { 1587 ClinicalUseIssueInteractionComponent dst = new ClinicalUseIssueInteractionComponent(); 1588 copyValues(dst); 1589 return dst; 1590 } 1591 1592 public void copyValues(ClinicalUseIssueInteractionComponent dst) { 1593 super.copyValues(dst); 1594 if (interactant != null) { 1595 dst.interactant = new ArrayList<ClinicalUseIssueInteractionInteractantComponent>(); 1596 for (ClinicalUseIssueInteractionInteractantComponent i : interactant) 1597 dst.interactant.add(i.copy()); 1598 }; 1599 dst.type = type == null ? null : type.copy(); 1600 dst.effect = effect == null ? null : effect.copy(); 1601 dst.incidence = incidence == null ? null : incidence.copy(); 1602 if (management != null) { 1603 dst.management = new ArrayList<CodeableConcept>(); 1604 for (CodeableConcept i : management) 1605 dst.management.add(i.copy()); 1606 }; 1607 } 1608 1609 @Override 1610 public boolean equalsDeep(Base other_) { 1611 if (!super.equalsDeep(other_)) 1612 return false; 1613 if (!(other_ instanceof ClinicalUseIssueInteractionComponent)) 1614 return false; 1615 ClinicalUseIssueInteractionComponent o = (ClinicalUseIssueInteractionComponent) other_; 1616 return compareDeep(interactant, o.interactant, true) && compareDeep(type, o.type, true) && compareDeep(effect, o.effect, true) 1617 && compareDeep(incidence, o.incidence, true) && compareDeep(management, o.management, true); 1618 } 1619 1620 @Override 1621 public boolean equalsShallow(Base other_) { 1622 if (!super.equalsShallow(other_)) 1623 return false; 1624 if (!(other_ instanceof ClinicalUseIssueInteractionComponent)) 1625 return false; 1626 ClinicalUseIssueInteractionComponent o = (ClinicalUseIssueInteractionComponent) other_; 1627 return true; 1628 } 1629 1630 public boolean isEmpty() { 1631 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(interactant, type, effect 1632 , incidence, management); 1633 } 1634 1635 public String fhirType() { 1636 return "ClinicalUseIssue.interaction"; 1637 1638 } 1639 1640 } 1641 1642 @Block() 1643 public static class ClinicalUseIssueInteractionInteractantComponent extends BackboneElement implements IBaseBackboneElement { 1644 /** 1645 * The specific medication, food or laboratory test that interacts. 1646 */ 1647 @Child(name = "item", type = {MedicinalProductDefinition.class, Medication.class, Substance.class, ObservationDefinition.class, CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) 1648 @Description(shortDefinition="The specific medication, food or laboratory test that interacts", formalDefinition="The specific medication, food or laboratory test that interacts." ) 1649 protected DataType item; 1650 1651 private static final long serialVersionUID = 1847936859L; 1652 1653 /** 1654 * Constructor 1655 */ 1656 public ClinicalUseIssueInteractionInteractantComponent() { 1657 super(); 1658 } 1659 1660 /** 1661 * Constructor 1662 */ 1663 public ClinicalUseIssueInteractionInteractantComponent(DataType item) { 1664 super(); 1665 this.setItem(item); 1666 } 1667 1668 /** 1669 * @return {@link #item} (The specific medication, food or laboratory test that interacts.) 1670 */ 1671 public DataType getItem() { 1672 return this.item; 1673 } 1674 1675 /** 1676 * @return {@link #item} (The specific medication, food or laboratory test that interacts.) 1677 */ 1678 public Reference getItemReference() throws FHIRException { 1679 if (this.item == null) 1680 this.item = new Reference(); 1681 if (!(this.item instanceof Reference)) 1682 throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.item.getClass().getName()+" was encountered"); 1683 return (Reference) this.item; 1684 } 1685 1686 public boolean hasItemReference() { 1687 return this != null && this.item instanceof Reference; 1688 } 1689 1690 /** 1691 * @return {@link #item} (The specific medication, food or laboratory test that interacts.) 1692 */ 1693 public CodeableConcept getItemCodeableConcept() throws FHIRException { 1694 if (this.item == null) 1695 this.item = new CodeableConcept(); 1696 if (!(this.item instanceof CodeableConcept)) 1697 throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.item.getClass().getName()+" was encountered"); 1698 return (CodeableConcept) this.item; 1699 } 1700 1701 public boolean hasItemCodeableConcept() { 1702 return this != null && this.item instanceof CodeableConcept; 1703 } 1704 1705 public boolean hasItem() { 1706 return this.item != null && !this.item.isEmpty(); 1707 } 1708 1709 /** 1710 * @param value {@link #item} (The specific medication, food or laboratory test that interacts.) 1711 */ 1712 public ClinicalUseIssueInteractionInteractantComponent setItem(DataType value) { 1713 if (value != null && !(value instanceof Reference || value instanceof CodeableConcept)) 1714 throw new Error("Not the right type for ClinicalUseIssue.interaction.interactant.item[x]: "+value.fhirType()); 1715 this.item = value; 1716 return this; 1717 } 1718 1719 protected void listChildren(List<Property> children) { 1720 super.listChildren(children); 1721 children.add(new Property("item[x]", "Reference(MedicinalProductDefinition|Medication|Substance|ObservationDefinition)|CodeableConcept", "The specific medication, food or laboratory test that interacts.", 0, 1, item)); 1722 } 1723 1724 @Override 1725 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1726 switch (_hash) { 1727 case 2116201613: /*item[x]*/ return new Property("item[x]", "Reference(MedicinalProductDefinition|Medication|Substance|ObservationDefinition)|CodeableConcept", "The specific medication, food or laboratory test that interacts.", 0, 1, item); 1728 case 3242771: /*item*/ return new Property("item[x]", "Reference(MedicinalProductDefinition|Medication|Substance|ObservationDefinition)|CodeableConcept", "The specific medication, food or laboratory test that interacts.", 0, 1, item); 1729 case 1376364920: /*itemReference*/ return new Property("item[x]", "Reference(MedicinalProductDefinition|Medication|Substance|ObservationDefinition)", "The specific medication, food or laboratory test that interacts.", 0, 1, item); 1730 case 106644494: /*itemCodeableConcept*/ return new Property("item[x]", "CodeableConcept", "The specific medication, food or laboratory test that interacts.", 0, 1, item); 1731 default: return super.getNamedProperty(_hash, _name, _checkValid); 1732 } 1733 1734 } 1735 1736 @Override 1737 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1738 switch (hash) { 1739 case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // DataType 1740 default: return super.getProperty(hash, name, checkValid); 1741 } 1742 1743 } 1744 1745 @Override 1746 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1747 switch (hash) { 1748 case 3242771: // item 1749 this.item = TypeConvertor.castToType(value); // DataType 1750 return value; 1751 default: return super.setProperty(hash, name, value); 1752 } 1753 1754 } 1755 1756 @Override 1757 public Base setProperty(String name, Base value) throws FHIRException { 1758 if (name.equals("item[x]")) { 1759 this.item = TypeConvertor.castToType(value); // DataType 1760 } else 1761 return super.setProperty(name, value); 1762 return value; 1763 } 1764 1765 @Override 1766 public Base makeProperty(int hash, String name) throws FHIRException { 1767 switch (hash) { 1768 case 2116201613: return getItem(); 1769 case 3242771: return getItem(); 1770 default: return super.makeProperty(hash, name); 1771 } 1772 1773 } 1774 1775 @Override 1776 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1777 switch (hash) { 1778 case 3242771: /*item*/ return new String[] {"Reference", "CodeableConcept"}; 1779 default: return super.getTypesForProperty(hash, name); 1780 } 1781 1782 } 1783 1784 @Override 1785 public Base addChild(String name) throws FHIRException { 1786 if (name.equals("itemReference")) { 1787 this.item = new Reference(); 1788 return this.item; 1789 } 1790 else if (name.equals("itemCodeableConcept")) { 1791 this.item = new CodeableConcept(); 1792 return this.item; 1793 } 1794 else 1795 return super.addChild(name); 1796 } 1797 1798 public ClinicalUseIssueInteractionInteractantComponent copy() { 1799 ClinicalUseIssueInteractionInteractantComponent dst = new ClinicalUseIssueInteractionInteractantComponent(); 1800 copyValues(dst); 1801 return dst; 1802 } 1803 1804 public void copyValues(ClinicalUseIssueInteractionInteractantComponent dst) { 1805 super.copyValues(dst); 1806 dst.item = item == null ? null : item.copy(); 1807 } 1808 1809 @Override 1810 public boolean equalsDeep(Base other_) { 1811 if (!super.equalsDeep(other_)) 1812 return false; 1813 if (!(other_ instanceof ClinicalUseIssueInteractionInteractantComponent)) 1814 return false; 1815 ClinicalUseIssueInteractionInteractantComponent o = (ClinicalUseIssueInteractionInteractantComponent) other_; 1816 return compareDeep(item, o.item, true); 1817 } 1818 1819 @Override 1820 public boolean equalsShallow(Base other_) { 1821 if (!super.equalsShallow(other_)) 1822 return false; 1823 if (!(other_ instanceof ClinicalUseIssueInteractionInteractantComponent)) 1824 return false; 1825 ClinicalUseIssueInteractionInteractantComponent o = (ClinicalUseIssueInteractionInteractantComponent) other_; 1826 return true; 1827 } 1828 1829 public boolean isEmpty() { 1830 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(item); 1831 } 1832 1833 public String fhirType() { 1834 return "ClinicalUseIssue.interaction.interactant"; 1835 1836 } 1837 1838 } 1839 1840 @Block() 1841 public static class ClinicalUseIssueUndesirableEffectComponent extends BackboneElement implements IBaseBackboneElement { 1842 /** 1843 * The situation in which the undesirable effect may manifest. 1844 */ 1845 @Child(name = "symptomConditionEffect", type = {CodeableReference.class}, order=1, min=0, max=1, modifier=false, summary=true) 1846 @Description(shortDefinition="The situation in which the undesirable effect may manifest", formalDefinition="The situation in which the undesirable effect may manifest." ) 1847 protected CodeableReference symptomConditionEffect; 1848 1849 /** 1850 * High level classification of the effect. 1851 */ 1852 @Child(name = "classification", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 1853 @Description(shortDefinition="High level classification of the effect", formalDefinition="High level classification of the effect." ) 1854 protected CodeableConcept classification; 1855 1856 /** 1857 * How often the effect is seen. 1858 */ 1859 @Child(name = "frequencyOfOccurrence", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) 1860 @Description(shortDefinition="How often the effect is seen", formalDefinition="How often the effect is seen." ) 1861 protected CodeableConcept frequencyOfOccurrence; 1862 1863 private static final long serialVersionUID = -55472609L; 1864 1865 /** 1866 * Constructor 1867 */ 1868 public ClinicalUseIssueUndesirableEffectComponent() { 1869 super(); 1870 } 1871 1872 /** 1873 * @return {@link #symptomConditionEffect} (The situation in which the undesirable effect may manifest.) 1874 */ 1875 public CodeableReference getSymptomConditionEffect() { 1876 if (this.symptomConditionEffect == null) 1877 if (Configuration.errorOnAutoCreate()) 1878 throw new Error("Attempt to auto-create ClinicalUseIssueUndesirableEffectComponent.symptomConditionEffect"); 1879 else if (Configuration.doAutoCreate()) 1880 this.symptomConditionEffect = new CodeableReference(); // cc 1881 return this.symptomConditionEffect; 1882 } 1883 1884 public boolean hasSymptomConditionEffect() { 1885 return this.symptomConditionEffect != null && !this.symptomConditionEffect.isEmpty(); 1886 } 1887 1888 /** 1889 * @param value {@link #symptomConditionEffect} (The situation in which the undesirable effect may manifest.) 1890 */ 1891 public ClinicalUseIssueUndesirableEffectComponent setSymptomConditionEffect(CodeableReference value) { 1892 this.symptomConditionEffect = value; 1893 return this; 1894 } 1895 1896 /** 1897 * @return {@link #classification} (High level classification of the effect.) 1898 */ 1899 public CodeableConcept getClassification() { 1900 if (this.classification == null) 1901 if (Configuration.errorOnAutoCreate()) 1902 throw new Error("Attempt to auto-create ClinicalUseIssueUndesirableEffectComponent.classification"); 1903 else if (Configuration.doAutoCreate()) 1904 this.classification = new CodeableConcept(); // cc 1905 return this.classification; 1906 } 1907 1908 public boolean hasClassification() { 1909 return this.classification != null && !this.classification.isEmpty(); 1910 } 1911 1912 /** 1913 * @param value {@link #classification} (High level classification of the effect.) 1914 */ 1915 public ClinicalUseIssueUndesirableEffectComponent setClassification(CodeableConcept value) { 1916 this.classification = value; 1917 return this; 1918 } 1919 1920 /** 1921 * @return {@link #frequencyOfOccurrence} (How often the effect is seen.) 1922 */ 1923 public CodeableConcept getFrequencyOfOccurrence() { 1924 if (this.frequencyOfOccurrence == null) 1925 if (Configuration.errorOnAutoCreate()) 1926 throw new Error("Attempt to auto-create ClinicalUseIssueUndesirableEffectComponent.frequencyOfOccurrence"); 1927 else if (Configuration.doAutoCreate()) 1928 this.frequencyOfOccurrence = new CodeableConcept(); // cc 1929 return this.frequencyOfOccurrence; 1930 } 1931 1932 public boolean hasFrequencyOfOccurrence() { 1933 return this.frequencyOfOccurrence != null && !this.frequencyOfOccurrence.isEmpty(); 1934 } 1935 1936 /** 1937 * @param value {@link #frequencyOfOccurrence} (How often the effect is seen.) 1938 */ 1939 public ClinicalUseIssueUndesirableEffectComponent setFrequencyOfOccurrence(CodeableConcept value) { 1940 this.frequencyOfOccurrence = value; 1941 return this; 1942 } 1943 1944 protected void listChildren(List<Property> children) { 1945 super.listChildren(children); 1946 children.add(new Property("symptomConditionEffect", "CodeableReference(ObservationDefinition)", "The situation in which the undesirable effect may manifest.", 0, 1, symptomConditionEffect)); 1947 children.add(new Property("classification", "CodeableConcept", "High level classification of the effect.", 0, 1, classification)); 1948 children.add(new Property("frequencyOfOccurrence", "CodeableConcept", "How often the effect is seen.", 0, 1, frequencyOfOccurrence)); 1949 } 1950 1951 @Override 1952 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1953 switch (_hash) { 1954 case -650549981: /*symptomConditionEffect*/ return new Property("symptomConditionEffect", "CodeableReference(ObservationDefinition)", "The situation in which the undesirable effect may manifest.", 0, 1, symptomConditionEffect); 1955 case 382350310: /*classification*/ return new Property("classification", "CodeableConcept", "High level classification of the effect.", 0, 1, classification); 1956 case 791175812: /*frequencyOfOccurrence*/ return new Property("frequencyOfOccurrence", "CodeableConcept", "How often the effect is seen.", 0, 1, frequencyOfOccurrence); 1957 default: return super.getNamedProperty(_hash, _name, _checkValid); 1958 } 1959 1960 } 1961 1962 @Override 1963 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1964 switch (hash) { 1965 case -650549981: /*symptomConditionEffect*/ return this.symptomConditionEffect == null ? new Base[0] : new Base[] {this.symptomConditionEffect}; // CodeableReference 1966 case 382350310: /*classification*/ return this.classification == null ? new Base[0] : new Base[] {this.classification}; // CodeableConcept 1967 case 791175812: /*frequencyOfOccurrence*/ return this.frequencyOfOccurrence == null ? new Base[0] : new Base[] {this.frequencyOfOccurrence}; // CodeableConcept 1968 default: return super.getProperty(hash, name, checkValid); 1969 } 1970 1971 } 1972 1973 @Override 1974 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1975 switch (hash) { 1976 case -650549981: // symptomConditionEffect 1977 this.symptomConditionEffect = TypeConvertor.castToCodeableReference(value); // CodeableReference 1978 return value; 1979 case 382350310: // classification 1980 this.classification = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1981 return value; 1982 case 791175812: // frequencyOfOccurrence 1983 this.frequencyOfOccurrence = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1984 return value; 1985 default: return super.setProperty(hash, name, value); 1986 } 1987 1988 } 1989 1990 @Override 1991 public Base setProperty(String name, Base value) throws FHIRException { 1992 if (name.equals("symptomConditionEffect")) { 1993 this.symptomConditionEffect = TypeConvertor.castToCodeableReference(value); // CodeableReference 1994 } else if (name.equals("classification")) { 1995 this.classification = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1996 } else if (name.equals("frequencyOfOccurrence")) { 1997 this.frequencyOfOccurrence = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1998 } else 1999 return super.setProperty(name, value); 2000 return value; 2001 } 2002 2003 @Override 2004 public Base makeProperty(int hash, String name) throws FHIRException { 2005 switch (hash) { 2006 case -650549981: return getSymptomConditionEffect(); 2007 case 382350310: return getClassification(); 2008 case 791175812: return getFrequencyOfOccurrence(); 2009 default: return super.makeProperty(hash, name); 2010 } 2011 2012 } 2013 2014 @Override 2015 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 2016 switch (hash) { 2017 case -650549981: /*symptomConditionEffect*/ return new String[] {"CodeableReference"}; 2018 case 382350310: /*classification*/ return new String[] {"CodeableConcept"}; 2019 case 791175812: /*frequencyOfOccurrence*/ return new String[] {"CodeableConcept"}; 2020 default: return super.getTypesForProperty(hash, name); 2021 } 2022 2023 } 2024 2025 @Override 2026 public Base addChild(String name) throws FHIRException { 2027 if (name.equals("symptomConditionEffect")) { 2028 this.symptomConditionEffect = new CodeableReference(); 2029 return this.symptomConditionEffect; 2030 } 2031 else if (name.equals("classification")) { 2032 this.classification = new CodeableConcept(); 2033 return this.classification; 2034 } 2035 else if (name.equals("frequencyOfOccurrence")) { 2036 this.frequencyOfOccurrence = new CodeableConcept(); 2037 return this.frequencyOfOccurrence; 2038 } 2039 else 2040 return super.addChild(name); 2041 } 2042 2043 public ClinicalUseIssueUndesirableEffectComponent copy() { 2044 ClinicalUseIssueUndesirableEffectComponent dst = new ClinicalUseIssueUndesirableEffectComponent(); 2045 copyValues(dst); 2046 return dst; 2047 } 2048 2049 public void copyValues(ClinicalUseIssueUndesirableEffectComponent dst) { 2050 super.copyValues(dst); 2051 dst.symptomConditionEffect = symptomConditionEffect == null ? null : symptomConditionEffect.copy(); 2052 dst.classification = classification == null ? null : classification.copy(); 2053 dst.frequencyOfOccurrence = frequencyOfOccurrence == null ? null : frequencyOfOccurrence.copy(); 2054 } 2055 2056 @Override 2057 public boolean equalsDeep(Base other_) { 2058 if (!super.equalsDeep(other_)) 2059 return false; 2060 if (!(other_ instanceof ClinicalUseIssueUndesirableEffectComponent)) 2061 return false; 2062 ClinicalUseIssueUndesirableEffectComponent o = (ClinicalUseIssueUndesirableEffectComponent) other_; 2063 return compareDeep(symptomConditionEffect, o.symptomConditionEffect, true) && compareDeep(classification, o.classification, true) 2064 && compareDeep(frequencyOfOccurrence, o.frequencyOfOccurrence, true); 2065 } 2066 2067 @Override 2068 public boolean equalsShallow(Base other_) { 2069 if (!super.equalsShallow(other_)) 2070 return false; 2071 if (!(other_ instanceof ClinicalUseIssueUndesirableEffectComponent)) 2072 return false; 2073 ClinicalUseIssueUndesirableEffectComponent o = (ClinicalUseIssueUndesirableEffectComponent) other_; 2074 return true; 2075 } 2076 2077 public boolean isEmpty() { 2078 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(symptomConditionEffect, classification 2079 , frequencyOfOccurrence); 2080 } 2081 2082 public String fhirType() { 2083 return "ClinicalUseIssue.undesirableEffect"; 2084 2085 } 2086 2087 } 2088 2089 /** 2090 * Business identifier for this issue. 2091 */ 2092 @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2093 @Description(shortDefinition="Business identifier for this issue", formalDefinition="Business identifier for this issue." ) 2094 protected List<Identifier> identifier; 2095 2096 /** 2097 * indication | contraindication | interaction | undesirable-effect | warning. 2098 */ 2099 @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) 2100 @Description(shortDefinition="indication | contraindication | interaction | undesirable-effect | warning", formalDefinition="indication | contraindication | interaction | undesirable-effect | warning." ) 2101 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-use-issue-type") 2102 protected Enumeration<ClinicalUseIssueType> type; 2103 2104 /** 2105 * A categorisation of the issue, primarily for dividing warnings into subject heading areas such as "Pregnancy and Lactation", "Overdose", "Effects on Ability to Drive and Use Machines". 2106 */ 2107 @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2108 @Description(shortDefinition="A categorisation of the issue, primarily for dividing warnings into subject heading areas such as \"Pregnancy and Lactation\", \"Overdose\", \"Effects on Ability to Drive and Use Machines\"", formalDefinition="A categorisation of the issue, primarily for dividing warnings into subject heading areas such as \"Pregnancy and Lactation\", \"Overdose\", \"Effects on Ability to Drive and Use Machines\"." ) 2109 protected List<CodeableConcept> category; 2110 2111 /** 2112 * The medication or procedure for which this is an indication. 2113 */ 2114 @Child(name = "subject", type = {MedicinalProductDefinition.class, Medication.class, ActivityDefinition.class, PlanDefinition.class, Device.class, DeviceDefinition.class, Substance.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2115 @Description(shortDefinition="The medication or procedure for which this is an indication", formalDefinition="The medication or procedure for which this is an indication." ) 2116 protected List<Reference> subject; 2117 2118 /** 2119 * Whether this is a current issue or one that has been retired etc. 2120 */ 2121 @Child(name = "status", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) 2122 @Description(shortDefinition="Whether this is a current issue or one that has been retired etc", formalDefinition="Whether this is a current issue or one that has been retired etc." ) 2123 protected CodeableConcept status; 2124 2125 /** 2126 * General description of an effect (particularly for a general warning, rather than any of the more specific types such as indication) for when a distinct coded or textual description is not appropriate using Indication.diseaseSymptomProcedure.text, Contraindication.diseaseSymptomProcedure.text etc. For example "May affect ability to drive". 2127 */ 2128 @Child(name = "description", type = {MarkdownType.class}, order=5, min=0, max=1, modifier=false, summary=true) 2129 @Description(shortDefinition="General description of an effect (particularly for a general warning, rather than any of the more specific types such as indication) for when a distinct coded or textual description is not appropriate using Indication.diseaseSymptomProcedure.text, Contraindication.diseaseSymptomProcedure.text etc. For example \"May affect ability to drive\"", formalDefinition="General description of an effect (particularly for a general warning, rather than any of the more specific types such as indication) for when a distinct coded or textual description is not appropriate using Indication.diseaseSymptomProcedure.text, Contraindication.diseaseSymptomProcedure.text etc. For example \"May affect ability to drive\"." ) 2130 protected MarkdownType description; 2131 2132 /** 2133 * Specifics for when this is a contraindication. 2134 */ 2135 @Child(name = "contraindication", type = {}, order=6, min=0, max=1, modifier=false, summary=true) 2136 @Description(shortDefinition="Specifics for when this is a contraindication", formalDefinition="Specifics for when this is a contraindication." ) 2137 protected ClinicalUseIssueContraindicationComponent contraindication; 2138 2139 /** 2140 * Specifics for when this is an indication. 2141 */ 2142 @Child(name = "indication", type = {}, order=7, min=0, max=1, modifier=false, summary=true) 2143 @Description(shortDefinition="Specifics for when this is an indication", formalDefinition="Specifics for when this is an indication." ) 2144 protected ClinicalUseIssueIndicationComponent indication; 2145 2146 /** 2147 * Specifics for when this is an interaction. 2148 */ 2149 @Child(name = "interaction", type = {}, order=8, min=0, max=1, modifier=false, summary=true) 2150 @Description(shortDefinition="Specifics for when this is an interaction", formalDefinition="Specifics for when this is an interaction." ) 2151 protected ClinicalUseIssueInteractionComponent interaction; 2152 2153 /** 2154 * The population group to which this applies. 2155 */ 2156 @Child(name = "population", type = {Population.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 2157 @Description(shortDefinition="The population group to which this applies", formalDefinition="The population group to which this applies." ) 2158 protected List<Population> population; 2159 2160 /** 2161 * Describe the undesirable effects of the medicinal product. 2162 */ 2163 @Child(name = "undesirableEffect", type = {}, order=10, min=0, max=1, modifier=false, summary=true) 2164 @Description(shortDefinition="A possible negative outcome from the use of this treatment", formalDefinition="Describe the undesirable effects of the medicinal product." ) 2165 protected ClinicalUseIssueUndesirableEffectComponent undesirableEffect; 2166 2167 private static final long serialVersionUID = 313334576L; 2168 2169 /** 2170 * Constructor 2171 */ 2172 public ClinicalUseIssue() { 2173 super(); 2174 } 2175 2176 /** 2177 * Constructor 2178 */ 2179 public ClinicalUseIssue(ClinicalUseIssueType type) { 2180 super(); 2181 this.setType(type); 2182 } 2183 2184 /** 2185 * @return {@link #identifier} (Business identifier for this issue.) 2186 */ 2187 public List<Identifier> getIdentifier() { 2188 if (this.identifier == null) 2189 this.identifier = new ArrayList<Identifier>(); 2190 return this.identifier; 2191 } 2192 2193 /** 2194 * @return Returns a reference to <code>this</code> for easy method chaining 2195 */ 2196 public ClinicalUseIssue setIdentifier(List<Identifier> theIdentifier) { 2197 this.identifier = theIdentifier; 2198 return this; 2199 } 2200 2201 public boolean hasIdentifier() { 2202 if (this.identifier == null) 2203 return false; 2204 for (Identifier item : this.identifier) 2205 if (!item.isEmpty()) 2206 return true; 2207 return false; 2208 } 2209 2210 public Identifier addIdentifier() { //3 2211 Identifier t = new Identifier(); 2212 if (this.identifier == null) 2213 this.identifier = new ArrayList<Identifier>(); 2214 this.identifier.add(t); 2215 return t; 2216 } 2217 2218 public ClinicalUseIssue addIdentifier(Identifier t) { //3 2219 if (t == null) 2220 return this; 2221 if (this.identifier == null) 2222 this.identifier = new ArrayList<Identifier>(); 2223 this.identifier.add(t); 2224 return this; 2225 } 2226 2227 /** 2228 * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3} 2229 */ 2230 public Identifier getIdentifierFirstRep() { 2231 if (getIdentifier().isEmpty()) { 2232 addIdentifier(); 2233 } 2234 return getIdentifier().get(0); 2235 } 2236 2237 /** 2238 * @return {@link #type} (indication | contraindication | interaction | undesirable-effect | warning.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 2239 */ 2240 public Enumeration<ClinicalUseIssueType> getTypeElement() { 2241 if (this.type == null) 2242 if (Configuration.errorOnAutoCreate()) 2243 throw new Error("Attempt to auto-create ClinicalUseIssue.type"); 2244 else if (Configuration.doAutoCreate()) 2245 this.type = new Enumeration<ClinicalUseIssueType>(new ClinicalUseIssueTypeEnumFactory()); // bb 2246 return this.type; 2247 } 2248 2249 public boolean hasTypeElement() { 2250 return this.type != null && !this.type.isEmpty(); 2251 } 2252 2253 public boolean hasType() { 2254 return this.type != null && !this.type.isEmpty(); 2255 } 2256 2257 /** 2258 * @param value {@link #type} (indication | contraindication | interaction | undesirable-effect | warning.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 2259 */ 2260 public ClinicalUseIssue setTypeElement(Enumeration<ClinicalUseIssueType> value) { 2261 this.type = value; 2262 return this; 2263 } 2264 2265 /** 2266 * @return indication | contraindication | interaction | undesirable-effect | warning. 2267 */ 2268 public ClinicalUseIssueType getType() { 2269 return this.type == null ? null : this.type.getValue(); 2270 } 2271 2272 /** 2273 * @param value indication | contraindication | interaction | undesirable-effect | warning. 2274 */ 2275 public ClinicalUseIssue setType(ClinicalUseIssueType value) { 2276 if (this.type == null) 2277 this.type = new Enumeration<ClinicalUseIssueType>(new ClinicalUseIssueTypeEnumFactory()); 2278 this.type.setValue(value); 2279 return this; 2280 } 2281 2282 /** 2283 * @return {@link #category} (A categorisation of the issue, primarily for dividing warnings into subject heading areas such as "Pregnancy and Lactation", "Overdose", "Effects on Ability to Drive and Use Machines".) 2284 */ 2285 public List<CodeableConcept> getCategory() { 2286 if (this.category == null) 2287 this.category = new ArrayList<CodeableConcept>(); 2288 return this.category; 2289 } 2290 2291 /** 2292 * @return Returns a reference to <code>this</code> for easy method chaining 2293 */ 2294 public ClinicalUseIssue setCategory(List<CodeableConcept> theCategory) { 2295 this.category = theCategory; 2296 return this; 2297 } 2298 2299 public boolean hasCategory() { 2300 if (this.category == null) 2301 return false; 2302 for (CodeableConcept item : this.category) 2303 if (!item.isEmpty()) 2304 return true; 2305 return false; 2306 } 2307 2308 public CodeableConcept addCategory() { //3 2309 CodeableConcept t = new CodeableConcept(); 2310 if (this.category == null) 2311 this.category = new ArrayList<CodeableConcept>(); 2312 this.category.add(t); 2313 return t; 2314 } 2315 2316 public ClinicalUseIssue addCategory(CodeableConcept t) { //3 2317 if (t == null) 2318 return this; 2319 if (this.category == null) 2320 this.category = new ArrayList<CodeableConcept>(); 2321 this.category.add(t); 2322 return this; 2323 } 2324 2325 /** 2326 * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3} 2327 */ 2328 public CodeableConcept getCategoryFirstRep() { 2329 if (getCategory().isEmpty()) { 2330 addCategory(); 2331 } 2332 return getCategory().get(0); 2333 } 2334 2335 /** 2336 * @return {@link #subject} (The medication or procedure for which this is an indication.) 2337 */ 2338 public List<Reference> getSubject() { 2339 if (this.subject == null) 2340 this.subject = new ArrayList<Reference>(); 2341 return this.subject; 2342 } 2343 2344 /** 2345 * @return Returns a reference to <code>this</code> for easy method chaining 2346 */ 2347 public ClinicalUseIssue setSubject(List<Reference> theSubject) { 2348 this.subject = theSubject; 2349 return this; 2350 } 2351 2352 public boolean hasSubject() { 2353 if (this.subject == null) 2354 return false; 2355 for (Reference item : this.subject) 2356 if (!item.isEmpty()) 2357 return true; 2358 return false; 2359 } 2360 2361 public Reference addSubject() { //3 2362 Reference t = new Reference(); 2363 if (this.subject == null) 2364 this.subject = new ArrayList<Reference>(); 2365 this.subject.add(t); 2366 return t; 2367 } 2368 2369 public ClinicalUseIssue addSubject(Reference t) { //3 2370 if (t == null) 2371 return this; 2372 if (this.subject == null) 2373 this.subject = new ArrayList<Reference>(); 2374 this.subject.add(t); 2375 return this; 2376 } 2377 2378 /** 2379 * @return The first repetition of repeating field {@link #subject}, creating it if it does not already exist {3} 2380 */ 2381 public Reference getSubjectFirstRep() { 2382 if (getSubject().isEmpty()) { 2383 addSubject(); 2384 } 2385 return getSubject().get(0); 2386 } 2387 2388 /** 2389 * @return {@link #status} (Whether this is a current issue or one that has been retired etc.) 2390 */ 2391 public CodeableConcept getStatus() { 2392 if (this.status == null) 2393 if (Configuration.errorOnAutoCreate()) 2394 throw new Error("Attempt to auto-create ClinicalUseIssue.status"); 2395 else if (Configuration.doAutoCreate()) 2396 this.status = new CodeableConcept(); // cc 2397 return this.status; 2398 } 2399 2400 public boolean hasStatus() { 2401 return this.status != null && !this.status.isEmpty(); 2402 } 2403 2404 /** 2405 * @param value {@link #status} (Whether this is a current issue or one that has been retired etc.) 2406 */ 2407 public ClinicalUseIssue setStatus(CodeableConcept value) { 2408 this.status = value; 2409 return this; 2410 } 2411 2412 /** 2413 * @return {@link #description} (General description of an effect (particularly for a general warning, rather than any of the more specific types such as indication) for when a distinct coded or textual description is not appropriate using Indication.diseaseSymptomProcedure.text, Contraindication.diseaseSymptomProcedure.text etc. For example "May affect ability to drive".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 2414 */ 2415 public MarkdownType getDescriptionElement() { 2416 if (this.description == null) 2417 if (Configuration.errorOnAutoCreate()) 2418 throw new Error("Attempt to auto-create ClinicalUseIssue.description"); 2419 else if (Configuration.doAutoCreate()) 2420 this.description = new MarkdownType(); // bb 2421 return this.description; 2422 } 2423 2424 public boolean hasDescriptionElement() { 2425 return this.description != null && !this.description.isEmpty(); 2426 } 2427 2428 public boolean hasDescription() { 2429 return this.description != null && !this.description.isEmpty(); 2430 } 2431 2432 /** 2433 * @param value {@link #description} (General description of an effect (particularly for a general warning, rather than any of the more specific types such as indication) for when a distinct coded or textual description is not appropriate using Indication.diseaseSymptomProcedure.text, Contraindication.diseaseSymptomProcedure.text etc. For example "May affect ability to drive".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value 2434 */ 2435 public ClinicalUseIssue setDescriptionElement(MarkdownType value) { 2436 this.description = value; 2437 return this; 2438 } 2439 2440 /** 2441 * @return General description of an effect (particularly for a general warning, rather than any of the more specific types such as indication) for when a distinct coded or textual description is not appropriate using Indication.diseaseSymptomProcedure.text, Contraindication.diseaseSymptomProcedure.text etc. For example "May affect ability to drive". 2442 */ 2443 public String getDescription() { 2444 return this.description == null ? null : this.description.getValue(); 2445 } 2446 2447 /** 2448 * @param value General description of an effect (particularly for a general warning, rather than any of the more specific types such as indication) for when a distinct coded or textual description is not appropriate using Indication.diseaseSymptomProcedure.text, Contraindication.diseaseSymptomProcedure.text etc. For example "May affect ability to drive". 2449 */ 2450 public ClinicalUseIssue setDescription(String value) { 2451 if (value == null) 2452 this.description = null; 2453 else { 2454 if (this.description == null) 2455 this.description = new MarkdownType(); 2456 this.description.setValue(value); 2457 } 2458 return this; 2459 } 2460 2461 /** 2462 * @return {@link #contraindication} (Specifics for when this is a contraindication.) 2463 */ 2464 public ClinicalUseIssueContraindicationComponent getContraindication() { 2465 if (this.contraindication == null) 2466 if (Configuration.errorOnAutoCreate()) 2467 throw new Error("Attempt to auto-create ClinicalUseIssue.contraindication"); 2468 else if (Configuration.doAutoCreate()) 2469 this.contraindication = new ClinicalUseIssueContraindicationComponent(); // cc 2470 return this.contraindication; 2471 } 2472 2473 public boolean hasContraindication() { 2474 return this.contraindication != null && !this.contraindication.isEmpty(); 2475 } 2476 2477 /** 2478 * @param value {@link #contraindication} (Specifics for when this is a contraindication.) 2479 */ 2480 public ClinicalUseIssue setContraindication(ClinicalUseIssueContraindicationComponent value) { 2481 this.contraindication = value; 2482 return this; 2483 } 2484 2485 /** 2486 * @return {@link #indication} (Specifics for when this is an indication.) 2487 */ 2488 public ClinicalUseIssueIndicationComponent getIndication() { 2489 if (this.indication == null) 2490 if (Configuration.errorOnAutoCreate()) 2491 throw new Error("Attempt to auto-create ClinicalUseIssue.indication"); 2492 else if (Configuration.doAutoCreate()) 2493 this.indication = new ClinicalUseIssueIndicationComponent(); // cc 2494 return this.indication; 2495 } 2496 2497 public boolean hasIndication() { 2498 return this.indication != null && !this.indication.isEmpty(); 2499 } 2500 2501 /** 2502 * @param value {@link #indication} (Specifics for when this is an indication.) 2503 */ 2504 public ClinicalUseIssue setIndication(ClinicalUseIssueIndicationComponent value) { 2505 this.indication = value; 2506 return this; 2507 } 2508 2509 /** 2510 * @return {@link #interaction} (Specifics for when this is an interaction.) 2511 */ 2512 public ClinicalUseIssueInteractionComponent getInteraction() { 2513 if (this.interaction == null) 2514 if (Configuration.errorOnAutoCreate()) 2515 throw new Error("Attempt to auto-create ClinicalUseIssue.interaction"); 2516 else if (Configuration.doAutoCreate()) 2517 this.interaction = new ClinicalUseIssueInteractionComponent(); // cc 2518 return this.interaction; 2519 } 2520 2521 public boolean hasInteraction() { 2522 return this.interaction != null && !this.interaction.isEmpty(); 2523 } 2524 2525 /** 2526 * @param value {@link #interaction} (Specifics for when this is an interaction.) 2527 */ 2528 public ClinicalUseIssue setInteraction(ClinicalUseIssueInteractionComponent value) { 2529 this.interaction = value; 2530 return this; 2531 } 2532 2533 /** 2534 * @return {@link #population} (The population group to which this applies.) 2535 */ 2536 public List<Population> getPopulation() { 2537 if (this.population == null) 2538 this.population = new ArrayList<Population>(); 2539 return this.population; 2540 } 2541 2542 /** 2543 * @return Returns a reference to <code>this</code> for easy method chaining 2544 */ 2545 public ClinicalUseIssue setPopulation(List<Population> thePopulation) { 2546 this.population = thePopulation; 2547 return this; 2548 } 2549 2550 public boolean hasPopulation() { 2551 if (this.population == null) 2552 return false; 2553 for (Population item : this.population) 2554 if (!item.isEmpty()) 2555 return true; 2556 return false; 2557 } 2558 2559 public Population addPopulation() { //3 2560 Population t = new Population(); 2561 if (this.population == null) 2562 this.population = new ArrayList<Population>(); 2563 this.population.add(t); 2564 return t; 2565 } 2566 2567 public ClinicalUseIssue addPopulation(Population t) { //3 2568 if (t == null) 2569 return this; 2570 if (this.population == null) 2571 this.population = new ArrayList<Population>(); 2572 this.population.add(t); 2573 return this; 2574 } 2575 2576 /** 2577 * @return The first repetition of repeating field {@link #population}, creating it if it does not already exist {3} 2578 */ 2579 public Population getPopulationFirstRep() { 2580 if (getPopulation().isEmpty()) { 2581 addPopulation(); 2582 } 2583 return getPopulation().get(0); 2584 } 2585 2586 /** 2587 * @return {@link #undesirableEffect} (Describe the undesirable effects of the medicinal product.) 2588 */ 2589 public ClinicalUseIssueUndesirableEffectComponent getUndesirableEffect() { 2590 if (this.undesirableEffect == null) 2591 if (Configuration.errorOnAutoCreate()) 2592 throw new Error("Attempt to auto-create ClinicalUseIssue.undesirableEffect"); 2593 else if (Configuration.doAutoCreate()) 2594 this.undesirableEffect = new ClinicalUseIssueUndesirableEffectComponent(); // cc 2595 return this.undesirableEffect; 2596 } 2597 2598 public boolean hasUndesirableEffect() { 2599 return this.undesirableEffect != null && !this.undesirableEffect.isEmpty(); 2600 } 2601 2602 /** 2603 * @param value {@link #undesirableEffect} (Describe the undesirable effects of the medicinal product.) 2604 */ 2605 public ClinicalUseIssue setUndesirableEffect(ClinicalUseIssueUndesirableEffectComponent value) { 2606 this.undesirableEffect = value; 2607 return this; 2608 } 2609 2610 protected void listChildren(List<Property> children) { 2611 super.listChildren(children); 2612 children.add(new Property("identifier", "Identifier", "Business identifier for this issue.", 0, java.lang.Integer.MAX_VALUE, identifier)); 2613 children.add(new Property("type", "code", "indication | contraindication | interaction | undesirable-effect | warning.", 0, 1, type)); 2614 children.add(new Property("category", "CodeableConcept", "A categorisation of the issue, primarily for dividing warnings into subject heading areas such as \"Pregnancy and Lactation\", \"Overdose\", \"Effects on Ability to Drive and Use Machines\".", 0, java.lang.Integer.MAX_VALUE, category)); 2615 children.add(new Property("subject", "Reference(MedicinalProductDefinition|Medication|ActivityDefinition|PlanDefinition|Device|DeviceDefinition|Substance)", "The medication or procedure for which this is an indication.", 0, java.lang.Integer.MAX_VALUE, subject)); 2616 children.add(new Property("status", "CodeableConcept", "Whether this is a current issue or one that has been retired etc.", 0, 1, status)); 2617 children.add(new Property("description", "markdown", "General description of an effect (particularly for a general warning, rather than any of the more specific types such as indication) for when a distinct coded or textual description is not appropriate using Indication.diseaseSymptomProcedure.text, Contraindication.diseaseSymptomProcedure.text etc. For example \"May affect ability to drive\".", 0, 1, description)); 2618 children.add(new Property("contraindication", "", "Specifics for when this is a contraindication.", 0, 1, contraindication)); 2619 children.add(new Property("indication", "", "Specifics for when this is an indication.", 0, 1, indication)); 2620 children.add(new Property("interaction", "", "Specifics for when this is an interaction.", 0, 1, interaction)); 2621 children.add(new Property("population", "Population", "The population group to which this applies.", 0, java.lang.Integer.MAX_VALUE, population)); 2622 children.add(new Property("undesirableEffect", "", "Describe the undesirable effects of the medicinal product.", 0, 1, undesirableEffect)); 2623 } 2624 2625 @Override 2626 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 2627 switch (_hash) { 2628 case -1618432855: /*identifier*/ return new Property("identifier", "Identifier", "Business identifier for this issue.", 0, java.lang.Integer.MAX_VALUE, identifier); 2629 case 3575610: /*type*/ return new Property("type", "code", "indication | contraindication | interaction | undesirable-effect | warning.", 0, 1, type); 2630 case 50511102: /*category*/ return new Property("category", "CodeableConcept", "A categorisation of the issue, primarily for dividing warnings into subject heading areas such as \"Pregnancy and Lactation\", \"Overdose\", \"Effects on Ability to Drive and Use Machines\".", 0, java.lang.Integer.MAX_VALUE, category); 2631 case -1867885268: /*subject*/ return new Property("subject", "Reference(MedicinalProductDefinition|Medication|ActivityDefinition|PlanDefinition|Device|DeviceDefinition|Substance)", "The medication or procedure for which this is an indication.", 0, java.lang.Integer.MAX_VALUE, subject); 2632 case -892481550: /*status*/ return new Property("status", "CodeableConcept", "Whether this is a current issue or one that has been retired etc.", 0, 1, status); 2633 case -1724546052: /*description*/ return new Property("description", "markdown", "General description of an effect (particularly for a general warning, rather than any of the more specific types such as indication) for when a distinct coded or textual description is not appropriate using Indication.diseaseSymptomProcedure.text, Contraindication.diseaseSymptomProcedure.text etc. For example \"May affect ability to drive\".", 0, 1, description); 2634 case 107135229: /*contraindication*/ return new Property("contraindication", "", "Specifics for when this is a contraindication.", 0, 1, contraindication); 2635 case -597168804: /*indication*/ return new Property("indication", "", "Specifics for when this is an indication.", 0, 1, indication); 2636 case 1844104722: /*interaction*/ return new Property("interaction", "", "Specifics for when this is an interaction.", 0, 1, interaction); 2637 case -2023558323: /*population*/ return new Property("population", "Population", "The population group to which this applies.", 0, java.lang.Integer.MAX_VALUE, population); 2638 case 444367565: /*undesirableEffect*/ return new Property("undesirableEffect", "", "Describe the undesirable effects of the medicinal product.", 0, 1, undesirableEffect); 2639 default: return super.getNamedProperty(_hash, _name, _checkValid); 2640 } 2641 2642 } 2643 2644 @Override 2645 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 2646 switch (hash) { 2647 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier 2648 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<ClinicalUseIssueType> 2649 case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept 2650 case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // Reference 2651 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept 2652 case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType 2653 case 107135229: /*contraindication*/ return this.contraindication == null ? new Base[0] : new Base[] {this.contraindication}; // ClinicalUseIssueContraindicationComponent 2654 case -597168804: /*indication*/ return this.indication == null ? new Base[0] : new Base[] {this.indication}; // ClinicalUseIssueIndicationComponent 2655 case 1844104722: /*interaction*/ return this.interaction == null ? new Base[0] : new Base[] {this.interaction}; // ClinicalUseIssueInteractionComponent 2656 case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // Population 2657 case 444367565: /*undesirableEffect*/ return this.undesirableEffect == null ? new Base[0] : new Base[] {this.undesirableEffect}; // ClinicalUseIssueUndesirableEffectComponent 2658 default: return super.getProperty(hash, name, checkValid); 2659 } 2660 2661 } 2662 2663 @Override 2664 public Base setProperty(int hash, String name, Base value) throws FHIRException { 2665 switch (hash) { 2666 case -1618432855: // identifier 2667 this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier 2668 return value; 2669 case 3575610: // type 2670 value = new ClinicalUseIssueTypeEnumFactory().fromType(TypeConvertor.castToCode(value)); 2671 this.type = (Enumeration) value; // Enumeration<ClinicalUseIssueType> 2672 return value; 2673 case 50511102: // category 2674 this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept 2675 return value; 2676 case -1867885268: // subject 2677 this.getSubject().add(TypeConvertor.castToReference(value)); // Reference 2678 return value; 2679 case -892481550: // status 2680 this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 2681 return value; 2682 case -1724546052: // description 2683 this.description = TypeConvertor.castToMarkdown(value); // MarkdownType 2684 return value; 2685 case 107135229: // contraindication 2686 this.contraindication = (ClinicalUseIssueContraindicationComponent) value; // ClinicalUseIssueContraindicationComponent 2687 return value; 2688 case -597168804: // indication 2689 this.indication = (ClinicalUseIssueIndicationComponent) value; // ClinicalUseIssueIndicationComponent 2690 return value; 2691 case 1844104722: // interaction 2692 this.interaction = (ClinicalUseIssueInteractionComponent) value; // ClinicalUseIssueInteractionComponent 2693 return value; 2694 case -2023558323: // population 2695 this.getPopulation().add(TypeConvertor.castToPopulation(value)); // Population 2696 return value; 2697 case 444367565: // undesirableEffect 2698 this.undesirableEffect = (ClinicalUseIssueUndesirableEffectComponent) value; // ClinicalUseIssueUndesirableEffectComponent 2699 return value; 2700 default: return super.setProperty(hash, name, value); 2701 } 2702 2703 } 2704 2705 @Override 2706 public Base setProperty(String name, Base value) throws FHIRException { 2707 if (name.equals("identifier")) { 2708 this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); 2709 } else if (name.equals("type")) { 2710 value = new ClinicalUseIssueTypeEnumFactory().fromType(TypeConvertor.castToCode(value)); 2711 this.type = (Enumeration) value; // Enumeration<ClinicalUseIssueType> 2712 } else if (name.equals("category")) { 2713 this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); 2714 } else if (name.equals("subject")) { 2715 this.getSubject().add(TypeConvertor.castToReference(value)); 2716 } else if (name.equals("status")) { 2717 this.status = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 2718 } else if (name.equals("description")) { 2719 this.description = TypeConvertor.castToMarkdown(value); // MarkdownType 2720 } else if (name.equals("contraindication")) { 2721 this.contraindication = (ClinicalUseIssueContraindicationComponent) value; // ClinicalUseIssueContraindicationComponent 2722 } else if (name.equals("indication")) { 2723 this.indication = (ClinicalUseIssueIndicationComponent) value; // ClinicalUseIssueIndicationComponent 2724 } else if (name.equals("interaction")) { 2725 this.interaction = (ClinicalUseIssueInteractionComponent) value; // ClinicalUseIssueInteractionComponent 2726 } else if (name.equals("population")) { 2727 this.getPopulation().add(TypeConvertor.castToPopulation(value)); 2728 } else if (name.equals("undesirableEffect")) { 2729 this.undesirableEffect = (ClinicalUseIssueUndesirableEffectComponent) value; // ClinicalUseIssueUndesirableEffectComponent 2730 } else 2731 return super.setProperty(name, value); 2732 return value; 2733 } 2734 2735 @Override 2736 public Base makeProperty(int hash, String name) throws FHIRException { 2737 switch (hash) { 2738 case -1618432855: return addIdentifier(); 2739 case 3575610: return getTypeElement(); 2740 case 50511102: return addCategory(); 2741 case -1867885268: return addSubject(); 2742 case -892481550: return getStatus(); 2743 case -1724546052: return getDescriptionElement(); 2744 case 107135229: return getContraindication(); 2745 case -597168804: return getIndication(); 2746 case 1844104722: return getInteraction(); 2747 case -2023558323: return addPopulation(); 2748 case 444367565: return getUndesirableEffect(); 2749 default: return super.makeProperty(hash, name); 2750 } 2751 2752 } 2753 2754 @Override 2755 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 2756 switch (hash) { 2757 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 2758 case 3575610: /*type*/ return new String[] {"code"}; 2759 case 50511102: /*category*/ return new String[] {"CodeableConcept"}; 2760 case -1867885268: /*subject*/ return new String[] {"Reference"}; 2761 case -892481550: /*status*/ return new String[] {"CodeableConcept"}; 2762 case -1724546052: /*description*/ return new String[] {"markdown"}; 2763 case 107135229: /*contraindication*/ return new String[] {}; 2764 case -597168804: /*indication*/ return new String[] {}; 2765 case 1844104722: /*interaction*/ return new String[] {}; 2766 case -2023558323: /*population*/ return new String[] {"Population"}; 2767 case 444367565: /*undesirableEffect*/ return new String[] {}; 2768 default: return super.getTypesForProperty(hash, name); 2769 } 2770 2771 } 2772 2773 @Override 2774 public Base addChild(String name) throws FHIRException { 2775 if (name.equals("identifier")) { 2776 return addIdentifier(); 2777 } 2778 else if (name.equals("type")) { 2779 throw new FHIRException("Cannot call addChild on a primitive type ClinicalUseIssue.type"); 2780 } 2781 else if (name.equals("category")) { 2782 return addCategory(); 2783 } 2784 else if (name.equals("subject")) { 2785 return addSubject(); 2786 } 2787 else if (name.equals("status")) { 2788 this.status = new CodeableConcept(); 2789 return this.status; 2790 } 2791 else if (name.equals("description")) { 2792 throw new FHIRException("Cannot call addChild on a primitive type ClinicalUseIssue.description"); 2793 } 2794 else if (name.equals("contraindication")) { 2795 this.contraindication = new ClinicalUseIssueContraindicationComponent(); 2796 return this.contraindication; 2797 } 2798 else if (name.equals("indication")) { 2799 this.indication = new ClinicalUseIssueIndicationComponent(); 2800 return this.indication; 2801 } 2802 else if (name.equals("interaction")) { 2803 this.interaction = new ClinicalUseIssueInteractionComponent(); 2804 return this.interaction; 2805 } 2806 else if (name.equals("population")) { 2807 return addPopulation(); 2808 } 2809 else if (name.equals("undesirableEffect")) { 2810 this.undesirableEffect = new ClinicalUseIssueUndesirableEffectComponent(); 2811 return this.undesirableEffect; 2812 } 2813 else 2814 return super.addChild(name); 2815 } 2816 2817 public String fhirType() { 2818 return "ClinicalUseIssue"; 2819 2820 } 2821 2822 public ClinicalUseIssue copy() { 2823 ClinicalUseIssue dst = new ClinicalUseIssue(); 2824 copyValues(dst); 2825 return dst; 2826 } 2827 2828 public void copyValues(ClinicalUseIssue dst) { 2829 super.copyValues(dst); 2830 if (identifier != null) { 2831 dst.identifier = new ArrayList<Identifier>(); 2832 for (Identifier i : identifier) 2833 dst.identifier.add(i.copy()); 2834 }; 2835 dst.type = type == null ? null : type.copy(); 2836 if (category != null) { 2837 dst.category = new ArrayList<CodeableConcept>(); 2838 for (CodeableConcept i : category) 2839 dst.category.add(i.copy()); 2840 }; 2841 if (subject != null) { 2842 dst.subject = new ArrayList<Reference>(); 2843 for (Reference i : subject) 2844 dst.subject.add(i.copy()); 2845 }; 2846 dst.status = status == null ? null : status.copy(); 2847 dst.description = description == null ? null : description.copy(); 2848 dst.contraindication = contraindication == null ? null : contraindication.copy(); 2849 dst.indication = indication == null ? null : indication.copy(); 2850 dst.interaction = interaction == null ? null : interaction.copy(); 2851 if (population != null) { 2852 dst.population = new ArrayList<Population>(); 2853 for (Population i : population) 2854 dst.population.add(i.copy()); 2855 }; 2856 dst.undesirableEffect = undesirableEffect == null ? null : undesirableEffect.copy(); 2857 } 2858 2859 protected ClinicalUseIssue typedCopy() { 2860 return copy(); 2861 } 2862 2863 @Override 2864 public boolean equalsDeep(Base other_) { 2865 if (!super.equalsDeep(other_)) 2866 return false; 2867 if (!(other_ instanceof ClinicalUseIssue)) 2868 return false; 2869 ClinicalUseIssue o = (ClinicalUseIssue) other_; 2870 return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(category, o.category, true) 2871 && compareDeep(subject, o.subject, true) && compareDeep(status, o.status, true) && compareDeep(description, o.description, true) 2872 && compareDeep(contraindication, o.contraindication, true) && compareDeep(indication, o.indication, true) 2873 && compareDeep(interaction, o.interaction, true) && compareDeep(population, o.population, true) 2874 && compareDeep(undesirableEffect, o.undesirableEffect, true); 2875 } 2876 2877 @Override 2878 public boolean equalsShallow(Base other_) { 2879 if (!super.equalsShallow(other_)) 2880 return false; 2881 if (!(other_ instanceof ClinicalUseIssue)) 2882 return false; 2883 ClinicalUseIssue o = (ClinicalUseIssue) other_; 2884 return compareValues(type, o.type, true) && compareValues(description, o.description, true); 2885 } 2886 2887 public boolean isEmpty() { 2888 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, category 2889 , subject, status, description, contraindication, indication, interaction, population 2890 , undesirableEffect); 2891 } 2892 2893 @Override 2894 public ResourceType getResourceType() { 2895 return ResourceType.ClinicalUseIssue; 2896 } 2897 2898 /** 2899 * Search parameter: <b>contraindication-reference</b> 2900 * <p> 2901 * Description: <b>The situation that is being documented as contraindicating against this item, as a reference</b><br> 2902 * Type: <b>reference</b><br> 2903 * Path: <b>ClinicalUseIssue.contraindication.diseaseSymptomProcedure</b><br> 2904 * </p> 2905 */ 2906 @SearchParamDefinition(name="contraindication-reference", path="ClinicalUseIssue.contraindication.diseaseSymptomProcedure", description="The situation that is being documented as contraindicating against this item, as a reference", type="reference" ) 2907 public static final String SP_CONTRAINDICATION_REFERENCE = "contraindication-reference"; 2908 /** 2909 * <b>Fluent Client</b> search parameter constant for <b>contraindication-reference</b> 2910 * <p> 2911 * Description: <b>The situation that is being documented as contraindicating against this item, as a reference</b><br> 2912 * Type: <b>reference</b><br> 2913 * Path: <b>ClinicalUseIssue.contraindication.diseaseSymptomProcedure</b><br> 2914 * </p> 2915 */ 2916 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTRAINDICATION_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTRAINDICATION_REFERENCE); 2917 2918/** 2919 * Constant for fluent queries to be used to add include statements. Specifies 2920 * the path value of "<b>ClinicalUseIssue:contraindication-reference</b>". 2921 */ 2922 public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTRAINDICATION_REFERENCE = new ca.uhn.fhir.model.api.Include("ClinicalUseIssue:contraindication-reference").toLocked(); 2923 2924 /** 2925 * Search parameter: <b>contraindication</b> 2926 * <p> 2927 * Description: <b>The situation that is being documented as contraindicating against this item, as a code</b><br> 2928 * Type: <b>token</b><br> 2929 * Path: <b>ClinicalUseIssue.contraindication.diseaseSymptomProcedure</b><br> 2930 * </p> 2931 */ 2932 @SearchParamDefinition(name="contraindication", path="ClinicalUseIssue.contraindication.diseaseSymptomProcedure", description="The situation that is being documented as contraindicating against this item, as a code", type="token" ) 2933 public static final String SP_CONTRAINDICATION = "contraindication"; 2934 /** 2935 * <b>Fluent Client</b> search parameter constant for <b>contraindication</b> 2936 * <p> 2937 * Description: <b>The situation that is being documented as contraindicating against this item, as a code</b><br> 2938 * Type: <b>token</b><br> 2939 * Path: <b>ClinicalUseIssue.contraindication.diseaseSymptomProcedure</b><br> 2940 * </p> 2941 */ 2942 public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTRAINDICATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTRAINDICATION); 2943 2944 /** 2945 * Search parameter: <b>effect-reference</b> 2946 * <p> 2947 * Description: <b>The situation in which the undesirable effect may manifest, as a reference</b><br> 2948 * Type: <b>reference</b><br> 2949 * Path: <b>ClinicalUseIssue.undesirableEffect.symptomConditionEffect</b><br> 2950 * </p> 2951 */ 2952 @SearchParamDefinition(name="effect-reference", path="ClinicalUseIssue.undesirableEffect.symptomConditionEffect", description="The situation in which the undesirable effect may manifest, as a reference", type="reference" ) 2953 public static final String SP_EFFECT_REFERENCE = "effect-reference"; 2954 /** 2955 * <b>Fluent Client</b> search parameter constant for <b>effect-reference</b> 2956 * <p> 2957 * Description: <b>The situation in which the undesirable effect may manifest, as a reference</b><br> 2958 * Type: <b>reference</b><br> 2959 * Path: <b>ClinicalUseIssue.undesirableEffect.symptomConditionEffect</b><br> 2960 * </p> 2961 */ 2962 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam EFFECT_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_EFFECT_REFERENCE); 2963 2964/** 2965 * Constant for fluent queries to be used to add include statements. Specifies 2966 * the path value of "<b>ClinicalUseIssue:effect-reference</b>". 2967 */ 2968 public static final ca.uhn.fhir.model.api.Include INCLUDE_EFFECT_REFERENCE = new ca.uhn.fhir.model.api.Include("ClinicalUseIssue:effect-reference").toLocked(); 2969 2970 /** 2971 * Search parameter: <b>effect</b> 2972 * <p> 2973 * Description: <b>The situation in which the undesirable effect may manifest, as a code</b><br> 2974 * Type: <b>token</b><br> 2975 * Path: <b>ClinicalUseIssue.undesirableEffect.symptomConditionEffect</b><br> 2976 * </p> 2977 */ 2978 @SearchParamDefinition(name="effect", path="ClinicalUseIssue.undesirableEffect.symptomConditionEffect", description="The situation in which the undesirable effect may manifest, as a code", type="token" ) 2979 public static final String SP_EFFECT = "effect"; 2980 /** 2981 * <b>Fluent Client</b> search parameter constant for <b>effect</b> 2982 * <p> 2983 * Description: <b>The situation in which the undesirable effect may manifest, as a code</b><br> 2984 * Type: <b>token</b><br> 2985 * Path: <b>ClinicalUseIssue.undesirableEffect.symptomConditionEffect</b><br> 2986 * </p> 2987 */ 2988 public static final ca.uhn.fhir.rest.gclient.TokenClientParam EFFECT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EFFECT); 2989 2990 /** 2991 * Search parameter: <b>identifier</b> 2992 * <p> 2993 * Description: <b>Business identifier for this issue</b><br> 2994 * Type: <b>token</b><br> 2995 * Path: <b>ClinicalUseIssue.identifier</b><br> 2996 * </p> 2997 */ 2998 @SearchParamDefinition(name="identifier", path="ClinicalUseIssue.identifier", description="Business identifier for this issue", type="token" ) 2999 public static final String SP_IDENTIFIER = "identifier"; 3000 /** 3001 * <b>Fluent Client</b> search parameter constant for <b>identifier</b> 3002 * <p> 3003 * Description: <b>Business identifier for this issue</b><br> 3004 * Type: <b>token</b><br> 3005 * Path: <b>ClinicalUseIssue.identifier</b><br> 3006 * </p> 3007 */ 3008 public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); 3009 3010 /** 3011 * Search parameter: <b>indication-reference</b> 3012 * <p> 3013 * Description: <b>The situation that is being documented as an indicaton for this item, as a reference</b><br> 3014 * Type: <b>reference</b><br> 3015 * Path: <b>ClinicalUseIssue.indication.diseaseSymptomProcedure</b><br> 3016 * </p> 3017 */ 3018 @SearchParamDefinition(name="indication-reference", path="ClinicalUseIssue.indication.diseaseSymptomProcedure", description="The situation that is being documented as an indicaton for this item, as a reference", type="reference" ) 3019 public static final String SP_INDICATION_REFERENCE = "indication-reference"; 3020 /** 3021 * <b>Fluent Client</b> search parameter constant for <b>indication-reference</b> 3022 * <p> 3023 * Description: <b>The situation that is being documented as an indicaton for this item, as a reference</b><br> 3024 * Type: <b>reference</b><br> 3025 * Path: <b>ClinicalUseIssue.indication.diseaseSymptomProcedure</b><br> 3026 * </p> 3027 */ 3028 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INDICATION_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INDICATION_REFERENCE); 3029 3030/** 3031 * Constant for fluent queries to be used to add include statements. Specifies 3032 * the path value of "<b>ClinicalUseIssue:indication-reference</b>". 3033 */ 3034 public static final ca.uhn.fhir.model.api.Include INCLUDE_INDICATION_REFERENCE = new ca.uhn.fhir.model.api.Include("ClinicalUseIssue:indication-reference").toLocked(); 3035 3036 /** 3037 * Search parameter: <b>indication</b> 3038 * <p> 3039 * Description: <b>The situation that is being documented as an indicaton for this item, as a code</b><br> 3040 * Type: <b>token</b><br> 3041 * Path: <b>ClinicalUseIssue.indication.diseaseSymptomProcedure</b><br> 3042 * </p> 3043 */ 3044 @SearchParamDefinition(name="indication", path="ClinicalUseIssue.indication.diseaseSymptomProcedure", description="The situation that is being documented as an indicaton for this item, as a code", type="token" ) 3045 public static final String SP_INDICATION = "indication"; 3046 /** 3047 * <b>Fluent Client</b> search parameter constant for <b>indication</b> 3048 * <p> 3049 * Description: <b>The situation that is being documented as an indicaton for this item, as a code</b><br> 3050 * Type: <b>token</b><br> 3051 * Path: <b>ClinicalUseIssue.indication.diseaseSymptomProcedure</b><br> 3052 * </p> 3053 */ 3054 public static final ca.uhn.fhir.rest.gclient.TokenClientParam INDICATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INDICATION); 3055 3056 /** 3057 * Search parameter: <b>interaction</b> 3058 * <p> 3059 * Description: <b>The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction</b><br> 3060 * Type: <b>token</b><br> 3061 * Path: <b>ClinicalUseIssue.interaction.type</b><br> 3062 * </p> 3063 */ 3064 @SearchParamDefinition(name="interaction", path="ClinicalUseIssue.interaction.type", description="The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction", type="token" ) 3065 public static final String SP_INTERACTION = "interaction"; 3066 /** 3067 * <b>Fluent Client</b> search parameter constant for <b>interaction</b> 3068 * <p> 3069 * Description: <b>The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction</b><br> 3070 * Type: <b>token</b><br> 3071 * Path: <b>ClinicalUseIssue.interaction.type</b><br> 3072 * </p> 3073 */ 3074 public static final ca.uhn.fhir.rest.gclient.TokenClientParam INTERACTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INTERACTION); 3075 3076 /** 3077 * Search parameter: <b>product</b> 3078 * <p> 3079 * Description: <b>The medicinal product for which this is a clinical usage issue</b><br> 3080 * Type: <b>reference</b><br> 3081 * Path: <b>ClinicalUseIssue.subject.where(resolve() is MedicinalProductDefinition)</b><br> 3082 * </p> 3083 */ 3084 @SearchParamDefinition(name="product", path="ClinicalUseIssue.subject.where(resolve() is MedicinalProductDefinition)", description="The medicinal product for which this is a clinical usage issue", type="reference", target={ActivityDefinition.class, Device.class, DeviceDefinition.class, Medication.class, MedicinalProductDefinition.class, PlanDefinition.class, Substance.class } ) 3085 public static final String SP_PRODUCT = "product"; 3086 /** 3087 * <b>Fluent Client</b> search parameter constant for <b>product</b> 3088 * <p> 3089 * Description: <b>The medicinal product for which this is a clinical usage issue</b><br> 3090 * Type: <b>reference</b><br> 3091 * Path: <b>ClinicalUseIssue.subject.where(resolve() is MedicinalProductDefinition)</b><br> 3092 * </p> 3093 */ 3094 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRODUCT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRODUCT); 3095 3096/** 3097 * Constant for fluent queries to be used to add include statements. Specifies 3098 * the path value of "<b>ClinicalUseIssue:product</b>". 3099 */ 3100 public static final ca.uhn.fhir.model.api.Include INCLUDE_PRODUCT = new ca.uhn.fhir.model.api.Include("ClinicalUseIssue:product").toLocked(); 3101 3102 /** 3103 * Search parameter: <b>subject</b> 3104 * <p> 3105 * Description: <b>The resource for which this is a clinical usage issue</b><br> 3106 * Type: <b>reference</b><br> 3107 * Path: <b>ClinicalUseIssue.subject</b><br> 3108 * </p> 3109 */ 3110 @SearchParamDefinition(name="subject", path="ClinicalUseIssue.subject", description="The resource for which this is a clinical usage issue", type="reference", target={ActivityDefinition.class, Device.class, DeviceDefinition.class, Medication.class, MedicinalProductDefinition.class, PlanDefinition.class, Substance.class } ) 3111 public static final String SP_SUBJECT = "subject"; 3112 /** 3113 * <b>Fluent Client</b> search parameter constant for <b>subject</b> 3114 * <p> 3115 * Description: <b>The resource for which this is a clinical usage issue</b><br> 3116 * Type: <b>reference</b><br> 3117 * Path: <b>ClinicalUseIssue.subject</b><br> 3118 * </p> 3119 */ 3120 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); 3121 3122/** 3123 * Constant for fluent queries to be used to add include statements. Specifies 3124 * the path value of "<b>ClinicalUseIssue:subject</b>". 3125 */ 3126 public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("ClinicalUseIssue:subject").toLocked(); 3127 3128 /** 3129 * Search parameter: <b>type</b> 3130 * <p> 3131 * Description: <b>indication | contraindication | interaction | undesirable-effect | warning</b><br> 3132 * Type: <b>token</b><br> 3133 * Path: <b>ClinicalUseIssue.type</b><br> 3134 * </p> 3135 */ 3136 @SearchParamDefinition(name="type", path="ClinicalUseIssue.type", description="indication | contraindication | interaction | undesirable-effect | warning", type="token" ) 3137 public static final String SP_TYPE = "type"; 3138 /** 3139 * <b>Fluent Client</b> search parameter constant for <b>type</b> 3140 * <p> 3141 * Description: <b>indication | contraindication | interaction | undesirable-effect | warning</b><br> 3142 * Type: <b>token</b><br> 3143 * Path: <b>ClinicalUseIssue.type</b><br> 3144 * </p> 3145 */ 3146 public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); 3147 3148 3149} 3150