
001package org.hl7.fhir.dstu3.model; 002 003 004 005/* 006 Copyright (c) 2011+, HL7, Inc. 007 All rights reserved. 008 009 Redistribution and use in source and binary forms, with or without modification, 010 are permitted provided that the following conditions are met: 011 012 * Redistributions of source code must retain the above copyright notice, this 013 list of conditions and the following disclaimer. 014 * Redistributions in binary form must reproduce the above copyright notice, 015 this list of conditions and the following disclaimer in the documentation 016 and/or other materials provided with the distribution. 017 * Neither the name of HL7 nor the names of its contributors may be used to 018 endorse or promote products derived from this software without specific 019 prior written permission. 020 021 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 022 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 023 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 024 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 025 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 026 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 027 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 028 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 029 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 030 POSSIBILITY OF SUCH DAMAGE. 031 032*/ 033 034// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x 035import java.util.ArrayList; 036import java.util.List; 037 038import org.hl7.fhir.exceptions.FHIRException; 039import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 040 041import ca.uhn.fhir.model.api.annotation.Block; 042import ca.uhn.fhir.model.api.annotation.Child; 043import ca.uhn.fhir.model.api.annotation.Description; 044import ca.uhn.fhir.model.api.annotation.ResourceDef; 045import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 046/** 047 * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. 048 */ 049@ResourceDef(name="EpisodeOfCare", profile="http://hl7.org/fhir/Profile/EpisodeOfCare") 050public class EpisodeOfCare extends DomainResource { 051 052 public enum EpisodeOfCareStatus { 053 /** 054 * This episode of care is planned to start at the date specified in the period.start. During this status, an organization may perform assessments to determine if the patient is eligible to receive services, or be organizing to make resources available to provide care services. 055 */ 056 PLANNED, 057 /** 058 * This episode has been placed on a waitlist, pending the episode being made active (or cancelled). 059 */ 060 WAITLIST, 061 /** 062 * This episode of care is current. 063 */ 064 ACTIVE, 065 /** 066 * This episode of care is on hold, the organization has limited responsibility for the patient (such as while on respite). 067 */ 068 ONHOLD, 069 /** 070 * This episode of care is finished and the organization is not expecting to be providing further care to the patient. Can also be known as "closed", "completed" or other similar terms. 071 */ 072 FINISHED, 073 /** 074 * The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care. It indicates that services terminated outside the planned/expected workflow. 075 */ 076 CANCELLED, 077 /** 078 * This instance should not have been part of this patient's medical record. 079 */ 080 ENTEREDINERROR, 081 /** 082 * added to help the parsers with the generic types 083 */ 084 NULL; 085 public static EpisodeOfCareStatus fromCode(String codeString) throws FHIRException { 086 if (codeString == null || "".equals(codeString)) 087 return null; 088 if ("planned".equals(codeString)) 089 return PLANNED; 090 if ("waitlist".equals(codeString)) 091 return WAITLIST; 092 if ("active".equals(codeString)) 093 return ACTIVE; 094 if ("onhold".equals(codeString)) 095 return ONHOLD; 096 if ("finished".equals(codeString)) 097 return FINISHED; 098 if ("cancelled".equals(codeString)) 099 return CANCELLED; 100 if ("entered-in-error".equals(codeString)) 101 return ENTEREDINERROR; 102 if (Configuration.isAcceptInvalidEnums()) 103 return null; 104 else 105 throw new FHIRException("Unknown EpisodeOfCareStatus code '"+codeString+"'"); 106 } 107 public String toCode() { 108 switch (this) { 109 case PLANNED: return "planned"; 110 case WAITLIST: return "waitlist"; 111 case ACTIVE: return "active"; 112 case ONHOLD: return "onhold"; 113 case FINISHED: return "finished"; 114 case CANCELLED: return "cancelled"; 115 case ENTEREDINERROR: return "entered-in-error"; 116 case NULL: return null; 117 default: return "?"; 118 } 119 } 120 public String getSystem() { 121 switch (this) { 122 case PLANNED: return "http://hl7.org/fhir/episode-of-care-status"; 123 case WAITLIST: return "http://hl7.org/fhir/episode-of-care-status"; 124 case ACTIVE: return "http://hl7.org/fhir/episode-of-care-status"; 125 case ONHOLD: return "http://hl7.org/fhir/episode-of-care-status"; 126 case FINISHED: return "http://hl7.org/fhir/episode-of-care-status"; 127 case CANCELLED: return "http://hl7.org/fhir/episode-of-care-status"; 128 case ENTEREDINERROR: return "http://hl7.org/fhir/episode-of-care-status"; 129 case NULL: return null; 130 default: return "?"; 131 } 132 } 133 public String getDefinition() { 134 switch (this) { 135 case PLANNED: return "This episode of care is planned to start at the date specified in the period.start. During this status, an organization may perform assessments to determine if the patient is eligible to receive services, or be organizing to make resources available to provide care services."; 136 case WAITLIST: return "This episode has been placed on a waitlist, pending the episode being made active (or cancelled)."; 137 case ACTIVE: return "This episode of care is current."; 138 case ONHOLD: return "This episode of care is on hold, the organization has limited responsibility for the patient (such as while on respite)."; 139 case FINISHED: return "This episode of care is finished and the organization is not expecting to be providing further care to the patient. Can also be known as \"closed\", \"completed\" or other similar terms."; 140 case CANCELLED: return "The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care. It indicates that services terminated outside the planned/expected workflow."; 141 case ENTEREDINERROR: return "This instance should not have been part of this patient's medical record."; 142 case NULL: return null; 143 default: return "?"; 144 } 145 } 146 public String getDisplay() { 147 switch (this) { 148 case PLANNED: return "Planned"; 149 case WAITLIST: return "Waitlist"; 150 case ACTIVE: return "Active"; 151 case ONHOLD: return "On Hold"; 152 case FINISHED: return "Finished"; 153 case CANCELLED: return "Cancelled"; 154 case ENTEREDINERROR: return "Entered in Error"; 155 case NULL: return null; 156 default: return "?"; 157 } 158 } 159 } 160 161 public static class EpisodeOfCareStatusEnumFactory implements EnumFactory<EpisodeOfCareStatus> { 162 public EpisodeOfCareStatus fromCode(String codeString) throws IllegalArgumentException { 163 if (codeString == null || "".equals(codeString)) 164 if (codeString == null || "".equals(codeString)) 165 return null; 166 if ("planned".equals(codeString)) 167 return EpisodeOfCareStatus.PLANNED; 168 if ("waitlist".equals(codeString)) 169 return EpisodeOfCareStatus.WAITLIST; 170 if ("active".equals(codeString)) 171 return EpisodeOfCareStatus.ACTIVE; 172 if ("onhold".equals(codeString)) 173 return EpisodeOfCareStatus.ONHOLD; 174 if ("finished".equals(codeString)) 175 return EpisodeOfCareStatus.FINISHED; 176 if ("cancelled".equals(codeString)) 177 return EpisodeOfCareStatus.CANCELLED; 178 if ("entered-in-error".equals(codeString)) 179 return EpisodeOfCareStatus.ENTEREDINERROR; 180 throw new IllegalArgumentException("Unknown EpisodeOfCareStatus code '"+codeString+"'"); 181 } 182 public Enumeration<EpisodeOfCareStatus> fromType(PrimitiveType<?> code) throws FHIRException { 183 if (code == null) 184 return null; 185 if (code.isEmpty()) 186 return new Enumeration<EpisodeOfCareStatus>(this); 187 String codeString = code.asStringValue(); 188 if (codeString == null || "".equals(codeString)) 189 return null; 190 if ("planned".equals(codeString)) 191 return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.PLANNED); 192 if ("waitlist".equals(codeString)) 193 return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.WAITLIST); 194 if ("active".equals(codeString)) 195 return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.ACTIVE); 196 if ("onhold".equals(codeString)) 197 return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.ONHOLD); 198 if ("finished".equals(codeString)) 199 return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.FINISHED); 200 if ("cancelled".equals(codeString)) 201 return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.CANCELLED); 202 if ("entered-in-error".equals(codeString)) 203 return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.ENTEREDINERROR); 204 throw new FHIRException("Unknown EpisodeOfCareStatus code '"+codeString+"'"); 205 } 206 public String toCode(EpisodeOfCareStatus code) { 207 if (code == EpisodeOfCareStatus.NULL) 208 return null; 209 if (code == EpisodeOfCareStatus.PLANNED) 210 return "planned"; 211 if (code == EpisodeOfCareStatus.WAITLIST) 212 return "waitlist"; 213 if (code == EpisodeOfCareStatus.ACTIVE) 214 return "active"; 215 if (code == EpisodeOfCareStatus.ONHOLD) 216 return "onhold"; 217 if (code == EpisodeOfCareStatus.FINISHED) 218 return "finished"; 219 if (code == EpisodeOfCareStatus.CANCELLED) 220 return "cancelled"; 221 if (code == EpisodeOfCareStatus.ENTEREDINERROR) 222 return "entered-in-error"; 223 return "?"; 224 } 225 public String toSystem(EpisodeOfCareStatus code) { 226 return code.getSystem(); 227 } 228 } 229 230 @Block() 231 public static class EpisodeOfCareStatusHistoryComponent extends BackboneElement implements IBaseBackboneElement { 232 /** 233 * planned | waitlist | active | onhold | finished | cancelled. 234 */ 235 @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) 236 @Description(shortDefinition="planned | waitlist | active | onhold | finished | cancelled | entered-in-error", formalDefinition="planned | waitlist | active | onhold | finished | cancelled." ) 237 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/episode-of-care-status") 238 protected Enumeration<EpisodeOfCareStatus> status; 239 240 /** 241 * The period during this EpisodeOfCare that the specific status applied. 242 */ 243 @Child(name = "period", type = {Period.class}, order=2, min=1, max=1, modifier=false, summary=false) 244 @Description(shortDefinition="Duration the EpisodeOfCare was in the specified status", formalDefinition="The period during this EpisodeOfCare that the specific status applied." ) 245 protected Period period; 246 247 private static final long serialVersionUID = -1192432864L; 248 249 /** 250 * Constructor 251 */ 252 public EpisodeOfCareStatusHistoryComponent() { 253 super(); 254 } 255 256 /** 257 * Constructor 258 */ 259 public EpisodeOfCareStatusHistoryComponent(Enumeration<EpisodeOfCareStatus> status, Period period) { 260 super(); 261 this.status = status; 262 this.period = period; 263 } 264 265 /** 266 * @return {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 267 */ 268 public Enumeration<EpisodeOfCareStatus> getStatusElement() { 269 if (this.status == null) 270 if (Configuration.errorOnAutoCreate()) 271 throw new Error("Attempt to auto-create EpisodeOfCareStatusHistoryComponent.status"); 272 else if (Configuration.doAutoCreate()) 273 this.status = new Enumeration<EpisodeOfCareStatus>(new EpisodeOfCareStatusEnumFactory()); // bb 274 return this.status; 275 } 276 277 public boolean hasStatusElement() { 278 return this.status != null && !this.status.isEmpty(); 279 } 280 281 public boolean hasStatus() { 282 return this.status != null && !this.status.isEmpty(); 283 } 284 285 /** 286 * @param value {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 287 */ 288 public EpisodeOfCareStatusHistoryComponent setStatusElement(Enumeration<EpisodeOfCareStatus> value) { 289 this.status = value; 290 return this; 291 } 292 293 /** 294 * @return planned | waitlist | active | onhold | finished | cancelled. 295 */ 296 public EpisodeOfCareStatus getStatus() { 297 return this.status == null ? null : this.status.getValue(); 298 } 299 300 /** 301 * @param value planned | waitlist | active | onhold | finished | cancelled. 302 */ 303 public EpisodeOfCareStatusHistoryComponent setStatus(EpisodeOfCareStatus value) { 304 if (this.status == null) 305 this.status = new Enumeration<EpisodeOfCareStatus>(new EpisodeOfCareStatusEnumFactory()); 306 this.status.setValue(value); 307 return this; 308 } 309 310 /** 311 * @return {@link #period} (The period during this EpisodeOfCare that the specific status applied.) 312 */ 313 public Period getPeriod() { 314 if (this.period == null) 315 if (Configuration.errorOnAutoCreate()) 316 throw new Error("Attempt to auto-create EpisodeOfCareStatusHistoryComponent.period"); 317 else if (Configuration.doAutoCreate()) 318 this.period = new Period(); // cc 319 return this.period; 320 } 321 322 public boolean hasPeriod() { 323 return this.period != null && !this.period.isEmpty(); 324 } 325 326 /** 327 * @param value {@link #period} (The period during this EpisodeOfCare that the specific status applied.) 328 */ 329 public EpisodeOfCareStatusHistoryComponent setPeriod(Period value) { 330 this.period = value; 331 return this; 332 } 333 334 protected void listChildren(List<Property> children) { 335 super.listChildren(children); 336 children.add(new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, 1, status)); 337 children.add(new Property("period", "Period", "The period during this EpisodeOfCare that the specific status applied.", 0, 1, period)); 338 } 339 340 @Override 341 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 342 switch (_hash) { 343 case -892481550: /*status*/ return new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, 1, status); 344 case -991726143: /*period*/ return new Property("period", "Period", "The period during this EpisodeOfCare that the specific status applied.", 0, 1, period); 345 default: return super.getNamedProperty(_hash, _name, _checkValid); 346 } 347 348 } 349 350 @Override 351 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 352 switch (hash) { 353 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EpisodeOfCareStatus> 354 case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period 355 default: return super.getProperty(hash, name, checkValid); 356 } 357 358 } 359 360 @Override 361 public Base setProperty(int hash, String name, Base value) throws FHIRException { 362 switch (hash) { 363 case -892481550: // status 364 value = new EpisodeOfCareStatusEnumFactory().fromType(castToCode(value)); 365 this.status = (Enumeration) value; // Enumeration<EpisodeOfCareStatus> 366 return value; 367 case -991726143: // period 368 this.period = castToPeriod(value); // Period 369 return value; 370 default: return super.setProperty(hash, name, value); 371 } 372 373 } 374 375 @Override 376 public Base setProperty(String name, Base value) throws FHIRException { 377 if (name.equals("status")) { 378 value = new EpisodeOfCareStatusEnumFactory().fromType(castToCode(value)); 379 this.status = (Enumeration) value; // Enumeration<EpisodeOfCareStatus> 380 } else if (name.equals("period")) { 381 this.period = castToPeriod(value); // Period 382 } else 383 return super.setProperty(name, value); 384 return value; 385 } 386 387 @Override 388 public Base makeProperty(int hash, String name) throws FHIRException { 389 switch (hash) { 390 case -892481550: return getStatusElement(); 391 case -991726143: return getPeriod(); 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 -892481550: /*status*/ return new String[] {"code"}; 401 case -991726143: /*period*/ return new String[] {"Period"}; 402 default: return super.getTypesForProperty(hash, name); 403 } 404 405 } 406 407 @Override 408 public Base addChild(String name) throws FHIRException { 409 if (name.equals("status")) { 410 throw new FHIRException("Cannot call addChild on a singleton property EpisodeOfCare.status"); 411 } 412 else if (name.equals("period")) { 413 this.period = new Period(); 414 return this.period; 415 } 416 else 417 return super.addChild(name); 418 } 419 420 public EpisodeOfCareStatusHistoryComponent copy() { 421 EpisodeOfCareStatusHistoryComponent dst = new EpisodeOfCareStatusHistoryComponent(); 422 copyValues(dst); 423 dst.status = status == null ? null : status.copy(); 424 dst.period = period == null ? null : period.copy(); 425 return dst; 426 } 427 428 @Override 429 public boolean equalsDeep(Base other_) { 430 if (!super.equalsDeep(other_)) 431 return false; 432 if (!(other_ instanceof EpisodeOfCareStatusHistoryComponent)) 433 return false; 434 EpisodeOfCareStatusHistoryComponent o = (EpisodeOfCareStatusHistoryComponent) other_; 435 return compareDeep(status, o.status, true) && compareDeep(period, o.period, true); 436 } 437 438 @Override 439 public boolean equalsShallow(Base other_) { 440 if (!super.equalsShallow(other_)) 441 return false; 442 if (!(other_ instanceof EpisodeOfCareStatusHistoryComponent)) 443 return false; 444 EpisodeOfCareStatusHistoryComponent o = (EpisodeOfCareStatusHistoryComponent) other_; 445 return compareValues(status, o.status, true); 446 } 447 448 public boolean isEmpty() { 449 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(status, period); 450 } 451 452 public String fhirType() { 453 return "EpisodeOfCare.statusHistory"; 454 455 } 456 457 } 458 459 @Block() 460 public static class DiagnosisComponent extends BackboneElement implements IBaseBackboneElement { 461 /** 462 * A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for. 463 */ 464 @Child(name = "condition", type = {Condition.class}, order=1, min=1, max=1, modifier=false, summary=true) 465 @Description(shortDefinition="Conditions/problems/diagnoses this episode of care is for", formalDefinition="A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for." ) 466 protected Reference condition; 467 468 /** 469 * The actual object that is the target of the reference (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) 470 */ 471 protected Condition conditionTarget; 472 473 /** 474 * Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge ?). 475 */ 476 @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) 477 @Description(shortDefinition="Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge ?)", formalDefinition="Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge ?)." ) 478 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/diagnosis-role") 479 protected CodeableConcept role; 480 481 /** 482 * Ranking of the diagnosis (for each role type). 483 */ 484 @Child(name = "rank", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=true) 485 @Description(shortDefinition="Ranking of the diagnosis (for each role type)", formalDefinition="Ranking of the diagnosis (for each role type)." ) 486 protected PositiveIntType rank; 487 488 private static final long serialVersionUID = 249445632L; 489 490 /** 491 * Constructor 492 */ 493 public DiagnosisComponent() { 494 super(); 495 } 496 497 /** 498 * Constructor 499 */ 500 public DiagnosisComponent(Reference condition) { 501 super(); 502 this.condition = condition; 503 } 504 505 /** 506 * @return {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) 507 */ 508 public Reference getCondition() { 509 if (this.condition == null) 510 if (Configuration.errorOnAutoCreate()) 511 throw new Error("Attempt to auto-create DiagnosisComponent.condition"); 512 else if (Configuration.doAutoCreate()) 513 this.condition = new Reference(); // cc 514 return this.condition; 515 } 516 517 public boolean hasCondition() { 518 return this.condition != null && !this.condition.isEmpty(); 519 } 520 521 /** 522 * @param value {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) 523 */ 524 public DiagnosisComponent setCondition(Reference value) { 525 this.condition = value; 526 return this; 527 } 528 529 /** 530 * @return {@link #condition} 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 list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) 531 */ 532 public Condition getConditionTarget() { 533 if (this.conditionTarget == null) 534 if (Configuration.errorOnAutoCreate()) 535 throw new Error("Attempt to auto-create DiagnosisComponent.condition"); 536 else if (Configuration.doAutoCreate()) 537 this.conditionTarget = new Condition(); // aa 538 return this.conditionTarget; 539 } 540 541 /** 542 * @param value {@link #condition} 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 list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) 543 */ 544 public DiagnosisComponent setConditionTarget(Condition value) { 545 this.conditionTarget = value; 546 return this; 547 } 548 549 /** 550 * @return {@link #role} (Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge ?).) 551 */ 552 public CodeableConcept getRole() { 553 if (this.role == null) 554 if (Configuration.errorOnAutoCreate()) 555 throw new Error("Attempt to auto-create DiagnosisComponent.role"); 556 else if (Configuration.doAutoCreate()) 557 this.role = new CodeableConcept(); // cc 558 return this.role; 559 } 560 561 public boolean hasRole() { 562 return this.role != null && !this.role.isEmpty(); 563 } 564 565 /** 566 * @param value {@link #role} (Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge ?).) 567 */ 568 public DiagnosisComponent setRole(CodeableConcept value) { 569 this.role = value; 570 return this; 571 } 572 573 /** 574 * @return {@link #rank} (Ranking of the diagnosis (for each role type).). This is the underlying object with id, value and extensions. The accessor "getRank" gives direct access to the value 575 */ 576 public PositiveIntType getRankElement() { 577 if (this.rank == null) 578 if (Configuration.errorOnAutoCreate()) 579 throw new Error("Attempt to auto-create DiagnosisComponent.rank"); 580 else if (Configuration.doAutoCreate()) 581 this.rank = new PositiveIntType(); // bb 582 return this.rank; 583 } 584 585 public boolean hasRankElement() { 586 return this.rank != null && !this.rank.isEmpty(); 587 } 588 589 public boolean hasRank() { 590 return this.rank != null && !this.rank.isEmpty(); 591 } 592 593 /** 594 * @param value {@link #rank} (Ranking of the diagnosis (for each role type).). This is the underlying object with id, value and extensions. The accessor "getRank" gives direct access to the value 595 */ 596 public DiagnosisComponent setRankElement(PositiveIntType value) { 597 this.rank = value; 598 return this; 599 } 600 601 /** 602 * @return Ranking of the diagnosis (for each role type). 603 */ 604 public int getRank() { 605 return this.rank == null || this.rank.isEmpty() ? 0 : this.rank.getValue(); 606 } 607 608 /** 609 * @param value Ranking of the diagnosis (for each role type). 610 */ 611 public DiagnosisComponent setRank(int value) { 612 if (this.rank == null) 613 this.rank = new PositiveIntType(); 614 this.rank.setValue(value); 615 return this; 616 } 617 618 protected void listChildren(List<Property> children) { 619 super.listChildren(children); 620 children.add(new Property("condition", "Reference(Condition)", "A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.", 0, 1, condition)); 621 children.add(new Property("role", "CodeableConcept", "Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge ?).", 0, 1, role)); 622 children.add(new Property("rank", "positiveInt", "Ranking of the diagnosis (for each role type).", 0, 1, rank)); 623 } 624 625 @Override 626 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 627 switch (_hash) { 628 case -861311717: /*condition*/ return new Property("condition", "Reference(Condition)", "A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.", 0, 1, condition); 629 case 3506294: /*role*/ return new Property("role", "CodeableConcept", "Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge ?).", 0, 1, role); 630 case 3492908: /*rank*/ return new Property("rank", "positiveInt", "Ranking of the diagnosis (for each role type).", 0, 1, rank); 631 default: return super.getNamedProperty(_hash, _name, _checkValid); 632 } 633 634 } 635 636 @Override 637 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 638 switch (hash) { 639 case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // Reference 640 case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept 641 case 3492908: /*rank*/ return this.rank == null ? new Base[0] : new Base[] {this.rank}; // PositiveIntType 642 default: return super.getProperty(hash, name, checkValid); 643 } 644 645 } 646 647 @Override 648 public Base setProperty(int hash, String name, Base value) throws FHIRException { 649 switch (hash) { 650 case -861311717: // condition 651 this.condition = castToReference(value); // Reference 652 return value; 653 case 3506294: // role 654 this.role = castToCodeableConcept(value); // CodeableConcept 655 return value; 656 case 3492908: // rank 657 this.rank = castToPositiveInt(value); // PositiveIntType 658 return value; 659 default: return super.setProperty(hash, name, value); 660 } 661 662 } 663 664 @Override 665 public Base setProperty(String name, Base value) throws FHIRException { 666 if (name.equals("condition")) { 667 this.condition = castToReference(value); // Reference 668 } else if (name.equals("role")) { 669 this.role = castToCodeableConcept(value); // CodeableConcept 670 } else if (name.equals("rank")) { 671 this.rank = castToPositiveInt(value); // PositiveIntType 672 } else 673 return super.setProperty(name, value); 674 return value; 675 } 676 677 @Override 678 public Base makeProperty(int hash, String name) throws FHIRException { 679 switch (hash) { 680 case -861311717: return getCondition(); 681 case 3506294: return getRole(); 682 case 3492908: return getRankElement(); 683 default: return super.makeProperty(hash, name); 684 } 685 686 } 687 688 @Override 689 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 690 switch (hash) { 691 case -861311717: /*condition*/ return new String[] {"Reference"}; 692 case 3506294: /*role*/ return new String[] {"CodeableConcept"}; 693 case 3492908: /*rank*/ return new String[] {"positiveInt"}; 694 default: return super.getTypesForProperty(hash, name); 695 } 696 697 } 698 699 @Override 700 public Base addChild(String name) throws FHIRException { 701 if (name.equals("condition")) { 702 this.condition = new Reference(); 703 return this.condition; 704 } 705 else if (name.equals("role")) { 706 this.role = new CodeableConcept(); 707 return this.role; 708 } 709 else if (name.equals("rank")) { 710 throw new FHIRException("Cannot call addChild on a singleton property EpisodeOfCare.rank"); 711 } 712 else 713 return super.addChild(name); 714 } 715 716 public DiagnosisComponent copy() { 717 DiagnosisComponent dst = new DiagnosisComponent(); 718 copyValues(dst); 719 dst.condition = condition == null ? null : condition.copy(); 720 dst.role = role == null ? null : role.copy(); 721 dst.rank = rank == null ? null : rank.copy(); 722 return dst; 723 } 724 725 @Override 726 public boolean equalsDeep(Base other_) { 727 if (!super.equalsDeep(other_)) 728 return false; 729 if (!(other_ instanceof DiagnosisComponent)) 730 return false; 731 DiagnosisComponent o = (DiagnosisComponent) other_; 732 return compareDeep(condition, o.condition, true) && compareDeep(role, o.role, true) && compareDeep(rank, o.rank, true) 733 ; 734 } 735 736 @Override 737 public boolean equalsShallow(Base other_) { 738 if (!super.equalsShallow(other_)) 739 return false; 740 if (!(other_ instanceof DiagnosisComponent)) 741 return false; 742 DiagnosisComponent o = (DiagnosisComponent) other_; 743 return compareValues(rank, o.rank, true); 744 } 745 746 public boolean isEmpty() { 747 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(condition, role, rank); 748 } 749 750 public String fhirType() { 751 return "EpisodeOfCare.diagnosis"; 752 753 } 754 755 } 756 757 /** 758 * The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes. 759 */ 760 @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 761 @Description(shortDefinition="Business Identifier(s) relevant for this EpisodeOfCare", formalDefinition="The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes." ) 762 protected List<Identifier> identifier; 763 764 /** 765 * planned | waitlist | active | onhold | finished | cancelled. 766 */ 767 @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) 768 @Description(shortDefinition="planned | waitlist | active | onhold | finished | cancelled | entered-in-error", formalDefinition="planned | waitlist | active | onhold | finished | cancelled." ) 769 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/episode-of-care-status") 770 protected Enumeration<EpisodeOfCareStatus> status; 771 772 /** 773 * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource). 774 */ 775 @Child(name = "statusHistory", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 776 @Description(shortDefinition="Past list of status codes (the current status may be included to cover the start date of the status)", formalDefinition="The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)." ) 777 protected List<EpisodeOfCareStatusHistoryComponent> statusHistory; 778 779 /** 780 * A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care. 781 */ 782 @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 783 @Description(shortDefinition="Type/class - e.g. specialist referral, disease management", formalDefinition="A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care." ) 784 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/episodeofcare-type") 785 protected List<CodeableConcept> type; 786 787 /** 788 * The list of diagnosis relevant to this episode of care. 789 */ 790 @Child(name = "diagnosis", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 791 @Description(shortDefinition="The list of diagnosis relevant to this episode of care", formalDefinition="The list of diagnosis relevant to this episode of care." ) 792 protected List<DiagnosisComponent> diagnosis; 793 794 /** 795 * The patient who is the focus of this episode of care. 796 */ 797 @Child(name = "patient", type = {Patient.class}, order=5, min=1, max=1, modifier=false, summary=true) 798 @Description(shortDefinition="The patient who is the focus of this episode of care", formalDefinition="The patient who is the focus of this episode of care." ) 799 protected Reference patient; 800 801 /** 802 * The actual object that is the target of the reference (The patient who is the focus of this episode of care.) 803 */ 804 protected Patient patientTarget; 805 806 /** 807 * The organization that has assumed the specific responsibilities for the specified duration. 808 */ 809 @Child(name = "managingOrganization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) 810 @Description(shortDefinition="Organization that assumes care", formalDefinition="The organization that has assumed the specific responsibilities for the specified duration." ) 811 protected Reference managingOrganization; 812 813 /** 814 * The actual object that is the target of the reference (The organization that has assumed the specific responsibilities for the specified duration.) 815 */ 816 protected Organization managingOrganizationTarget; 817 818 /** 819 * The interval during which the managing organization assumes the defined responsibility. 820 */ 821 @Child(name = "period", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=true) 822 @Description(shortDefinition="Interval during responsibility is assumed", formalDefinition="The interval during which the managing organization assumes the defined responsibility." ) 823 protected Period period; 824 825 /** 826 * Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals. 827 */ 828 @Child(name = "referralRequest", type = {ReferralRequest.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 829 @Description(shortDefinition="Originating Referral Request(s)", formalDefinition="Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals." ) 830 protected List<Reference> referralRequest; 831 /** 832 * The actual objects that are the target of the reference (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) 833 */ 834 protected List<ReferralRequest> referralRequestTarget; 835 836 837 /** 838 * The practitioner that is the care manager/care co-ordinator for this patient. 839 */ 840 @Child(name = "careManager", type = {Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=false) 841 @Description(shortDefinition="Care manager/care co-ordinator for the patient", formalDefinition="The practitioner that is the care manager/care co-ordinator for this patient." ) 842 protected Reference careManager; 843 844 /** 845 * The actual object that is the target of the reference (The practitioner that is the care manager/care co-ordinator for this patient.) 846 */ 847 protected Practitioner careManagerTarget; 848 849 /** 850 * The list of practitioners that may be facilitating this episode of care for specific purposes. 851 */ 852 @Child(name = "team", type = {CareTeam.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 853 @Description(shortDefinition="Other practitioners facilitating this episode of care", formalDefinition="The list of practitioners that may be facilitating this episode of care for specific purposes." ) 854 protected List<Reference> team; 855 /** 856 * The actual objects that are the target of the reference (The list of practitioners that may be facilitating this episode of care for specific purposes.) 857 */ 858 protected List<CareTeam> teamTarget; 859 860 861 /** 862 * The set of accounts that may be used for billing for this EpisodeOfCare. 863 */ 864 @Child(name = "account", type = {Account.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 865 @Description(shortDefinition="The set of accounts that may be used for billing for this EpisodeOfCare", formalDefinition="The set of accounts that may be used for billing for this EpisodeOfCare." ) 866 protected List<Reference> account; 867 /** 868 * The actual objects that are the target of the reference (The set of accounts that may be used for billing for this EpisodeOfCare.) 869 */ 870 protected List<Account> accountTarget; 871 872 873 private static final long serialVersionUID = 76719771L; 874 875 /** 876 * Constructor 877 */ 878 public EpisodeOfCare() { 879 super(); 880 } 881 882 /** 883 * Constructor 884 */ 885 public EpisodeOfCare(Enumeration<EpisodeOfCareStatus> status, Reference patient) { 886 super(); 887 this.status = status; 888 this.patient = patient; 889 } 890 891 /** 892 * @return {@link #identifier} (The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes.) 893 */ 894 public List<Identifier> getIdentifier() { 895 if (this.identifier == null) 896 this.identifier = new ArrayList<Identifier>(); 897 return this.identifier; 898 } 899 900 /** 901 * @return Returns a reference to <code>this</code> for easy method chaining 902 */ 903 public EpisodeOfCare setIdentifier(List<Identifier> theIdentifier) { 904 this.identifier = theIdentifier; 905 return this; 906 } 907 908 public boolean hasIdentifier() { 909 if (this.identifier == null) 910 return false; 911 for (Identifier item : this.identifier) 912 if (!item.isEmpty()) 913 return true; 914 return false; 915 } 916 917 public Identifier addIdentifier() { //3 918 Identifier t = new Identifier(); 919 if (this.identifier == null) 920 this.identifier = new ArrayList<Identifier>(); 921 this.identifier.add(t); 922 return t; 923 } 924 925 public EpisodeOfCare addIdentifier(Identifier t) { //3 926 if (t == null) 927 return this; 928 if (this.identifier == null) 929 this.identifier = new ArrayList<Identifier>(); 930 this.identifier.add(t); 931 return this; 932 } 933 934 /** 935 * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist 936 */ 937 public Identifier getIdentifierFirstRep() { 938 if (getIdentifier().isEmpty()) { 939 addIdentifier(); 940 } 941 return getIdentifier().get(0); 942 } 943 944 /** 945 * @return {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 946 */ 947 public Enumeration<EpisodeOfCareStatus> getStatusElement() { 948 if (this.status == null) 949 if (Configuration.errorOnAutoCreate()) 950 throw new Error("Attempt to auto-create EpisodeOfCare.status"); 951 else if (Configuration.doAutoCreate()) 952 this.status = new Enumeration<EpisodeOfCareStatus>(new EpisodeOfCareStatusEnumFactory()); // bb 953 return this.status; 954 } 955 956 public boolean hasStatusElement() { 957 return this.status != null && !this.status.isEmpty(); 958 } 959 960 public boolean hasStatus() { 961 return this.status != null && !this.status.isEmpty(); 962 } 963 964 /** 965 * @param value {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 966 */ 967 public EpisodeOfCare setStatusElement(Enumeration<EpisodeOfCareStatus> value) { 968 this.status = value; 969 return this; 970 } 971 972 /** 973 * @return planned | waitlist | active | onhold | finished | cancelled. 974 */ 975 public EpisodeOfCareStatus getStatus() { 976 return this.status == null ? null : this.status.getValue(); 977 } 978 979 /** 980 * @param value planned | waitlist | active | onhold | finished | cancelled. 981 */ 982 public EpisodeOfCare setStatus(EpisodeOfCareStatus value) { 983 if (this.status == null) 984 this.status = new Enumeration<EpisodeOfCareStatus>(new EpisodeOfCareStatusEnumFactory()); 985 this.status.setValue(value); 986 return this; 987 } 988 989 /** 990 * @return {@link #statusHistory} (The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).) 991 */ 992 public List<EpisodeOfCareStatusHistoryComponent> getStatusHistory() { 993 if (this.statusHistory == null) 994 this.statusHistory = new ArrayList<EpisodeOfCareStatusHistoryComponent>(); 995 return this.statusHistory; 996 } 997 998 /** 999 * @return Returns a reference to <code>this</code> for easy method chaining 1000 */ 1001 public EpisodeOfCare setStatusHistory(List<EpisodeOfCareStatusHistoryComponent> theStatusHistory) { 1002 this.statusHistory = theStatusHistory; 1003 return this; 1004 } 1005 1006 public boolean hasStatusHistory() { 1007 if (this.statusHistory == null) 1008 return false; 1009 for (EpisodeOfCareStatusHistoryComponent item : this.statusHistory) 1010 if (!item.isEmpty()) 1011 return true; 1012 return false; 1013 } 1014 1015 public EpisodeOfCareStatusHistoryComponent addStatusHistory() { //3 1016 EpisodeOfCareStatusHistoryComponent t = new EpisodeOfCareStatusHistoryComponent(); 1017 if (this.statusHistory == null) 1018 this.statusHistory = new ArrayList<EpisodeOfCareStatusHistoryComponent>(); 1019 this.statusHistory.add(t); 1020 return t; 1021 } 1022 1023 public EpisodeOfCare addStatusHistory(EpisodeOfCareStatusHistoryComponent t) { //3 1024 if (t == null) 1025 return this; 1026 if (this.statusHistory == null) 1027 this.statusHistory = new ArrayList<EpisodeOfCareStatusHistoryComponent>(); 1028 this.statusHistory.add(t); 1029 return this; 1030 } 1031 1032 /** 1033 * @return The first repetition of repeating field {@link #statusHistory}, creating it if it does not already exist 1034 */ 1035 public EpisodeOfCareStatusHistoryComponent getStatusHistoryFirstRep() { 1036 if (getStatusHistory().isEmpty()) { 1037 addStatusHistory(); 1038 } 1039 return getStatusHistory().get(0); 1040 } 1041 1042 /** 1043 * @return {@link #type} (A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.) 1044 */ 1045 public List<CodeableConcept> getType() { 1046 if (this.type == null) 1047 this.type = new ArrayList<CodeableConcept>(); 1048 return this.type; 1049 } 1050 1051 /** 1052 * @return Returns a reference to <code>this</code> for easy method chaining 1053 */ 1054 public EpisodeOfCare setType(List<CodeableConcept> theType) { 1055 this.type = theType; 1056 return this; 1057 } 1058 1059 public boolean hasType() { 1060 if (this.type == null) 1061 return false; 1062 for (CodeableConcept item : this.type) 1063 if (!item.isEmpty()) 1064 return true; 1065 return false; 1066 } 1067 1068 public CodeableConcept addType() { //3 1069 CodeableConcept t = new CodeableConcept(); 1070 if (this.type == null) 1071 this.type = new ArrayList<CodeableConcept>(); 1072 this.type.add(t); 1073 return t; 1074 } 1075 1076 public EpisodeOfCare addType(CodeableConcept t) { //3 1077 if (t == null) 1078 return this; 1079 if (this.type == null) 1080 this.type = new ArrayList<CodeableConcept>(); 1081 this.type.add(t); 1082 return this; 1083 } 1084 1085 /** 1086 * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist 1087 */ 1088 public CodeableConcept getTypeFirstRep() { 1089 if (getType().isEmpty()) { 1090 addType(); 1091 } 1092 return getType().get(0); 1093 } 1094 1095 /** 1096 * @return {@link #diagnosis} (The list of diagnosis relevant to this episode of care.) 1097 */ 1098 public List<DiagnosisComponent> getDiagnosis() { 1099 if (this.diagnosis == null) 1100 this.diagnosis = new ArrayList<DiagnosisComponent>(); 1101 return this.diagnosis; 1102 } 1103 1104 /** 1105 * @return Returns a reference to <code>this</code> for easy method chaining 1106 */ 1107 public EpisodeOfCare setDiagnosis(List<DiagnosisComponent> theDiagnosis) { 1108 this.diagnosis = theDiagnosis; 1109 return this; 1110 } 1111 1112 public boolean hasDiagnosis() { 1113 if (this.diagnosis == null) 1114 return false; 1115 for (DiagnosisComponent item : this.diagnosis) 1116 if (!item.isEmpty()) 1117 return true; 1118 return false; 1119 } 1120 1121 public DiagnosisComponent addDiagnosis() { //3 1122 DiagnosisComponent t = new DiagnosisComponent(); 1123 if (this.diagnosis == null) 1124 this.diagnosis = new ArrayList<DiagnosisComponent>(); 1125 this.diagnosis.add(t); 1126 return t; 1127 } 1128 1129 public EpisodeOfCare addDiagnosis(DiagnosisComponent t) { //3 1130 if (t == null) 1131 return this; 1132 if (this.diagnosis == null) 1133 this.diagnosis = new ArrayList<DiagnosisComponent>(); 1134 this.diagnosis.add(t); 1135 return this; 1136 } 1137 1138 /** 1139 * @return The first repetition of repeating field {@link #diagnosis}, creating it if it does not already exist 1140 */ 1141 public DiagnosisComponent getDiagnosisFirstRep() { 1142 if (getDiagnosis().isEmpty()) { 1143 addDiagnosis(); 1144 } 1145 return getDiagnosis().get(0); 1146 } 1147 1148 /** 1149 * @return {@link #patient} (The patient who is the focus of this episode of care.) 1150 */ 1151 public Reference getPatient() { 1152 if (this.patient == null) 1153 if (Configuration.errorOnAutoCreate()) 1154 throw new Error("Attempt to auto-create EpisodeOfCare.patient"); 1155 else if (Configuration.doAutoCreate()) 1156 this.patient = new Reference(); // cc 1157 return this.patient; 1158 } 1159 1160 public boolean hasPatient() { 1161 return this.patient != null && !this.patient.isEmpty(); 1162 } 1163 1164 /** 1165 * @param value {@link #patient} (The patient who is the focus of this episode of care.) 1166 */ 1167 public EpisodeOfCare setPatient(Reference value) { 1168 this.patient = value; 1169 return this; 1170 } 1171 1172 /** 1173 * @return {@link #patient} 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 patient who is the focus of this episode of care.) 1174 */ 1175 public Patient getPatientTarget() { 1176 if (this.patientTarget == null) 1177 if (Configuration.errorOnAutoCreate()) 1178 throw new Error("Attempt to auto-create EpisodeOfCare.patient"); 1179 else if (Configuration.doAutoCreate()) 1180 this.patientTarget = new Patient(); // aa 1181 return this.patientTarget; 1182 } 1183 1184 /** 1185 * @param value {@link #patient} 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 patient who is the focus of this episode of care.) 1186 */ 1187 public EpisodeOfCare setPatientTarget(Patient value) { 1188 this.patientTarget = value; 1189 return this; 1190 } 1191 1192 /** 1193 * @return {@link #managingOrganization} (The organization that has assumed the specific responsibilities for the specified duration.) 1194 */ 1195 public Reference getManagingOrganization() { 1196 if (this.managingOrganization == null) 1197 if (Configuration.errorOnAutoCreate()) 1198 throw new Error("Attempt to auto-create EpisodeOfCare.managingOrganization"); 1199 else if (Configuration.doAutoCreate()) 1200 this.managingOrganization = new Reference(); // cc 1201 return this.managingOrganization; 1202 } 1203 1204 public boolean hasManagingOrganization() { 1205 return this.managingOrganization != null && !this.managingOrganization.isEmpty(); 1206 } 1207 1208 /** 1209 * @param value {@link #managingOrganization} (The organization that has assumed the specific responsibilities for the specified duration.) 1210 */ 1211 public EpisodeOfCare setManagingOrganization(Reference value) { 1212 this.managingOrganization = value; 1213 return this; 1214 } 1215 1216 /** 1217 * @return {@link #managingOrganization} 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 organization that has assumed the specific responsibilities for the specified duration.) 1218 */ 1219 public Organization getManagingOrganizationTarget() { 1220 if (this.managingOrganizationTarget == null) 1221 if (Configuration.errorOnAutoCreate()) 1222 throw new Error("Attempt to auto-create EpisodeOfCare.managingOrganization"); 1223 else if (Configuration.doAutoCreate()) 1224 this.managingOrganizationTarget = new Organization(); // aa 1225 return this.managingOrganizationTarget; 1226 } 1227 1228 /** 1229 * @param value {@link #managingOrganization} 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 organization that has assumed the specific responsibilities for the specified duration.) 1230 */ 1231 public EpisodeOfCare setManagingOrganizationTarget(Organization value) { 1232 this.managingOrganizationTarget = value; 1233 return this; 1234 } 1235 1236 /** 1237 * @return {@link #period} (The interval during which the managing organization assumes the defined responsibility.) 1238 */ 1239 public Period getPeriod() { 1240 if (this.period == null) 1241 if (Configuration.errorOnAutoCreate()) 1242 throw new Error("Attempt to auto-create EpisodeOfCare.period"); 1243 else if (Configuration.doAutoCreate()) 1244 this.period = new Period(); // cc 1245 return this.period; 1246 } 1247 1248 public boolean hasPeriod() { 1249 return this.period != null && !this.period.isEmpty(); 1250 } 1251 1252 /** 1253 * @param value {@link #period} (The interval during which the managing organization assumes the defined responsibility.) 1254 */ 1255 public EpisodeOfCare setPeriod(Period value) { 1256 this.period = value; 1257 return this; 1258 } 1259 1260 /** 1261 * @return {@link #referralRequest} (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) 1262 */ 1263 public List<Reference> getReferralRequest() { 1264 if (this.referralRequest == null) 1265 this.referralRequest = new ArrayList<Reference>(); 1266 return this.referralRequest; 1267 } 1268 1269 /** 1270 * @return Returns a reference to <code>this</code> for easy method chaining 1271 */ 1272 public EpisodeOfCare setReferralRequest(List<Reference> theReferralRequest) { 1273 this.referralRequest = theReferralRequest; 1274 return this; 1275 } 1276 1277 public boolean hasReferralRequest() { 1278 if (this.referralRequest == null) 1279 return false; 1280 for (Reference item : this.referralRequest) 1281 if (!item.isEmpty()) 1282 return true; 1283 return false; 1284 } 1285 1286 public Reference addReferralRequest() { //3 1287 Reference t = new Reference(); 1288 if (this.referralRequest == null) 1289 this.referralRequest = new ArrayList<Reference>(); 1290 this.referralRequest.add(t); 1291 return t; 1292 } 1293 1294 public EpisodeOfCare addReferralRequest(Reference t) { //3 1295 if (t == null) 1296 return this; 1297 if (this.referralRequest == null) 1298 this.referralRequest = new ArrayList<Reference>(); 1299 this.referralRequest.add(t); 1300 return this; 1301 } 1302 1303 /** 1304 * @return The first repetition of repeating field {@link #referralRequest}, creating it if it does not already exist 1305 */ 1306 public Reference getReferralRequestFirstRep() { 1307 if (getReferralRequest().isEmpty()) { 1308 addReferralRequest(); 1309 } 1310 return getReferralRequest().get(0); 1311 } 1312 1313 /** 1314 * @return {@link #careManager} (The practitioner that is the care manager/care co-ordinator for this patient.) 1315 */ 1316 public Reference getCareManager() { 1317 if (this.careManager == null) 1318 if (Configuration.errorOnAutoCreate()) 1319 throw new Error("Attempt to auto-create EpisodeOfCare.careManager"); 1320 else if (Configuration.doAutoCreate()) 1321 this.careManager = new Reference(); // cc 1322 return this.careManager; 1323 } 1324 1325 public boolean hasCareManager() { 1326 return this.careManager != null && !this.careManager.isEmpty(); 1327 } 1328 1329 /** 1330 * @param value {@link #careManager} (The practitioner that is the care manager/care co-ordinator for this patient.) 1331 */ 1332 public EpisodeOfCare setCareManager(Reference value) { 1333 this.careManager = value; 1334 return this; 1335 } 1336 1337 /** 1338 * @return {@link #careManager} 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 practitioner that is the care manager/care co-ordinator for this patient.) 1339 */ 1340 public Practitioner getCareManagerTarget() { 1341 if (this.careManagerTarget == null) 1342 if (Configuration.errorOnAutoCreate()) 1343 throw new Error("Attempt to auto-create EpisodeOfCare.careManager"); 1344 else if (Configuration.doAutoCreate()) 1345 this.careManagerTarget = new Practitioner(); // aa 1346 return this.careManagerTarget; 1347 } 1348 1349 /** 1350 * @param value {@link #careManager} 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 practitioner that is the care manager/care co-ordinator for this patient.) 1351 */ 1352 public EpisodeOfCare setCareManagerTarget(Practitioner value) { 1353 this.careManagerTarget = value; 1354 return this; 1355 } 1356 1357 /** 1358 * @return {@link #team} (The list of practitioners that may be facilitating this episode of care for specific purposes.) 1359 */ 1360 public List<Reference> getTeam() { 1361 if (this.team == null) 1362 this.team = new ArrayList<Reference>(); 1363 return this.team; 1364 } 1365 1366 /** 1367 * @return Returns a reference to <code>this</code> for easy method chaining 1368 */ 1369 public EpisodeOfCare setTeam(List<Reference> theTeam) { 1370 this.team = theTeam; 1371 return this; 1372 } 1373 1374 public boolean hasTeam() { 1375 if (this.team == null) 1376 return false; 1377 for (Reference item : this.team) 1378 if (!item.isEmpty()) 1379 return true; 1380 return false; 1381 } 1382 1383 public Reference addTeam() { //3 1384 Reference t = new Reference(); 1385 if (this.team == null) 1386 this.team = new ArrayList<Reference>(); 1387 this.team.add(t); 1388 return t; 1389 } 1390 1391 public EpisodeOfCare addTeam(Reference t) { //3 1392 if (t == null) 1393 return this; 1394 if (this.team == null) 1395 this.team = new ArrayList<Reference>(); 1396 this.team.add(t); 1397 return this; 1398 } 1399 1400 /** 1401 * @return The first repetition of repeating field {@link #team}, creating it if it does not already exist 1402 */ 1403 public Reference getTeamFirstRep() { 1404 if (getTeam().isEmpty()) { 1405 addTeam(); 1406 } 1407 return getTeam().get(0); 1408 } 1409 1410 /** 1411 * @return {@link #account} (The set of accounts that may be used for billing for this EpisodeOfCare.) 1412 */ 1413 public List<Reference> getAccount() { 1414 if (this.account == null) 1415 this.account = new ArrayList<Reference>(); 1416 return this.account; 1417 } 1418 1419 /** 1420 * @return Returns a reference to <code>this</code> for easy method chaining 1421 */ 1422 public EpisodeOfCare setAccount(List<Reference> theAccount) { 1423 this.account = theAccount; 1424 return this; 1425 } 1426 1427 public boolean hasAccount() { 1428 if (this.account == null) 1429 return false; 1430 for (Reference item : this.account) 1431 if (!item.isEmpty()) 1432 return true; 1433 return false; 1434 } 1435 1436 public Reference addAccount() { //3 1437 Reference t = new Reference(); 1438 if (this.account == null) 1439 this.account = new ArrayList<Reference>(); 1440 this.account.add(t); 1441 return t; 1442 } 1443 1444 public EpisodeOfCare addAccount(Reference t) { //3 1445 if (t == null) 1446 return this; 1447 if (this.account == null) 1448 this.account = new ArrayList<Reference>(); 1449 this.account.add(t); 1450 return this; 1451 } 1452 1453 /** 1454 * @return The first repetition of repeating field {@link #account}, creating it if it does not already exist 1455 */ 1456 public Reference getAccountFirstRep() { 1457 if (getAccount().isEmpty()) { 1458 addAccount(); 1459 } 1460 return getAccount().get(0); 1461 } 1462 1463 protected void listChildren(List<Property> children) { 1464 super.listChildren(children); 1465 children.add(new Property("identifier", "Identifier", "The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes.", 0, java.lang.Integer.MAX_VALUE, identifier)); 1466 children.add(new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, 1, status)); 1467 children.add(new Property("statusHistory", "", "The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).", 0, java.lang.Integer.MAX_VALUE, statusHistory)); 1468 children.add(new Property("type", "CodeableConcept", "A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.", 0, java.lang.Integer.MAX_VALUE, type)); 1469 children.add(new Property("diagnosis", "", "The list of diagnosis relevant to this episode of care.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); 1470 children.add(new Property("patient", "Reference(Patient)", "The patient who is the focus of this episode of care.", 0, 1, patient)); 1471 children.add(new Property("managingOrganization", "Reference(Organization)", "The organization that has assumed the specific responsibilities for the specified duration.", 0, 1, managingOrganization)); 1472 children.add(new Property("period", "Period", "The interval during which the managing organization assumes the defined responsibility.", 0, 1, period)); 1473 children.add(new Property("referralRequest", "Reference(ReferralRequest)", "Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.", 0, java.lang.Integer.MAX_VALUE, referralRequest)); 1474 children.add(new Property("careManager", "Reference(Practitioner)", "The practitioner that is the care manager/care co-ordinator for this patient.", 0, 1, careManager)); 1475 children.add(new Property("team", "Reference(CareTeam)", "The list of practitioners that may be facilitating this episode of care for specific purposes.", 0, java.lang.Integer.MAX_VALUE, team)); 1476 children.add(new Property("account", "Reference(Account)", "The set of accounts that may be used for billing for this EpisodeOfCare.", 0, java.lang.Integer.MAX_VALUE, account)); 1477 } 1478 1479 @Override 1480 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1481 switch (_hash) { 1482 case -1618432855: /*identifier*/ return new Property("identifier", "Identifier", "The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes.", 0, java.lang.Integer.MAX_VALUE, identifier); 1483 case -892481550: /*status*/ return new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, 1, status); 1484 case -986695614: /*statusHistory*/ return new Property("statusHistory", "", "The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).", 0, java.lang.Integer.MAX_VALUE, statusHistory); 1485 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.", 0, java.lang.Integer.MAX_VALUE, type); 1486 case 1196993265: /*diagnosis*/ return new Property("diagnosis", "", "The list of diagnosis relevant to this episode of care.", 0, java.lang.Integer.MAX_VALUE, diagnosis); 1487 case -791418107: /*patient*/ return new Property("patient", "Reference(Patient)", "The patient who is the focus of this episode of care.", 0, 1, patient); 1488 case -2058947787: /*managingOrganization*/ return new Property("managingOrganization", "Reference(Organization)", "The organization that has assumed the specific responsibilities for the specified duration.", 0, 1, managingOrganization); 1489 case -991726143: /*period*/ return new Property("period", "Period", "The interval during which the managing organization assumes the defined responsibility.", 0, 1, period); 1490 case -310299598: /*referralRequest*/ return new Property("referralRequest", "Reference(ReferralRequest)", "Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.", 0, java.lang.Integer.MAX_VALUE, referralRequest); 1491 case -1147746468: /*careManager*/ return new Property("careManager", "Reference(Practitioner)", "The practitioner that is the care manager/care co-ordinator for this patient.", 0, 1, careManager); 1492 case 3555933: /*team*/ return new Property("team", "Reference(CareTeam)", "The list of practitioners that may be facilitating this episode of care for specific purposes.", 0, java.lang.Integer.MAX_VALUE, team); 1493 case -1177318867: /*account*/ return new Property("account", "Reference(Account)", "The set of accounts that may be used for billing for this EpisodeOfCare.", 0, java.lang.Integer.MAX_VALUE, account); 1494 default: return super.getNamedProperty(_hash, _name, _checkValid); 1495 } 1496 1497 } 1498 1499 @Override 1500 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1501 switch (hash) { 1502 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier 1503 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EpisodeOfCareStatus> 1504 case -986695614: /*statusHistory*/ return this.statusHistory == null ? new Base[0] : this.statusHistory.toArray(new Base[this.statusHistory.size()]); // EpisodeOfCareStatusHistoryComponent 1505 case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept 1506 case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : this.diagnosis.toArray(new Base[this.diagnosis.size()]); // DiagnosisComponent 1507 case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference 1508 case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference 1509 case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period 1510 case -310299598: /*referralRequest*/ return this.referralRequest == null ? new Base[0] : this.referralRequest.toArray(new Base[this.referralRequest.size()]); // Reference 1511 case -1147746468: /*careManager*/ return this.careManager == null ? new Base[0] : new Base[] {this.careManager}; // Reference 1512 case 3555933: /*team*/ return this.team == null ? new Base[0] : this.team.toArray(new Base[this.team.size()]); // Reference 1513 case -1177318867: /*account*/ return this.account == null ? new Base[0] : this.account.toArray(new Base[this.account.size()]); // Reference 1514 default: return super.getProperty(hash, name, checkValid); 1515 } 1516 1517 } 1518 1519 @Override 1520 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1521 switch (hash) { 1522 case -1618432855: // identifier 1523 this.getIdentifier().add(castToIdentifier(value)); // Identifier 1524 return value; 1525 case -892481550: // status 1526 value = new EpisodeOfCareStatusEnumFactory().fromType(castToCode(value)); 1527 this.status = (Enumeration) value; // Enumeration<EpisodeOfCareStatus> 1528 return value; 1529 case -986695614: // statusHistory 1530 this.getStatusHistory().add((EpisodeOfCareStatusHistoryComponent) value); // EpisodeOfCareStatusHistoryComponent 1531 return value; 1532 case 3575610: // type 1533 this.getType().add(castToCodeableConcept(value)); // CodeableConcept 1534 return value; 1535 case 1196993265: // diagnosis 1536 this.getDiagnosis().add((DiagnosisComponent) value); // DiagnosisComponent 1537 return value; 1538 case -791418107: // patient 1539 this.patient = castToReference(value); // Reference 1540 return value; 1541 case -2058947787: // managingOrganization 1542 this.managingOrganization = castToReference(value); // Reference 1543 return value; 1544 case -991726143: // period 1545 this.period = castToPeriod(value); // Period 1546 return value; 1547 case -310299598: // referralRequest 1548 this.getReferralRequest().add(castToReference(value)); // Reference 1549 return value; 1550 case -1147746468: // careManager 1551 this.careManager = castToReference(value); // Reference 1552 return value; 1553 case 3555933: // team 1554 this.getTeam().add(castToReference(value)); // Reference 1555 return value; 1556 case -1177318867: // account 1557 this.getAccount().add(castToReference(value)); // Reference 1558 return value; 1559 default: return super.setProperty(hash, name, value); 1560 } 1561 1562 } 1563 1564 @Override 1565 public Base setProperty(String name, Base value) throws FHIRException { 1566 if (name.equals("identifier")) { 1567 this.getIdentifier().add(castToIdentifier(value)); 1568 } else if (name.equals("status")) { 1569 value = new EpisodeOfCareStatusEnumFactory().fromType(castToCode(value)); 1570 this.status = (Enumeration) value; // Enumeration<EpisodeOfCareStatus> 1571 } else if (name.equals("statusHistory")) { 1572 this.getStatusHistory().add((EpisodeOfCareStatusHistoryComponent) value); 1573 } else if (name.equals("type")) { 1574 this.getType().add(castToCodeableConcept(value)); 1575 } else if (name.equals("diagnosis")) { 1576 this.getDiagnosis().add((DiagnosisComponent) value); 1577 } else if (name.equals("patient")) { 1578 this.patient = castToReference(value); // Reference 1579 } else if (name.equals("managingOrganization")) { 1580 this.managingOrganization = castToReference(value); // Reference 1581 } else if (name.equals("period")) { 1582 this.period = castToPeriod(value); // Period 1583 } else if (name.equals("referralRequest")) { 1584 this.getReferralRequest().add(castToReference(value)); 1585 } else if (name.equals("careManager")) { 1586 this.careManager = castToReference(value); // Reference 1587 } else if (name.equals("team")) { 1588 this.getTeam().add(castToReference(value)); 1589 } else if (name.equals("account")) { 1590 this.getAccount().add(castToReference(value)); 1591 } else 1592 return super.setProperty(name, value); 1593 return value; 1594 } 1595 1596 @Override 1597 public Base makeProperty(int hash, String name) throws FHIRException { 1598 switch (hash) { 1599 case -1618432855: return addIdentifier(); 1600 case -892481550: return getStatusElement(); 1601 case -986695614: return addStatusHistory(); 1602 case 3575610: return addType(); 1603 case 1196993265: return addDiagnosis(); 1604 case -791418107: return getPatient(); 1605 case -2058947787: return getManagingOrganization(); 1606 case -991726143: return getPeriod(); 1607 case -310299598: return addReferralRequest(); 1608 case -1147746468: return getCareManager(); 1609 case 3555933: return addTeam(); 1610 case -1177318867: return addAccount(); 1611 default: return super.makeProperty(hash, name); 1612 } 1613 1614 } 1615 1616 @Override 1617 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1618 switch (hash) { 1619 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 1620 case -892481550: /*status*/ return new String[] {"code"}; 1621 case -986695614: /*statusHistory*/ return new String[] {}; 1622 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 1623 case 1196993265: /*diagnosis*/ return new String[] {}; 1624 case -791418107: /*patient*/ return new String[] {"Reference"}; 1625 case -2058947787: /*managingOrganization*/ return new String[] {"Reference"}; 1626 case -991726143: /*period*/ return new String[] {"Period"}; 1627 case -310299598: /*referralRequest*/ return new String[] {"Reference"}; 1628 case -1147746468: /*careManager*/ return new String[] {"Reference"}; 1629 case 3555933: /*team*/ return new String[] {"Reference"}; 1630 case -1177318867: /*account*/ return new String[] {"Reference"}; 1631 default: return super.getTypesForProperty(hash, name); 1632 } 1633 1634 } 1635 1636 @Override 1637 public Base addChild(String name) throws FHIRException { 1638 if (name.equals("identifier")) { 1639 return addIdentifier(); 1640 } 1641 else if (name.equals("status")) { 1642 throw new FHIRException("Cannot call addChild on a singleton property EpisodeOfCare.status"); 1643 } 1644 else if (name.equals("statusHistory")) { 1645 return addStatusHistory(); 1646 } 1647 else if (name.equals("type")) { 1648 return addType(); 1649 } 1650 else if (name.equals("diagnosis")) { 1651 return addDiagnosis(); 1652 } 1653 else if (name.equals("patient")) { 1654 this.patient = new Reference(); 1655 return this.patient; 1656 } 1657 else if (name.equals("managingOrganization")) { 1658 this.managingOrganization = new Reference(); 1659 return this.managingOrganization; 1660 } 1661 else if (name.equals("period")) { 1662 this.period = new Period(); 1663 return this.period; 1664 } 1665 else if (name.equals("referralRequest")) { 1666 return addReferralRequest(); 1667 } 1668 else if (name.equals("careManager")) { 1669 this.careManager = new Reference(); 1670 return this.careManager; 1671 } 1672 else if (name.equals("team")) { 1673 return addTeam(); 1674 } 1675 else if (name.equals("account")) { 1676 return addAccount(); 1677 } 1678 else 1679 return super.addChild(name); 1680 } 1681 1682 public String fhirType() { 1683 return "EpisodeOfCare"; 1684 1685 } 1686 1687 public EpisodeOfCare copy() { 1688 EpisodeOfCare dst = new EpisodeOfCare(); 1689 copyValues(dst); 1690 if (identifier != null) { 1691 dst.identifier = new ArrayList<Identifier>(); 1692 for (Identifier i : identifier) 1693 dst.identifier.add(i.copy()); 1694 }; 1695 dst.status = status == null ? null : status.copy(); 1696 if (statusHistory != null) { 1697 dst.statusHistory = new ArrayList<EpisodeOfCareStatusHistoryComponent>(); 1698 for (EpisodeOfCareStatusHistoryComponent i : statusHistory) 1699 dst.statusHistory.add(i.copy()); 1700 }; 1701 if (type != null) { 1702 dst.type = new ArrayList<CodeableConcept>(); 1703 for (CodeableConcept i : type) 1704 dst.type.add(i.copy()); 1705 }; 1706 if (diagnosis != null) { 1707 dst.diagnosis = new ArrayList<DiagnosisComponent>(); 1708 for (DiagnosisComponent i : diagnosis) 1709 dst.diagnosis.add(i.copy()); 1710 }; 1711 dst.patient = patient == null ? null : patient.copy(); 1712 dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); 1713 dst.period = period == null ? null : period.copy(); 1714 if (referralRequest != null) { 1715 dst.referralRequest = new ArrayList<Reference>(); 1716 for (Reference i : referralRequest) 1717 dst.referralRequest.add(i.copy()); 1718 }; 1719 dst.careManager = careManager == null ? null : careManager.copy(); 1720 if (team != null) { 1721 dst.team = new ArrayList<Reference>(); 1722 for (Reference i : team) 1723 dst.team.add(i.copy()); 1724 }; 1725 if (account != null) { 1726 dst.account = new ArrayList<Reference>(); 1727 for (Reference i : account) 1728 dst.account.add(i.copy()); 1729 }; 1730 return dst; 1731 } 1732 1733 protected EpisodeOfCare typedCopy() { 1734 return copy(); 1735 } 1736 1737 @Override 1738 public boolean equalsDeep(Base other_) { 1739 if (!super.equalsDeep(other_)) 1740 return false; 1741 if (!(other_ instanceof EpisodeOfCare)) 1742 return false; 1743 EpisodeOfCare o = (EpisodeOfCare) other_; 1744 return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(statusHistory, o.statusHistory, true) 1745 && compareDeep(type, o.type, true) && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(patient, o.patient, true) 1746 && compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(period, o.period, true) 1747 && compareDeep(referralRequest, o.referralRequest, true) && compareDeep(careManager, o.careManager, true) 1748 && compareDeep(team, o.team, true) && compareDeep(account, o.account, true); 1749 } 1750 1751 @Override 1752 public boolean equalsShallow(Base other_) { 1753 if (!super.equalsShallow(other_)) 1754 return false; 1755 if (!(other_ instanceof EpisodeOfCare)) 1756 return false; 1757 EpisodeOfCare o = (EpisodeOfCare) other_; 1758 return compareValues(status, o.status, true); 1759 } 1760 1761 public boolean isEmpty() { 1762 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, statusHistory 1763 , type, diagnosis, patient, managingOrganization, period, referralRequest, careManager 1764 , team, account); 1765 } 1766 1767 @Override 1768 public ResourceType getResourceType() { 1769 return ResourceType.EpisodeOfCare; 1770 } 1771 1772 /** 1773 * Search parameter: <b>date</b> 1774 * <p> 1775 * Description: <b>The provided date search value falls within the episode of care's period</b><br> 1776 * Type: <b>date</b><br> 1777 * Path: <b>EpisodeOfCare.period</b><br> 1778 * </p> 1779 */ 1780 @SearchParamDefinition(name="date", path="EpisodeOfCare.period", description="The provided date search value falls within the episode of care's period", type="date" ) 1781 public static final String SP_DATE = "date"; 1782 /** 1783 * <b>Fluent Client</b> search parameter constant for <b>date</b> 1784 * <p> 1785 * Description: <b>The provided date search value falls within the episode of care's period</b><br> 1786 * Type: <b>date</b><br> 1787 * Path: <b>EpisodeOfCare.period</b><br> 1788 * </p> 1789 */ 1790 public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); 1791 1792 /** 1793 * Search parameter: <b>identifier</b> 1794 * <p> 1795 * Description: <b>Business Identifier(s) relevant for this EpisodeOfCare</b><br> 1796 * Type: <b>token</b><br> 1797 * Path: <b>EpisodeOfCare.identifier</b><br> 1798 * </p> 1799 */ 1800 @SearchParamDefinition(name="identifier", path="EpisodeOfCare.identifier", description="Business Identifier(s) relevant for this EpisodeOfCare", type="token" ) 1801 public static final String SP_IDENTIFIER = "identifier"; 1802 /** 1803 * <b>Fluent Client</b> search parameter constant for <b>identifier</b> 1804 * <p> 1805 * Description: <b>Business Identifier(s) relevant for this EpisodeOfCare</b><br> 1806 * Type: <b>token</b><br> 1807 * Path: <b>EpisodeOfCare.identifier</b><br> 1808 * </p> 1809 */ 1810 public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); 1811 1812 /** 1813 * Search parameter: <b>condition</b> 1814 * <p> 1815 * Description: <b>Conditions/problems/diagnoses this episode of care is for</b><br> 1816 * Type: <b>reference</b><br> 1817 * Path: <b>EpisodeOfCare.diagnosis.condition</b><br> 1818 * </p> 1819 */ 1820 @SearchParamDefinition(name="condition", path="EpisodeOfCare.diagnosis.condition", description="Conditions/problems/diagnoses this episode of care is for", type="reference", target={Condition.class } ) 1821 public static final String SP_CONDITION = "condition"; 1822 /** 1823 * <b>Fluent Client</b> search parameter constant for <b>condition</b> 1824 * <p> 1825 * Description: <b>Conditions/problems/diagnoses this episode of care is for</b><br> 1826 * Type: <b>reference</b><br> 1827 * Path: <b>EpisodeOfCare.diagnosis.condition</b><br> 1828 * </p> 1829 */ 1830 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION); 1831 1832/** 1833 * Constant for fluent queries to be used to add include statements. Specifies 1834 * the path value of "<b>EpisodeOfCare:condition</b>". 1835 */ 1836 public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:condition").toLocked(); 1837 1838 /** 1839 * Search parameter: <b>incomingreferral</b> 1840 * <p> 1841 * Description: <b>Incoming Referral Request</b><br> 1842 * Type: <b>reference</b><br> 1843 * Path: <b>EpisodeOfCare.referralRequest</b><br> 1844 * </p> 1845 */ 1846 @SearchParamDefinition(name="incomingreferral", path="EpisodeOfCare.referralRequest", description="Incoming Referral Request", type="reference", target={ReferralRequest.class } ) 1847 public static final String SP_INCOMINGREFERRAL = "incomingreferral"; 1848 /** 1849 * <b>Fluent Client</b> search parameter constant for <b>incomingreferral</b> 1850 * <p> 1851 * Description: <b>Incoming Referral Request</b><br> 1852 * Type: <b>reference</b><br> 1853 * Path: <b>EpisodeOfCare.referralRequest</b><br> 1854 * </p> 1855 */ 1856 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INCOMINGREFERRAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INCOMINGREFERRAL); 1857 1858/** 1859 * Constant for fluent queries to be used to add include statements. Specifies 1860 * the path value of "<b>EpisodeOfCare:incomingreferral</b>". 1861 */ 1862 public static final ca.uhn.fhir.model.api.Include INCLUDE_INCOMINGREFERRAL = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:incomingreferral").toLocked(); 1863 1864 /** 1865 * Search parameter: <b>patient</b> 1866 * <p> 1867 * Description: <b>The patient who is the focus of this episode of care</b><br> 1868 * Type: <b>reference</b><br> 1869 * Path: <b>EpisodeOfCare.patient</b><br> 1870 * </p> 1871 */ 1872 @SearchParamDefinition(name="patient", path="EpisodeOfCare.patient", description="The patient who is the focus of this episode of care", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } ) 1873 public static final String SP_PATIENT = "patient"; 1874 /** 1875 * <b>Fluent Client</b> search parameter constant for <b>patient</b> 1876 * <p> 1877 * Description: <b>The patient who is the focus of this episode of care</b><br> 1878 * Type: <b>reference</b><br> 1879 * Path: <b>EpisodeOfCare.patient</b><br> 1880 * </p> 1881 */ 1882 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); 1883 1884/** 1885 * Constant for fluent queries to be used to add include statements. Specifies 1886 * the path value of "<b>EpisodeOfCare:patient</b>". 1887 */ 1888 public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:patient").toLocked(); 1889 1890 /** 1891 * Search parameter: <b>organization</b> 1892 * <p> 1893 * Description: <b>The organization that has assumed the specific responsibilities of this EpisodeOfCare</b><br> 1894 * Type: <b>reference</b><br> 1895 * Path: <b>EpisodeOfCare.managingOrganization</b><br> 1896 * </p> 1897 */ 1898 @SearchParamDefinition(name="organization", path="EpisodeOfCare.managingOrganization", description="The organization that has assumed the specific responsibilities of this EpisodeOfCare", type="reference", target={Organization.class } ) 1899 public static final String SP_ORGANIZATION = "organization"; 1900 /** 1901 * <b>Fluent Client</b> search parameter constant for <b>organization</b> 1902 * <p> 1903 * Description: <b>The organization that has assumed the specific responsibilities of this EpisodeOfCare</b><br> 1904 * Type: <b>reference</b><br> 1905 * Path: <b>EpisodeOfCare.managingOrganization</b><br> 1906 * </p> 1907 */ 1908 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); 1909 1910/** 1911 * Constant for fluent queries to be used to add include statements. Specifies 1912 * the path value of "<b>EpisodeOfCare:organization</b>". 1913 */ 1914 public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:organization").toLocked(); 1915 1916 /** 1917 * Search parameter: <b>type</b> 1918 * <p> 1919 * Description: <b>Type/class - e.g. specialist referral, disease management</b><br> 1920 * Type: <b>token</b><br> 1921 * Path: <b>EpisodeOfCare.type</b><br> 1922 * </p> 1923 */ 1924 @SearchParamDefinition(name="type", path="EpisodeOfCare.type", description="Type/class - e.g. specialist referral, disease management", type="token" ) 1925 public static final String SP_TYPE = "type"; 1926 /** 1927 * <b>Fluent Client</b> search parameter constant for <b>type</b> 1928 * <p> 1929 * Description: <b>Type/class - e.g. specialist referral, disease management</b><br> 1930 * Type: <b>token</b><br> 1931 * Path: <b>EpisodeOfCare.type</b><br> 1932 * </p> 1933 */ 1934 public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); 1935 1936 /** 1937 * Search parameter: <b>care-manager</b> 1938 * <p> 1939 * Description: <b>Care manager/care co-ordinator for the patient</b><br> 1940 * Type: <b>reference</b><br> 1941 * Path: <b>EpisodeOfCare.careManager</b><br> 1942 * </p> 1943 */ 1944 @SearchParamDefinition(name="care-manager", path="EpisodeOfCare.careManager", description="Care manager/care co-ordinator for the patient", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Practitioner.class } ) 1945 public static final String SP_CARE_MANAGER = "care-manager"; 1946 /** 1947 * <b>Fluent Client</b> search parameter constant for <b>care-manager</b> 1948 * <p> 1949 * Description: <b>Care manager/care co-ordinator for the patient</b><br> 1950 * Type: <b>reference</b><br> 1951 * Path: <b>EpisodeOfCare.careManager</b><br> 1952 * </p> 1953 */ 1954 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CARE_MANAGER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CARE_MANAGER); 1955 1956/** 1957 * Constant for fluent queries to be used to add include statements. Specifies 1958 * the path value of "<b>EpisodeOfCare:care-manager</b>". 1959 */ 1960 public static final ca.uhn.fhir.model.api.Include INCLUDE_CARE_MANAGER = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:care-manager").toLocked(); 1961 1962 /** 1963 * Search parameter: <b>status</b> 1964 * <p> 1965 * Description: <b>The current status of the Episode of Care as provided (does not check the status history collection)</b><br> 1966 * Type: <b>token</b><br> 1967 * Path: <b>EpisodeOfCare.status</b><br> 1968 * </p> 1969 */ 1970 @SearchParamDefinition(name="status", path="EpisodeOfCare.status", description="The current status of the Episode of Care as provided (does not check the status history collection)", type="token" ) 1971 public static final String SP_STATUS = "status"; 1972 /** 1973 * <b>Fluent Client</b> search parameter constant for <b>status</b> 1974 * <p> 1975 * Description: <b>The current status of the Episode of Care as provided (does not check the status history collection)</b><br> 1976 * Type: <b>token</b><br> 1977 * Path: <b>EpisodeOfCare.status</b><br> 1978 * </p> 1979 */ 1980 public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); 1981 1982 1983}