
001package org.hl7.fhir.r5.openehr; 002 003 004/* 005 Copyright (c) 2011+, HL7, Inc. 006 All rights reserved. 007 008 Redistribution and use in source and binary forms, with or without modification, \ 009 are permitted provided that the following conditions are met: 010 011 * Redistributions of source code must retain the above copyright notice, this \ 012 list of conditions and the following disclaimer. 013 * Redistributions in binary form must reproduce the above copyright notice, \ 014 this list of conditions and the following disclaimer in the documentation \ 015 and/or other materials provided with the distribution. 016 * Neither the name of HL7 nor the names of its contributors may be used to 017 endorse or promote products derived from this software without specific 018 prior written permission. 019 020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \ 021 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \ 022 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \ 023 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \ 024 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \ 025 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \ 026 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \ 027 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \ 028 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \ 029 POSSIBILITY OF SUCH DAMAGE. 030 */ 031 032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0 033 034import java.util.ArrayList; 035import java.util.Date; 036import java.util.List; 037import org.hl7.fhir.utilities.Utilities; 038import org.hl7.fhir.r5.openehr.Enumerations.*; 039import org.hl7.fhir.exceptions.FHIRException; 040import org.hl7.fhir.r5.model.*; 041import org.hl7.fhir.instance.model.api.ICompositeType; 042import ca.uhn.fhir.model.api.annotation.Child; 043import ca.uhn.fhir.model.api.annotation.ChildOrder; 044import ca.uhn.fhir.model.api.annotation.DatatypeDef; 045import ca.uhn.fhir.model.api.annotation.Description; 046import ca.uhn.fhir.model.api.annotation.Block; 047 048/** 049 * Documents the context information of a healthcare event involving the subject of care and the health system. The context information recorded here are independent of the attributes recorded in the version audit, which document the system interaction context, i.e. the context of a user interacting with the health record system. Healthcare events include patient contacts, and any other business activity, such as pathology investigations which take place on behalf of the patient. 050 */ 051@DatatypeDef(name="EVENT_CONTEXT") 052public class EVENT_CONTEXT extends LOCATABLE implements ICompositeType { 053 054 /** 055 * Start time of the clinical session or other kind of event during which a provider performs a service of any kind for the patient. 056 */ 057 @Child(name = "start_time", type = {DV_DATE_TIME.class}, order=0, min=1, max=1, modifier=false, summary=false) 058 @Description(shortDefinition="Start time of the clinical session or other kind of event during which a provider performs a service of any kind for the patient", formalDefinition="Start time of the clinical session or other kind of event during which a provider performs a service of any kind for the patient." ) 059 protected DV_DATE_TIME start_time; 060 061 /** 062 * Optional end time of the clinical session. 063 */ 064 @Child(name = "end_time", type = {DV_DATE_TIME.class}, order=1, min=0, max=1, modifier=false, summary=false) 065 @Description(shortDefinition="Optional end time of the clinical session", formalDefinition="Optional end time of the clinical session." ) 066 protected DV_DATE_TIME end_time; 067 068 /** 069 * The actual location where the session occurred, e.g. 'microbiology lab 2', 'home', 'ward A3' and so on. 070 */ 071 @Child(name = "location", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) 072 @Description(shortDefinition="The actual location where the session occurred, e.g. 'microbiology lab 2', 'home', 'ward A3' and so on", formalDefinition="The actual location where the session occurred, e.g. 'microbiology lab 2', 'home', 'ward A3' and so on." ) 073 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="https://specifications.openehr.org/fhir/valueset-composition_category") 074 protected StringType location; 075 076 /** 077 * The clinical session context of this Composition, i.e. the contextual attributes of the clinical session. 078 */ 079 @Child(name = "setting", type = {DV_CODED_TEXT.class}, order=3, min=1, max=1, modifier=false, summary=false) 080 @Description(shortDefinition="The clinical session context of this Composition, i.e. the contextual attributes of the clinical session", formalDefinition="The clinical session context of this Composition, i.e. the contextual attributes of the clinical session." ) 081 protected DV_CODED_TEXT setting; 082 083 /** 084 * Other optional context which will be archetyped. 085 */ 086 @Child(name = "other_context", type = {ITEM_STRUCTURE.class}, order=4, min=0, max=1, modifier=false, summary=false) 087 @Description(shortDefinition="Other optional context which will be archetyped", formalDefinition="Other optional context which will be archetyped." ) 088 protected ITEM_STRUCTURE other_context; 089 090 /** 091 * The health care facility under whose care the event took place. This is the most specific workgroup or delivery unit within a care delivery enterprise that has an official identifier in the health system, and can be used to ensure medico-legal accountability. 092 */ 093 @Child(name = "health_care_facility", type = {PARTY_IDENTIFIED.class}, order=5, min=0, max=1, modifier=false, summary=false) 094 @Description(shortDefinition="The health care facility under whose care the event took place", formalDefinition="The health care facility under whose care the event took place. This is the most specific workgroup or delivery unit within a care delivery enterprise that has an official identifier in the health system, and can be used to ensure medico-legal accountability." ) 095 protected PARTY_IDENTIFIED health_care_facility; 096 097 /** 098 * Parties involved in the healthcare event. These would normally include the physician(s) and often the patient (but not the latter if the clinical session is a pathology test for example). 099 */ 100 @Child(name = "participations", type = {PARTICIPATION.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 101 @Description(shortDefinition="Parties involved in the healthcare event", formalDefinition="Parties involved in the healthcare event. These would normally include the physician(s) and often the patient (but not the latter if the clinical session is a pathology test for example)." ) 102 protected List<PARTICIPATION> participationsList; 103 104 private static final long serialVersionUID = -454658763L; 105 106 /** 107 * Constructor 108 */ 109 public EVENT_CONTEXT() { 110 super(); 111 } 112 113 /** 114 * Constructor 115 */ 116 public EVENT_CONTEXT(DV_DATE_TIME start_time, DV_CODED_TEXT setting) { 117 super(); 118 this.setStart_time(start_time); 119 this.setSetting(setting); 120 } 121 122 /** 123 * @return {@link #start_time} (Start time of the clinical session or other kind of event during which a provider performs a service of any kind for the patient.) 124 */ 125 public DV_DATE_TIME getStart_time() { 126 if (this.start_time == null) 127 if (Configuration.errorOnAutoCreate()) 128 throw new Error("Attempt to auto-create EVENT_CONTEXT.start_time"); 129 else if (Configuration.doAutoCreate()) 130 this.start_time = new DV_DATE_TIME(); // cc 131 return this.start_time; 132 } 133 134 public boolean hasStart_time() { 135 return this.start_time != null && !this.start_time.isEmpty(); 136 } 137 138 /** 139 * @param value {@link #start_time} (Start time of the clinical session or other kind of event during which a provider performs a service of any kind for the patient.) 140 */ 141 public EVENT_CONTEXT setStart_time(DV_DATE_TIME value) { 142 this.start_time = value; 143 return this; 144 } 145 146 /** 147 * @return {@link #end_time} (Optional end time of the clinical session.) 148 */ 149 public DV_DATE_TIME getEnd_time() { 150 if (this.end_time == null) 151 if (Configuration.errorOnAutoCreate()) 152 throw new Error("Attempt to auto-create EVENT_CONTEXT.end_time"); 153 else if (Configuration.doAutoCreate()) 154 this.end_time = new DV_DATE_TIME(); // cc 155 return this.end_time; 156 } 157 158 public boolean hasEnd_time() { 159 return this.end_time != null && !this.end_time.isEmpty(); 160 } 161 162 /** 163 * @param value {@link #end_time} (Optional end time of the clinical session.) 164 */ 165 public EVENT_CONTEXT setEnd_time(DV_DATE_TIME value) { 166 this.end_time = value; 167 return this; 168 } 169 170 /** 171 * @return {@link #location} (The actual location where the session occurred, e.g. 'microbiology lab 2', 'home', 'ward A3' and so on.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value 172 */ 173 public StringType getLocationElement() { 174 if (this.location == null) 175 if (Configuration.errorOnAutoCreate()) 176 throw new Error("Attempt to auto-create EVENT_CONTEXT.location"); 177 else if (Configuration.doAutoCreate()) 178 this.location = new StringType(); // bb 179 return this.location; 180 } 181 182 public boolean hasLocationElement() { 183 return this.location != null && !this.location.isEmpty(); 184 } 185 186 public boolean hasLocation() { 187 return this.location != null && !this.location.isEmpty(); 188 } 189 190 /** 191 * @param value {@link #location} (The actual location where the session occurred, e.g. 'microbiology lab 2', 'home', 'ward A3' and so on.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value 192 */ 193 public EVENT_CONTEXT setLocationElement(StringType value) { 194 this.location = value; 195 return this; 196 } 197 198 /** 199 * @return The actual location where the session occurred, e.g. 'microbiology lab 2', 'home', 'ward A3' and so on. 200 */ 201 public String getLocation() { 202 return this.location == null ? null : this.location.getValue(); 203 } 204 205 /** 206 * @param value The actual location where the session occurred, e.g. 'microbiology lab 2', 'home', 'ward A3' and so on. 207 */ 208 public EVENT_CONTEXT setLocation(String value) { 209 if (Utilities.noString(value)) 210 this.location = null; 211 else { 212 if (this.location == null) 213 this.location = new StringType(); 214 this.location.setValue(value); 215 } 216 return this; 217 } 218 219 /** 220 * @return {@link #setting} (The clinical session context of this Composition, i.e. the contextual attributes of the clinical session.) 221 */ 222 public DV_CODED_TEXT getSetting() { 223 if (this.setting == null) 224 if (Configuration.errorOnAutoCreate()) 225 throw new Error("Attempt to auto-create EVENT_CONTEXT.setting"); 226 else if (Configuration.doAutoCreate()) 227 this.setting = new DV_CODED_TEXT(); // cc 228 return this.setting; 229 } 230 231 public boolean hasSetting() { 232 return this.setting != null && !this.setting.isEmpty(); 233 } 234 235 /** 236 * @param value {@link #setting} (The clinical session context of this Composition, i.e. the contextual attributes of the clinical session.) 237 */ 238 public EVENT_CONTEXT setSetting(DV_CODED_TEXT value) { 239 this.setting = value; 240 return this; 241 } 242 243 /** 244 * @return {@link #other_context} (Other optional context which will be archetyped.) 245 */ 246 public ITEM_STRUCTURE getOther_context() { 247 return this.other_context; 248 } 249 250 public boolean hasOther_context() { 251 return this.other_context != null && !this.other_context.isEmpty(); 252 } 253 254 /** 255 * @param value {@link #other_context} (Other optional context which will be archetyped.) 256 */ 257 public EVENT_CONTEXT setOther_context(ITEM_STRUCTURE value) { 258 this.other_context = value; 259 return this; 260 } 261 262 /** 263 * @return {@link #health_care_facility} (The health care facility under whose care the event took place. This is the most specific workgroup or delivery unit within a care delivery enterprise that has an official identifier in the health system, and can be used to ensure medico-legal accountability.) 264 */ 265 public PARTY_IDENTIFIED getHealth_care_facility() { 266 if (this.health_care_facility == null) 267 if (Configuration.errorOnAutoCreate()) 268 throw new Error("Attempt to auto-create EVENT_CONTEXT.health_care_facility"); 269 else if (Configuration.doAutoCreate()) 270 this.health_care_facility = new PARTY_IDENTIFIED(); // cc 271 return this.health_care_facility; 272 } 273 274 public boolean hasHealth_care_facility() { 275 return this.health_care_facility != null && !this.health_care_facility.isEmpty(); 276 } 277 278 /** 279 * @param value {@link #health_care_facility} (The health care facility under whose care the event took place. This is the most specific workgroup or delivery unit within a care delivery enterprise that has an official identifier in the health system, and can be used to ensure medico-legal accountability.) 280 */ 281 public EVENT_CONTEXT setHealth_care_facility(PARTY_IDENTIFIED value) { 282 this.health_care_facility = value; 283 return this; 284 } 285 286 /** 287 * @return {@link #participations} (Parties involved in the healthcare event. These would normally include the physician(s) and often the patient (but not the latter if the clinical session is a pathology test for example).) 288 */ 289 public List<PARTICIPATION> getParticipationsList() { 290 if (this.participationsList == null) 291 this.participationsList = new ArrayList<PARTICIPATION>(); 292 return this.participationsList; 293 } 294 295 /** 296 * @return Returns a reference to <code>this</code> for easy method chaining 297 */ 298 public EVENT_CONTEXT setParticipationsList(List<PARTICIPATION> theParticipations) { 299 this.participationsList = theParticipations; 300 return this; 301 } 302 303 public boolean hasParticipations() { 304 if (this.participationsList == null) 305 return false; 306 for (PARTICIPATION item : this.participationsList) 307 if (!item.isEmpty()) 308 return true; 309 return false; 310 } 311 312 public PARTICIPATION addParticipations() { //3a 313 PARTICIPATION t = new PARTICIPATION(); 314 if (this.participationsList == null) 315 this.participationsList = new ArrayList<PARTICIPATION>(); 316 this.participationsList.add(t); 317 return t; 318 } 319 320 public EVENT_CONTEXT addParticipations(PARTICIPATION t) { //3b 321 if (t == null) 322 return this; 323 if (this.participationsList == null) 324 this.participationsList = new ArrayList<PARTICIPATION>(); 325 this.participationsList.add(t); 326 return this; 327 } 328 329 /** 330 * @return The first repetition of repeating field {@link #participations}, creating it if it does not already exist {3} 331 */ 332 public PARTICIPATION getParticipationsFirstRep() { 333 if (getParticipationsList().isEmpty()) { 334 addParticipations(); 335 } 336 return getParticipationsList().get(0); 337 } 338 339 protected void listChildren(List<Property> children) { 340 super.listChildren(children); 341 children.add(new Property("start_time", "http://openehr.org/fhir/StructureDefinition/DV-DATE-TIME", "Start time of the clinical session or other kind of event during which a provider performs a service of any kind for the patient.", 0, 1, start_time)); 342 children.add(new Property("end_time", "http://openehr.org/fhir/StructureDefinition/DV-DATE-TIME", "Optional end time of the clinical session.", 0, 1, end_time)); 343 children.add(new Property("location", "string", "The actual location where the session occurred, e.g. 'microbiology lab 2', 'home', 'ward A3' and so on.", 0, 1, location)); 344 children.add(new Property("setting", "http://openehr.org/fhir/StructureDefinition/DV-CODED-TEXT", "The clinical session context of this Composition, i.e. the contextual attributes of the clinical session.", 0, 1, setting)); 345 children.add(new Property("other_context", "http://openehr.org/fhir/StructureDefinition/ITEM-STRUCTURE", "Other optional context which will be archetyped.", 0, 1, other_context)); 346 children.add(new Property("health_care_facility", "http://openehr.org/fhir/StructureDefinition/PARTY-IDENTIFIED", "The health care facility under whose care the event took place. This is the most specific workgroup or delivery unit within a care delivery enterprise that has an official identifier in the health system, and can be used to ensure medico-legal accountability.", 0, 1, health_care_facility)); 347 children.add(new Property("participations", "http://openehr.org/fhir/StructureDefinition/PARTICIPATION", "Parties involved in the healthcare event. These would normally include the physician(s) and often the patient (but not the latter if the clinical session is a pathology test for example).", 0, java.lang.Integer.MAX_VALUE, participationsList)); 348 } 349 350 @Override 351 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 352 switch (_hash) { 353 case -1573145462: /*start_time*/ return new Property("start_time", "http://openehr.org/fhir/StructureDefinition/DV-DATE-TIME", "Start time of the clinical session or other kind of event during which a provider performs a service of any kind for the patient.", 0, 1, start_time); 354 case 1725551537: /*end_time*/ return new Property("end_time", "http://openehr.org/fhir/StructureDefinition/DV-DATE-TIME", "Optional end time of the clinical session.", 0, 1, end_time); 355 case 1901043637: /*location*/ return new Property("location", "string", "The actual location where the session occurred, e.g. 'microbiology lab 2', 'home', 'ward A3' and so on.", 0, 1, location); 356 case 1985941072: /*setting*/ return new Property("setting", "http://openehr.org/fhir/StructureDefinition/DV-CODED-TEXT", "The clinical session context of this Composition, i.e. the contextual attributes of the clinical session.", 0, 1, setting); 357 case -1863234688: /*other_context*/ return new Property("other_context", "http://openehr.org/fhir/StructureDefinition/ITEM-STRUCTURE", "Other optional context which will be archetyped.", 0, 1, other_context); 358 case 1115786094: /*health_care_facility*/ return new Property("health_care_facility", "http://openehr.org/fhir/StructureDefinition/PARTY-IDENTIFIED", "The health care facility under whose care the event took place. This is the most specific workgroup or delivery unit within a care delivery enterprise that has an official identifier in the health system, and can be used to ensure medico-legal accountability.", 0, 1, health_care_facility); 359 case 170924882: /*participations*/ return new Property("participations", "http://openehr.org/fhir/StructureDefinition/PARTICIPATION", "Parties involved in the healthcare event. These would normally include the physician(s) and often the patient (but not the latter if the clinical session is a pathology test for example).", 0, java.lang.Integer.MAX_VALUE, participationsList); 360 default: return super.getNamedProperty(_hash, _name, _checkValid); 361 } 362 363 } 364 365 @Override 366 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 367 switch (hash) { 368 case -1573145462: /*start_time*/ return this.start_time == null ? new Base[0] : new Base[] {this.start_time}; // DV_DATE_TIME 369 case 1725551537: /*end_time*/ return this.end_time == null ? new Base[0] : new Base[] {this.end_time}; // DV_DATE_TIME 370 case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // StringType 371 case 1985941072: /*setting*/ return this.setting == null ? new Base[0] : new Base[] {this.setting}; // DV_CODED_TEXT 372 case -1863234688: /*other_context*/ return this.other_context == null ? new Base[0] : new Base[] {this.other_context}; // ITEM_STRUCTURE 373 case 1115786094: /*health_care_facility*/ return this.health_care_facility == null ? new Base[0] : new Base[] {this.health_care_facility}; // PARTY_IDENTIFIED 374 case 170924882: /*participations*/ return this.participationsList == null ? new Base[0] : this.participationsList.toArray(new Base[this.participationsList.size()]); // PARTICIPATION 375 default: return super.getProperty(hash, name, checkValid); 376 } 377 378 } 379 380 @Override 381 public Base setProperty(int hash, String name, Base value) throws FHIRException { 382 switch (hash) { 383 case -1573145462: // start_time 384 this.start_time = (DV_DATE_TIME) value; // DV_DATE_TIME 385 return value; 386 case 1725551537: // end_time 387 this.end_time = (DV_DATE_TIME) value; // DV_DATE_TIME 388 return value; 389 case 1901043637: // location 390 this.location = TypeConvertor.castToString(value); // StringType 391 return value; 392 case 1985941072: // setting 393 this.setting = (DV_CODED_TEXT) value; // DV_CODED_TEXT 394 return value; 395 case -1863234688: // other_context 396 this.other_context = (ITEM_STRUCTURE) value; // ITEM_STRUCTURE 397 return value; 398 case 1115786094: // health_care_facility 399 this.health_care_facility = (PARTY_IDENTIFIED) value; // PARTY_IDENTIFIED 400 return value; 401 case 170924882: // participations 402 this.getParticipationsList().add((PARTICIPATION) value); // PARTICIPATION 403 return value; 404 default: return super.setProperty(hash, name, value); 405 } 406 407 } 408 409 @Override 410 public Base setProperty(String name, Base value) throws FHIRException { 411 if (name.equals("start_time")) { 412 this.start_time = (DV_DATE_TIME) value; // DV_DATE_TIME 413 } else if (name.equals("end_time")) { 414 this.end_time = (DV_DATE_TIME) value; // DV_DATE_TIME 415 } else if (name.equals("location")) { 416 this.location = TypeConvertor.castToString(value); // StringType 417 } else if (name.equals("setting")) { 418 this.setting = (DV_CODED_TEXT) value; // DV_CODED_TEXT 419 } else if (name.equals("other_context")) { 420 this.other_context = (ITEM_STRUCTURE) value; // ITEM_STRUCTURE 421 } else if (name.equals("health_care_facility")) { 422 this.health_care_facility = (PARTY_IDENTIFIED) value; // PARTY_IDENTIFIED 423 } else if (name.equals("participations")) { 424 this.getParticipationsList().add((PARTICIPATION) value); // PARTICIPATION 425 } else 426 return super.setProperty(name, value); 427 return value; 428 } 429 430 @Override 431 public Base makeProperty(int hash, String name) throws FHIRException { 432 switch (hash) { 433 case -1573145462: return getStart_time(); 434 case 1725551537: return getEnd_time(); 435 case 1901043637: return getLocationElement(); 436 case 1985941072: return getSetting(); 437 case -1863234688: /*div*/ 438 throw new Error("Unable to make an instance of the abstract property 'other_context'"); 439 case 1115786094: return getHealth_care_facility(); 440 case 170924882: return addParticipations(); 441 default: return super.makeProperty(hash, name); 442 } 443 444 } 445 446 @Override 447 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 448 switch (hash) { 449 case -1573145462: /*start_time*/ return new String[] {"http://openehr.org/fhir/StructureDefinition/DV-DATE-TIME"}; 450 case 1725551537: /*end_time*/ return new String[] {"http://openehr.org/fhir/StructureDefinition/DV-DATE-TIME"}; 451 case 1901043637: /*location*/ return new String[] {"string"}; 452 case 1985941072: /*setting*/ return new String[] {"http://openehr.org/fhir/StructureDefinition/DV-CODED-TEXT"}; 453 case -1863234688: /*other_context*/ return new String[] {"http://openehr.org/fhir/StructureDefinition/ITEM-STRUCTURE"}; 454 case 1115786094: /*health_care_facility*/ return new String[] {"http://openehr.org/fhir/StructureDefinition/PARTY-IDENTIFIED"}; 455 case 170924882: /*participations*/ return new String[] {"http://openehr.org/fhir/StructureDefinition/PARTICIPATION"}; 456 default: return super.getTypesForProperty(hash, name); 457 } 458 459 } 460 461 @Override 462 public Base addChild(String name) throws FHIRException { 463 if (name.equals("start_time")) { 464 this.start_time = new DV_DATE_TIME(); 465 return this.start_time; 466 } 467 else if (name.equals("end_time")) { 468 this.end_time = new DV_DATE_TIME(); 469 return this.end_time; 470 } 471 else if (name.equals("location")) { 472 throw new FHIRException("Cannot call addChild on a singleton property EVENT_CONTEXT.location"); 473 } 474 else if (name.equals("setting")) { 475 this.setting = new DV_CODED_TEXT(); 476 return this.setting; 477 } 478 else if (name.equals("other_context")) { 479 throw new FHIRException("Cannot call addChild on an abstract type EVENT_CONTEXT.other_context"); 480 } 481 else if (name.equals("health_care_facility")) { 482 this.health_care_facility = new PARTY_IDENTIFIED(); 483 return this.health_care_facility; 484 } 485 else if (name.equals("participations")) { 486 return addParticipations(); 487 } 488 else 489 return super.addChild(name); 490 } 491 492 public String fhirType() { 493 return "EVENT_CONTEXT"; 494 495 } 496 497 public EVENT_CONTEXT copy() { 498 EVENT_CONTEXT dst = new EVENT_CONTEXT(); 499 copyValues(dst); 500 return dst; 501 } 502 503 public void copyValues(EVENT_CONTEXT dst) { 504 super.copyValues(dst); 505 dst.start_time = start_time == null ? null : start_time.copy(); 506 dst.end_time = end_time == null ? null : end_time.copy(); 507 dst.location = location == null ? null : location.copy(); 508 dst.setting = setting == null ? null : setting.copy(); 509 dst.other_context = other_context == null ? null : other_context.copy(); 510 dst.health_care_facility = health_care_facility == null ? null : health_care_facility.copy(); 511 if (participationsList != null) { 512 dst.participationsList = new ArrayList<PARTICIPATION>(); 513 for (PARTICIPATION i : participationsList) 514 dst.participationsList.add(i.copy()); 515 }; 516 } 517 518 protected EVENT_CONTEXT typedCopy() { 519 return copy(); 520 } 521 522 @Override 523 public boolean equalsDeep(Base other_) { 524 if (!super.equalsDeep(other_)) 525 return false; 526 if (!(other_ instanceof EVENT_CONTEXT)) 527 return false; 528 EVENT_CONTEXT o = (EVENT_CONTEXT) other_; 529 return compareDeep(start_time, o.start_time, true) && compareDeep(end_time, o.end_time, true) && compareDeep(location, o.location, true) 530 && compareDeep(setting, o.setting, true) && compareDeep(other_context, o.other_context, true) && compareDeep(health_care_facility, o.health_care_facility, true) 531 && compareDeep(participationsList, o.participationsList, true); 532 } 533 534 @Override 535 public boolean equalsShallow(Base other_) { 536 if (!super.equalsShallow(other_)) 537 return false; 538 if (!(other_ instanceof EVENT_CONTEXT)) 539 return false; 540 EVENT_CONTEXT o = (EVENT_CONTEXT) other_; 541 return compareValues(location, o.location, true); 542 } 543 544 public boolean isEmpty() { 545 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(start_time, end_time, location 546 , setting, other_context, health_care_facility, participationsList); 547 } 548 549 550} 551