001package org.hl7.fhir.dstu3.model; 002 003/*- 004 * #%L 005 * org.hl7.fhir.dstu3 006 * %% 007 * Copyright (C) 2014 - 2019 Health Level 7 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023/* 024 Copyright (c) 2011+, HL7, Inc. 025 All rights reserved. 026 027 Redistribution and use in source and binary forms, with or without modification, 028 are permitted provided that the following conditions are met: 029 030 * Redistributions of source code must retain the above copyright notice, this 031 list of conditions and the following disclaimer. 032 * Redistributions in binary form must reproduce the above copyright notice, 033 this list of conditions and the following disclaimer in the documentation 034 and/or other materials provided with the distribution. 035 * Neither the name of HL7 nor the names of its contributors may be used to 036 endorse or promote products derived from this software without specific 037 prior written permission. 038 039 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 040 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 041 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 042 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 043 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 044 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 045 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 046 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 047 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 048 POSSIBILITY OF SUCH DAMAGE. 049 050*/ 051 052// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x 053import java.util.List; 054 055import org.hl7.fhir.exceptions.FHIRException; 056import org.hl7.fhir.utilities.Utilities; 057 058import ca.uhn.fhir.model.api.annotation.Child; 059import ca.uhn.fhir.model.api.annotation.Description; 060import ca.uhn.fhir.model.api.annotation.ResourceDef; 061import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 062/** 063 * A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge. This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques. A ResearchStudy involves the gathering of information about human or animal subjects. 064 */ 065@ResourceDef(name="ResearchSubject", profile="http://hl7.org/fhir/Profile/ResearchSubject") 066public class ResearchSubject extends DomainResource { 067 068 public enum ResearchSubjectStatus { 069 /** 070 * The subject has been identified as a potential participant in the study but has not yet agreed to participate 071 */ 072 CANDIDATE, 073 /** 074 * The subject has agreed to participate in the study but has not yet begun performing any action within the study 075 */ 076 ENROLLED, 077 /** 078 * The subject is currently being monitored and/or subject to treatment as part of the study 079 */ 080 ACTIVE, 081 /** 082 * The subject has temporarily discontinued monitoring/treatment as part of the study 083 */ 084 SUSPENDED, 085 /** 086 * The subject has permanently ended participation in the study prior to completion of the intended monitoring/treatment 087 */ 088 WITHDRAWN, 089 /** 090 * All intended monitoring/treatment of the subject has been completed and their engagement with the study is now ended 091 */ 092 COMPLETED, 093 /** 094 * added to help the parsers with the generic types 095 */ 096 NULL; 097 public static ResearchSubjectStatus fromCode(String codeString) throws FHIRException { 098 if (codeString == null || "".equals(codeString)) 099 return null; 100 if ("candidate".equals(codeString)) 101 return CANDIDATE; 102 if ("enrolled".equals(codeString)) 103 return ENROLLED; 104 if ("active".equals(codeString)) 105 return ACTIVE; 106 if ("suspended".equals(codeString)) 107 return SUSPENDED; 108 if ("withdrawn".equals(codeString)) 109 return WITHDRAWN; 110 if ("completed".equals(codeString)) 111 return COMPLETED; 112 if (Configuration.isAcceptInvalidEnums()) 113 return null; 114 else 115 throw new FHIRException("Unknown ResearchSubjectStatus code '"+codeString+"'"); 116 } 117 public String toCode() { 118 switch (this) { 119 case CANDIDATE: return "candidate"; 120 case ENROLLED: return "enrolled"; 121 case ACTIVE: return "active"; 122 case SUSPENDED: return "suspended"; 123 case WITHDRAWN: return "withdrawn"; 124 case COMPLETED: return "completed"; 125 default: return "?"; 126 } 127 } 128 public String getSystem() { 129 switch (this) { 130 case CANDIDATE: return "http://hl7.org/fhir/research-subject-status"; 131 case ENROLLED: return "http://hl7.org/fhir/research-subject-status"; 132 case ACTIVE: return "http://hl7.org/fhir/research-subject-status"; 133 case SUSPENDED: return "http://hl7.org/fhir/research-subject-status"; 134 case WITHDRAWN: return "http://hl7.org/fhir/research-subject-status"; 135 case COMPLETED: return "http://hl7.org/fhir/research-subject-status"; 136 default: return "?"; 137 } 138 } 139 public String getDefinition() { 140 switch (this) { 141 case CANDIDATE: return "The subject has been identified as a potential participant in the study but has not yet agreed to participate"; 142 case ENROLLED: return "The subject has agreed to participate in the study but has not yet begun performing any action within the study"; 143 case ACTIVE: return "The subject is currently being monitored and/or subject to treatment as part of the study"; 144 case SUSPENDED: return "The subject has temporarily discontinued monitoring/treatment as part of the study"; 145 case WITHDRAWN: return "The subject has permanently ended participation in the study prior to completion of the intended monitoring/treatment"; 146 case COMPLETED: return "All intended monitoring/treatment of the subject has been completed and their engagement with the study is now ended"; 147 default: return "?"; 148 } 149 } 150 public String getDisplay() { 151 switch (this) { 152 case CANDIDATE: return "Candidate"; 153 case ENROLLED: return "Enrolled"; 154 case ACTIVE: return "Active"; 155 case SUSPENDED: return "Suspended"; 156 case WITHDRAWN: return "Withdrawn"; 157 case COMPLETED: return "Completed"; 158 default: return "?"; 159 } 160 } 161 } 162 163 public static class ResearchSubjectStatusEnumFactory implements EnumFactory<ResearchSubjectStatus> { 164 public ResearchSubjectStatus fromCode(String codeString) throws IllegalArgumentException { 165 if (codeString == null || "".equals(codeString)) 166 if (codeString == null || "".equals(codeString)) 167 return null; 168 if ("candidate".equals(codeString)) 169 return ResearchSubjectStatus.CANDIDATE; 170 if ("enrolled".equals(codeString)) 171 return ResearchSubjectStatus.ENROLLED; 172 if ("active".equals(codeString)) 173 return ResearchSubjectStatus.ACTIVE; 174 if ("suspended".equals(codeString)) 175 return ResearchSubjectStatus.SUSPENDED; 176 if ("withdrawn".equals(codeString)) 177 return ResearchSubjectStatus.WITHDRAWN; 178 if ("completed".equals(codeString)) 179 return ResearchSubjectStatus.COMPLETED; 180 throw new IllegalArgumentException("Unknown ResearchSubjectStatus code '"+codeString+"'"); 181 } 182 public Enumeration<ResearchSubjectStatus> fromType(Base code) throws FHIRException { 183 if (code == null) 184 return null; 185 if (code.isEmpty()) 186 return new Enumeration<ResearchSubjectStatus>(this); 187 String codeString = ((PrimitiveType) code).asStringValue(); 188 if (codeString == null || "".equals(codeString)) 189 return null; 190 if ("candidate".equals(codeString)) 191 return new Enumeration<ResearchSubjectStatus>(this, ResearchSubjectStatus.CANDIDATE); 192 if ("enrolled".equals(codeString)) 193 return new Enumeration<ResearchSubjectStatus>(this, ResearchSubjectStatus.ENROLLED); 194 if ("active".equals(codeString)) 195 return new Enumeration<ResearchSubjectStatus>(this, ResearchSubjectStatus.ACTIVE); 196 if ("suspended".equals(codeString)) 197 return new Enumeration<ResearchSubjectStatus>(this, ResearchSubjectStatus.SUSPENDED); 198 if ("withdrawn".equals(codeString)) 199 return new Enumeration<ResearchSubjectStatus>(this, ResearchSubjectStatus.WITHDRAWN); 200 if ("completed".equals(codeString)) 201 return new Enumeration<ResearchSubjectStatus>(this, ResearchSubjectStatus.COMPLETED); 202 throw new FHIRException("Unknown ResearchSubjectStatus code '"+codeString+"'"); 203 } 204 public String toCode(ResearchSubjectStatus code) { 205 if (code == ResearchSubjectStatus.CANDIDATE) 206 return "candidate"; 207 if (code == ResearchSubjectStatus.ENROLLED) 208 return "enrolled"; 209 if (code == ResearchSubjectStatus.ACTIVE) 210 return "active"; 211 if (code == ResearchSubjectStatus.SUSPENDED) 212 return "suspended"; 213 if (code == ResearchSubjectStatus.WITHDRAWN) 214 return "withdrawn"; 215 if (code == ResearchSubjectStatus.COMPLETED) 216 return "completed"; 217 return "?"; 218 } 219 public String toSystem(ResearchSubjectStatus code) { 220 return code.getSystem(); 221 } 222 } 223 224 /** 225 * Identifiers assigned to this research study by the sponsor or other systems. 226 */ 227 @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) 228 @Description(shortDefinition="Business Identifier for research subject", formalDefinition="Identifiers assigned to this research study by the sponsor or other systems." ) 229 protected Identifier identifier; 230 231 /** 232 * The current state of the subject. 233 */ 234 @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) 235 @Description(shortDefinition="candidate | enrolled | active | suspended | withdrawn | completed", formalDefinition="The current state of the subject." ) 236 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/research-subject-status") 237 protected Enumeration<ResearchSubjectStatus> status; 238 239 /** 240 * The dates the subject began and ended their participation in the study. 241 */ 242 @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true) 243 @Description(shortDefinition="Start and end of participation", formalDefinition="The dates the subject began and ended their participation in the study." ) 244 protected Period period; 245 246 /** 247 * Reference to the study the subject is participating in. 248 */ 249 @Child(name = "study", type = {ResearchStudy.class}, order=3, min=1, max=1, modifier=false, summary=true) 250 @Description(shortDefinition="Study subject is part of", formalDefinition="Reference to the study the subject is participating in." ) 251 protected Reference study; 252 253 /** 254 * The actual object that is the target of the reference (Reference to the study the subject is participating in.) 255 */ 256 protected ResearchStudy studyTarget; 257 258 /** 259 * The record of the person or animal who is involved in the study. 260 */ 261 @Child(name = "individual", type = {Patient.class}, order=4, min=1, max=1, modifier=false, summary=true) 262 @Description(shortDefinition="Who is part of study", formalDefinition="The record of the person or animal who is involved in the study." ) 263 protected Reference individual; 264 265 /** 266 * The actual object that is the target of the reference (The record of the person or animal who is involved in the study.) 267 */ 268 protected Patient individualTarget; 269 270 /** 271 * The name of the arm in the study the subject is expected to follow as part of this study. 272 */ 273 @Child(name = "assignedArm", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) 274 @Description(shortDefinition="What path should be followed", formalDefinition="The name of the arm in the study the subject is expected to follow as part of this study." ) 275 protected StringType assignedArm; 276 277 /** 278 * The name of the arm in the study the subject actually followed as part of this study. 279 */ 280 @Child(name = "actualArm", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false) 281 @Description(shortDefinition="What path was followed", formalDefinition="The name of the arm in the study the subject actually followed as part of this study." ) 282 protected StringType actualArm; 283 284 /** 285 * A record of the patient's informed agreement to participate in the study. 286 */ 287 @Child(name = "consent", type = {Consent.class}, order=7, min=0, max=1, modifier=false, summary=false) 288 @Description(shortDefinition="Agreement to participate in study", formalDefinition="A record of the patient's informed agreement to participate in the study." ) 289 protected Reference consent; 290 291 /** 292 * The actual object that is the target of the reference (A record of the patient's informed agreement to participate in the study.) 293 */ 294 protected Consent consentTarget; 295 296 private static final long serialVersionUID = -1730128953L; 297 298 /** 299 * Constructor 300 */ 301 public ResearchSubject() { 302 super(); 303 } 304 305 /** 306 * Constructor 307 */ 308 public ResearchSubject(Enumeration<ResearchSubjectStatus> status, Reference study, Reference individual) { 309 super(); 310 this.status = status; 311 this.study = study; 312 this.individual = individual; 313 } 314 315 /** 316 * @return {@link #identifier} (Identifiers assigned to this research study by the sponsor or other systems.) 317 */ 318 public Identifier getIdentifier() { 319 if (this.identifier == null) 320 if (Configuration.errorOnAutoCreate()) 321 throw new Error("Attempt to auto-create ResearchSubject.identifier"); 322 else if (Configuration.doAutoCreate()) 323 this.identifier = new Identifier(); // cc 324 return this.identifier; 325 } 326 327 public boolean hasIdentifier() { 328 return this.identifier != null && !this.identifier.isEmpty(); 329 } 330 331 /** 332 * @param value {@link #identifier} (Identifiers assigned to this research study by the sponsor or other systems.) 333 */ 334 public ResearchSubject setIdentifier(Identifier value) { 335 this.identifier = value; 336 return this; 337 } 338 339 /** 340 * @return {@link #status} (The current state of the subject.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 341 */ 342 public Enumeration<ResearchSubjectStatus> getStatusElement() { 343 if (this.status == null) 344 if (Configuration.errorOnAutoCreate()) 345 throw new Error("Attempt to auto-create ResearchSubject.status"); 346 else if (Configuration.doAutoCreate()) 347 this.status = new Enumeration<ResearchSubjectStatus>(new ResearchSubjectStatusEnumFactory()); // bb 348 return this.status; 349 } 350 351 public boolean hasStatusElement() { 352 return this.status != null && !this.status.isEmpty(); 353 } 354 355 public boolean hasStatus() { 356 return this.status != null && !this.status.isEmpty(); 357 } 358 359 /** 360 * @param value {@link #status} (The current state of the subject.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 361 */ 362 public ResearchSubject setStatusElement(Enumeration<ResearchSubjectStatus> value) { 363 this.status = value; 364 return this; 365 } 366 367 /** 368 * @return The current state of the subject. 369 */ 370 public ResearchSubjectStatus getStatus() { 371 return this.status == null ? null : this.status.getValue(); 372 } 373 374 /** 375 * @param value The current state of the subject. 376 */ 377 public ResearchSubject setStatus(ResearchSubjectStatus value) { 378 if (this.status == null) 379 this.status = new Enumeration<ResearchSubjectStatus>(new ResearchSubjectStatusEnumFactory()); 380 this.status.setValue(value); 381 return this; 382 } 383 384 /** 385 * @return {@link #period} (The dates the subject began and ended their participation in the study.) 386 */ 387 public Period getPeriod() { 388 if (this.period == null) 389 if (Configuration.errorOnAutoCreate()) 390 throw new Error("Attempt to auto-create ResearchSubject.period"); 391 else if (Configuration.doAutoCreate()) 392 this.period = new Period(); // cc 393 return this.period; 394 } 395 396 public boolean hasPeriod() { 397 return this.period != null && !this.period.isEmpty(); 398 } 399 400 /** 401 * @param value {@link #period} (The dates the subject began and ended their participation in the study.) 402 */ 403 public ResearchSubject setPeriod(Period value) { 404 this.period = value; 405 return this; 406 } 407 408 /** 409 * @return {@link #study} (Reference to the study the subject is participating in.) 410 */ 411 public Reference getStudy() { 412 if (this.study == null) 413 if (Configuration.errorOnAutoCreate()) 414 throw new Error("Attempt to auto-create ResearchSubject.study"); 415 else if (Configuration.doAutoCreate()) 416 this.study = new Reference(); // cc 417 return this.study; 418 } 419 420 public boolean hasStudy() { 421 return this.study != null && !this.study.isEmpty(); 422 } 423 424 /** 425 * @param value {@link #study} (Reference to the study the subject is participating in.) 426 */ 427 public ResearchSubject setStudy(Reference value) { 428 this.study = value; 429 return this; 430 } 431 432 /** 433 * @return {@link #study} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the study the subject is participating in.) 434 */ 435 public ResearchStudy getStudyTarget() { 436 if (this.studyTarget == null) 437 if (Configuration.errorOnAutoCreate()) 438 throw new Error("Attempt to auto-create ResearchSubject.study"); 439 else if (Configuration.doAutoCreate()) 440 this.studyTarget = new ResearchStudy(); // aa 441 return this.studyTarget; 442 } 443 444 /** 445 * @param value {@link #study} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the study the subject is participating in.) 446 */ 447 public ResearchSubject setStudyTarget(ResearchStudy value) { 448 this.studyTarget = value; 449 return this; 450 } 451 452 /** 453 * @return {@link #individual} (The record of the person or animal who is involved in the study.) 454 */ 455 public Reference getIndividual() { 456 if (this.individual == null) 457 if (Configuration.errorOnAutoCreate()) 458 throw new Error("Attempt to auto-create ResearchSubject.individual"); 459 else if (Configuration.doAutoCreate()) 460 this.individual = new Reference(); // cc 461 return this.individual; 462 } 463 464 public boolean hasIndividual() { 465 return this.individual != null && !this.individual.isEmpty(); 466 } 467 468 /** 469 * @param value {@link #individual} (The record of the person or animal who is involved in the study.) 470 */ 471 public ResearchSubject setIndividual(Reference value) { 472 this.individual = value; 473 return this; 474 } 475 476 /** 477 * @return {@link #individual} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The record of the person or animal who is involved in the study.) 478 */ 479 public Patient getIndividualTarget() { 480 if (this.individualTarget == null) 481 if (Configuration.errorOnAutoCreate()) 482 throw new Error("Attempt to auto-create ResearchSubject.individual"); 483 else if (Configuration.doAutoCreate()) 484 this.individualTarget = new Patient(); // aa 485 return this.individualTarget; 486 } 487 488 /** 489 * @param value {@link #individual} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The record of the person or animal who is involved in the study.) 490 */ 491 public ResearchSubject setIndividualTarget(Patient value) { 492 this.individualTarget = value; 493 return this; 494 } 495 496 /** 497 * @return {@link #assignedArm} (The name of the arm in the study the subject is expected to follow as part of this study.). This is the underlying object with id, value and extensions. The accessor "getAssignedArm" gives direct access to the value 498 */ 499 public StringType getAssignedArmElement() { 500 if (this.assignedArm == null) 501 if (Configuration.errorOnAutoCreate()) 502 throw new Error("Attempt to auto-create ResearchSubject.assignedArm"); 503 else if (Configuration.doAutoCreate()) 504 this.assignedArm = new StringType(); // bb 505 return this.assignedArm; 506 } 507 508 public boolean hasAssignedArmElement() { 509 return this.assignedArm != null && !this.assignedArm.isEmpty(); 510 } 511 512 public boolean hasAssignedArm() { 513 return this.assignedArm != null && !this.assignedArm.isEmpty(); 514 } 515 516 /** 517 * @param value {@link #assignedArm} (The name of the arm in the study the subject is expected to follow as part of this study.). This is the underlying object with id, value and extensions. The accessor "getAssignedArm" gives direct access to the value 518 */ 519 public ResearchSubject setAssignedArmElement(StringType value) { 520 this.assignedArm = value; 521 return this; 522 } 523 524 /** 525 * @return The name of the arm in the study the subject is expected to follow as part of this study. 526 */ 527 public String getAssignedArm() { 528 return this.assignedArm == null ? null : this.assignedArm.getValue(); 529 } 530 531 /** 532 * @param value The name of the arm in the study the subject is expected to follow as part of this study. 533 */ 534 public ResearchSubject setAssignedArm(String value) { 535 if (Utilities.noString(value)) 536 this.assignedArm = null; 537 else { 538 if (this.assignedArm == null) 539 this.assignedArm = new StringType(); 540 this.assignedArm.setValue(value); 541 } 542 return this; 543 } 544 545 /** 546 * @return {@link #actualArm} (The name of the arm in the study the subject actually followed as part of this study.). This is the underlying object with id, value and extensions. The accessor "getActualArm" gives direct access to the value 547 */ 548 public StringType getActualArmElement() { 549 if (this.actualArm == null) 550 if (Configuration.errorOnAutoCreate()) 551 throw new Error("Attempt to auto-create ResearchSubject.actualArm"); 552 else if (Configuration.doAutoCreate()) 553 this.actualArm = new StringType(); // bb 554 return this.actualArm; 555 } 556 557 public boolean hasActualArmElement() { 558 return this.actualArm != null && !this.actualArm.isEmpty(); 559 } 560 561 public boolean hasActualArm() { 562 return this.actualArm != null && !this.actualArm.isEmpty(); 563 } 564 565 /** 566 * @param value {@link #actualArm} (The name of the arm in the study the subject actually followed as part of this study.). This is the underlying object with id, value and extensions. The accessor "getActualArm" gives direct access to the value 567 */ 568 public ResearchSubject setActualArmElement(StringType value) { 569 this.actualArm = value; 570 return this; 571 } 572 573 /** 574 * @return The name of the arm in the study the subject actually followed as part of this study. 575 */ 576 public String getActualArm() { 577 return this.actualArm == null ? null : this.actualArm.getValue(); 578 } 579 580 /** 581 * @param value The name of the arm in the study the subject actually followed as part of this study. 582 */ 583 public ResearchSubject setActualArm(String value) { 584 if (Utilities.noString(value)) 585 this.actualArm = null; 586 else { 587 if (this.actualArm == null) 588 this.actualArm = new StringType(); 589 this.actualArm.setValue(value); 590 } 591 return this; 592 } 593 594 /** 595 * @return {@link #consent} (A record of the patient's informed agreement to participate in the study.) 596 */ 597 public Reference getConsent() { 598 if (this.consent == null) 599 if (Configuration.errorOnAutoCreate()) 600 throw new Error("Attempt to auto-create ResearchSubject.consent"); 601 else if (Configuration.doAutoCreate()) 602 this.consent = new Reference(); // cc 603 return this.consent; 604 } 605 606 public boolean hasConsent() { 607 return this.consent != null && !this.consent.isEmpty(); 608 } 609 610 /** 611 * @param value {@link #consent} (A record of the patient's informed agreement to participate in the study.) 612 */ 613 public ResearchSubject setConsent(Reference value) { 614 this.consent = value; 615 return this; 616 } 617 618 /** 619 * @return {@link #consent} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A record of the patient's informed agreement to participate in the study.) 620 */ 621 public Consent getConsentTarget() { 622 if (this.consentTarget == null) 623 if (Configuration.errorOnAutoCreate()) 624 throw new Error("Attempt to auto-create ResearchSubject.consent"); 625 else if (Configuration.doAutoCreate()) 626 this.consentTarget = new Consent(); // aa 627 return this.consentTarget; 628 } 629 630 /** 631 * @param value {@link #consent} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A record of the patient's informed agreement to participate in the study.) 632 */ 633 public ResearchSubject setConsentTarget(Consent value) { 634 this.consentTarget = value; 635 return this; 636 } 637 638 protected void listChildren(List<Property> children) { 639 super.listChildren(children); 640 children.add(new Property("identifier", "Identifier", "Identifiers assigned to this research study by the sponsor or other systems.", 0, 1, identifier)); 641 children.add(new Property("status", "code", "The current state of the subject.", 0, 1, status)); 642 children.add(new Property("period", "Period", "The dates the subject began and ended their participation in the study.", 0, 1, period)); 643 children.add(new Property("study", "Reference(ResearchStudy)", "Reference to the study the subject is participating in.", 0, 1, study)); 644 children.add(new Property("individual", "Reference(Patient)", "The record of the person or animal who is involved in the study.", 0, 1, individual)); 645 children.add(new Property("assignedArm", "string", "The name of the arm in the study the subject is expected to follow as part of this study.", 0, 1, assignedArm)); 646 children.add(new Property("actualArm", "string", "The name of the arm in the study the subject actually followed as part of this study.", 0, 1, actualArm)); 647 children.add(new Property("consent", "Reference(Consent)", "A record of the patient's informed agreement to participate in the study.", 0, 1, consent)); 648 } 649 650 @Override 651 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 652 switch (_hash) { 653 case -1618432855: /*identifier*/ return new Property("identifier", "Identifier", "Identifiers assigned to this research study by the sponsor or other systems.", 0, 1, identifier); 654 case -892481550: /*status*/ return new Property("status", "code", "The current state of the subject.", 0, 1, status); 655 case -991726143: /*period*/ return new Property("period", "Period", "The dates the subject began and ended their participation in the study.", 0, 1, period); 656 case 109776329: /*study*/ return new Property("study", "Reference(ResearchStudy)", "Reference to the study the subject is participating in.", 0, 1, study); 657 case -46292327: /*individual*/ return new Property("individual", "Reference(Patient)", "The record of the person or animal who is involved in the study.", 0, 1, individual); 658 case 1741912494: /*assignedArm*/ return new Property("assignedArm", "string", "The name of the arm in the study the subject is expected to follow as part of this study.", 0, 1, assignedArm); 659 case 528827886: /*actualArm*/ return new Property("actualArm", "string", "The name of the arm in the study the subject actually followed as part of this study.", 0, 1, actualArm); 660 case 951500826: /*consent*/ return new Property("consent", "Reference(Consent)", "A record of the patient's informed agreement to participate in the study.", 0, 1, consent); 661 default: return super.getNamedProperty(_hash, _name, _checkValid); 662 } 663 664 } 665 666 @Override 667 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 668 switch (hash) { 669 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier 670 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ResearchSubjectStatus> 671 case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period 672 case 109776329: /*study*/ return this.study == null ? new Base[0] : new Base[] {this.study}; // Reference 673 case -46292327: /*individual*/ return this.individual == null ? new Base[0] : new Base[] {this.individual}; // Reference 674 case 1741912494: /*assignedArm*/ return this.assignedArm == null ? new Base[0] : new Base[] {this.assignedArm}; // StringType 675 case 528827886: /*actualArm*/ return this.actualArm == null ? new Base[0] : new Base[] {this.actualArm}; // StringType 676 case 951500826: /*consent*/ return this.consent == null ? new Base[0] : new Base[] {this.consent}; // Reference 677 default: return super.getProperty(hash, name, checkValid); 678 } 679 680 } 681 682 @Override 683 public Base setProperty(int hash, String name, Base value) throws FHIRException { 684 switch (hash) { 685 case -1618432855: // identifier 686 this.identifier = castToIdentifier(value); // Identifier 687 return value; 688 case -892481550: // status 689 value = new ResearchSubjectStatusEnumFactory().fromType(castToCode(value)); 690 this.status = (Enumeration) value; // Enumeration<ResearchSubjectStatus> 691 return value; 692 case -991726143: // period 693 this.period = castToPeriod(value); // Period 694 return value; 695 case 109776329: // study 696 this.study = castToReference(value); // Reference 697 return value; 698 case -46292327: // individual 699 this.individual = castToReference(value); // Reference 700 return value; 701 case 1741912494: // assignedArm 702 this.assignedArm = castToString(value); // StringType 703 return value; 704 case 528827886: // actualArm 705 this.actualArm = castToString(value); // StringType 706 return value; 707 case 951500826: // consent 708 this.consent = castToReference(value); // Reference 709 return value; 710 default: return super.setProperty(hash, name, value); 711 } 712 713 } 714 715 @Override 716 public Base setProperty(String name, Base value) throws FHIRException { 717 if (name.equals("identifier")) { 718 this.identifier = castToIdentifier(value); // Identifier 719 } else if (name.equals("status")) { 720 value = new ResearchSubjectStatusEnumFactory().fromType(castToCode(value)); 721 this.status = (Enumeration) value; // Enumeration<ResearchSubjectStatus> 722 } else if (name.equals("period")) { 723 this.period = castToPeriod(value); // Period 724 } else if (name.equals("study")) { 725 this.study = castToReference(value); // Reference 726 } else if (name.equals("individual")) { 727 this.individual = castToReference(value); // Reference 728 } else if (name.equals("assignedArm")) { 729 this.assignedArm = castToString(value); // StringType 730 } else if (name.equals("actualArm")) { 731 this.actualArm = castToString(value); // StringType 732 } else if (name.equals("consent")) { 733 this.consent = castToReference(value); // Reference 734 } else 735 return super.setProperty(name, value); 736 return value; 737 } 738 739 @Override 740 public Base makeProperty(int hash, String name) throws FHIRException { 741 switch (hash) { 742 case -1618432855: return getIdentifier(); 743 case -892481550: return getStatusElement(); 744 case -991726143: return getPeriod(); 745 case 109776329: return getStudy(); 746 case -46292327: return getIndividual(); 747 case 1741912494: return getAssignedArmElement(); 748 case 528827886: return getActualArmElement(); 749 case 951500826: return getConsent(); 750 default: return super.makeProperty(hash, name); 751 } 752 753 } 754 755 @Override 756 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 757 switch (hash) { 758 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 759 case -892481550: /*status*/ return new String[] {"code"}; 760 case -991726143: /*period*/ return new String[] {"Period"}; 761 case 109776329: /*study*/ return new String[] {"Reference"}; 762 case -46292327: /*individual*/ return new String[] {"Reference"}; 763 case 1741912494: /*assignedArm*/ return new String[] {"string"}; 764 case 528827886: /*actualArm*/ return new String[] {"string"}; 765 case 951500826: /*consent*/ return new String[] {"Reference"}; 766 default: return super.getTypesForProperty(hash, name); 767 } 768 769 } 770 771 @Override 772 public Base addChild(String name) throws FHIRException { 773 if (name.equals("identifier")) { 774 this.identifier = new Identifier(); 775 return this.identifier; 776 } 777 else if (name.equals("status")) { 778 throw new FHIRException("Cannot call addChild on a primitive type ResearchSubject.status"); 779 } 780 else if (name.equals("period")) { 781 this.period = new Period(); 782 return this.period; 783 } 784 else if (name.equals("study")) { 785 this.study = new Reference(); 786 return this.study; 787 } 788 else if (name.equals("individual")) { 789 this.individual = new Reference(); 790 return this.individual; 791 } 792 else if (name.equals("assignedArm")) { 793 throw new FHIRException("Cannot call addChild on a primitive type ResearchSubject.assignedArm"); 794 } 795 else if (name.equals("actualArm")) { 796 throw new FHIRException("Cannot call addChild on a primitive type ResearchSubject.actualArm"); 797 } 798 else if (name.equals("consent")) { 799 this.consent = new Reference(); 800 return this.consent; 801 } 802 else 803 return super.addChild(name); 804 } 805 806 public String fhirType() { 807 return "ResearchSubject"; 808 809 } 810 811 public ResearchSubject copy() { 812 ResearchSubject dst = new ResearchSubject(); 813 copyValues(dst); 814 dst.identifier = identifier == null ? null : identifier.copy(); 815 dst.status = status == null ? null : status.copy(); 816 dst.period = period == null ? null : period.copy(); 817 dst.study = study == null ? null : study.copy(); 818 dst.individual = individual == null ? null : individual.copy(); 819 dst.assignedArm = assignedArm == null ? null : assignedArm.copy(); 820 dst.actualArm = actualArm == null ? null : actualArm.copy(); 821 dst.consent = consent == null ? null : consent.copy(); 822 return dst; 823 } 824 825 protected ResearchSubject typedCopy() { 826 return copy(); 827 } 828 829 @Override 830 public boolean equalsDeep(Base other_) { 831 if (!super.equalsDeep(other_)) 832 return false; 833 if (!(other_ instanceof ResearchSubject)) 834 return false; 835 ResearchSubject o = (ResearchSubject) other_; 836 return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(period, o.period, true) 837 && compareDeep(study, o.study, true) && compareDeep(individual, o.individual, true) && compareDeep(assignedArm, o.assignedArm, true) 838 && compareDeep(actualArm, o.actualArm, true) && compareDeep(consent, o.consent, true); 839 } 840 841 @Override 842 public boolean equalsShallow(Base other_) { 843 if (!super.equalsShallow(other_)) 844 return false; 845 if (!(other_ instanceof ResearchSubject)) 846 return false; 847 ResearchSubject o = (ResearchSubject) other_; 848 return compareValues(status, o.status, true) && compareValues(assignedArm, o.assignedArm, true) && compareValues(actualArm, o.actualArm, true) 849 ; 850 } 851 852 public boolean isEmpty() { 853 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, period 854 , study, individual, assignedArm, actualArm, consent); 855 } 856 857 @Override 858 public ResourceType getResourceType() { 859 return ResourceType.ResearchSubject; 860 } 861 862 /** 863 * Search parameter: <b>date</b> 864 * <p> 865 * Description: <b>Start and end of participation</b><br> 866 * Type: <b>date</b><br> 867 * Path: <b>ResearchSubject.period</b><br> 868 * </p> 869 */ 870 @SearchParamDefinition(name="date", path="ResearchSubject.period", description="Start and end of participation", type="date" ) 871 public static final String SP_DATE = "date"; 872 /** 873 * <b>Fluent Client</b> search parameter constant for <b>date</b> 874 * <p> 875 * Description: <b>Start and end of participation</b><br> 876 * Type: <b>date</b><br> 877 * Path: <b>ResearchSubject.period</b><br> 878 * </p> 879 */ 880 public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); 881 882 /** 883 * Search parameter: <b>identifier</b> 884 * <p> 885 * Description: <b>Business Identifier for research subject</b><br> 886 * Type: <b>token</b><br> 887 * Path: <b>ResearchSubject.identifier</b><br> 888 * </p> 889 */ 890 @SearchParamDefinition(name="identifier", path="ResearchSubject.identifier", description="Business Identifier for research subject", type="token" ) 891 public static final String SP_IDENTIFIER = "identifier"; 892 /** 893 * <b>Fluent Client</b> search parameter constant for <b>identifier</b> 894 * <p> 895 * Description: <b>Business Identifier for research subject</b><br> 896 * Type: <b>token</b><br> 897 * Path: <b>ResearchSubject.identifier</b><br> 898 * </p> 899 */ 900 public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); 901 902 /** 903 * Search parameter: <b>individual</b> 904 * <p> 905 * Description: <b>Who is part of study</b><br> 906 * Type: <b>reference</b><br> 907 * Path: <b>ResearchSubject.individual</b><br> 908 * </p> 909 */ 910 @SearchParamDefinition(name="individual", path="ResearchSubject.individual", description="Who is part of study", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } ) 911 public static final String SP_INDIVIDUAL = "individual"; 912 /** 913 * <b>Fluent Client</b> search parameter constant for <b>individual</b> 914 * <p> 915 * Description: <b>Who is part of study</b><br> 916 * Type: <b>reference</b><br> 917 * Path: <b>ResearchSubject.individual</b><br> 918 * </p> 919 */ 920 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INDIVIDUAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INDIVIDUAL); 921 922/** 923 * Constant for fluent queries to be used to add include statements. Specifies 924 * the path value of "<b>ResearchSubject:individual</b>". 925 */ 926 public static final ca.uhn.fhir.model.api.Include INCLUDE_INDIVIDUAL = new ca.uhn.fhir.model.api.Include("ResearchSubject:individual").toLocked(); 927 928 /** 929 * Search parameter: <b>patient</b> 930 * <p> 931 * Description: <b>Who is part of study</b><br> 932 * Type: <b>reference</b><br> 933 * Path: <b>ResearchSubject.individual</b><br> 934 * </p> 935 */ 936 @SearchParamDefinition(name="patient", path="ResearchSubject.individual", description="Who is part of study", type="reference", target={Patient.class } ) 937 public static final String SP_PATIENT = "patient"; 938 /** 939 * <b>Fluent Client</b> search parameter constant for <b>patient</b> 940 * <p> 941 * Description: <b>Who is part of study</b><br> 942 * Type: <b>reference</b><br> 943 * Path: <b>ResearchSubject.individual</b><br> 944 * </p> 945 */ 946 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); 947 948/** 949 * Constant for fluent queries to be used to add include statements. Specifies 950 * the path value of "<b>ResearchSubject:patient</b>". 951 */ 952 public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ResearchSubject:patient").toLocked(); 953 954 /** 955 * Search parameter: <b>status</b> 956 * <p> 957 * Description: <b>candidate | enrolled | active | suspended | withdrawn | completed</b><br> 958 * Type: <b>token</b><br> 959 * Path: <b>ResearchSubject.status</b><br> 960 * </p> 961 */ 962 @SearchParamDefinition(name="status", path="ResearchSubject.status", description="candidate | enrolled | active | suspended | withdrawn | completed", type="token" ) 963 public static final String SP_STATUS = "status"; 964 /** 965 * <b>Fluent Client</b> search parameter constant for <b>status</b> 966 * <p> 967 * Description: <b>candidate | enrolled | active | suspended | withdrawn | completed</b><br> 968 * Type: <b>token</b><br> 969 * Path: <b>ResearchSubject.status</b><br> 970 * </p> 971 */ 972 public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); 973 974 975} 976