001package org.hl7.fhir.r5.model; 002 003 004/* 005 Copyright (c) 2011+, HL7, Inc. 006 All rights reserved. 007 008 Redistribution and use in source and binary forms, with or without modification, \ 009 are permitted provided that the following conditions are met: 010 011 * Redistributions of source code must retain the above copyright notice, this \ 012 list of conditions and the following disclaimer. 013 * Redistributions in binary form must reproduce the above copyright notice, \ 014 this list of conditions and the following disclaimer in the documentation \ 015 and/or other materials provided with the distribution. 016 * Neither the name of HL7 nor the names of its contributors may be used to 017 endorse or promote products derived from this software without specific 018 prior written permission. 019 020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \ 021 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \ 022 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \ 023 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \ 024 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \ 025 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \ 026 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \ 027 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \ 028 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \ 029 POSSIBILITY OF SUCH DAMAGE. 030 */ 031 032// Generated on Tue, Dec 13, 2022 17:53+1100 for FHIR vcurrent 033 034import java.util.ArrayList; 035import java.util.Date; 036import java.util.List; 037import org.hl7.fhir.utilities.Utilities; 038import org.hl7.fhir.r5.model.Enumerations.*; 039import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 040import org.hl7.fhir.exceptions.FHIRException; 041import org.hl7.fhir.instance.model.api.ICompositeType; 042import ca.uhn.fhir.model.api.annotation.ResourceDef; 043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 044import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 045import ca.uhn.fhir.model.api.annotation.Child; 046import ca.uhn.fhir.model.api.annotation.ChildOrder; 047import ca.uhn.fhir.model.api.annotation.Description; 048import ca.uhn.fhir.model.api.annotation.Block; 049 050/** 051 * Indicates that a device is to be or has been dispensed for a named person/patient. This includes a description of the product (supply) provided and the instructions for using the device. 052 */ 053@ResourceDef(name="DeviceDispense", profile="http://hl7.org/fhir/StructureDefinition/DeviceDispense") 054public class DeviceDispense extends DomainResource { 055 056 public enum DeviceDispenseStatusCodes { 057 /** 058 * The core event has not started yet, but some staging activities have begun (e.g. initial preparing of the device. Preparation stages may be tracked e.g. for planning, supply or billing purposes. 059 */ 060 PREPARATION, 061 /** 062 * The dispensed product is ready for pickup. 063 */ 064 INPROGRESS, 065 /** 066 * The dispensed product was not and will never be picked up by the patient. 067 */ 068 CANCELLED, 069 /** 070 * The dispense process is paused while waiting for an external event to reactivate the dispense. For example, new stock has arrived or the prescriber has called. 071 */ 072 ONHOLD, 073 /** 074 * The dispensed product has been picked up. 075 */ 076 COMPLETED, 077 /** 078 * The dispense was entered in error and therefore nullified. 079 */ 080 ENTEREDINERROR, 081 /** 082 * Actions implied by the dispense have been permanently halted, before all of them occurred. 083 */ 084 STOPPED, 085 /** 086 * The dispense was declined and not performed. 087 */ 088 DECLINED, 089 /** 090 * The authoring system does not know which of the status values applies for this dispense. Note: this concept is not to be used for other - one of the listed statuses is presumed to apply, it's just now known which one. 091 */ 092 UNKNOWN, 093 /** 094 * added to help the parsers with the generic types 095 */ 096 NULL; 097 public static DeviceDispenseStatusCodes fromCode(String codeString) throws FHIRException { 098 if (codeString == null || "".equals(codeString)) 099 return null; 100 if ("preparation".equals(codeString)) 101 return PREPARATION; 102 if ("in-progress".equals(codeString)) 103 return INPROGRESS; 104 if ("cancelled".equals(codeString)) 105 return CANCELLED; 106 if ("on-hold".equals(codeString)) 107 return ONHOLD; 108 if ("completed".equals(codeString)) 109 return COMPLETED; 110 if ("entered-in-error".equals(codeString)) 111 return ENTEREDINERROR; 112 if ("stopped".equals(codeString)) 113 return STOPPED; 114 if ("declined".equals(codeString)) 115 return DECLINED; 116 if ("unknown".equals(codeString)) 117 return UNKNOWN; 118 if (Configuration.isAcceptInvalidEnums()) 119 return null; 120 else 121 throw new FHIRException("Unknown DeviceDispenseStatusCodes code '"+codeString+"'"); 122 } 123 public String toCode() { 124 switch (this) { 125 case PREPARATION: return "preparation"; 126 case INPROGRESS: return "in-progress"; 127 case CANCELLED: return "cancelled"; 128 case ONHOLD: return "on-hold"; 129 case COMPLETED: return "completed"; 130 case ENTEREDINERROR: return "entered-in-error"; 131 case STOPPED: return "stopped"; 132 case DECLINED: return "declined"; 133 case UNKNOWN: return "unknown"; 134 case NULL: return null; 135 default: return "?"; 136 } 137 } 138 public String getSystem() { 139 switch (this) { 140 case PREPARATION: return "http://hl7.org/fhir/devicedispense-status"; 141 case INPROGRESS: return "http://hl7.org/fhir/devicedispense-status"; 142 case CANCELLED: return "http://hl7.org/fhir/devicedispense-status"; 143 case ONHOLD: return "http://hl7.org/fhir/devicedispense-status"; 144 case COMPLETED: return "http://hl7.org/fhir/devicedispense-status"; 145 case ENTEREDINERROR: return "http://hl7.org/fhir/devicedispense-status"; 146 case STOPPED: return "http://hl7.org/fhir/devicedispense-status"; 147 case DECLINED: return "http://hl7.org/fhir/devicedispense-status"; 148 case UNKNOWN: return "http://hl7.org/fhir/devicedispense-status"; 149 case NULL: return null; 150 default: return "?"; 151 } 152 } 153 public String getDefinition() { 154 switch (this) { 155 case PREPARATION: return "The core event has not started yet, but some staging activities have begun (e.g. initial preparing of the device. Preparation stages may be tracked e.g. for planning, supply or billing purposes."; 156 case INPROGRESS: return "The dispensed product is ready for pickup."; 157 case CANCELLED: return "The dispensed product was not and will never be picked up by the patient."; 158 case ONHOLD: return "The dispense process is paused while waiting for an external event to reactivate the dispense. For example, new stock has arrived or the prescriber has called."; 159 case COMPLETED: return "The dispensed product has been picked up."; 160 case ENTEREDINERROR: return "The dispense was entered in error and therefore nullified."; 161 case STOPPED: return "Actions implied by the dispense have been permanently halted, before all of them occurred."; 162 case DECLINED: return "The dispense was declined and not performed."; 163 case UNKNOWN: return "The authoring system does not know which of the status values applies for this dispense. Note: this concept is not to be used for other - one of the listed statuses is presumed to apply, it's just now known which one."; 164 case NULL: return null; 165 default: return "?"; 166 } 167 } 168 public String getDisplay() { 169 switch (this) { 170 case PREPARATION: return "Preparation"; 171 case INPROGRESS: return "In Progress"; 172 case CANCELLED: return "Cancelled"; 173 case ONHOLD: return "On Hold"; 174 case COMPLETED: return "Completed"; 175 case ENTEREDINERROR: return "Entered in Error"; 176 case STOPPED: return "Stopped"; 177 case DECLINED: return "Declined"; 178 case UNKNOWN: return "Unknown"; 179 case NULL: return null; 180 default: return "?"; 181 } 182 } 183 } 184 185 public static class DeviceDispenseStatusCodesEnumFactory implements EnumFactory<DeviceDispenseStatusCodes> { 186 public DeviceDispenseStatusCodes fromCode(String codeString) throws IllegalArgumentException { 187 if (codeString == null || "".equals(codeString)) 188 if (codeString == null || "".equals(codeString)) 189 return null; 190 if ("preparation".equals(codeString)) 191 return DeviceDispenseStatusCodes.PREPARATION; 192 if ("in-progress".equals(codeString)) 193 return DeviceDispenseStatusCodes.INPROGRESS; 194 if ("cancelled".equals(codeString)) 195 return DeviceDispenseStatusCodes.CANCELLED; 196 if ("on-hold".equals(codeString)) 197 return DeviceDispenseStatusCodes.ONHOLD; 198 if ("completed".equals(codeString)) 199 return DeviceDispenseStatusCodes.COMPLETED; 200 if ("entered-in-error".equals(codeString)) 201 return DeviceDispenseStatusCodes.ENTEREDINERROR; 202 if ("stopped".equals(codeString)) 203 return DeviceDispenseStatusCodes.STOPPED; 204 if ("declined".equals(codeString)) 205 return DeviceDispenseStatusCodes.DECLINED; 206 if ("unknown".equals(codeString)) 207 return DeviceDispenseStatusCodes.UNKNOWN; 208 throw new IllegalArgumentException("Unknown DeviceDispenseStatusCodes code '"+codeString+"'"); 209 } 210 public Enumeration<DeviceDispenseStatusCodes> fromType(PrimitiveType<?> code) throws FHIRException { 211 if (code == null) 212 return null; 213 if (code.isEmpty()) 214 return new Enumeration<DeviceDispenseStatusCodes>(this, DeviceDispenseStatusCodes.NULL, code); 215 String codeString = ((PrimitiveType) code).asStringValue(); 216 if (codeString == null || "".equals(codeString)) 217 return new Enumeration<DeviceDispenseStatusCodes>(this, DeviceDispenseStatusCodes.NULL, code); 218 if ("preparation".equals(codeString)) 219 return new Enumeration<DeviceDispenseStatusCodes>(this, DeviceDispenseStatusCodes.PREPARATION, code); 220 if ("in-progress".equals(codeString)) 221 return new Enumeration<DeviceDispenseStatusCodes>(this, DeviceDispenseStatusCodes.INPROGRESS, code); 222 if ("cancelled".equals(codeString)) 223 return new Enumeration<DeviceDispenseStatusCodes>(this, DeviceDispenseStatusCodes.CANCELLED, code); 224 if ("on-hold".equals(codeString)) 225 return new Enumeration<DeviceDispenseStatusCodes>(this, DeviceDispenseStatusCodes.ONHOLD, code); 226 if ("completed".equals(codeString)) 227 return new Enumeration<DeviceDispenseStatusCodes>(this, DeviceDispenseStatusCodes.COMPLETED, code); 228 if ("entered-in-error".equals(codeString)) 229 return new Enumeration<DeviceDispenseStatusCodes>(this, DeviceDispenseStatusCodes.ENTEREDINERROR, code); 230 if ("stopped".equals(codeString)) 231 return new Enumeration<DeviceDispenseStatusCodes>(this, DeviceDispenseStatusCodes.STOPPED, code); 232 if ("declined".equals(codeString)) 233 return new Enumeration<DeviceDispenseStatusCodes>(this, DeviceDispenseStatusCodes.DECLINED, code); 234 if ("unknown".equals(codeString)) 235 return new Enumeration<DeviceDispenseStatusCodes>(this, DeviceDispenseStatusCodes.UNKNOWN, code); 236 throw new FHIRException("Unknown DeviceDispenseStatusCodes code '"+codeString+"'"); 237 } 238 public String toCode(DeviceDispenseStatusCodes code) { 239 if (code == DeviceDispenseStatusCodes.PREPARATION) 240 return "preparation"; 241 if (code == DeviceDispenseStatusCodes.INPROGRESS) 242 return "in-progress"; 243 if (code == DeviceDispenseStatusCodes.CANCELLED) 244 return "cancelled"; 245 if (code == DeviceDispenseStatusCodes.ONHOLD) 246 return "on-hold"; 247 if (code == DeviceDispenseStatusCodes.COMPLETED) 248 return "completed"; 249 if (code == DeviceDispenseStatusCodes.ENTEREDINERROR) 250 return "entered-in-error"; 251 if (code == DeviceDispenseStatusCodes.STOPPED) 252 return "stopped"; 253 if (code == DeviceDispenseStatusCodes.DECLINED) 254 return "declined"; 255 if (code == DeviceDispenseStatusCodes.UNKNOWN) 256 return "unknown"; 257 return "?"; 258 } 259 public String toSystem(DeviceDispenseStatusCodes code) { 260 return code.getSystem(); 261 } 262 } 263 264 @Block() 265 public static class DeviceDispensePerformerComponent extends BackboneElement implements IBaseBackboneElement { 266 /** 267 * Distinguishes the type of performer in the dispense. For example, date enterer, packager, final checker. 268 */ 269 @Child(name = "function", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) 270 @Description(shortDefinition="Who performed the dispense and what they did", formalDefinition="Distinguishes the type of performer in the dispense. For example, date enterer, packager, final checker." ) 271 protected CodeableConcept function; 272 273 /** 274 * The device, practitioner, etc. who performed the action. It should be assumed that the actor is the dispenser of the device. 275 */ 276 @Child(name = "actor", type = {Practitioner.class, PractitionerRole.class, Organization.class, Patient.class, Device.class, RelatedPerson.class, CareTeam.class}, order=2, min=1, max=1, modifier=false, summary=false) 277 @Description(shortDefinition="Individual who was performing", formalDefinition="The device, practitioner, etc. who performed the action. It should be assumed that the actor is the dispenser of the device." ) 278 protected Reference actor; 279 280 private static final long serialVersionUID = -576943815L; 281 282 /** 283 * Constructor 284 */ 285 public DeviceDispensePerformerComponent() { 286 super(); 287 } 288 289 /** 290 * Constructor 291 */ 292 public DeviceDispensePerformerComponent(Reference actor) { 293 super(); 294 this.setActor(actor); 295 } 296 297 /** 298 * @return {@link #function} (Distinguishes the type of performer in the dispense. For example, date enterer, packager, final checker.) 299 */ 300 public CodeableConcept getFunction() { 301 if (this.function == null) 302 if (Configuration.errorOnAutoCreate()) 303 throw new Error("Attempt to auto-create DeviceDispensePerformerComponent.function"); 304 else if (Configuration.doAutoCreate()) 305 this.function = new CodeableConcept(); // cc 306 return this.function; 307 } 308 309 public boolean hasFunction() { 310 return this.function != null && !this.function.isEmpty(); 311 } 312 313 /** 314 * @param value {@link #function} (Distinguishes the type of performer in the dispense. For example, date enterer, packager, final checker.) 315 */ 316 public DeviceDispensePerformerComponent setFunction(CodeableConcept value) { 317 this.function = value; 318 return this; 319 } 320 321 /** 322 * @return {@link #actor} (The device, practitioner, etc. who performed the action. It should be assumed that the actor is the dispenser of the device.) 323 */ 324 public Reference getActor() { 325 if (this.actor == null) 326 if (Configuration.errorOnAutoCreate()) 327 throw new Error("Attempt to auto-create DeviceDispensePerformerComponent.actor"); 328 else if (Configuration.doAutoCreate()) 329 this.actor = new Reference(); // cc 330 return this.actor; 331 } 332 333 public boolean hasActor() { 334 return this.actor != null && !this.actor.isEmpty(); 335 } 336 337 /** 338 * @param value {@link #actor} (The device, practitioner, etc. who performed the action. It should be assumed that the actor is the dispenser of the device.) 339 */ 340 public DeviceDispensePerformerComponent setActor(Reference value) { 341 this.actor = value; 342 return this; 343 } 344 345 protected void listChildren(List<Property> children) { 346 super.listChildren(children); 347 children.add(new Property("function", "CodeableConcept", "Distinguishes the type of performer in the dispense. For example, date enterer, packager, final checker.", 0, 1, function)); 348 children.add(new Property("actor", "Reference(Practitioner|PractitionerRole|Organization|Patient|Device|RelatedPerson|CareTeam)", "The device, practitioner, etc. who performed the action. It should be assumed that the actor is the dispenser of the device.", 0, 1, actor)); 349 } 350 351 @Override 352 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 353 switch (_hash) { 354 case 1380938712: /*function*/ return new Property("function", "CodeableConcept", "Distinguishes the type of performer in the dispense. For example, date enterer, packager, final checker.", 0, 1, function); 355 case 92645877: /*actor*/ return new Property("actor", "Reference(Practitioner|PractitionerRole|Organization|Patient|Device|RelatedPerson|CareTeam)", "The device, practitioner, etc. who performed the action. It should be assumed that the actor is the dispenser of the device.", 0, 1, actor); 356 default: return super.getNamedProperty(_hash, _name, _checkValid); 357 } 358 359 } 360 361 @Override 362 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 363 switch (hash) { 364 case 1380938712: /*function*/ return this.function == null ? new Base[0] : new Base[] {this.function}; // CodeableConcept 365 case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference 366 default: return super.getProperty(hash, name, checkValid); 367 } 368 369 } 370 371 @Override 372 public Base setProperty(int hash, String name, Base value) throws FHIRException { 373 switch (hash) { 374 case 1380938712: // function 375 this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 376 return value; 377 case 92645877: // actor 378 this.actor = TypeConvertor.castToReference(value); // Reference 379 return value; 380 default: return super.setProperty(hash, name, value); 381 } 382 383 } 384 385 @Override 386 public Base setProperty(String name, Base value) throws FHIRException { 387 if (name.equals("function")) { 388 this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 389 } else if (name.equals("actor")) { 390 this.actor = TypeConvertor.castToReference(value); // Reference 391 } else 392 return super.setProperty(name, value); 393 return value; 394 } 395 396 @Override 397 public Base makeProperty(int hash, String name) throws FHIRException { 398 switch (hash) { 399 case 1380938712: return getFunction(); 400 case 92645877: return getActor(); 401 default: return super.makeProperty(hash, name); 402 } 403 404 } 405 406 @Override 407 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 408 switch (hash) { 409 case 1380938712: /*function*/ return new String[] {"CodeableConcept"}; 410 case 92645877: /*actor*/ return new String[] {"Reference"}; 411 default: return super.getTypesForProperty(hash, name); 412 } 413 414 } 415 416 @Override 417 public Base addChild(String name) throws FHIRException { 418 if (name.equals("function")) { 419 this.function = new CodeableConcept(); 420 return this.function; 421 } 422 else if (name.equals("actor")) { 423 this.actor = new Reference(); 424 return this.actor; 425 } 426 else 427 return super.addChild(name); 428 } 429 430 public DeviceDispensePerformerComponent copy() { 431 DeviceDispensePerformerComponent dst = new DeviceDispensePerformerComponent(); 432 copyValues(dst); 433 return dst; 434 } 435 436 public void copyValues(DeviceDispensePerformerComponent dst) { 437 super.copyValues(dst); 438 dst.function = function == null ? null : function.copy(); 439 dst.actor = actor == null ? null : actor.copy(); 440 } 441 442 @Override 443 public boolean equalsDeep(Base other_) { 444 if (!super.equalsDeep(other_)) 445 return false; 446 if (!(other_ instanceof DeviceDispensePerformerComponent)) 447 return false; 448 DeviceDispensePerformerComponent o = (DeviceDispensePerformerComponent) other_; 449 return compareDeep(function, o.function, true) && compareDeep(actor, o.actor, true); 450 } 451 452 @Override 453 public boolean equalsShallow(Base other_) { 454 if (!super.equalsShallow(other_)) 455 return false; 456 if (!(other_ instanceof DeviceDispensePerformerComponent)) 457 return false; 458 DeviceDispensePerformerComponent o = (DeviceDispensePerformerComponent) other_; 459 return true; 460 } 461 462 public boolean isEmpty() { 463 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(function, actor); 464 } 465 466 public String fhirType() { 467 return "DeviceDispense.performer"; 468 469 } 470 471 } 472 473 /** 474 * Business identifier for this dispensation. 475 */ 476 @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 477 @Description(shortDefinition="Business identifier for this dispensation", formalDefinition="Business identifier for this dispensation." ) 478 protected List<Identifier> identifier; 479 480 /** 481 * The order or request that this dispense is fulfilling. 482 */ 483 @Child(name = "basedOn", type = {CarePlan.class, DeviceRequest.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 484 @Description(shortDefinition="The order or request that this dispense is fulfilling", formalDefinition="The order or request that this dispense is fulfilling." ) 485 protected List<Reference> basedOn; 486 487 /** 488 * The bigger event that this dispense is a part of. 489 */ 490 @Child(name = "partOf", type = {Procedure.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 491 @Description(shortDefinition="The bigger event that this dispense is a part of", formalDefinition="The bigger event that this dispense is a part of." ) 492 protected List<Reference> partOf; 493 494 /** 495 * A code specifying the state of the set of dispense events. 496 */ 497 @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) 498 @Description(shortDefinition="preparation | in-progress | cancelled | on-hold | completed | entered-in-error | stopped | declined | unknown", formalDefinition="A code specifying the state of the set of dispense events." ) 499 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/devicedispense-status") 500 protected Enumeration<DeviceDispenseStatusCodes> status; 501 502 /** 503 * Indicates the reason why a dispense was or was not performed. 504 */ 505 @Child(name = "statusReason", type = {CodeableReference.class}, order=4, min=0, max=1, modifier=false, summary=false) 506 @Description(shortDefinition="Why a dispense was or was not performed", formalDefinition="Indicates the reason why a dispense was or was not performed." ) 507 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/devicedispense-status-reason") 508 protected CodeableReference statusReason; 509 510 /** 511 * Indicates the type of device dispense. 512 */ 513 @Child(name = "category", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 514 @Description(shortDefinition="Type of device dispense", formalDefinition="Indicates the type of device dispense." ) 515 protected List<CodeableConcept> category; 516 517 /** 518 * Identifies the device being dispensed. This is either a link to a resource representing the details of the device or a simple attribute carrying a code that identifies the device from a known list of devices. 519 */ 520 @Child(name = "device", type = {CodeableReference.class}, order=6, min=1, max=1, modifier=false, summary=true) 521 @Description(shortDefinition="What device was supplied", formalDefinition="Identifies the device being dispensed. This is either a link to a resource representing the details of the device or a simple attribute carrying a code that identifies the device from a known list of devices." ) 522 protected CodeableReference device; 523 524 /** 525 * A link to a resource representing the person to whom the device is intended. 526 */ 527 @Child(name = "subject", type = {Patient.class}, order=7, min=1, max=1, modifier=false, summary=true) 528 @Description(shortDefinition="Who the dispense is for", formalDefinition="A link to a resource representing the person to whom the device is intended." ) 529 protected Reference subject; 530 531 /** 532 * The encounter that establishes the context for this event. 533 */ 534 @Child(name = "encounter", type = {Encounter.class}, order=8, min=0, max=1, modifier=false, summary=false) 535 @Description(shortDefinition="Encounter associated with event", formalDefinition="The encounter that establishes the context for this event." ) 536 protected Reference encounter; 537 538 /** 539 * Additional information that supports the device being dispensed. 540 */ 541 @Child(name = "supportingInformation", type = {Reference.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 542 @Description(shortDefinition="Information that supports the dispensing of the device", formalDefinition="Additional information that supports the device being dispensed." ) 543 protected List<Reference> supportingInformation; 544 545 /** 546 * Indicates who or what performed the event. 547 */ 548 @Child(name = "performer", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 549 @Description(shortDefinition="Who performed event", formalDefinition="Indicates who or what performed the event." ) 550 protected List<DeviceDispensePerformerComponent> performer; 551 552 /** 553 * The principal physical location where the dispense was performed. 554 */ 555 @Child(name = "location", type = {Location.class}, order=11, min=0, max=1, modifier=false, summary=false) 556 @Description(shortDefinition="Where the dispense occurred", formalDefinition="The principal physical location where the dispense was performed." ) 557 protected Reference location; 558 559 /** 560 * Indicates the type of dispensing event that is performed. 561 */ 562 @Child(name = "type", type = {CodeableConcept.class}, order=12, min=0, max=1, modifier=false, summary=false) 563 @Description(shortDefinition="Trial fill, partial fill, emergency fill, etc.", formalDefinition="Indicates the type of dispensing event that is performed." ) 564 protected CodeableConcept type; 565 566 /** 567 * The number of devices that have been dispensed. 568 */ 569 @Child(name = "quantity", type = {Quantity.class}, order=13, min=0, max=1, modifier=false, summary=false) 570 @Description(shortDefinition="Amount dispensed", formalDefinition="The number of devices that have been dispensed." ) 571 protected Quantity quantity; 572 573 /** 574 * The time when the dispensed product was packaged and reviewed. 575 */ 576 @Child(name = "preparedDate", type = {DateTimeType.class}, order=14, min=0, max=1, modifier=false, summary=true) 577 @Description(shortDefinition="When product was packaged and reviewed", formalDefinition="The time when the dispensed product was packaged and reviewed." ) 578 protected DateTimeType preparedDate; 579 580 /** 581 * The time the dispensed product was made available to the patient or their representative. 582 */ 583 @Child(name = "whenHandedOver", type = {DateTimeType.class}, order=15, min=0, max=1, modifier=false, summary=false) 584 @Description(shortDefinition="When product was given out", formalDefinition="The time the dispensed product was made available to the patient or their representative." ) 585 protected DateTimeType whenHandedOver; 586 587 /** 588 * Identification of the facility/location where the device was /should be shipped to, as part of the dispense process. 589 */ 590 @Child(name = "destination", type = {Location.class}, order=16, min=0, max=1, modifier=false, summary=false) 591 @Description(shortDefinition="Where the device was sent or should be sent", formalDefinition="Identification of the facility/location where the device was /should be shipped to, as part of the dispense process." ) 592 protected Reference destination; 593 594 /** 595 * Extra information about the dispense that could not be conveyed in the other attributes. 596 */ 597 @Child(name = "note", type = {Annotation.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 598 @Description(shortDefinition="Information about the dispense", formalDefinition="Extra information about the dispense that could not be conveyed in the other attributes." ) 599 protected List<Annotation> note; 600 601 /** 602 * The full representation of the instructions. 603 */ 604 @Child(name = "usageInstruction", type = {StringType.class}, order=18, min=0, max=1, modifier=false, summary=false) 605 @Description(shortDefinition="Full representation of the usage instructions", formalDefinition="The full representation of the instructions." ) 606 protected StringType usageInstruction; 607 608 /** 609 * A summary of the events of interest that have occurred, such as when the dispense was verified. 610 */ 611 @Child(name = "eventHistory", type = {Provenance.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 612 @Description(shortDefinition="A list of relevant lifecycle events", formalDefinition="A summary of the events of interest that have occurred, such as when the dispense was verified." ) 613 protected List<Reference> eventHistory; 614 615 private static final long serialVersionUID = -1613459109L; 616 617 /** 618 * Constructor 619 */ 620 public DeviceDispense() { 621 super(); 622 } 623 624 /** 625 * Constructor 626 */ 627 public DeviceDispense(DeviceDispenseStatusCodes status, CodeableReference device, Reference subject) { 628 super(); 629 this.setStatus(status); 630 this.setDevice(device); 631 this.setSubject(subject); 632 } 633 634 /** 635 * @return {@link #identifier} (Business identifier for this dispensation.) 636 */ 637 public List<Identifier> getIdentifier() { 638 if (this.identifier == null) 639 this.identifier = new ArrayList<Identifier>(); 640 return this.identifier; 641 } 642 643 /** 644 * @return Returns a reference to <code>this</code> for easy method chaining 645 */ 646 public DeviceDispense setIdentifier(List<Identifier> theIdentifier) { 647 this.identifier = theIdentifier; 648 return this; 649 } 650 651 public boolean hasIdentifier() { 652 if (this.identifier == null) 653 return false; 654 for (Identifier item : this.identifier) 655 if (!item.isEmpty()) 656 return true; 657 return false; 658 } 659 660 public Identifier addIdentifier() { //3 661 Identifier t = new Identifier(); 662 if (this.identifier == null) 663 this.identifier = new ArrayList<Identifier>(); 664 this.identifier.add(t); 665 return t; 666 } 667 668 public DeviceDispense addIdentifier(Identifier t) { //3 669 if (t == null) 670 return this; 671 if (this.identifier == null) 672 this.identifier = new ArrayList<Identifier>(); 673 this.identifier.add(t); 674 return this; 675 } 676 677 /** 678 * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3} 679 */ 680 public Identifier getIdentifierFirstRep() { 681 if (getIdentifier().isEmpty()) { 682 addIdentifier(); 683 } 684 return getIdentifier().get(0); 685 } 686 687 /** 688 * @return {@link #basedOn} (The order or request that this dispense is fulfilling.) 689 */ 690 public List<Reference> getBasedOn() { 691 if (this.basedOn == null) 692 this.basedOn = new ArrayList<Reference>(); 693 return this.basedOn; 694 } 695 696 /** 697 * @return Returns a reference to <code>this</code> for easy method chaining 698 */ 699 public DeviceDispense setBasedOn(List<Reference> theBasedOn) { 700 this.basedOn = theBasedOn; 701 return this; 702 } 703 704 public boolean hasBasedOn() { 705 if (this.basedOn == null) 706 return false; 707 for (Reference item : this.basedOn) 708 if (!item.isEmpty()) 709 return true; 710 return false; 711 } 712 713 public Reference addBasedOn() { //3 714 Reference t = new Reference(); 715 if (this.basedOn == null) 716 this.basedOn = new ArrayList<Reference>(); 717 this.basedOn.add(t); 718 return t; 719 } 720 721 public DeviceDispense addBasedOn(Reference t) { //3 722 if (t == null) 723 return this; 724 if (this.basedOn == null) 725 this.basedOn = new ArrayList<Reference>(); 726 this.basedOn.add(t); 727 return this; 728 } 729 730 /** 731 * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3} 732 */ 733 public Reference getBasedOnFirstRep() { 734 if (getBasedOn().isEmpty()) { 735 addBasedOn(); 736 } 737 return getBasedOn().get(0); 738 } 739 740 /** 741 * @return {@link #partOf} (The bigger event that this dispense is a part of.) 742 */ 743 public List<Reference> getPartOf() { 744 if (this.partOf == null) 745 this.partOf = new ArrayList<Reference>(); 746 return this.partOf; 747 } 748 749 /** 750 * @return Returns a reference to <code>this</code> for easy method chaining 751 */ 752 public DeviceDispense setPartOf(List<Reference> thePartOf) { 753 this.partOf = thePartOf; 754 return this; 755 } 756 757 public boolean hasPartOf() { 758 if (this.partOf == null) 759 return false; 760 for (Reference item : this.partOf) 761 if (!item.isEmpty()) 762 return true; 763 return false; 764 } 765 766 public Reference addPartOf() { //3 767 Reference t = new Reference(); 768 if (this.partOf == null) 769 this.partOf = new ArrayList<Reference>(); 770 this.partOf.add(t); 771 return t; 772 } 773 774 public DeviceDispense addPartOf(Reference t) { //3 775 if (t == null) 776 return this; 777 if (this.partOf == null) 778 this.partOf = new ArrayList<Reference>(); 779 this.partOf.add(t); 780 return this; 781 } 782 783 /** 784 * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist {3} 785 */ 786 public Reference getPartOfFirstRep() { 787 if (getPartOf().isEmpty()) { 788 addPartOf(); 789 } 790 return getPartOf().get(0); 791 } 792 793 /** 794 * @return {@link #status} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 795 */ 796 public Enumeration<DeviceDispenseStatusCodes> getStatusElement() { 797 if (this.status == null) 798 if (Configuration.errorOnAutoCreate()) 799 throw new Error("Attempt to auto-create DeviceDispense.status"); 800 else if (Configuration.doAutoCreate()) 801 this.status = new Enumeration<DeviceDispenseStatusCodes>(new DeviceDispenseStatusCodesEnumFactory()); // bb 802 return this.status; 803 } 804 805 public boolean hasStatusElement() { 806 return this.status != null && !this.status.isEmpty(); 807 } 808 809 public boolean hasStatus() { 810 return this.status != null && !this.status.isEmpty(); 811 } 812 813 /** 814 * @param value {@link #status} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value 815 */ 816 public DeviceDispense setStatusElement(Enumeration<DeviceDispenseStatusCodes> value) { 817 this.status = value; 818 return this; 819 } 820 821 /** 822 * @return A code specifying the state of the set of dispense events. 823 */ 824 public DeviceDispenseStatusCodes getStatus() { 825 return this.status == null ? null : this.status.getValue(); 826 } 827 828 /** 829 * @param value A code specifying the state of the set of dispense events. 830 */ 831 public DeviceDispense setStatus(DeviceDispenseStatusCodes value) { 832 if (this.status == null) 833 this.status = new Enumeration<DeviceDispenseStatusCodes>(new DeviceDispenseStatusCodesEnumFactory()); 834 this.status.setValue(value); 835 return this; 836 } 837 838 /** 839 * @return {@link #statusReason} (Indicates the reason why a dispense was or was not performed.) 840 */ 841 public CodeableReference getStatusReason() { 842 if (this.statusReason == null) 843 if (Configuration.errorOnAutoCreate()) 844 throw new Error("Attempt to auto-create DeviceDispense.statusReason"); 845 else if (Configuration.doAutoCreate()) 846 this.statusReason = new CodeableReference(); // cc 847 return this.statusReason; 848 } 849 850 public boolean hasStatusReason() { 851 return this.statusReason != null && !this.statusReason.isEmpty(); 852 } 853 854 /** 855 * @param value {@link #statusReason} (Indicates the reason why a dispense was or was not performed.) 856 */ 857 public DeviceDispense setStatusReason(CodeableReference value) { 858 this.statusReason = value; 859 return this; 860 } 861 862 /** 863 * @return {@link #category} (Indicates the type of device dispense.) 864 */ 865 public List<CodeableConcept> getCategory() { 866 if (this.category == null) 867 this.category = new ArrayList<CodeableConcept>(); 868 return this.category; 869 } 870 871 /** 872 * @return Returns a reference to <code>this</code> for easy method chaining 873 */ 874 public DeviceDispense setCategory(List<CodeableConcept> theCategory) { 875 this.category = theCategory; 876 return this; 877 } 878 879 public boolean hasCategory() { 880 if (this.category == null) 881 return false; 882 for (CodeableConcept item : this.category) 883 if (!item.isEmpty()) 884 return true; 885 return false; 886 } 887 888 public CodeableConcept addCategory() { //3 889 CodeableConcept t = new CodeableConcept(); 890 if (this.category == null) 891 this.category = new ArrayList<CodeableConcept>(); 892 this.category.add(t); 893 return t; 894 } 895 896 public DeviceDispense addCategory(CodeableConcept t) { //3 897 if (t == null) 898 return this; 899 if (this.category == null) 900 this.category = new ArrayList<CodeableConcept>(); 901 this.category.add(t); 902 return this; 903 } 904 905 /** 906 * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3} 907 */ 908 public CodeableConcept getCategoryFirstRep() { 909 if (getCategory().isEmpty()) { 910 addCategory(); 911 } 912 return getCategory().get(0); 913 } 914 915 /** 916 * @return {@link #device} (Identifies the device being dispensed. This is either a link to a resource representing the details of the device or a simple attribute carrying a code that identifies the device from a known list of devices.) 917 */ 918 public CodeableReference getDevice() { 919 if (this.device == null) 920 if (Configuration.errorOnAutoCreate()) 921 throw new Error("Attempt to auto-create DeviceDispense.device"); 922 else if (Configuration.doAutoCreate()) 923 this.device = new CodeableReference(); // cc 924 return this.device; 925 } 926 927 public boolean hasDevice() { 928 return this.device != null && !this.device.isEmpty(); 929 } 930 931 /** 932 * @param value {@link #device} (Identifies the device being dispensed. This is either a link to a resource representing the details of the device or a simple attribute carrying a code that identifies the device from a known list of devices.) 933 */ 934 public DeviceDispense setDevice(CodeableReference value) { 935 this.device = value; 936 return this; 937 } 938 939 /** 940 * @return {@link #subject} (A link to a resource representing the person to whom the device is intended.) 941 */ 942 public Reference getSubject() { 943 if (this.subject == null) 944 if (Configuration.errorOnAutoCreate()) 945 throw new Error("Attempt to auto-create DeviceDispense.subject"); 946 else if (Configuration.doAutoCreate()) 947 this.subject = new Reference(); // cc 948 return this.subject; 949 } 950 951 public boolean hasSubject() { 952 return this.subject != null && !this.subject.isEmpty(); 953 } 954 955 /** 956 * @param value {@link #subject} (A link to a resource representing the person to whom the device is intended.) 957 */ 958 public DeviceDispense setSubject(Reference value) { 959 this.subject = value; 960 return this; 961 } 962 963 /** 964 * @return {@link #encounter} (The encounter that establishes the context for this event.) 965 */ 966 public Reference getEncounter() { 967 if (this.encounter == null) 968 if (Configuration.errorOnAutoCreate()) 969 throw new Error("Attempt to auto-create DeviceDispense.encounter"); 970 else if (Configuration.doAutoCreate()) 971 this.encounter = new Reference(); // cc 972 return this.encounter; 973 } 974 975 public boolean hasEncounter() { 976 return this.encounter != null && !this.encounter.isEmpty(); 977 } 978 979 /** 980 * @param value {@link #encounter} (The encounter that establishes the context for this event.) 981 */ 982 public DeviceDispense setEncounter(Reference value) { 983 this.encounter = value; 984 return this; 985 } 986 987 /** 988 * @return {@link #supportingInformation} (Additional information that supports the device being dispensed.) 989 */ 990 public List<Reference> getSupportingInformation() { 991 if (this.supportingInformation == null) 992 this.supportingInformation = new ArrayList<Reference>(); 993 return this.supportingInformation; 994 } 995 996 /** 997 * @return Returns a reference to <code>this</code> for easy method chaining 998 */ 999 public DeviceDispense setSupportingInformation(List<Reference> theSupportingInformation) { 1000 this.supportingInformation = theSupportingInformation; 1001 return this; 1002 } 1003 1004 public boolean hasSupportingInformation() { 1005 if (this.supportingInformation == null) 1006 return false; 1007 for (Reference item : this.supportingInformation) 1008 if (!item.isEmpty()) 1009 return true; 1010 return false; 1011 } 1012 1013 public Reference addSupportingInformation() { //3 1014 Reference t = new Reference(); 1015 if (this.supportingInformation == null) 1016 this.supportingInformation = new ArrayList<Reference>(); 1017 this.supportingInformation.add(t); 1018 return t; 1019 } 1020 1021 public DeviceDispense addSupportingInformation(Reference t) { //3 1022 if (t == null) 1023 return this; 1024 if (this.supportingInformation == null) 1025 this.supportingInformation = new ArrayList<Reference>(); 1026 this.supportingInformation.add(t); 1027 return this; 1028 } 1029 1030 /** 1031 * @return The first repetition of repeating field {@link #supportingInformation}, creating it if it does not already exist {3} 1032 */ 1033 public Reference getSupportingInformationFirstRep() { 1034 if (getSupportingInformation().isEmpty()) { 1035 addSupportingInformation(); 1036 } 1037 return getSupportingInformation().get(0); 1038 } 1039 1040 /** 1041 * @return {@link #performer} (Indicates who or what performed the event.) 1042 */ 1043 public List<DeviceDispensePerformerComponent> getPerformer() { 1044 if (this.performer == null) 1045 this.performer = new ArrayList<DeviceDispensePerformerComponent>(); 1046 return this.performer; 1047 } 1048 1049 /** 1050 * @return Returns a reference to <code>this</code> for easy method chaining 1051 */ 1052 public DeviceDispense setPerformer(List<DeviceDispensePerformerComponent> thePerformer) { 1053 this.performer = thePerformer; 1054 return this; 1055 } 1056 1057 public boolean hasPerformer() { 1058 if (this.performer == null) 1059 return false; 1060 for (DeviceDispensePerformerComponent item : this.performer) 1061 if (!item.isEmpty()) 1062 return true; 1063 return false; 1064 } 1065 1066 public DeviceDispensePerformerComponent addPerformer() { //3 1067 DeviceDispensePerformerComponent t = new DeviceDispensePerformerComponent(); 1068 if (this.performer == null) 1069 this.performer = new ArrayList<DeviceDispensePerformerComponent>(); 1070 this.performer.add(t); 1071 return t; 1072 } 1073 1074 public DeviceDispense addPerformer(DeviceDispensePerformerComponent t) { //3 1075 if (t == null) 1076 return this; 1077 if (this.performer == null) 1078 this.performer = new ArrayList<DeviceDispensePerformerComponent>(); 1079 this.performer.add(t); 1080 return this; 1081 } 1082 1083 /** 1084 * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist {3} 1085 */ 1086 public DeviceDispensePerformerComponent getPerformerFirstRep() { 1087 if (getPerformer().isEmpty()) { 1088 addPerformer(); 1089 } 1090 return getPerformer().get(0); 1091 } 1092 1093 /** 1094 * @return {@link #location} (The principal physical location where the dispense was performed.) 1095 */ 1096 public Reference getLocation() { 1097 if (this.location == null) 1098 if (Configuration.errorOnAutoCreate()) 1099 throw new Error("Attempt to auto-create DeviceDispense.location"); 1100 else if (Configuration.doAutoCreate()) 1101 this.location = new Reference(); // cc 1102 return this.location; 1103 } 1104 1105 public boolean hasLocation() { 1106 return this.location != null && !this.location.isEmpty(); 1107 } 1108 1109 /** 1110 * @param value {@link #location} (The principal physical location where the dispense was performed.) 1111 */ 1112 public DeviceDispense setLocation(Reference value) { 1113 this.location = value; 1114 return this; 1115 } 1116 1117 /** 1118 * @return {@link #type} (Indicates the type of dispensing event that is performed.) 1119 */ 1120 public CodeableConcept getType() { 1121 if (this.type == null) 1122 if (Configuration.errorOnAutoCreate()) 1123 throw new Error("Attempt to auto-create DeviceDispense.type"); 1124 else if (Configuration.doAutoCreate()) 1125 this.type = new CodeableConcept(); // cc 1126 return this.type; 1127 } 1128 1129 public boolean hasType() { 1130 return this.type != null && !this.type.isEmpty(); 1131 } 1132 1133 /** 1134 * @param value {@link #type} (Indicates the type of dispensing event that is performed.) 1135 */ 1136 public DeviceDispense setType(CodeableConcept value) { 1137 this.type = value; 1138 return this; 1139 } 1140 1141 /** 1142 * @return {@link #quantity} (The number of devices that have been dispensed.) 1143 */ 1144 public Quantity getQuantity() { 1145 if (this.quantity == null) 1146 if (Configuration.errorOnAutoCreate()) 1147 throw new Error("Attempt to auto-create DeviceDispense.quantity"); 1148 else if (Configuration.doAutoCreate()) 1149 this.quantity = new Quantity(); // cc 1150 return this.quantity; 1151 } 1152 1153 public boolean hasQuantity() { 1154 return this.quantity != null && !this.quantity.isEmpty(); 1155 } 1156 1157 /** 1158 * @param value {@link #quantity} (The number of devices that have been dispensed.) 1159 */ 1160 public DeviceDispense setQuantity(Quantity value) { 1161 this.quantity = value; 1162 return this; 1163 } 1164 1165 /** 1166 * @return {@link #preparedDate} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getPreparedDate" gives direct access to the value 1167 */ 1168 public DateTimeType getPreparedDateElement() { 1169 if (this.preparedDate == null) 1170 if (Configuration.errorOnAutoCreate()) 1171 throw new Error("Attempt to auto-create DeviceDispense.preparedDate"); 1172 else if (Configuration.doAutoCreate()) 1173 this.preparedDate = new DateTimeType(); // bb 1174 return this.preparedDate; 1175 } 1176 1177 public boolean hasPreparedDateElement() { 1178 return this.preparedDate != null && !this.preparedDate.isEmpty(); 1179 } 1180 1181 public boolean hasPreparedDate() { 1182 return this.preparedDate != null && !this.preparedDate.isEmpty(); 1183 } 1184 1185 /** 1186 * @param value {@link #preparedDate} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getPreparedDate" gives direct access to the value 1187 */ 1188 public DeviceDispense setPreparedDateElement(DateTimeType value) { 1189 this.preparedDate = value; 1190 return this; 1191 } 1192 1193 /** 1194 * @return The time when the dispensed product was packaged and reviewed. 1195 */ 1196 public Date getPreparedDate() { 1197 return this.preparedDate == null ? null : this.preparedDate.getValue(); 1198 } 1199 1200 /** 1201 * @param value The time when the dispensed product was packaged and reviewed. 1202 */ 1203 public DeviceDispense setPreparedDate(Date value) { 1204 if (value == null) 1205 this.preparedDate = null; 1206 else { 1207 if (this.preparedDate == null) 1208 this.preparedDate = new DateTimeType(); 1209 this.preparedDate.setValue(value); 1210 } 1211 return this; 1212 } 1213 1214 /** 1215 * @return {@link #whenHandedOver} (The time the dispensed product was made available to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value 1216 */ 1217 public DateTimeType getWhenHandedOverElement() { 1218 if (this.whenHandedOver == null) 1219 if (Configuration.errorOnAutoCreate()) 1220 throw new Error("Attempt to auto-create DeviceDispense.whenHandedOver"); 1221 else if (Configuration.doAutoCreate()) 1222 this.whenHandedOver = new DateTimeType(); // bb 1223 return this.whenHandedOver; 1224 } 1225 1226 public boolean hasWhenHandedOverElement() { 1227 return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); 1228 } 1229 1230 public boolean hasWhenHandedOver() { 1231 return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); 1232 } 1233 1234 /** 1235 * @param value {@link #whenHandedOver} (The time the dispensed product was made available to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value 1236 */ 1237 public DeviceDispense setWhenHandedOverElement(DateTimeType value) { 1238 this.whenHandedOver = value; 1239 return this; 1240 } 1241 1242 /** 1243 * @return The time the dispensed product was made available to the patient or their representative. 1244 */ 1245 public Date getWhenHandedOver() { 1246 return this.whenHandedOver == null ? null : this.whenHandedOver.getValue(); 1247 } 1248 1249 /** 1250 * @param value The time the dispensed product was made available to the patient or their representative. 1251 */ 1252 public DeviceDispense setWhenHandedOver(Date value) { 1253 if (value == null) 1254 this.whenHandedOver = null; 1255 else { 1256 if (this.whenHandedOver == null) 1257 this.whenHandedOver = new DateTimeType(); 1258 this.whenHandedOver.setValue(value); 1259 } 1260 return this; 1261 } 1262 1263 /** 1264 * @return {@link #destination} (Identification of the facility/location where the device was /should be shipped to, as part of the dispense process.) 1265 */ 1266 public Reference getDestination() { 1267 if (this.destination == null) 1268 if (Configuration.errorOnAutoCreate()) 1269 throw new Error("Attempt to auto-create DeviceDispense.destination"); 1270 else if (Configuration.doAutoCreate()) 1271 this.destination = new Reference(); // cc 1272 return this.destination; 1273 } 1274 1275 public boolean hasDestination() { 1276 return this.destination != null && !this.destination.isEmpty(); 1277 } 1278 1279 /** 1280 * @param value {@link #destination} (Identification of the facility/location where the device was /should be shipped to, as part of the dispense process.) 1281 */ 1282 public DeviceDispense setDestination(Reference value) { 1283 this.destination = value; 1284 return this; 1285 } 1286 1287 /** 1288 * @return {@link #note} (Extra information about the dispense that could not be conveyed in the other attributes.) 1289 */ 1290 public List<Annotation> getNote() { 1291 if (this.note == null) 1292 this.note = new ArrayList<Annotation>(); 1293 return this.note; 1294 } 1295 1296 /** 1297 * @return Returns a reference to <code>this</code> for easy method chaining 1298 */ 1299 public DeviceDispense setNote(List<Annotation> theNote) { 1300 this.note = theNote; 1301 return this; 1302 } 1303 1304 public boolean hasNote() { 1305 if (this.note == null) 1306 return false; 1307 for (Annotation item : this.note) 1308 if (!item.isEmpty()) 1309 return true; 1310 return false; 1311 } 1312 1313 public Annotation addNote() { //3 1314 Annotation t = new Annotation(); 1315 if (this.note == null) 1316 this.note = new ArrayList<Annotation>(); 1317 this.note.add(t); 1318 return t; 1319 } 1320 1321 public DeviceDispense addNote(Annotation t) { //3 1322 if (t == null) 1323 return this; 1324 if (this.note == null) 1325 this.note = new ArrayList<Annotation>(); 1326 this.note.add(t); 1327 return this; 1328 } 1329 1330 /** 1331 * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3} 1332 */ 1333 public Annotation getNoteFirstRep() { 1334 if (getNote().isEmpty()) { 1335 addNote(); 1336 } 1337 return getNote().get(0); 1338 } 1339 1340 /** 1341 * @return {@link #usageInstruction} (The full representation of the instructions.). This is the underlying object with id, value and extensions. The accessor "getUsageInstruction" gives direct access to the value 1342 */ 1343 public StringType getUsageInstructionElement() { 1344 if (this.usageInstruction == null) 1345 if (Configuration.errorOnAutoCreate()) 1346 throw new Error("Attempt to auto-create DeviceDispense.usageInstruction"); 1347 else if (Configuration.doAutoCreate()) 1348 this.usageInstruction = new StringType(); // bb 1349 return this.usageInstruction; 1350 } 1351 1352 public boolean hasUsageInstructionElement() { 1353 return this.usageInstruction != null && !this.usageInstruction.isEmpty(); 1354 } 1355 1356 public boolean hasUsageInstruction() { 1357 return this.usageInstruction != null && !this.usageInstruction.isEmpty(); 1358 } 1359 1360 /** 1361 * @param value {@link #usageInstruction} (The full representation of the instructions.). This is the underlying object with id, value and extensions. The accessor "getUsageInstruction" gives direct access to the value 1362 */ 1363 public DeviceDispense setUsageInstructionElement(StringType value) { 1364 this.usageInstruction = value; 1365 return this; 1366 } 1367 1368 /** 1369 * @return The full representation of the instructions. 1370 */ 1371 public String getUsageInstruction() { 1372 return this.usageInstruction == null ? null : this.usageInstruction.getValue(); 1373 } 1374 1375 /** 1376 * @param value The full representation of the instructions. 1377 */ 1378 public DeviceDispense setUsageInstruction(String value) { 1379 if (Utilities.noString(value)) 1380 this.usageInstruction = null; 1381 else { 1382 if (this.usageInstruction == null) 1383 this.usageInstruction = new StringType(); 1384 this.usageInstruction.setValue(value); 1385 } 1386 return this; 1387 } 1388 1389 /** 1390 * @return {@link #eventHistory} (A summary of the events of interest that have occurred, such as when the dispense was verified.) 1391 */ 1392 public List<Reference> getEventHistory() { 1393 if (this.eventHistory == null) 1394 this.eventHistory = new ArrayList<Reference>(); 1395 return this.eventHistory; 1396 } 1397 1398 /** 1399 * @return Returns a reference to <code>this</code> for easy method chaining 1400 */ 1401 public DeviceDispense setEventHistory(List<Reference> theEventHistory) { 1402 this.eventHistory = theEventHistory; 1403 return this; 1404 } 1405 1406 public boolean hasEventHistory() { 1407 if (this.eventHistory == null) 1408 return false; 1409 for (Reference item : this.eventHistory) 1410 if (!item.isEmpty()) 1411 return true; 1412 return false; 1413 } 1414 1415 public Reference addEventHistory() { //3 1416 Reference t = new Reference(); 1417 if (this.eventHistory == null) 1418 this.eventHistory = new ArrayList<Reference>(); 1419 this.eventHistory.add(t); 1420 return t; 1421 } 1422 1423 public DeviceDispense addEventHistory(Reference t) { //3 1424 if (t == null) 1425 return this; 1426 if (this.eventHistory == null) 1427 this.eventHistory = new ArrayList<Reference>(); 1428 this.eventHistory.add(t); 1429 return this; 1430 } 1431 1432 /** 1433 * @return The first repetition of repeating field {@link #eventHistory}, creating it if it does not already exist {3} 1434 */ 1435 public Reference getEventHistoryFirstRep() { 1436 if (getEventHistory().isEmpty()) { 1437 addEventHistory(); 1438 } 1439 return getEventHistory().get(0); 1440 } 1441 1442 protected void listChildren(List<Property> children) { 1443 super.listChildren(children); 1444 children.add(new Property("identifier", "Identifier", "Business identifier for this dispensation.", 0, java.lang.Integer.MAX_VALUE, identifier)); 1445 children.add(new Property("basedOn", "Reference(CarePlan|DeviceRequest)", "The order or request that this dispense is fulfilling.", 0, java.lang.Integer.MAX_VALUE, basedOn)); 1446 children.add(new Property("partOf", "Reference(Procedure)", "The bigger event that this dispense is a part of.", 0, java.lang.Integer.MAX_VALUE, partOf)); 1447 children.add(new Property("status", "code", "A code specifying the state of the set of dispense events.", 0, 1, status)); 1448 children.add(new Property("statusReason", "CodeableReference(DetectedIssue)", "Indicates the reason why a dispense was or was not performed.", 0, 1, statusReason)); 1449 children.add(new Property("category", "CodeableConcept", "Indicates the type of device dispense.", 0, java.lang.Integer.MAX_VALUE, category)); 1450 children.add(new Property("device", "CodeableReference(Device|DeviceDefinition)", "Identifies the device being dispensed. This is either a link to a resource representing the details of the device or a simple attribute carrying a code that identifies the device from a known list of devices.", 0, 1, device)); 1451 children.add(new Property("subject", "Reference(Patient)", "A link to a resource representing the person to whom the device is intended.", 0, 1, subject)); 1452 children.add(new Property("encounter", "Reference(Encounter)", "The encounter that establishes the context for this event.", 0, 1, encounter)); 1453 children.add(new Property("supportingInformation", "Reference(Any)", "Additional information that supports the device being dispensed.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); 1454 children.add(new Property("performer", "", "Indicates who or what performed the event.", 0, java.lang.Integer.MAX_VALUE, performer)); 1455 children.add(new Property("location", "Reference(Location)", "The principal physical location where the dispense was performed.", 0, 1, location)); 1456 children.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed.", 0, 1, type)); 1457 children.add(new Property("quantity", "Quantity", "The number of devices that have been dispensed.", 0, 1, quantity)); 1458 children.add(new Property("preparedDate", "dateTime", "The time when the dispensed product was packaged and reviewed.", 0, 1, preparedDate)); 1459 children.add(new Property("whenHandedOver", "dateTime", "The time the dispensed product was made available to the patient or their representative.", 0, 1, whenHandedOver)); 1460 children.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the device was /should be shipped to, as part of the dispense process.", 0, 1, destination)); 1461 children.add(new Property("note", "Annotation", "Extra information about the dispense that could not be conveyed in the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); 1462 children.add(new Property("usageInstruction", "string", "The full representation of the instructions.", 0, 1, usageInstruction)); 1463 children.add(new Property("eventHistory", "Reference(Provenance)", "A summary of the events of interest that have occurred, such as when the dispense was verified.", 0, java.lang.Integer.MAX_VALUE, eventHistory)); 1464 } 1465 1466 @Override 1467 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1468 switch (_hash) { 1469 case -1618432855: /*identifier*/ return new Property("identifier", "Identifier", "Business identifier for this dispensation.", 0, java.lang.Integer.MAX_VALUE, identifier); 1470 case -332612366: /*basedOn*/ return new Property("basedOn", "Reference(CarePlan|DeviceRequest)", "The order or request that this dispense is fulfilling.", 0, java.lang.Integer.MAX_VALUE, basedOn); 1471 case -995410646: /*partOf*/ return new Property("partOf", "Reference(Procedure)", "The bigger event that this dispense is a part of.", 0, java.lang.Integer.MAX_VALUE, partOf); 1472 case -892481550: /*status*/ return new Property("status", "code", "A code specifying the state of the set of dispense events.", 0, 1, status); 1473 case 2051346646: /*statusReason*/ return new Property("statusReason", "CodeableReference(DetectedIssue)", "Indicates the reason why a dispense was or was not performed.", 0, 1, statusReason); 1474 case 50511102: /*category*/ return new Property("category", "CodeableConcept", "Indicates the type of device dispense.", 0, java.lang.Integer.MAX_VALUE, category); 1475 case -1335157162: /*device*/ return new Property("device", "CodeableReference(Device|DeviceDefinition)", "Identifies the device being dispensed. This is either a link to a resource representing the details of the device or a simple attribute carrying a code that identifies the device from a known list of devices.", 0, 1, device); 1476 case -1867885268: /*subject*/ return new Property("subject", "Reference(Patient)", "A link to a resource representing the person to whom the device is intended.", 0, 1, subject); 1477 case 1524132147: /*encounter*/ return new Property("encounter", "Reference(Encounter)", "The encounter that establishes the context for this event.", 0, 1, encounter); 1478 case -1248768647: /*supportingInformation*/ return new Property("supportingInformation", "Reference(Any)", "Additional information that supports the device being dispensed.", 0, java.lang.Integer.MAX_VALUE, supportingInformation); 1479 case 481140686: /*performer*/ return new Property("performer", "", "Indicates who or what performed the event.", 0, java.lang.Integer.MAX_VALUE, performer); 1480 case 1901043637: /*location*/ return new Property("location", "Reference(Location)", "The principal physical location where the dispense was performed.", 0, 1, location); 1481 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed.", 0, 1, type); 1482 case -1285004149: /*quantity*/ return new Property("quantity", "Quantity", "The number of devices that have been dispensed.", 0, 1, quantity); 1483 case -2024959605: /*preparedDate*/ return new Property("preparedDate", "dateTime", "The time when the dispensed product was packaged and reviewed.", 0, 1, preparedDate); 1484 case -940241380: /*whenHandedOver*/ return new Property("whenHandedOver", "dateTime", "The time the dispensed product was made available to the patient or their representative.", 0, 1, whenHandedOver); 1485 case -1429847026: /*destination*/ return new Property("destination", "Reference(Location)", "Identification of the facility/location where the device was /should be shipped to, as part of the dispense process.", 0, 1, destination); 1486 case 3387378: /*note*/ return new Property("note", "Annotation", "Extra information about the dispense that could not be conveyed in the other attributes.", 0, java.lang.Integer.MAX_VALUE, note); 1487 case 2138372141: /*usageInstruction*/ return new Property("usageInstruction", "string", "The full representation of the instructions.", 0, 1, usageInstruction); 1488 case 1835190426: /*eventHistory*/ return new Property("eventHistory", "Reference(Provenance)", "A summary of the events of interest that have occurred, such as when the dispense was verified.", 0, java.lang.Integer.MAX_VALUE, eventHistory); 1489 default: return super.getNamedProperty(_hash, _name, _checkValid); 1490 } 1491 1492 } 1493 1494 @Override 1495 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1496 switch (hash) { 1497 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier 1498 case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference 1499 case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference 1500 case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<DeviceDispenseStatusCodes> 1501 case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // CodeableReference 1502 case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept 1503 case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // CodeableReference 1504 case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference 1505 case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference 1506 case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference 1507 case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // DeviceDispensePerformerComponent 1508 case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference 1509 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 1510 case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity 1511 case -2024959605: /*preparedDate*/ return this.preparedDate == null ? new Base[0] : new Base[] {this.preparedDate}; // DateTimeType 1512 case -940241380: /*whenHandedOver*/ return this.whenHandedOver == null ? new Base[0] : new Base[] {this.whenHandedOver}; // DateTimeType 1513 case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // Reference 1514 case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation 1515 case 2138372141: /*usageInstruction*/ return this.usageInstruction == null ? new Base[0] : new Base[] {this.usageInstruction}; // StringType 1516 case 1835190426: /*eventHistory*/ return this.eventHistory == null ? new Base[0] : this.eventHistory.toArray(new Base[this.eventHistory.size()]); // Reference 1517 default: return super.getProperty(hash, name, checkValid); 1518 } 1519 1520 } 1521 1522 @Override 1523 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1524 switch (hash) { 1525 case -1618432855: // identifier 1526 this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier 1527 return value; 1528 case -332612366: // basedOn 1529 this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference 1530 return value; 1531 case -995410646: // partOf 1532 this.getPartOf().add(TypeConvertor.castToReference(value)); // Reference 1533 return value; 1534 case -892481550: // status 1535 value = new DeviceDispenseStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value)); 1536 this.status = (Enumeration) value; // Enumeration<DeviceDispenseStatusCodes> 1537 return value; 1538 case 2051346646: // statusReason 1539 this.statusReason = TypeConvertor.castToCodeableReference(value); // CodeableReference 1540 return value; 1541 case 50511102: // category 1542 this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept 1543 return value; 1544 case -1335157162: // device 1545 this.device = TypeConvertor.castToCodeableReference(value); // CodeableReference 1546 return value; 1547 case -1867885268: // subject 1548 this.subject = TypeConvertor.castToReference(value); // Reference 1549 return value; 1550 case 1524132147: // encounter 1551 this.encounter = TypeConvertor.castToReference(value); // Reference 1552 return value; 1553 case -1248768647: // supportingInformation 1554 this.getSupportingInformation().add(TypeConvertor.castToReference(value)); // Reference 1555 return value; 1556 case 481140686: // performer 1557 this.getPerformer().add((DeviceDispensePerformerComponent) value); // DeviceDispensePerformerComponent 1558 return value; 1559 case 1901043637: // location 1560 this.location = TypeConvertor.castToReference(value); // Reference 1561 return value; 1562 case 3575610: // type 1563 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1564 return value; 1565 case -1285004149: // quantity 1566 this.quantity = TypeConvertor.castToQuantity(value); // Quantity 1567 return value; 1568 case -2024959605: // preparedDate 1569 this.preparedDate = TypeConvertor.castToDateTime(value); // DateTimeType 1570 return value; 1571 case -940241380: // whenHandedOver 1572 this.whenHandedOver = TypeConvertor.castToDateTime(value); // DateTimeType 1573 return value; 1574 case -1429847026: // destination 1575 this.destination = TypeConvertor.castToReference(value); // Reference 1576 return value; 1577 case 3387378: // note 1578 this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation 1579 return value; 1580 case 2138372141: // usageInstruction 1581 this.usageInstruction = TypeConvertor.castToString(value); // StringType 1582 return value; 1583 case 1835190426: // eventHistory 1584 this.getEventHistory().add(TypeConvertor.castToReference(value)); // Reference 1585 return value; 1586 default: return super.setProperty(hash, name, value); 1587 } 1588 1589 } 1590 1591 @Override 1592 public Base setProperty(String name, Base value) throws FHIRException { 1593 if (name.equals("identifier")) { 1594 this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); 1595 } else if (name.equals("basedOn")) { 1596 this.getBasedOn().add(TypeConvertor.castToReference(value)); 1597 } else if (name.equals("partOf")) { 1598 this.getPartOf().add(TypeConvertor.castToReference(value)); 1599 } else if (name.equals("status")) { 1600 value = new DeviceDispenseStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value)); 1601 this.status = (Enumeration) value; // Enumeration<DeviceDispenseStatusCodes> 1602 } else if (name.equals("statusReason")) { 1603 this.statusReason = TypeConvertor.castToCodeableReference(value); // CodeableReference 1604 } else if (name.equals("category")) { 1605 this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); 1606 } else if (name.equals("device")) { 1607 this.device = TypeConvertor.castToCodeableReference(value); // CodeableReference 1608 } else if (name.equals("subject")) { 1609 this.subject = TypeConvertor.castToReference(value); // Reference 1610 } else if (name.equals("encounter")) { 1611 this.encounter = TypeConvertor.castToReference(value); // Reference 1612 } else if (name.equals("supportingInformation")) { 1613 this.getSupportingInformation().add(TypeConvertor.castToReference(value)); 1614 } else if (name.equals("performer")) { 1615 this.getPerformer().add((DeviceDispensePerformerComponent) value); 1616 } else if (name.equals("location")) { 1617 this.location = TypeConvertor.castToReference(value); // Reference 1618 } else if (name.equals("type")) { 1619 this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept 1620 } else if (name.equals("quantity")) { 1621 this.quantity = TypeConvertor.castToQuantity(value); // Quantity 1622 } else if (name.equals("preparedDate")) { 1623 this.preparedDate = TypeConvertor.castToDateTime(value); // DateTimeType 1624 } else if (name.equals("whenHandedOver")) { 1625 this.whenHandedOver = TypeConvertor.castToDateTime(value); // DateTimeType 1626 } else if (name.equals("destination")) { 1627 this.destination = TypeConvertor.castToReference(value); // Reference 1628 } else if (name.equals("note")) { 1629 this.getNote().add(TypeConvertor.castToAnnotation(value)); 1630 } else if (name.equals("usageInstruction")) { 1631 this.usageInstruction = TypeConvertor.castToString(value); // StringType 1632 } else if (name.equals("eventHistory")) { 1633 this.getEventHistory().add(TypeConvertor.castToReference(value)); 1634 } else 1635 return super.setProperty(name, value); 1636 return value; 1637 } 1638 1639 @Override 1640 public Base makeProperty(int hash, String name) throws FHIRException { 1641 switch (hash) { 1642 case -1618432855: return addIdentifier(); 1643 case -332612366: return addBasedOn(); 1644 case -995410646: return addPartOf(); 1645 case -892481550: return getStatusElement(); 1646 case 2051346646: return getStatusReason(); 1647 case 50511102: return addCategory(); 1648 case -1335157162: return getDevice(); 1649 case -1867885268: return getSubject(); 1650 case 1524132147: return getEncounter(); 1651 case -1248768647: return addSupportingInformation(); 1652 case 481140686: return addPerformer(); 1653 case 1901043637: return getLocation(); 1654 case 3575610: return getType(); 1655 case -1285004149: return getQuantity(); 1656 case -2024959605: return getPreparedDateElement(); 1657 case -940241380: return getWhenHandedOverElement(); 1658 case -1429847026: return getDestination(); 1659 case 3387378: return addNote(); 1660 case 2138372141: return getUsageInstructionElement(); 1661 case 1835190426: return addEventHistory(); 1662 default: return super.makeProperty(hash, name); 1663 } 1664 1665 } 1666 1667 @Override 1668 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1669 switch (hash) { 1670 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 1671 case -332612366: /*basedOn*/ return new String[] {"Reference"}; 1672 case -995410646: /*partOf*/ return new String[] {"Reference"}; 1673 case -892481550: /*status*/ return new String[] {"code"}; 1674 case 2051346646: /*statusReason*/ return new String[] {"CodeableReference"}; 1675 case 50511102: /*category*/ return new String[] {"CodeableConcept"}; 1676 case -1335157162: /*device*/ return new String[] {"CodeableReference"}; 1677 case -1867885268: /*subject*/ return new String[] {"Reference"}; 1678 case 1524132147: /*encounter*/ return new String[] {"Reference"}; 1679 case -1248768647: /*supportingInformation*/ return new String[] {"Reference"}; 1680 case 481140686: /*performer*/ return new String[] {}; 1681 case 1901043637: /*location*/ return new String[] {"Reference"}; 1682 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 1683 case -1285004149: /*quantity*/ return new String[] {"Quantity"}; 1684 case -2024959605: /*preparedDate*/ return new String[] {"dateTime"}; 1685 case -940241380: /*whenHandedOver*/ return new String[] {"dateTime"}; 1686 case -1429847026: /*destination*/ return new String[] {"Reference"}; 1687 case 3387378: /*note*/ return new String[] {"Annotation"}; 1688 case 2138372141: /*usageInstruction*/ return new String[] {"string"}; 1689 case 1835190426: /*eventHistory*/ return new String[] {"Reference"}; 1690 default: return super.getTypesForProperty(hash, name); 1691 } 1692 1693 } 1694 1695 @Override 1696 public Base addChild(String name) throws FHIRException { 1697 if (name.equals("identifier")) { 1698 return addIdentifier(); 1699 } 1700 else if (name.equals("basedOn")) { 1701 return addBasedOn(); 1702 } 1703 else if (name.equals("partOf")) { 1704 return addPartOf(); 1705 } 1706 else if (name.equals("status")) { 1707 throw new FHIRException("Cannot call addChild on a primitive type DeviceDispense.status"); 1708 } 1709 else if (name.equals("statusReason")) { 1710 this.statusReason = new CodeableReference(); 1711 return this.statusReason; 1712 } 1713 else if (name.equals("category")) { 1714 return addCategory(); 1715 } 1716 else if (name.equals("device")) { 1717 this.device = new CodeableReference(); 1718 return this.device; 1719 } 1720 else if (name.equals("subject")) { 1721 this.subject = new Reference(); 1722 return this.subject; 1723 } 1724 else if (name.equals("encounter")) { 1725 this.encounter = new Reference(); 1726 return this.encounter; 1727 } 1728 else if (name.equals("supportingInformation")) { 1729 return addSupportingInformation(); 1730 } 1731 else if (name.equals("performer")) { 1732 return addPerformer(); 1733 } 1734 else if (name.equals("location")) { 1735 this.location = new Reference(); 1736 return this.location; 1737 } 1738 else if (name.equals("type")) { 1739 this.type = new CodeableConcept(); 1740 return this.type; 1741 } 1742 else if (name.equals("quantity")) { 1743 this.quantity = new Quantity(); 1744 return this.quantity; 1745 } 1746 else if (name.equals("preparedDate")) { 1747 throw new FHIRException("Cannot call addChild on a primitive type DeviceDispense.preparedDate"); 1748 } 1749 else if (name.equals("whenHandedOver")) { 1750 throw new FHIRException("Cannot call addChild on a primitive type DeviceDispense.whenHandedOver"); 1751 } 1752 else if (name.equals("destination")) { 1753 this.destination = new Reference(); 1754 return this.destination; 1755 } 1756 else if (name.equals("note")) { 1757 return addNote(); 1758 } 1759 else if (name.equals("usageInstruction")) { 1760 throw new FHIRException("Cannot call addChild on a primitive type DeviceDispense.usageInstruction"); 1761 } 1762 else if (name.equals("eventHistory")) { 1763 return addEventHistory(); 1764 } 1765 else 1766 return super.addChild(name); 1767 } 1768 1769 public String fhirType() { 1770 return "DeviceDispense"; 1771 1772 } 1773 1774 public DeviceDispense copy() { 1775 DeviceDispense dst = new DeviceDispense(); 1776 copyValues(dst); 1777 return dst; 1778 } 1779 1780 public void copyValues(DeviceDispense dst) { 1781 super.copyValues(dst); 1782 if (identifier != null) { 1783 dst.identifier = new ArrayList<Identifier>(); 1784 for (Identifier i : identifier) 1785 dst.identifier.add(i.copy()); 1786 }; 1787 if (basedOn != null) { 1788 dst.basedOn = new ArrayList<Reference>(); 1789 for (Reference i : basedOn) 1790 dst.basedOn.add(i.copy()); 1791 }; 1792 if (partOf != null) { 1793 dst.partOf = new ArrayList<Reference>(); 1794 for (Reference i : partOf) 1795 dst.partOf.add(i.copy()); 1796 }; 1797 dst.status = status == null ? null : status.copy(); 1798 dst.statusReason = statusReason == null ? null : statusReason.copy(); 1799 if (category != null) { 1800 dst.category = new ArrayList<CodeableConcept>(); 1801 for (CodeableConcept i : category) 1802 dst.category.add(i.copy()); 1803 }; 1804 dst.device = device == null ? null : device.copy(); 1805 dst.subject = subject == null ? null : subject.copy(); 1806 dst.encounter = encounter == null ? null : encounter.copy(); 1807 if (supportingInformation != null) { 1808 dst.supportingInformation = new ArrayList<Reference>(); 1809 for (Reference i : supportingInformation) 1810 dst.supportingInformation.add(i.copy()); 1811 }; 1812 if (performer != null) { 1813 dst.performer = new ArrayList<DeviceDispensePerformerComponent>(); 1814 for (DeviceDispensePerformerComponent i : performer) 1815 dst.performer.add(i.copy()); 1816 }; 1817 dst.location = location == null ? null : location.copy(); 1818 dst.type = type == null ? null : type.copy(); 1819 dst.quantity = quantity == null ? null : quantity.copy(); 1820 dst.preparedDate = preparedDate == null ? null : preparedDate.copy(); 1821 dst.whenHandedOver = whenHandedOver == null ? null : whenHandedOver.copy(); 1822 dst.destination = destination == null ? null : destination.copy(); 1823 if (note != null) { 1824 dst.note = new ArrayList<Annotation>(); 1825 for (Annotation i : note) 1826 dst.note.add(i.copy()); 1827 }; 1828 dst.usageInstruction = usageInstruction == null ? null : usageInstruction.copy(); 1829 if (eventHistory != null) { 1830 dst.eventHistory = new ArrayList<Reference>(); 1831 for (Reference i : eventHistory) 1832 dst.eventHistory.add(i.copy()); 1833 }; 1834 } 1835 1836 protected DeviceDispense typedCopy() { 1837 return copy(); 1838 } 1839 1840 @Override 1841 public boolean equalsDeep(Base other_) { 1842 if (!super.equalsDeep(other_)) 1843 return false; 1844 if (!(other_ instanceof DeviceDispense)) 1845 return false; 1846 DeviceDispense o = (DeviceDispense) other_; 1847 return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(partOf, o.partOf, true) 1848 && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true) && compareDeep(category, o.category, true) 1849 && compareDeep(device, o.device, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true) 1850 && compareDeep(supportingInformation, o.supportingInformation, true) && compareDeep(performer, o.performer, true) 1851 && compareDeep(location, o.location, true) && compareDeep(type, o.type, true) && compareDeep(quantity, o.quantity, true) 1852 && compareDeep(preparedDate, o.preparedDate, true) && compareDeep(whenHandedOver, o.whenHandedOver, true) 1853 && compareDeep(destination, o.destination, true) && compareDeep(note, o.note, true) && compareDeep(usageInstruction, o.usageInstruction, true) 1854 && compareDeep(eventHistory, o.eventHistory, true); 1855 } 1856 1857 @Override 1858 public boolean equalsShallow(Base other_) { 1859 if (!super.equalsShallow(other_)) 1860 return false; 1861 if (!(other_ instanceof DeviceDispense)) 1862 return false; 1863 DeviceDispense o = (DeviceDispense) other_; 1864 return compareValues(status, o.status, true) && compareValues(preparedDate, o.preparedDate, true) && compareValues(whenHandedOver, o.whenHandedOver, true) 1865 && compareValues(usageInstruction, o.usageInstruction, true); 1866 } 1867 1868 public boolean isEmpty() { 1869 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, partOf 1870 , status, statusReason, category, device, subject, encounter, supportingInformation 1871 , performer, location, type, quantity, preparedDate, whenHandedOver, destination 1872 , note, usageInstruction, eventHistory); 1873 } 1874 1875 @Override 1876 public ResourceType getResourceType() { 1877 return ResourceType.DeviceDispense; 1878 } 1879 1880 /** 1881 * Search parameter: <b>code</b> 1882 * <p> 1883 * Description: <b>Search for devices that match this code</b><br> 1884 * Type: <b>token</b><br> 1885 * Path: <b>DeviceDispense.device.concept</b><br> 1886 * </p> 1887 */ 1888 @SearchParamDefinition(name="code", path="DeviceDispense.device.concept", description="Search for devices that match this code", type="token" ) 1889 public static final String SP_CODE = "code"; 1890 /** 1891 * <b>Fluent Client</b> search parameter constant for <b>code</b> 1892 * <p> 1893 * Description: <b>Search for devices that match this code</b><br> 1894 * Type: <b>token</b><br> 1895 * Path: <b>DeviceDispense.device.concept</b><br> 1896 * </p> 1897 */ 1898 public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); 1899 1900 /** 1901 * Search parameter: <b>subject</b> 1902 * <p> 1903 * Description: <b>The identity of a patient for whom to list dispenses</b><br> 1904 * Type: <b>reference</b><br> 1905 * Path: <b>DeviceDispense.subject</b><br> 1906 * </p> 1907 */ 1908 @SearchParamDefinition(name="subject", path="DeviceDispense.subject", description="The identity of a patient for whom to list dispenses", type="reference", target={Patient.class } ) 1909 public static final String SP_SUBJECT = "subject"; 1910 /** 1911 * <b>Fluent Client</b> search parameter constant for <b>subject</b> 1912 * <p> 1913 * Description: <b>The identity of a patient for whom to list dispenses</b><br> 1914 * Type: <b>reference</b><br> 1915 * Path: <b>DeviceDispense.subject</b><br> 1916 * </p> 1917 */ 1918 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); 1919 1920/** 1921 * Constant for fluent queries to be used to add include statements. Specifies 1922 * the path value of "<b>DeviceDispense:subject</b>". 1923 */ 1924 public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DeviceDispense:subject").toLocked(); 1925 1926 1927}