001package org.hl7.fhir.r4.model; 002 003 004 005/* 006 Copyright (c) 2011+, HL7, Inc. 007 All rights reserved. 008 009 Redistribution and use in source and binary forms, with or without modification, 010 are permitted provided that the following conditions are met: 011 012 * Redistributions of source code must retain the above copyright notice, this 013 list of conditions and the following disclaimer. 014 * Redistributions in binary form must reproduce the above copyright notice, 015 this list of conditions and the following disclaimer in the documentation 016 and/or other materials provided with the distribution. 017 * Neither the name of HL7 nor the names of its contributors may be used to 018 endorse or promote products derived from this software without specific 019 prior written permission. 020 021 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 022 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 023 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 024 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 025 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 026 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 027 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 028 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 029 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 030 POSSIBILITY OF SUCH DAMAGE. 031 032*/ 033 034 035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1 036 037import java.util.*; 038 039import org.hl7.fhir.utilities.Utilities; 040import ca.uhn.fhir.model.api.annotation.ResourceDef; 041import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 042import ca.uhn.fhir.model.api.annotation.Child; 043import ca.uhn.fhir.model.api.annotation.ChildOrder; 044import ca.uhn.fhir.model.api.annotation.Description; 045import ca.uhn.fhir.model.api.annotation.Block; 046import org.hl7.fhir.instance.model.api.*; 047import org.hl7.fhir.exceptions.FHIRException; 048/** 049 * The characteristics, operational status and capabilities of a medical-related component of a medical device. 050 */ 051@ResourceDef(name="DeviceDefinition", profile="http://hl7.org/fhir/StructureDefinition/DeviceDefinition") 052public class DeviceDefinition extends DomainResource { 053 054 public enum DeviceNameType { 055 /** 056 * UDI Label name. 057 */ 058 UDILABELNAME, 059 /** 060 * User Friendly name. 061 */ 062 USERFRIENDLYNAME, 063 /** 064 * Patient Reported name. 065 */ 066 PATIENTREPORTEDNAME, 067 /** 068 * Manufacturer name. 069 */ 070 MANUFACTURERNAME, 071 /** 072 * Model name. 073 */ 074 MODELNAME, 075 /** 076 * other. 077 */ 078 OTHER, 079 /** 080 * added to help the parsers with the generic types 081 */ 082 NULL; 083 public static DeviceNameType fromCode(String codeString) throws FHIRException { 084 if (codeString == null || "".equals(codeString)) 085 return null; 086 if ("udi-label-name".equals(codeString)) 087 return UDILABELNAME; 088 if ("user-friendly-name".equals(codeString)) 089 return USERFRIENDLYNAME; 090 if ("patient-reported-name".equals(codeString)) 091 return PATIENTREPORTEDNAME; 092 if ("manufacturer-name".equals(codeString)) 093 return MANUFACTURERNAME; 094 if ("model-name".equals(codeString)) 095 return MODELNAME; 096 if ("other".equals(codeString)) 097 return OTHER; 098 if (Configuration.isAcceptInvalidEnums()) 099 return null; 100 else 101 throw new FHIRException("Unknown DeviceNameType code '"+codeString+"'"); 102 } 103 public String toCode() { 104 switch (this) { 105 case UDILABELNAME: return "udi-label-name"; 106 case USERFRIENDLYNAME: return "user-friendly-name"; 107 case PATIENTREPORTEDNAME: return "patient-reported-name"; 108 case MANUFACTURERNAME: return "manufacturer-name"; 109 case MODELNAME: return "model-name"; 110 case OTHER: return "other"; 111 case NULL: return null; 112 default: return "?"; 113 } 114 } 115 public String getSystem() { 116 switch (this) { 117 case UDILABELNAME: return "http://hl7.org/fhir/device-nametype"; 118 case USERFRIENDLYNAME: return "http://hl7.org/fhir/device-nametype"; 119 case PATIENTREPORTEDNAME: return "http://hl7.org/fhir/device-nametype"; 120 case MANUFACTURERNAME: return "http://hl7.org/fhir/device-nametype"; 121 case MODELNAME: return "http://hl7.org/fhir/device-nametype"; 122 case OTHER: return "http://hl7.org/fhir/device-nametype"; 123 case NULL: return null; 124 default: return "?"; 125 } 126 } 127 public String getDefinition() { 128 switch (this) { 129 case UDILABELNAME: return "UDI Label name."; 130 case USERFRIENDLYNAME: return "User Friendly name."; 131 case PATIENTREPORTEDNAME: return "Patient Reported name."; 132 case MANUFACTURERNAME: return "Manufacturer name."; 133 case MODELNAME: return "Model name."; 134 case OTHER: return "other."; 135 case NULL: return null; 136 default: return "?"; 137 } 138 } 139 public String getDisplay() { 140 switch (this) { 141 case UDILABELNAME: return "UDI Label name"; 142 case USERFRIENDLYNAME: return "User Friendly name"; 143 case PATIENTREPORTEDNAME: return "Patient Reported name"; 144 case MANUFACTURERNAME: return "Manufacturer name"; 145 case MODELNAME: return "Model name"; 146 case OTHER: return "other"; 147 case NULL: return null; 148 default: return "?"; 149 } 150 } 151 } 152 153 public static class DeviceNameTypeEnumFactory implements EnumFactory<DeviceNameType> { 154 public DeviceNameType fromCode(String codeString) throws IllegalArgumentException { 155 if (codeString == null || "".equals(codeString)) 156 if (codeString == null || "".equals(codeString)) 157 return null; 158 if ("udi-label-name".equals(codeString)) 159 return DeviceNameType.UDILABELNAME; 160 if ("user-friendly-name".equals(codeString)) 161 return DeviceNameType.USERFRIENDLYNAME; 162 if ("patient-reported-name".equals(codeString)) 163 return DeviceNameType.PATIENTREPORTEDNAME; 164 if ("manufacturer-name".equals(codeString)) 165 return DeviceNameType.MANUFACTURERNAME; 166 if ("model-name".equals(codeString)) 167 return DeviceNameType.MODELNAME; 168 if ("other".equals(codeString)) 169 return DeviceNameType.OTHER; 170 throw new IllegalArgumentException("Unknown DeviceNameType code '"+codeString+"'"); 171 } 172 public Enumeration<DeviceNameType> fromType(Base code) throws FHIRException { 173 if (code == null) 174 return null; 175 if (code.isEmpty()) 176 return new Enumeration<DeviceNameType>(this); 177 String codeString = ((PrimitiveType) code).asStringValue(); 178 if (codeString == null || "".equals(codeString)) 179 return null; 180 if ("udi-label-name".equals(codeString)) 181 return new Enumeration<DeviceNameType>(this, DeviceNameType.UDILABELNAME); 182 if ("user-friendly-name".equals(codeString)) 183 return new Enumeration<DeviceNameType>(this, DeviceNameType.USERFRIENDLYNAME); 184 if ("patient-reported-name".equals(codeString)) 185 return new Enumeration<DeviceNameType>(this, DeviceNameType.PATIENTREPORTEDNAME); 186 if ("manufacturer-name".equals(codeString)) 187 return new Enumeration<DeviceNameType>(this, DeviceNameType.MANUFACTURERNAME); 188 if ("model-name".equals(codeString)) 189 return new Enumeration<DeviceNameType>(this, DeviceNameType.MODELNAME); 190 if ("other".equals(codeString)) 191 return new Enumeration<DeviceNameType>(this, DeviceNameType.OTHER); 192 throw new FHIRException("Unknown DeviceNameType code '"+codeString+"'"); 193 } 194 public String toCode(DeviceNameType code) { 195 if (code == DeviceNameType.UDILABELNAME) 196 return "udi-label-name"; 197 if (code == DeviceNameType.USERFRIENDLYNAME) 198 return "user-friendly-name"; 199 if (code == DeviceNameType.PATIENTREPORTEDNAME) 200 return "patient-reported-name"; 201 if (code == DeviceNameType.MANUFACTURERNAME) 202 return "manufacturer-name"; 203 if (code == DeviceNameType.MODELNAME) 204 return "model-name"; 205 if (code == DeviceNameType.OTHER) 206 return "other"; 207 return "?"; 208 } 209 public String toSystem(DeviceNameType code) { 210 return code.getSystem(); 211 } 212 } 213 214 @Block() 215 public static class DeviceDefinitionUdiDeviceIdentifierComponent extends BackboneElement implements IBaseBackboneElement { 216 /** 217 * The identifier that is to be associated with every Device that references this DeviceDefintiion for the issuer and jurisdication porvided in the DeviceDefinition.udiDeviceIdentifier. 218 */ 219 @Child(name = "deviceIdentifier", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) 220 @Description(shortDefinition="The identifier that is to be associated with every Device that references this DeviceDefintiion for the issuer and jurisdication porvided in the DeviceDefinition.udiDeviceIdentifier", formalDefinition="The identifier that is to be associated with every Device that references this DeviceDefintiion for the issuer and jurisdication porvided in the DeviceDefinition.udiDeviceIdentifier." ) 221 protected StringType deviceIdentifier; 222 223 /** 224 * The organization that assigns the identifier algorithm. 225 */ 226 @Child(name = "issuer", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false) 227 @Description(shortDefinition="The organization that assigns the identifier algorithm", formalDefinition="The organization that assigns the identifier algorithm." ) 228 protected UriType issuer; 229 230 /** 231 * The jurisdiction to which the deviceIdentifier applies. 232 */ 233 @Child(name = "jurisdiction", type = {UriType.class}, order=3, min=1, max=1, modifier=false, summary=false) 234 @Description(shortDefinition="The jurisdiction to which the deviceIdentifier applies", formalDefinition="The jurisdiction to which the deviceIdentifier applies." ) 235 protected UriType jurisdiction; 236 237 private static final long serialVersionUID = -1577319218L; 238 239 /** 240 * Constructor 241 */ 242 public DeviceDefinitionUdiDeviceIdentifierComponent() { 243 super(); 244 } 245 246 /** 247 * Constructor 248 */ 249 public DeviceDefinitionUdiDeviceIdentifierComponent(StringType deviceIdentifier, UriType issuer, UriType jurisdiction) { 250 super(); 251 this.deviceIdentifier = deviceIdentifier; 252 this.issuer = issuer; 253 this.jurisdiction = jurisdiction; 254 } 255 256 /** 257 * @return {@link #deviceIdentifier} (The identifier that is to be associated with every Device that references this DeviceDefintiion for the issuer and jurisdication porvided in the DeviceDefinition.udiDeviceIdentifier.). This is the underlying object with id, value and extensions. The accessor "getDeviceIdentifier" gives direct access to the value 258 */ 259 public StringType getDeviceIdentifierElement() { 260 if (this.deviceIdentifier == null) 261 if (Configuration.errorOnAutoCreate()) 262 throw new Error("Attempt to auto-create DeviceDefinitionUdiDeviceIdentifierComponent.deviceIdentifier"); 263 else if (Configuration.doAutoCreate()) 264 this.deviceIdentifier = new StringType(); // bb 265 return this.deviceIdentifier; 266 } 267 268 public boolean hasDeviceIdentifierElement() { 269 return this.deviceIdentifier != null && !this.deviceIdentifier.isEmpty(); 270 } 271 272 public boolean hasDeviceIdentifier() { 273 return this.deviceIdentifier != null && !this.deviceIdentifier.isEmpty(); 274 } 275 276 /** 277 * @param value {@link #deviceIdentifier} (The identifier that is to be associated with every Device that references this DeviceDefintiion for the issuer and jurisdication porvided in the DeviceDefinition.udiDeviceIdentifier.). This is the underlying object with id, value and extensions. The accessor "getDeviceIdentifier" gives direct access to the value 278 */ 279 public DeviceDefinitionUdiDeviceIdentifierComponent setDeviceIdentifierElement(StringType value) { 280 this.deviceIdentifier = value; 281 return this; 282 } 283 284 /** 285 * @return The identifier that is to be associated with every Device that references this DeviceDefintiion for the issuer and jurisdication porvided in the DeviceDefinition.udiDeviceIdentifier. 286 */ 287 public String getDeviceIdentifier() { 288 return this.deviceIdentifier == null ? null : this.deviceIdentifier.getValue(); 289 } 290 291 /** 292 * @param value The identifier that is to be associated with every Device that references this DeviceDefintiion for the issuer and jurisdication porvided in the DeviceDefinition.udiDeviceIdentifier. 293 */ 294 public DeviceDefinitionUdiDeviceIdentifierComponent setDeviceIdentifier(String value) { 295 if (this.deviceIdentifier == null) 296 this.deviceIdentifier = new StringType(); 297 this.deviceIdentifier.setValue(value); 298 return this; 299 } 300 301 /** 302 * @return {@link #issuer} (The organization that assigns the identifier algorithm.). This is the underlying object with id, value and extensions. The accessor "getIssuer" gives direct access to the value 303 */ 304 public UriType getIssuerElement() { 305 if (this.issuer == null) 306 if (Configuration.errorOnAutoCreate()) 307 throw new Error("Attempt to auto-create DeviceDefinitionUdiDeviceIdentifierComponent.issuer"); 308 else if (Configuration.doAutoCreate()) 309 this.issuer = new UriType(); // bb 310 return this.issuer; 311 } 312 313 public boolean hasIssuerElement() { 314 return this.issuer != null && !this.issuer.isEmpty(); 315 } 316 317 public boolean hasIssuer() { 318 return this.issuer != null && !this.issuer.isEmpty(); 319 } 320 321 /** 322 * @param value {@link #issuer} (The organization that assigns the identifier algorithm.). This is the underlying object with id, value and extensions. The accessor "getIssuer" gives direct access to the value 323 */ 324 public DeviceDefinitionUdiDeviceIdentifierComponent setIssuerElement(UriType value) { 325 this.issuer = value; 326 return this; 327 } 328 329 /** 330 * @return The organization that assigns the identifier algorithm. 331 */ 332 public String getIssuer() { 333 return this.issuer == null ? null : this.issuer.getValue(); 334 } 335 336 /** 337 * @param value The organization that assigns the identifier algorithm. 338 */ 339 public DeviceDefinitionUdiDeviceIdentifierComponent setIssuer(String value) { 340 if (this.issuer == null) 341 this.issuer = new UriType(); 342 this.issuer.setValue(value); 343 return this; 344 } 345 346 /** 347 * @return {@link #jurisdiction} (The jurisdiction to which the deviceIdentifier applies.). This is the underlying object with id, value and extensions. The accessor "getJurisdiction" gives direct access to the value 348 */ 349 public UriType getJurisdictionElement() { 350 if (this.jurisdiction == null) 351 if (Configuration.errorOnAutoCreate()) 352 throw new Error("Attempt to auto-create DeviceDefinitionUdiDeviceIdentifierComponent.jurisdiction"); 353 else if (Configuration.doAutoCreate()) 354 this.jurisdiction = new UriType(); // bb 355 return this.jurisdiction; 356 } 357 358 public boolean hasJurisdictionElement() { 359 return this.jurisdiction != null && !this.jurisdiction.isEmpty(); 360 } 361 362 public boolean hasJurisdiction() { 363 return this.jurisdiction != null && !this.jurisdiction.isEmpty(); 364 } 365 366 /** 367 * @param value {@link #jurisdiction} (The jurisdiction to which the deviceIdentifier applies.). This is the underlying object with id, value and extensions. The accessor "getJurisdiction" gives direct access to the value 368 */ 369 public DeviceDefinitionUdiDeviceIdentifierComponent setJurisdictionElement(UriType value) { 370 this.jurisdiction = value; 371 return this; 372 } 373 374 /** 375 * @return The jurisdiction to which the deviceIdentifier applies. 376 */ 377 public String getJurisdiction() { 378 return this.jurisdiction == null ? null : this.jurisdiction.getValue(); 379 } 380 381 /** 382 * @param value The jurisdiction to which the deviceIdentifier applies. 383 */ 384 public DeviceDefinitionUdiDeviceIdentifierComponent setJurisdiction(String value) { 385 if (this.jurisdiction == null) 386 this.jurisdiction = new UriType(); 387 this.jurisdiction.setValue(value); 388 return this; 389 } 390 391 protected void listChildren(List<Property> children) { 392 super.listChildren(children); 393 children.add(new Property("deviceIdentifier", "string", "The identifier that is to be associated with every Device that references this DeviceDefintiion for the issuer and jurisdication porvided in the DeviceDefinition.udiDeviceIdentifier.", 0, 1, deviceIdentifier)); 394 children.add(new Property("issuer", "uri", "The organization that assigns the identifier algorithm.", 0, 1, issuer)); 395 children.add(new Property("jurisdiction", "uri", "The jurisdiction to which the deviceIdentifier applies.", 0, 1, jurisdiction)); 396 } 397 398 @Override 399 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 400 switch (_hash) { 401 case 1322005407: /*deviceIdentifier*/ return new Property("deviceIdentifier", "string", "The identifier that is to be associated with every Device that references this DeviceDefintiion for the issuer and jurisdication porvided in the DeviceDefinition.udiDeviceIdentifier.", 0, 1, deviceIdentifier); 402 case -1179159879: /*issuer*/ return new Property("issuer", "uri", "The organization that assigns the identifier algorithm.", 0, 1, issuer); 403 case -507075711: /*jurisdiction*/ return new Property("jurisdiction", "uri", "The jurisdiction to which the deviceIdentifier applies.", 0, 1, jurisdiction); 404 default: return super.getNamedProperty(_hash, _name, _checkValid); 405 } 406 407 } 408 409 @Override 410 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 411 switch (hash) { 412 case 1322005407: /*deviceIdentifier*/ return this.deviceIdentifier == null ? new Base[0] : new Base[] {this.deviceIdentifier}; // StringType 413 case -1179159879: /*issuer*/ return this.issuer == null ? new Base[0] : new Base[] {this.issuer}; // UriType 414 case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : new Base[] {this.jurisdiction}; // UriType 415 default: return super.getProperty(hash, name, checkValid); 416 } 417 418 } 419 420 @Override 421 public Base setProperty(int hash, String name, Base value) throws FHIRException { 422 switch (hash) { 423 case 1322005407: // deviceIdentifier 424 this.deviceIdentifier = castToString(value); // StringType 425 return value; 426 case -1179159879: // issuer 427 this.issuer = castToUri(value); // UriType 428 return value; 429 case -507075711: // jurisdiction 430 this.jurisdiction = castToUri(value); // UriType 431 return value; 432 default: return super.setProperty(hash, name, value); 433 } 434 435 } 436 437 @Override 438 public Base setProperty(String name, Base value) throws FHIRException { 439 if (name.equals("deviceIdentifier")) { 440 this.deviceIdentifier = castToString(value); // StringType 441 } else if (name.equals("issuer")) { 442 this.issuer = castToUri(value); // UriType 443 } else if (name.equals("jurisdiction")) { 444 this.jurisdiction = castToUri(value); // UriType 445 } else 446 return super.setProperty(name, value); 447 return value; 448 } 449 450 @Override 451 public Base makeProperty(int hash, String name) throws FHIRException { 452 switch (hash) { 453 case 1322005407: return getDeviceIdentifierElement(); 454 case -1179159879: return getIssuerElement(); 455 case -507075711: return getJurisdictionElement(); 456 default: return super.makeProperty(hash, name); 457 } 458 459 } 460 461 @Override 462 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 463 switch (hash) { 464 case 1322005407: /*deviceIdentifier*/ return new String[] {"string"}; 465 case -1179159879: /*issuer*/ return new String[] {"uri"}; 466 case -507075711: /*jurisdiction*/ return new String[] {"uri"}; 467 default: return super.getTypesForProperty(hash, name); 468 } 469 470 } 471 472 @Override 473 public Base addChild(String name) throws FHIRException { 474 if (name.equals("deviceIdentifier")) { 475 throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.deviceIdentifier"); 476 } 477 else if (name.equals("issuer")) { 478 throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.issuer"); 479 } 480 else if (name.equals("jurisdiction")) { 481 throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.jurisdiction"); 482 } 483 else 484 return super.addChild(name); 485 } 486 487 public DeviceDefinitionUdiDeviceIdentifierComponent copy() { 488 DeviceDefinitionUdiDeviceIdentifierComponent dst = new DeviceDefinitionUdiDeviceIdentifierComponent(); 489 copyValues(dst); 490 return dst; 491 } 492 493 public void copyValues(DeviceDefinitionUdiDeviceIdentifierComponent dst) { 494 super.copyValues(dst); 495 dst.deviceIdentifier = deviceIdentifier == null ? null : deviceIdentifier.copy(); 496 dst.issuer = issuer == null ? null : issuer.copy(); 497 dst.jurisdiction = jurisdiction == null ? null : jurisdiction.copy(); 498 } 499 500 @Override 501 public boolean equalsDeep(Base other_) { 502 if (!super.equalsDeep(other_)) 503 return false; 504 if (!(other_ instanceof DeviceDefinitionUdiDeviceIdentifierComponent)) 505 return false; 506 DeviceDefinitionUdiDeviceIdentifierComponent o = (DeviceDefinitionUdiDeviceIdentifierComponent) other_; 507 return compareDeep(deviceIdentifier, o.deviceIdentifier, true) && compareDeep(issuer, o.issuer, true) 508 && compareDeep(jurisdiction, o.jurisdiction, true); 509 } 510 511 @Override 512 public boolean equalsShallow(Base other_) { 513 if (!super.equalsShallow(other_)) 514 return false; 515 if (!(other_ instanceof DeviceDefinitionUdiDeviceIdentifierComponent)) 516 return false; 517 DeviceDefinitionUdiDeviceIdentifierComponent o = (DeviceDefinitionUdiDeviceIdentifierComponent) other_; 518 return compareValues(deviceIdentifier, o.deviceIdentifier, true) && compareValues(issuer, o.issuer, true) 519 && compareValues(jurisdiction, o.jurisdiction, true); 520 } 521 522 public boolean isEmpty() { 523 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(deviceIdentifier, issuer, jurisdiction 524 ); 525 } 526 527 public String fhirType() { 528 return "DeviceDefinition.udiDeviceIdentifier"; 529 530 } 531 532 } 533 534 @Block() 535 public static class DeviceDefinitionDeviceNameComponent extends BackboneElement implements IBaseBackboneElement { 536 /** 537 * The name of the device. 538 */ 539 @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) 540 @Description(shortDefinition="The name of the device", formalDefinition="The name of the device." ) 541 protected StringType name; 542 543 /** 544 * The type of deviceName. 545UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName. 546 */ 547 @Child(name = "type", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false) 548 @Description(shortDefinition="udi-label-name | user-friendly-name | patient-reported-name | manufacturer-name | model-name | other", formalDefinition="The type of deviceName.\nUDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName." ) 549 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-nametype") 550 protected Enumeration<DeviceNameType> type; 551 552 private static final long serialVersionUID = 918983440L; 553 554 /** 555 * Constructor 556 */ 557 public DeviceDefinitionDeviceNameComponent() { 558 super(); 559 } 560 561 /** 562 * Constructor 563 */ 564 public DeviceDefinitionDeviceNameComponent(StringType name, Enumeration<DeviceNameType> type) { 565 super(); 566 this.name = name; 567 this.type = type; 568 } 569 570 /** 571 * @return {@link #name} (The name of the device.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 572 */ 573 public StringType getNameElement() { 574 if (this.name == null) 575 if (Configuration.errorOnAutoCreate()) 576 throw new Error("Attempt to auto-create DeviceDefinitionDeviceNameComponent.name"); 577 else if (Configuration.doAutoCreate()) 578 this.name = new StringType(); // bb 579 return this.name; 580 } 581 582 public boolean hasNameElement() { 583 return this.name != null && !this.name.isEmpty(); 584 } 585 586 public boolean hasName() { 587 return this.name != null && !this.name.isEmpty(); 588 } 589 590 /** 591 * @param value {@link #name} (The name of the device.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value 592 */ 593 public DeviceDefinitionDeviceNameComponent setNameElement(StringType value) { 594 this.name = value; 595 return this; 596 } 597 598 /** 599 * @return The name of the device. 600 */ 601 public String getName() { 602 return this.name == null ? null : this.name.getValue(); 603 } 604 605 /** 606 * @param value The name of the device. 607 */ 608 public DeviceDefinitionDeviceNameComponent setName(String value) { 609 if (this.name == null) 610 this.name = new StringType(); 611 this.name.setValue(value); 612 return this; 613 } 614 615 /** 616 * @return {@link #type} (The type of deviceName. 617UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 618 */ 619 public Enumeration<DeviceNameType> getTypeElement() { 620 if (this.type == null) 621 if (Configuration.errorOnAutoCreate()) 622 throw new Error("Attempt to auto-create DeviceDefinitionDeviceNameComponent.type"); 623 else if (Configuration.doAutoCreate()) 624 this.type = new Enumeration<DeviceNameType>(new DeviceNameTypeEnumFactory()); // bb 625 return this.type; 626 } 627 628 public boolean hasTypeElement() { 629 return this.type != null && !this.type.isEmpty(); 630 } 631 632 public boolean hasType() { 633 return this.type != null && !this.type.isEmpty(); 634 } 635 636 /** 637 * @param value {@link #type} (The type of deviceName. 638UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value 639 */ 640 public DeviceDefinitionDeviceNameComponent setTypeElement(Enumeration<DeviceNameType> value) { 641 this.type = value; 642 return this; 643 } 644 645 /** 646 * @return The type of deviceName. 647UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName. 648 */ 649 public DeviceNameType getType() { 650 return this.type == null ? null : this.type.getValue(); 651 } 652 653 /** 654 * @param value The type of deviceName. 655UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName. 656 */ 657 public DeviceDefinitionDeviceNameComponent setType(DeviceNameType value) { 658 if (this.type == null) 659 this.type = new Enumeration<DeviceNameType>(new DeviceNameTypeEnumFactory()); 660 this.type.setValue(value); 661 return this; 662 } 663 664 protected void listChildren(List<Property> children) { 665 super.listChildren(children); 666 children.add(new Property("name", "string", "The name of the device.", 0, 1, name)); 667 children.add(new Property("type", "code", "The type of deviceName.\nUDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.", 0, 1, type)); 668 } 669 670 @Override 671 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 672 switch (_hash) { 673 case 3373707: /*name*/ return new Property("name", "string", "The name of the device.", 0, 1, name); 674 case 3575610: /*type*/ return new Property("type", "code", "The type of deviceName.\nUDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.", 0, 1, type); 675 default: return super.getNamedProperty(_hash, _name, _checkValid); 676 } 677 678 } 679 680 @Override 681 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 682 switch (hash) { 683 case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType 684 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<DeviceNameType> 685 default: return super.getProperty(hash, name, checkValid); 686 } 687 688 } 689 690 @Override 691 public Base setProperty(int hash, String name, Base value) throws FHIRException { 692 switch (hash) { 693 case 3373707: // name 694 this.name = castToString(value); // StringType 695 return value; 696 case 3575610: // type 697 value = new DeviceNameTypeEnumFactory().fromType(castToCode(value)); 698 this.type = (Enumeration) value; // Enumeration<DeviceNameType> 699 return value; 700 default: return super.setProperty(hash, name, value); 701 } 702 703 } 704 705 @Override 706 public Base setProperty(String name, Base value) throws FHIRException { 707 if (name.equals("name")) { 708 this.name = castToString(value); // StringType 709 } else if (name.equals("type")) { 710 value = new DeviceNameTypeEnumFactory().fromType(castToCode(value)); 711 this.type = (Enumeration) value; // Enumeration<DeviceNameType> 712 } else 713 return super.setProperty(name, value); 714 return value; 715 } 716 717 @Override 718 public Base makeProperty(int hash, String name) throws FHIRException { 719 switch (hash) { 720 case 3373707: return getNameElement(); 721 case 3575610: return getTypeElement(); 722 default: return super.makeProperty(hash, name); 723 } 724 725 } 726 727 @Override 728 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 729 switch (hash) { 730 case 3373707: /*name*/ return new String[] {"string"}; 731 case 3575610: /*type*/ return new String[] {"code"}; 732 default: return super.getTypesForProperty(hash, name); 733 } 734 735 } 736 737 @Override 738 public Base addChild(String name) throws FHIRException { 739 if (name.equals("name")) { 740 throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.name"); 741 } 742 else if (name.equals("type")) { 743 throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.type"); 744 } 745 else 746 return super.addChild(name); 747 } 748 749 public DeviceDefinitionDeviceNameComponent copy() { 750 DeviceDefinitionDeviceNameComponent dst = new DeviceDefinitionDeviceNameComponent(); 751 copyValues(dst); 752 return dst; 753 } 754 755 public void copyValues(DeviceDefinitionDeviceNameComponent dst) { 756 super.copyValues(dst); 757 dst.name = name == null ? null : name.copy(); 758 dst.type = type == null ? null : type.copy(); 759 } 760 761 @Override 762 public boolean equalsDeep(Base other_) { 763 if (!super.equalsDeep(other_)) 764 return false; 765 if (!(other_ instanceof DeviceDefinitionDeviceNameComponent)) 766 return false; 767 DeviceDefinitionDeviceNameComponent o = (DeviceDefinitionDeviceNameComponent) other_; 768 return compareDeep(name, o.name, true) && compareDeep(type, o.type, true); 769 } 770 771 @Override 772 public boolean equalsShallow(Base other_) { 773 if (!super.equalsShallow(other_)) 774 return false; 775 if (!(other_ instanceof DeviceDefinitionDeviceNameComponent)) 776 return false; 777 DeviceDefinitionDeviceNameComponent o = (DeviceDefinitionDeviceNameComponent) other_; 778 return compareValues(name, o.name, true) && compareValues(type, o.type, true); 779 } 780 781 public boolean isEmpty() { 782 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, type); 783 } 784 785 public String fhirType() { 786 return "DeviceDefinition.deviceName"; 787 788 } 789 790 } 791 792 @Block() 793 public static class DeviceDefinitionSpecializationComponent extends BackboneElement implements IBaseBackboneElement { 794 /** 795 * The standard that is used to operate and communicate. 796 */ 797 @Child(name = "systemType", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) 798 @Description(shortDefinition="The standard that is used to operate and communicate", formalDefinition="The standard that is used to operate and communicate." ) 799 protected StringType systemType; 800 801 /** 802 * The version of the standard that is used to operate and communicate. 803 */ 804 @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) 805 @Description(shortDefinition="The version of the standard that is used to operate and communicate", formalDefinition="The version of the standard that is used to operate and communicate." ) 806 protected StringType version; 807 808 private static final long serialVersionUID = -249304393L; 809 810 /** 811 * Constructor 812 */ 813 public DeviceDefinitionSpecializationComponent() { 814 super(); 815 } 816 817 /** 818 * Constructor 819 */ 820 public DeviceDefinitionSpecializationComponent(StringType systemType) { 821 super(); 822 this.systemType = systemType; 823 } 824 825 /** 826 * @return {@link #systemType} (The standard that is used to operate and communicate.). This is the underlying object with id, value and extensions. The accessor "getSystemType" gives direct access to the value 827 */ 828 public StringType getSystemTypeElement() { 829 if (this.systemType == null) 830 if (Configuration.errorOnAutoCreate()) 831 throw new Error("Attempt to auto-create DeviceDefinitionSpecializationComponent.systemType"); 832 else if (Configuration.doAutoCreate()) 833 this.systemType = new StringType(); // bb 834 return this.systemType; 835 } 836 837 public boolean hasSystemTypeElement() { 838 return this.systemType != null && !this.systemType.isEmpty(); 839 } 840 841 public boolean hasSystemType() { 842 return this.systemType != null && !this.systemType.isEmpty(); 843 } 844 845 /** 846 * @param value {@link #systemType} (The standard that is used to operate and communicate.). This is the underlying object with id, value and extensions. The accessor "getSystemType" gives direct access to the value 847 */ 848 public DeviceDefinitionSpecializationComponent setSystemTypeElement(StringType value) { 849 this.systemType = value; 850 return this; 851 } 852 853 /** 854 * @return The standard that is used to operate and communicate. 855 */ 856 public String getSystemType() { 857 return this.systemType == null ? null : this.systemType.getValue(); 858 } 859 860 /** 861 * @param value The standard that is used to operate and communicate. 862 */ 863 public DeviceDefinitionSpecializationComponent setSystemType(String value) { 864 if (this.systemType == null) 865 this.systemType = new StringType(); 866 this.systemType.setValue(value); 867 return this; 868 } 869 870 /** 871 * @return {@link #version} (The version of the standard that is used to operate and communicate.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value 872 */ 873 public StringType getVersionElement() { 874 if (this.version == null) 875 if (Configuration.errorOnAutoCreate()) 876 throw new Error("Attempt to auto-create DeviceDefinitionSpecializationComponent.version"); 877 else if (Configuration.doAutoCreate()) 878 this.version = new StringType(); // bb 879 return this.version; 880 } 881 882 public boolean hasVersionElement() { 883 return this.version != null && !this.version.isEmpty(); 884 } 885 886 public boolean hasVersion() { 887 return this.version != null && !this.version.isEmpty(); 888 } 889 890 /** 891 * @param value {@link #version} (The version of the standard that is used to operate and communicate.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value 892 */ 893 public DeviceDefinitionSpecializationComponent setVersionElement(StringType value) { 894 this.version = value; 895 return this; 896 } 897 898 /** 899 * @return The version of the standard that is used to operate and communicate. 900 */ 901 public String getVersion() { 902 return this.version == null ? null : this.version.getValue(); 903 } 904 905 /** 906 * @param value The version of the standard that is used to operate and communicate. 907 */ 908 public DeviceDefinitionSpecializationComponent setVersion(String value) { 909 if (Utilities.noString(value)) 910 this.version = null; 911 else { 912 if (this.version == null) 913 this.version = new StringType(); 914 this.version.setValue(value); 915 } 916 return this; 917 } 918 919 protected void listChildren(List<Property> children) { 920 super.listChildren(children); 921 children.add(new Property("systemType", "string", "The standard that is used to operate and communicate.", 0, 1, systemType)); 922 children.add(new Property("version", "string", "The version of the standard that is used to operate and communicate.", 0, 1, version)); 923 } 924 925 @Override 926 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 927 switch (_hash) { 928 case 642893321: /*systemType*/ return new Property("systemType", "string", "The standard that is used to operate and communicate.", 0, 1, systemType); 929 case 351608024: /*version*/ return new Property("version", "string", "The version of the standard that is used to operate and communicate.", 0, 1, version); 930 default: return super.getNamedProperty(_hash, _name, _checkValid); 931 } 932 933 } 934 935 @Override 936 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 937 switch (hash) { 938 case 642893321: /*systemType*/ return this.systemType == null ? new Base[0] : new Base[] {this.systemType}; // StringType 939 case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType 940 default: return super.getProperty(hash, name, checkValid); 941 } 942 943 } 944 945 @Override 946 public Base setProperty(int hash, String name, Base value) throws FHIRException { 947 switch (hash) { 948 case 642893321: // systemType 949 this.systemType = castToString(value); // StringType 950 return value; 951 case 351608024: // version 952 this.version = castToString(value); // StringType 953 return value; 954 default: return super.setProperty(hash, name, value); 955 } 956 957 } 958 959 @Override 960 public Base setProperty(String name, Base value) throws FHIRException { 961 if (name.equals("systemType")) { 962 this.systemType = castToString(value); // StringType 963 } else if (name.equals("version")) { 964 this.version = castToString(value); // StringType 965 } else 966 return super.setProperty(name, value); 967 return value; 968 } 969 970 @Override 971 public Base makeProperty(int hash, String name) throws FHIRException { 972 switch (hash) { 973 case 642893321: return getSystemTypeElement(); 974 case 351608024: return getVersionElement(); 975 default: return super.makeProperty(hash, name); 976 } 977 978 } 979 980 @Override 981 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 982 switch (hash) { 983 case 642893321: /*systemType*/ return new String[] {"string"}; 984 case 351608024: /*version*/ return new String[] {"string"}; 985 default: return super.getTypesForProperty(hash, name); 986 } 987 988 } 989 990 @Override 991 public Base addChild(String name) throws FHIRException { 992 if (name.equals("systemType")) { 993 throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.systemType"); 994 } 995 else if (name.equals("version")) { 996 throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.version"); 997 } 998 else 999 return super.addChild(name); 1000 } 1001 1002 public DeviceDefinitionSpecializationComponent copy() { 1003 DeviceDefinitionSpecializationComponent dst = new DeviceDefinitionSpecializationComponent(); 1004 copyValues(dst); 1005 return dst; 1006 } 1007 1008 public void copyValues(DeviceDefinitionSpecializationComponent dst) { 1009 super.copyValues(dst); 1010 dst.systemType = systemType == null ? null : systemType.copy(); 1011 dst.version = version == null ? null : version.copy(); 1012 } 1013 1014 @Override 1015 public boolean equalsDeep(Base other_) { 1016 if (!super.equalsDeep(other_)) 1017 return false; 1018 if (!(other_ instanceof DeviceDefinitionSpecializationComponent)) 1019 return false; 1020 DeviceDefinitionSpecializationComponent o = (DeviceDefinitionSpecializationComponent) other_; 1021 return compareDeep(systemType, o.systemType, true) && compareDeep(version, o.version, true); 1022 } 1023 1024 @Override 1025 public boolean equalsShallow(Base other_) { 1026 if (!super.equalsShallow(other_)) 1027 return false; 1028 if (!(other_ instanceof DeviceDefinitionSpecializationComponent)) 1029 return false; 1030 DeviceDefinitionSpecializationComponent o = (DeviceDefinitionSpecializationComponent) other_; 1031 return compareValues(systemType, o.systemType, true) && compareValues(version, o.version, true); 1032 } 1033 1034 public boolean isEmpty() { 1035 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(systemType, version); 1036 } 1037 1038 public String fhirType() { 1039 return "DeviceDefinition.specialization"; 1040 1041 } 1042 1043 } 1044 1045 @Block() 1046 public static class DeviceDefinitionCapabilityComponent extends BackboneElement implements IBaseBackboneElement { 1047 /** 1048 * Type of capability. 1049 */ 1050 @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) 1051 @Description(shortDefinition="Type of capability", formalDefinition="Type of capability." ) 1052 protected CodeableConcept type; 1053 1054 /** 1055 * Description of capability. 1056 */ 1057 @Child(name = "description", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1058 @Description(shortDefinition="Description of capability", formalDefinition="Description of capability." ) 1059 protected List<CodeableConcept> description; 1060 1061 private static final long serialVersionUID = -192945344L; 1062 1063 /** 1064 * Constructor 1065 */ 1066 public DeviceDefinitionCapabilityComponent() { 1067 super(); 1068 } 1069 1070 /** 1071 * Constructor 1072 */ 1073 public DeviceDefinitionCapabilityComponent(CodeableConcept type) { 1074 super(); 1075 this.type = type; 1076 } 1077 1078 /** 1079 * @return {@link #type} (Type of capability.) 1080 */ 1081 public CodeableConcept getType() { 1082 if (this.type == null) 1083 if (Configuration.errorOnAutoCreate()) 1084 throw new Error("Attempt to auto-create DeviceDefinitionCapabilityComponent.type"); 1085 else if (Configuration.doAutoCreate()) 1086 this.type = new CodeableConcept(); // cc 1087 return this.type; 1088 } 1089 1090 public boolean hasType() { 1091 return this.type != null && !this.type.isEmpty(); 1092 } 1093 1094 /** 1095 * @param value {@link #type} (Type of capability.) 1096 */ 1097 public DeviceDefinitionCapabilityComponent setType(CodeableConcept value) { 1098 this.type = value; 1099 return this; 1100 } 1101 1102 /** 1103 * @return {@link #description} (Description of capability.) 1104 */ 1105 public List<CodeableConcept> getDescription() { 1106 if (this.description == null) 1107 this.description = new ArrayList<CodeableConcept>(); 1108 return this.description; 1109 } 1110 1111 /** 1112 * @return Returns a reference to <code>this</code> for easy method chaining 1113 */ 1114 public DeviceDefinitionCapabilityComponent setDescription(List<CodeableConcept> theDescription) { 1115 this.description = theDescription; 1116 return this; 1117 } 1118 1119 public boolean hasDescription() { 1120 if (this.description == null) 1121 return false; 1122 for (CodeableConcept item : this.description) 1123 if (!item.isEmpty()) 1124 return true; 1125 return false; 1126 } 1127 1128 public CodeableConcept addDescription() { //3 1129 CodeableConcept t = new CodeableConcept(); 1130 if (this.description == null) 1131 this.description = new ArrayList<CodeableConcept>(); 1132 this.description.add(t); 1133 return t; 1134 } 1135 1136 public DeviceDefinitionCapabilityComponent addDescription(CodeableConcept t) { //3 1137 if (t == null) 1138 return this; 1139 if (this.description == null) 1140 this.description = new ArrayList<CodeableConcept>(); 1141 this.description.add(t); 1142 return this; 1143 } 1144 1145 /** 1146 * @return The first repetition of repeating field {@link #description}, creating it if it does not already exist 1147 */ 1148 public CodeableConcept getDescriptionFirstRep() { 1149 if (getDescription().isEmpty()) { 1150 addDescription(); 1151 } 1152 return getDescription().get(0); 1153 } 1154 1155 protected void listChildren(List<Property> children) { 1156 super.listChildren(children); 1157 children.add(new Property("type", "CodeableConcept", "Type of capability.", 0, 1, type)); 1158 children.add(new Property("description", "CodeableConcept", "Description of capability.", 0, java.lang.Integer.MAX_VALUE, description)); 1159 } 1160 1161 @Override 1162 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1163 switch (_hash) { 1164 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "Type of capability.", 0, 1, type); 1165 case -1724546052: /*description*/ return new Property("description", "CodeableConcept", "Description of capability.", 0, java.lang.Integer.MAX_VALUE, description); 1166 default: return super.getNamedProperty(_hash, _name, _checkValid); 1167 } 1168 1169 } 1170 1171 @Override 1172 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1173 switch (hash) { 1174 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 1175 case -1724546052: /*description*/ return this.description == null ? new Base[0] : this.description.toArray(new Base[this.description.size()]); // CodeableConcept 1176 default: return super.getProperty(hash, name, checkValid); 1177 } 1178 1179 } 1180 1181 @Override 1182 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1183 switch (hash) { 1184 case 3575610: // type 1185 this.type = castToCodeableConcept(value); // CodeableConcept 1186 return value; 1187 case -1724546052: // description 1188 this.getDescription().add(castToCodeableConcept(value)); // CodeableConcept 1189 return value; 1190 default: return super.setProperty(hash, name, value); 1191 } 1192 1193 } 1194 1195 @Override 1196 public Base setProperty(String name, Base value) throws FHIRException { 1197 if (name.equals("type")) { 1198 this.type = castToCodeableConcept(value); // CodeableConcept 1199 } else if (name.equals("description")) { 1200 this.getDescription().add(castToCodeableConcept(value)); 1201 } else 1202 return super.setProperty(name, value); 1203 return value; 1204 } 1205 1206 @Override 1207 public Base makeProperty(int hash, String name) throws FHIRException { 1208 switch (hash) { 1209 case 3575610: return getType(); 1210 case -1724546052: return addDescription(); 1211 default: return super.makeProperty(hash, name); 1212 } 1213 1214 } 1215 1216 @Override 1217 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1218 switch (hash) { 1219 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 1220 case -1724546052: /*description*/ return new String[] {"CodeableConcept"}; 1221 default: return super.getTypesForProperty(hash, name); 1222 } 1223 1224 } 1225 1226 @Override 1227 public Base addChild(String name) throws FHIRException { 1228 if (name.equals("type")) { 1229 this.type = new CodeableConcept(); 1230 return this.type; 1231 } 1232 else if (name.equals("description")) { 1233 return addDescription(); 1234 } 1235 else 1236 return super.addChild(name); 1237 } 1238 1239 public DeviceDefinitionCapabilityComponent copy() { 1240 DeviceDefinitionCapabilityComponent dst = new DeviceDefinitionCapabilityComponent(); 1241 copyValues(dst); 1242 return dst; 1243 } 1244 1245 public void copyValues(DeviceDefinitionCapabilityComponent dst) { 1246 super.copyValues(dst); 1247 dst.type = type == null ? null : type.copy(); 1248 if (description != null) { 1249 dst.description = new ArrayList<CodeableConcept>(); 1250 for (CodeableConcept i : description) 1251 dst.description.add(i.copy()); 1252 }; 1253 } 1254 1255 @Override 1256 public boolean equalsDeep(Base other_) { 1257 if (!super.equalsDeep(other_)) 1258 return false; 1259 if (!(other_ instanceof DeviceDefinitionCapabilityComponent)) 1260 return false; 1261 DeviceDefinitionCapabilityComponent o = (DeviceDefinitionCapabilityComponent) other_; 1262 return compareDeep(type, o.type, true) && compareDeep(description, o.description, true); 1263 } 1264 1265 @Override 1266 public boolean equalsShallow(Base other_) { 1267 if (!super.equalsShallow(other_)) 1268 return false; 1269 if (!(other_ instanceof DeviceDefinitionCapabilityComponent)) 1270 return false; 1271 DeviceDefinitionCapabilityComponent o = (DeviceDefinitionCapabilityComponent) other_; 1272 return true; 1273 } 1274 1275 public boolean isEmpty() { 1276 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, description); 1277 } 1278 1279 public String fhirType() { 1280 return "DeviceDefinition.capability"; 1281 1282 } 1283 1284 } 1285 1286 @Block() 1287 public static class DeviceDefinitionPropertyComponent extends BackboneElement implements IBaseBackboneElement { 1288 /** 1289 * Code that specifies the property DeviceDefinitionPropetyCode (Extensible). 1290 */ 1291 @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) 1292 @Description(shortDefinition="Code that specifies the property DeviceDefinitionPropetyCode (Extensible)", formalDefinition="Code that specifies the property DeviceDefinitionPropetyCode (Extensible)." ) 1293 protected CodeableConcept type; 1294 1295 /** 1296 * Property value as a quantity. 1297 */ 1298 @Child(name = "valueQuantity", type = {Quantity.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1299 @Description(shortDefinition="Property value as a quantity", formalDefinition="Property value as a quantity." ) 1300 protected List<Quantity> valueQuantity; 1301 1302 /** 1303 * Property value as a code, e.g., NTP4 (synced to NTP). 1304 */ 1305 @Child(name = "valueCode", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1306 @Description(shortDefinition="Property value as a code, e.g., NTP4 (synced to NTP)", formalDefinition="Property value as a code, e.g., NTP4 (synced to NTP)." ) 1307 protected List<CodeableConcept> valueCode; 1308 1309 private static final long serialVersionUID = 1512172633L; 1310 1311 /** 1312 * Constructor 1313 */ 1314 public DeviceDefinitionPropertyComponent() { 1315 super(); 1316 } 1317 1318 /** 1319 * Constructor 1320 */ 1321 public DeviceDefinitionPropertyComponent(CodeableConcept type) { 1322 super(); 1323 this.type = type; 1324 } 1325 1326 /** 1327 * @return {@link #type} (Code that specifies the property DeviceDefinitionPropetyCode (Extensible).) 1328 */ 1329 public CodeableConcept getType() { 1330 if (this.type == null) 1331 if (Configuration.errorOnAutoCreate()) 1332 throw new Error("Attempt to auto-create DeviceDefinitionPropertyComponent.type"); 1333 else if (Configuration.doAutoCreate()) 1334 this.type = new CodeableConcept(); // cc 1335 return this.type; 1336 } 1337 1338 public boolean hasType() { 1339 return this.type != null && !this.type.isEmpty(); 1340 } 1341 1342 /** 1343 * @param value {@link #type} (Code that specifies the property DeviceDefinitionPropetyCode (Extensible).) 1344 */ 1345 public DeviceDefinitionPropertyComponent setType(CodeableConcept value) { 1346 this.type = value; 1347 return this; 1348 } 1349 1350 /** 1351 * @return {@link #valueQuantity} (Property value as a quantity.) 1352 */ 1353 public List<Quantity> getValueQuantity() { 1354 if (this.valueQuantity == null) 1355 this.valueQuantity = new ArrayList<Quantity>(); 1356 return this.valueQuantity; 1357 } 1358 1359 /** 1360 * @return Returns a reference to <code>this</code> for easy method chaining 1361 */ 1362 public DeviceDefinitionPropertyComponent setValueQuantity(List<Quantity> theValueQuantity) { 1363 this.valueQuantity = theValueQuantity; 1364 return this; 1365 } 1366 1367 public boolean hasValueQuantity() { 1368 if (this.valueQuantity == null) 1369 return false; 1370 for (Quantity item : this.valueQuantity) 1371 if (!item.isEmpty()) 1372 return true; 1373 return false; 1374 } 1375 1376 public Quantity addValueQuantity() { //3 1377 Quantity t = new Quantity(); 1378 if (this.valueQuantity == null) 1379 this.valueQuantity = new ArrayList<Quantity>(); 1380 this.valueQuantity.add(t); 1381 return t; 1382 } 1383 1384 public DeviceDefinitionPropertyComponent addValueQuantity(Quantity t) { //3 1385 if (t == null) 1386 return this; 1387 if (this.valueQuantity == null) 1388 this.valueQuantity = new ArrayList<Quantity>(); 1389 this.valueQuantity.add(t); 1390 return this; 1391 } 1392 1393 /** 1394 * @return The first repetition of repeating field {@link #valueQuantity}, creating it if it does not already exist 1395 */ 1396 public Quantity getValueQuantityFirstRep() { 1397 if (getValueQuantity().isEmpty()) { 1398 addValueQuantity(); 1399 } 1400 return getValueQuantity().get(0); 1401 } 1402 1403 /** 1404 * @return {@link #valueCode} (Property value as a code, e.g., NTP4 (synced to NTP).) 1405 */ 1406 public List<CodeableConcept> getValueCode() { 1407 if (this.valueCode == null) 1408 this.valueCode = new ArrayList<CodeableConcept>(); 1409 return this.valueCode; 1410 } 1411 1412 /** 1413 * @return Returns a reference to <code>this</code> for easy method chaining 1414 */ 1415 public DeviceDefinitionPropertyComponent setValueCode(List<CodeableConcept> theValueCode) { 1416 this.valueCode = theValueCode; 1417 return this; 1418 } 1419 1420 public boolean hasValueCode() { 1421 if (this.valueCode == null) 1422 return false; 1423 for (CodeableConcept item : this.valueCode) 1424 if (!item.isEmpty()) 1425 return true; 1426 return false; 1427 } 1428 1429 public CodeableConcept addValueCode() { //3 1430 CodeableConcept t = new CodeableConcept(); 1431 if (this.valueCode == null) 1432 this.valueCode = new ArrayList<CodeableConcept>(); 1433 this.valueCode.add(t); 1434 return t; 1435 } 1436 1437 public DeviceDefinitionPropertyComponent addValueCode(CodeableConcept t) { //3 1438 if (t == null) 1439 return this; 1440 if (this.valueCode == null) 1441 this.valueCode = new ArrayList<CodeableConcept>(); 1442 this.valueCode.add(t); 1443 return this; 1444 } 1445 1446 /** 1447 * @return The first repetition of repeating field {@link #valueCode}, creating it if it does not already exist 1448 */ 1449 public CodeableConcept getValueCodeFirstRep() { 1450 if (getValueCode().isEmpty()) { 1451 addValueCode(); 1452 } 1453 return getValueCode().get(0); 1454 } 1455 1456 protected void listChildren(List<Property> children) { 1457 super.listChildren(children); 1458 children.add(new Property("type", "CodeableConcept", "Code that specifies the property DeviceDefinitionPropetyCode (Extensible).", 0, 1, type)); 1459 children.add(new Property("valueQuantity", "Quantity", "Property value as a quantity.", 0, java.lang.Integer.MAX_VALUE, valueQuantity)); 1460 children.add(new Property("valueCode", "CodeableConcept", "Property value as a code, e.g., NTP4 (synced to NTP).", 0, java.lang.Integer.MAX_VALUE, valueCode)); 1461 } 1462 1463 @Override 1464 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1465 switch (_hash) { 1466 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "Code that specifies the property DeviceDefinitionPropetyCode (Extensible).", 0, 1, type); 1467 case -2029823716: /*valueQuantity*/ return new Property("valueQuantity", "Quantity", "Property value as a quantity.", 0, java.lang.Integer.MAX_VALUE, valueQuantity); 1468 case -766209282: /*valueCode*/ return new Property("valueCode", "CodeableConcept", "Property value as a code, e.g., NTP4 (synced to NTP).", 0, java.lang.Integer.MAX_VALUE, valueCode); 1469 default: return super.getNamedProperty(_hash, _name, _checkValid); 1470 } 1471 1472 } 1473 1474 @Override 1475 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1476 switch (hash) { 1477 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 1478 case -2029823716: /*valueQuantity*/ return this.valueQuantity == null ? new Base[0] : this.valueQuantity.toArray(new Base[this.valueQuantity.size()]); // Quantity 1479 case -766209282: /*valueCode*/ return this.valueCode == null ? new Base[0] : this.valueCode.toArray(new Base[this.valueCode.size()]); // CodeableConcept 1480 default: return super.getProperty(hash, name, checkValid); 1481 } 1482 1483 } 1484 1485 @Override 1486 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1487 switch (hash) { 1488 case 3575610: // type 1489 this.type = castToCodeableConcept(value); // CodeableConcept 1490 return value; 1491 case -2029823716: // valueQuantity 1492 this.getValueQuantity().add(castToQuantity(value)); // Quantity 1493 return value; 1494 case -766209282: // valueCode 1495 this.getValueCode().add(castToCodeableConcept(value)); // CodeableConcept 1496 return value; 1497 default: return super.setProperty(hash, name, value); 1498 } 1499 1500 } 1501 1502 @Override 1503 public Base setProperty(String name, Base value) throws FHIRException { 1504 if (name.equals("type")) { 1505 this.type = castToCodeableConcept(value); // CodeableConcept 1506 } else if (name.equals("valueQuantity")) { 1507 this.getValueQuantity().add(castToQuantity(value)); 1508 } else if (name.equals("valueCode")) { 1509 this.getValueCode().add(castToCodeableConcept(value)); 1510 } else 1511 return super.setProperty(name, value); 1512 return value; 1513 } 1514 1515 @Override 1516 public Base makeProperty(int hash, String name) throws FHIRException { 1517 switch (hash) { 1518 case 3575610: return getType(); 1519 case -2029823716: return addValueQuantity(); 1520 case -766209282: return addValueCode(); 1521 default: return super.makeProperty(hash, name); 1522 } 1523 1524 } 1525 1526 @Override 1527 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1528 switch (hash) { 1529 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 1530 case -2029823716: /*valueQuantity*/ return new String[] {"Quantity"}; 1531 case -766209282: /*valueCode*/ return new String[] {"CodeableConcept"}; 1532 default: return super.getTypesForProperty(hash, name); 1533 } 1534 1535 } 1536 1537 @Override 1538 public Base addChild(String name) throws FHIRException { 1539 if (name.equals("type")) { 1540 this.type = new CodeableConcept(); 1541 return this.type; 1542 } 1543 else if (name.equals("valueQuantity")) { 1544 return addValueQuantity(); 1545 } 1546 else if (name.equals("valueCode")) { 1547 return addValueCode(); 1548 } 1549 else 1550 return super.addChild(name); 1551 } 1552 1553 public DeviceDefinitionPropertyComponent copy() { 1554 DeviceDefinitionPropertyComponent dst = new DeviceDefinitionPropertyComponent(); 1555 copyValues(dst); 1556 return dst; 1557 } 1558 1559 public void copyValues(DeviceDefinitionPropertyComponent dst) { 1560 super.copyValues(dst); 1561 dst.type = type == null ? null : type.copy(); 1562 if (valueQuantity != null) { 1563 dst.valueQuantity = new ArrayList<Quantity>(); 1564 for (Quantity i : valueQuantity) 1565 dst.valueQuantity.add(i.copy()); 1566 }; 1567 if (valueCode != null) { 1568 dst.valueCode = new ArrayList<CodeableConcept>(); 1569 for (CodeableConcept i : valueCode) 1570 dst.valueCode.add(i.copy()); 1571 }; 1572 } 1573 1574 @Override 1575 public boolean equalsDeep(Base other_) { 1576 if (!super.equalsDeep(other_)) 1577 return false; 1578 if (!(other_ instanceof DeviceDefinitionPropertyComponent)) 1579 return false; 1580 DeviceDefinitionPropertyComponent o = (DeviceDefinitionPropertyComponent) other_; 1581 return compareDeep(type, o.type, true) && compareDeep(valueQuantity, o.valueQuantity, true) && compareDeep(valueCode, o.valueCode, true) 1582 ; 1583 } 1584 1585 @Override 1586 public boolean equalsShallow(Base other_) { 1587 if (!super.equalsShallow(other_)) 1588 return false; 1589 if (!(other_ instanceof DeviceDefinitionPropertyComponent)) 1590 return false; 1591 DeviceDefinitionPropertyComponent o = (DeviceDefinitionPropertyComponent) other_; 1592 return true; 1593 } 1594 1595 public boolean isEmpty() { 1596 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, valueQuantity, valueCode 1597 ); 1598 } 1599 1600 public String fhirType() { 1601 return "DeviceDefinition.property"; 1602 1603 } 1604 1605 } 1606 1607 @Block() 1608 public static class DeviceDefinitionMaterialComponent extends BackboneElement implements IBaseBackboneElement { 1609 /** 1610 * The substance. 1611 */ 1612 @Child(name = "substance", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) 1613 @Description(shortDefinition="The substance", formalDefinition="The substance." ) 1614 protected CodeableConcept substance; 1615 1616 /** 1617 * Indicates an alternative material of the device. 1618 */ 1619 @Child(name = "alternate", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) 1620 @Description(shortDefinition="Indicates an alternative material of the device", formalDefinition="Indicates an alternative material of the device." ) 1621 protected BooleanType alternate; 1622 1623 /** 1624 * Whether the substance is a known or suspected allergen. 1625 */ 1626 @Child(name = "allergenicIndicator", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false) 1627 @Description(shortDefinition="Whether the substance is a known or suspected allergen", formalDefinition="Whether the substance is a known or suspected allergen." ) 1628 protected BooleanType allergenicIndicator; 1629 1630 private static final long serialVersionUID = 1232736508L; 1631 1632 /** 1633 * Constructor 1634 */ 1635 public DeviceDefinitionMaterialComponent() { 1636 super(); 1637 } 1638 1639 /** 1640 * Constructor 1641 */ 1642 public DeviceDefinitionMaterialComponent(CodeableConcept substance) { 1643 super(); 1644 this.substance = substance; 1645 } 1646 1647 /** 1648 * @return {@link #substance} (The substance.) 1649 */ 1650 public CodeableConcept getSubstance() { 1651 if (this.substance == null) 1652 if (Configuration.errorOnAutoCreate()) 1653 throw new Error("Attempt to auto-create DeviceDefinitionMaterialComponent.substance"); 1654 else if (Configuration.doAutoCreate()) 1655 this.substance = new CodeableConcept(); // cc 1656 return this.substance; 1657 } 1658 1659 public boolean hasSubstance() { 1660 return this.substance != null && !this.substance.isEmpty(); 1661 } 1662 1663 /** 1664 * @param value {@link #substance} (The substance.) 1665 */ 1666 public DeviceDefinitionMaterialComponent setSubstance(CodeableConcept value) { 1667 this.substance = value; 1668 return this; 1669 } 1670 1671 /** 1672 * @return {@link #alternate} (Indicates an alternative material of the device.). This is the underlying object with id, value and extensions. The accessor "getAlternate" gives direct access to the value 1673 */ 1674 public BooleanType getAlternateElement() { 1675 if (this.alternate == null) 1676 if (Configuration.errorOnAutoCreate()) 1677 throw new Error("Attempt to auto-create DeviceDefinitionMaterialComponent.alternate"); 1678 else if (Configuration.doAutoCreate()) 1679 this.alternate = new BooleanType(); // bb 1680 return this.alternate; 1681 } 1682 1683 public boolean hasAlternateElement() { 1684 return this.alternate != null && !this.alternate.isEmpty(); 1685 } 1686 1687 public boolean hasAlternate() { 1688 return this.alternate != null && !this.alternate.isEmpty(); 1689 } 1690 1691 /** 1692 * @param value {@link #alternate} (Indicates an alternative material of the device.). This is the underlying object with id, value and extensions. The accessor "getAlternate" gives direct access to the value 1693 */ 1694 public DeviceDefinitionMaterialComponent setAlternateElement(BooleanType value) { 1695 this.alternate = value; 1696 return this; 1697 } 1698 1699 /** 1700 * @return Indicates an alternative material of the device. 1701 */ 1702 public boolean getAlternate() { 1703 return this.alternate == null || this.alternate.isEmpty() ? false : this.alternate.getValue(); 1704 } 1705 1706 /** 1707 * @param value Indicates an alternative material of the device. 1708 */ 1709 public DeviceDefinitionMaterialComponent setAlternate(boolean value) { 1710 if (this.alternate == null) 1711 this.alternate = new BooleanType(); 1712 this.alternate.setValue(value); 1713 return this; 1714 } 1715 1716 /** 1717 * @return {@link #allergenicIndicator} (Whether the substance is a known or suspected allergen.). This is the underlying object with id, value and extensions. The accessor "getAllergenicIndicator" gives direct access to the value 1718 */ 1719 public BooleanType getAllergenicIndicatorElement() { 1720 if (this.allergenicIndicator == null) 1721 if (Configuration.errorOnAutoCreate()) 1722 throw new Error("Attempt to auto-create DeviceDefinitionMaterialComponent.allergenicIndicator"); 1723 else if (Configuration.doAutoCreate()) 1724 this.allergenicIndicator = new BooleanType(); // bb 1725 return this.allergenicIndicator; 1726 } 1727 1728 public boolean hasAllergenicIndicatorElement() { 1729 return this.allergenicIndicator != null && !this.allergenicIndicator.isEmpty(); 1730 } 1731 1732 public boolean hasAllergenicIndicator() { 1733 return this.allergenicIndicator != null && !this.allergenicIndicator.isEmpty(); 1734 } 1735 1736 /** 1737 * @param value {@link #allergenicIndicator} (Whether the substance is a known or suspected allergen.). This is the underlying object with id, value and extensions. The accessor "getAllergenicIndicator" gives direct access to the value 1738 */ 1739 public DeviceDefinitionMaterialComponent setAllergenicIndicatorElement(BooleanType value) { 1740 this.allergenicIndicator = value; 1741 return this; 1742 } 1743 1744 /** 1745 * @return Whether the substance is a known or suspected allergen. 1746 */ 1747 public boolean getAllergenicIndicator() { 1748 return this.allergenicIndicator == null || this.allergenicIndicator.isEmpty() ? false : this.allergenicIndicator.getValue(); 1749 } 1750 1751 /** 1752 * @param value Whether the substance is a known or suspected allergen. 1753 */ 1754 public DeviceDefinitionMaterialComponent setAllergenicIndicator(boolean value) { 1755 if (this.allergenicIndicator == null) 1756 this.allergenicIndicator = new BooleanType(); 1757 this.allergenicIndicator.setValue(value); 1758 return this; 1759 } 1760 1761 protected void listChildren(List<Property> children) { 1762 super.listChildren(children); 1763 children.add(new Property("substance", "CodeableConcept", "The substance.", 0, 1, substance)); 1764 children.add(new Property("alternate", "boolean", "Indicates an alternative material of the device.", 0, 1, alternate)); 1765 children.add(new Property("allergenicIndicator", "boolean", "Whether the substance is a known or suspected allergen.", 0, 1, allergenicIndicator)); 1766 } 1767 1768 @Override 1769 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1770 switch (_hash) { 1771 case 530040176: /*substance*/ return new Property("substance", "CodeableConcept", "The substance.", 0, 1, substance); 1772 case -1408024454: /*alternate*/ return new Property("alternate", "boolean", "Indicates an alternative material of the device.", 0, 1, alternate); 1773 case 75406931: /*allergenicIndicator*/ return new Property("allergenicIndicator", "boolean", "Whether the substance is a known or suspected allergen.", 0, 1, allergenicIndicator); 1774 default: return super.getNamedProperty(_hash, _name, _checkValid); 1775 } 1776 1777 } 1778 1779 @Override 1780 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1781 switch (hash) { 1782 case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // CodeableConcept 1783 case -1408024454: /*alternate*/ return this.alternate == null ? new Base[0] : new Base[] {this.alternate}; // BooleanType 1784 case 75406931: /*allergenicIndicator*/ return this.allergenicIndicator == null ? new Base[0] : new Base[] {this.allergenicIndicator}; // BooleanType 1785 default: return super.getProperty(hash, name, checkValid); 1786 } 1787 1788 } 1789 1790 @Override 1791 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1792 switch (hash) { 1793 case 530040176: // substance 1794 this.substance = castToCodeableConcept(value); // CodeableConcept 1795 return value; 1796 case -1408024454: // alternate 1797 this.alternate = castToBoolean(value); // BooleanType 1798 return value; 1799 case 75406931: // allergenicIndicator 1800 this.allergenicIndicator = castToBoolean(value); // BooleanType 1801 return value; 1802 default: return super.setProperty(hash, name, value); 1803 } 1804 1805 } 1806 1807 @Override 1808 public Base setProperty(String name, Base value) throws FHIRException { 1809 if (name.equals("substance")) { 1810 this.substance = castToCodeableConcept(value); // CodeableConcept 1811 } else if (name.equals("alternate")) { 1812 this.alternate = castToBoolean(value); // BooleanType 1813 } else if (name.equals("allergenicIndicator")) { 1814 this.allergenicIndicator = castToBoolean(value); // BooleanType 1815 } else 1816 return super.setProperty(name, value); 1817 return value; 1818 } 1819 1820 @Override 1821 public Base makeProperty(int hash, String name) throws FHIRException { 1822 switch (hash) { 1823 case 530040176: return getSubstance(); 1824 case -1408024454: return getAlternateElement(); 1825 case 75406931: return getAllergenicIndicatorElement(); 1826 default: return super.makeProperty(hash, name); 1827 } 1828 1829 } 1830 1831 @Override 1832 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1833 switch (hash) { 1834 case 530040176: /*substance*/ return new String[] {"CodeableConcept"}; 1835 case -1408024454: /*alternate*/ return new String[] {"boolean"}; 1836 case 75406931: /*allergenicIndicator*/ return new String[] {"boolean"}; 1837 default: return super.getTypesForProperty(hash, name); 1838 } 1839 1840 } 1841 1842 @Override 1843 public Base addChild(String name) throws FHIRException { 1844 if (name.equals("substance")) { 1845 this.substance = new CodeableConcept(); 1846 return this.substance; 1847 } 1848 else if (name.equals("alternate")) { 1849 throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.alternate"); 1850 } 1851 else if (name.equals("allergenicIndicator")) { 1852 throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.allergenicIndicator"); 1853 } 1854 else 1855 return super.addChild(name); 1856 } 1857 1858 public DeviceDefinitionMaterialComponent copy() { 1859 DeviceDefinitionMaterialComponent dst = new DeviceDefinitionMaterialComponent(); 1860 copyValues(dst); 1861 return dst; 1862 } 1863 1864 public void copyValues(DeviceDefinitionMaterialComponent dst) { 1865 super.copyValues(dst); 1866 dst.substance = substance == null ? null : substance.copy(); 1867 dst.alternate = alternate == null ? null : alternate.copy(); 1868 dst.allergenicIndicator = allergenicIndicator == null ? null : allergenicIndicator.copy(); 1869 } 1870 1871 @Override 1872 public boolean equalsDeep(Base other_) { 1873 if (!super.equalsDeep(other_)) 1874 return false; 1875 if (!(other_ instanceof DeviceDefinitionMaterialComponent)) 1876 return false; 1877 DeviceDefinitionMaterialComponent o = (DeviceDefinitionMaterialComponent) other_; 1878 return compareDeep(substance, o.substance, true) && compareDeep(alternate, o.alternate, true) && compareDeep(allergenicIndicator, o.allergenicIndicator, true) 1879 ; 1880 } 1881 1882 @Override 1883 public boolean equalsShallow(Base other_) { 1884 if (!super.equalsShallow(other_)) 1885 return false; 1886 if (!(other_ instanceof DeviceDefinitionMaterialComponent)) 1887 return false; 1888 DeviceDefinitionMaterialComponent o = (DeviceDefinitionMaterialComponent) other_; 1889 return compareValues(alternate, o.alternate, true) && compareValues(allergenicIndicator, o.allergenicIndicator, true) 1890 ; 1891 } 1892 1893 public boolean isEmpty() { 1894 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(substance, alternate, allergenicIndicator 1895 ); 1896 } 1897 1898 public String fhirType() { 1899 return "DeviceDefinition.material"; 1900 1901 } 1902 1903 } 1904 1905 /** 1906 * Unique instance identifiers assigned to a device by the software, manufacturers, other organizations or owners. For example: handle ID. 1907 */ 1908 @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1909 @Description(shortDefinition="Instance identifier", formalDefinition="Unique instance identifiers assigned to a device by the software, manufacturers, other organizations or owners. For example: handle ID." ) 1910 protected List<Identifier> identifier; 1911 1912 /** 1913 * Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold. 1914 */ 1915 @Child(name = "udiDeviceIdentifier", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1916 @Description(shortDefinition="Unique Device Identifier (UDI) Barcode string", formalDefinition="Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold." ) 1917 protected List<DeviceDefinitionUdiDeviceIdentifierComponent> udiDeviceIdentifier; 1918 1919 /** 1920 * A name of the manufacturer. 1921 */ 1922 @Child(name = "manufacturer", type = {StringType.class, Organization.class}, order=2, min=0, max=1, modifier=false, summary=false) 1923 @Description(shortDefinition="Name of device manufacturer", formalDefinition="A name of the manufacturer." ) 1924 protected Type manufacturer; 1925 1926 /** 1927 * A name given to the device to identify it. 1928 */ 1929 @Child(name = "deviceName", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1930 @Description(shortDefinition="A name given to the device to identify it", formalDefinition="A name given to the device to identify it." ) 1931 protected List<DeviceDefinitionDeviceNameComponent> deviceName; 1932 1933 /** 1934 * The model number for the device. 1935 */ 1936 @Child(name = "modelNumber", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) 1937 @Description(shortDefinition="The model number for the device", formalDefinition="The model number for the device." ) 1938 protected StringType modelNumber; 1939 1940 /** 1941 * What kind of device or device system this is. 1942 */ 1943 @Child(name = "type", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) 1944 @Description(shortDefinition="What kind of device or device system this is", formalDefinition="What kind of device or device system this is." ) 1945 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-kind") 1946 protected CodeableConcept type; 1947 1948 /** 1949 * The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication. 1950 */ 1951 @Child(name = "specialization", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1952 @Description(shortDefinition="The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication", formalDefinition="The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication." ) 1953 protected List<DeviceDefinitionSpecializationComponent> specialization; 1954 1955 /** 1956 * The available versions of the device, e.g., software versions. 1957 */ 1958 @Child(name = "version", type = {StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1959 @Description(shortDefinition="Available versions", formalDefinition="The available versions of the device, e.g., software versions." ) 1960 protected List<StringType> version; 1961 1962 /** 1963 * Safety characteristics of the device. 1964 */ 1965 @Child(name = "safety", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1966 @Description(shortDefinition="Safety characteristics of the device", formalDefinition="Safety characteristics of the device." ) 1967 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-safety") 1968 protected List<CodeableConcept> safety; 1969 1970 /** 1971 * Shelf Life and storage information. 1972 */ 1973 @Child(name = "shelfLifeStorage", type = {ProductShelfLife.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1974 @Description(shortDefinition="Shelf Life and storage information", formalDefinition="Shelf Life and storage information." ) 1975 protected List<ProductShelfLife> shelfLifeStorage; 1976 1977 /** 1978 * Dimensions, color etc. 1979 */ 1980 @Child(name = "physicalCharacteristics", type = {ProdCharacteristic.class}, order=10, min=0, max=1, modifier=false, summary=false) 1981 @Description(shortDefinition="Dimensions, color etc.", formalDefinition="Dimensions, color etc." ) 1982 protected ProdCharacteristic physicalCharacteristics; 1983 1984 /** 1985 * Language code for the human-readable text strings produced by the device (all supported). 1986 */ 1987 @Child(name = "languageCode", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1988 @Description(shortDefinition="Language code for the human-readable text strings produced by the device (all supported)", formalDefinition="Language code for the human-readable text strings produced by the device (all supported)." ) 1989 protected List<CodeableConcept> languageCode; 1990 1991 /** 1992 * Device capabilities. 1993 */ 1994 @Child(name = "capability", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 1995 @Description(shortDefinition="Device capabilities", formalDefinition="Device capabilities." ) 1996 protected List<DeviceDefinitionCapabilityComponent> capability; 1997 1998 /** 1999 * The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties. 2000 */ 2001 @Child(name = "property", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 2002 @Description(shortDefinition="The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties", formalDefinition="The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties." ) 2003 protected List<DeviceDefinitionPropertyComponent> property; 2004 2005 /** 2006 * An organization that is responsible for the provision and ongoing maintenance of the device. 2007 */ 2008 @Child(name = "owner", type = {Organization.class}, order=14, min=0, max=1, modifier=false, summary=false) 2009 @Description(shortDefinition="Organization responsible for device", formalDefinition="An organization that is responsible for the provision and ongoing maintenance of the device." ) 2010 protected Reference owner; 2011 2012 /** 2013 * The actual object that is the target of the reference (An organization that is responsible for the provision and ongoing maintenance of the device.) 2014 */ 2015 protected Organization ownerTarget; 2016 2017 /** 2018 * Contact details for an organization or a particular human that is responsible for the device. 2019 */ 2020 @Child(name = "contact", type = {ContactPoint.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 2021 @Description(shortDefinition="Details for human/organization for support", formalDefinition="Contact details for an organization or a particular human that is responsible for the device." ) 2022 protected List<ContactPoint> contact; 2023 2024 /** 2025 * A network address on which the device may be contacted directly. 2026 */ 2027 @Child(name = "url", type = {UriType.class}, order=16, min=0, max=1, modifier=false, summary=false) 2028 @Description(shortDefinition="Network address to contact device", formalDefinition="A network address on which the device may be contacted directly." ) 2029 protected UriType url; 2030 2031 /** 2032 * Access to on-line information about the device. 2033 */ 2034 @Child(name = "onlineInformation", type = {UriType.class}, order=17, min=0, max=1, modifier=false, summary=false) 2035 @Description(shortDefinition="Access to on-line information", formalDefinition="Access to on-line information about the device." ) 2036 protected UriType onlineInformation; 2037 2038 /** 2039 * Descriptive information, usage information or implantation information that is not captured in an existing element. 2040 */ 2041 @Child(name = "note", type = {Annotation.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 2042 @Description(shortDefinition="Device notes and comments", formalDefinition="Descriptive information, usage information or implantation information that is not captured in an existing element." ) 2043 protected List<Annotation> note; 2044 2045 /** 2046 * The quantity of the device present in the packaging (e.g. the number of devices present in a pack, or the number of devices in the same package of the medicinal product). 2047 */ 2048 @Child(name = "quantity", type = {Quantity.class}, order=19, min=0, max=1, modifier=false, summary=false) 2049 @Description(shortDefinition="The quantity of the device present in the packaging (e.g. the number of devices present in a pack, or the number of devices in the same package of the medicinal product)", formalDefinition="The quantity of the device present in the packaging (e.g. the number of devices present in a pack, or the number of devices in the same package of the medicinal product)." ) 2050 protected Quantity quantity; 2051 2052 /** 2053 * The parent device it can be part of. 2054 */ 2055 @Child(name = "parentDevice", type = {DeviceDefinition.class}, order=20, min=0, max=1, modifier=false, summary=true) 2056 @Description(shortDefinition="The parent device it can be part of", formalDefinition="The parent device it can be part of." ) 2057 protected Reference parentDevice; 2058 2059 /** 2060 * The actual object that is the target of the reference (The parent device it can be part of.) 2061 */ 2062 protected DeviceDefinition parentDeviceTarget; 2063 2064 /** 2065 * A substance used to create the material(s) of which the device is made. 2066 */ 2067 @Child(name = "material", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) 2068 @Description(shortDefinition="A substance used to create the material(s) of which the device is made", formalDefinition="A substance used to create the material(s) of which the device is made." ) 2069 protected List<DeviceDefinitionMaterialComponent> material; 2070 2071 private static final long serialVersionUID = -2041532433L; 2072 2073 /** 2074 * Constructor 2075 */ 2076 public DeviceDefinition() { 2077 super(); 2078 } 2079 2080 /** 2081 * @return {@link #identifier} (Unique instance identifiers assigned to a device by the software, manufacturers, other organizations or owners. For example: handle ID.) 2082 */ 2083 public List<Identifier> getIdentifier() { 2084 if (this.identifier == null) 2085 this.identifier = new ArrayList<Identifier>(); 2086 return this.identifier; 2087 } 2088 2089 /** 2090 * @return Returns a reference to <code>this</code> for easy method chaining 2091 */ 2092 public DeviceDefinition setIdentifier(List<Identifier> theIdentifier) { 2093 this.identifier = theIdentifier; 2094 return this; 2095 } 2096 2097 public boolean hasIdentifier() { 2098 if (this.identifier == null) 2099 return false; 2100 for (Identifier item : this.identifier) 2101 if (!item.isEmpty()) 2102 return true; 2103 return false; 2104 } 2105 2106 public Identifier addIdentifier() { //3 2107 Identifier t = new Identifier(); 2108 if (this.identifier == null) 2109 this.identifier = new ArrayList<Identifier>(); 2110 this.identifier.add(t); 2111 return t; 2112 } 2113 2114 public DeviceDefinition addIdentifier(Identifier t) { //3 2115 if (t == null) 2116 return this; 2117 if (this.identifier == null) 2118 this.identifier = new ArrayList<Identifier>(); 2119 this.identifier.add(t); 2120 return this; 2121 } 2122 2123 /** 2124 * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist 2125 */ 2126 public Identifier getIdentifierFirstRep() { 2127 if (getIdentifier().isEmpty()) { 2128 addIdentifier(); 2129 } 2130 return getIdentifier().get(0); 2131 } 2132 2133 /** 2134 * @return {@link #udiDeviceIdentifier} (Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold.) 2135 */ 2136 public List<DeviceDefinitionUdiDeviceIdentifierComponent> getUdiDeviceIdentifier() { 2137 if (this.udiDeviceIdentifier == null) 2138 this.udiDeviceIdentifier = new ArrayList<DeviceDefinitionUdiDeviceIdentifierComponent>(); 2139 return this.udiDeviceIdentifier; 2140 } 2141 2142 /** 2143 * @return Returns a reference to <code>this</code> for easy method chaining 2144 */ 2145 public DeviceDefinition setUdiDeviceIdentifier(List<DeviceDefinitionUdiDeviceIdentifierComponent> theUdiDeviceIdentifier) { 2146 this.udiDeviceIdentifier = theUdiDeviceIdentifier; 2147 return this; 2148 } 2149 2150 public boolean hasUdiDeviceIdentifier() { 2151 if (this.udiDeviceIdentifier == null) 2152 return false; 2153 for (DeviceDefinitionUdiDeviceIdentifierComponent item : this.udiDeviceIdentifier) 2154 if (!item.isEmpty()) 2155 return true; 2156 return false; 2157 } 2158 2159 public DeviceDefinitionUdiDeviceIdentifierComponent addUdiDeviceIdentifier() { //3 2160 DeviceDefinitionUdiDeviceIdentifierComponent t = new DeviceDefinitionUdiDeviceIdentifierComponent(); 2161 if (this.udiDeviceIdentifier == null) 2162 this.udiDeviceIdentifier = new ArrayList<DeviceDefinitionUdiDeviceIdentifierComponent>(); 2163 this.udiDeviceIdentifier.add(t); 2164 return t; 2165 } 2166 2167 public DeviceDefinition addUdiDeviceIdentifier(DeviceDefinitionUdiDeviceIdentifierComponent t) { //3 2168 if (t == null) 2169 return this; 2170 if (this.udiDeviceIdentifier == null) 2171 this.udiDeviceIdentifier = new ArrayList<DeviceDefinitionUdiDeviceIdentifierComponent>(); 2172 this.udiDeviceIdentifier.add(t); 2173 return this; 2174 } 2175 2176 /** 2177 * @return The first repetition of repeating field {@link #udiDeviceIdentifier}, creating it if it does not already exist 2178 */ 2179 public DeviceDefinitionUdiDeviceIdentifierComponent getUdiDeviceIdentifierFirstRep() { 2180 if (getUdiDeviceIdentifier().isEmpty()) { 2181 addUdiDeviceIdentifier(); 2182 } 2183 return getUdiDeviceIdentifier().get(0); 2184 } 2185 2186 /** 2187 * @return {@link #manufacturer} (A name of the manufacturer.) 2188 */ 2189 public Type getManufacturer() { 2190 return this.manufacturer; 2191 } 2192 2193 /** 2194 * @return {@link #manufacturer} (A name of the manufacturer.) 2195 */ 2196 public StringType getManufacturerStringType() throws FHIRException { 2197 if (this.manufacturer == null) 2198 this.manufacturer = new StringType(); 2199 if (!(this.manufacturer instanceof StringType)) 2200 throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.manufacturer.getClass().getName()+" was encountered"); 2201 return (StringType) this.manufacturer; 2202 } 2203 2204 public boolean hasManufacturerStringType() { 2205 return this != null && this.manufacturer instanceof StringType; 2206 } 2207 2208 /** 2209 * @return {@link #manufacturer} (A name of the manufacturer.) 2210 */ 2211 public Reference getManufacturerReference() throws FHIRException { 2212 if (this.manufacturer == null) 2213 this.manufacturer = new Reference(); 2214 if (!(this.manufacturer instanceof Reference)) 2215 throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.manufacturer.getClass().getName()+" was encountered"); 2216 return (Reference) this.manufacturer; 2217 } 2218 2219 public boolean hasManufacturerReference() { 2220 return this != null && this.manufacturer instanceof Reference; 2221 } 2222 2223 public boolean hasManufacturer() { 2224 return this.manufacturer != null && !this.manufacturer.isEmpty(); 2225 } 2226 2227 /** 2228 * @param value {@link #manufacturer} (A name of the manufacturer.) 2229 */ 2230 public DeviceDefinition setManufacturer(Type value) { 2231 if (value != null && !(value instanceof StringType || value instanceof Reference)) 2232 throw new Error("Not the right type for DeviceDefinition.manufacturer[x]: "+value.fhirType()); 2233 this.manufacturer = value; 2234 return this; 2235 } 2236 2237 /** 2238 * @return {@link #deviceName} (A name given to the device to identify it.) 2239 */ 2240 public List<DeviceDefinitionDeviceNameComponent> getDeviceName() { 2241 if (this.deviceName == null) 2242 this.deviceName = new ArrayList<DeviceDefinitionDeviceNameComponent>(); 2243 return this.deviceName; 2244 } 2245 2246 /** 2247 * @return Returns a reference to <code>this</code> for easy method chaining 2248 */ 2249 public DeviceDefinition setDeviceName(List<DeviceDefinitionDeviceNameComponent> theDeviceName) { 2250 this.deviceName = theDeviceName; 2251 return this; 2252 } 2253 2254 public boolean hasDeviceName() { 2255 if (this.deviceName == null) 2256 return false; 2257 for (DeviceDefinitionDeviceNameComponent item : this.deviceName) 2258 if (!item.isEmpty()) 2259 return true; 2260 return false; 2261 } 2262 2263 public DeviceDefinitionDeviceNameComponent addDeviceName() { //3 2264 DeviceDefinitionDeviceNameComponent t = new DeviceDefinitionDeviceNameComponent(); 2265 if (this.deviceName == null) 2266 this.deviceName = new ArrayList<DeviceDefinitionDeviceNameComponent>(); 2267 this.deviceName.add(t); 2268 return t; 2269 } 2270 2271 public DeviceDefinition addDeviceName(DeviceDefinitionDeviceNameComponent t) { //3 2272 if (t == null) 2273 return this; 2274 if (this.deviceName == null) 2275 this.deviceName = new ArrayList<DeviceDefinitionDeviceNameComponent>(); 2276 this.deviceName.add(t); 2277 return this; 2278 } 2279 2280 /** 2281 * @return The first repetition of repeating field {@link #deviceName}, creating it if it does not already exist 2282 */ 2283 public DeviceDefinitionDeviceNameComponent getDeviceNameFirstRep() { 2284 if (getDeviceName().isEmpty()) { 2285 addDeviceName(); 2286 } 2287 return getDeviceName().get(0); 2288 } 2289 2290 /** 2291 * @return {@link #modelNumber} (The model number for the device.). This is the underlying object with id, value and extensions. The accessor "getModelNumber" gives direct access to the value 2292 */ 2293 public StringType getModelNumberElement() { 2294 if (this.modelNumber == null) 2295 if (Configuration.errorOnAutoCreate()) 2296 throw new Error("Attempt to auto-create DeviceDefinition.modelNumber"); 2297 else if (Configuration.doAutoCreate()) 2298 this.modelNumber = new StringType(); // bb 2299 return this.modelNumber; 2300 } 2301 2302 public boolean hasModelNumberElement() { 2303 return this.modelNumber != null && !this.modelNumber.isEmpty(); 2304 } 2305 2306 public boolean hasModelNumber() { 2307 return this.modelNumber != null && !this.modelNumber.isEmpty(); 2308 } 2309 2310 /** 2311 * @param value {@link #modelNumber} (The model number for the device.). This is the underlying object with id, value and extensions. The accessor "getModelNumber" gives direct access to the value 2312 */ 2313 public DeviceDefinition setModelNumberElement(StringType value) { 2314 this.modelNumber = value; 2315 return this; 2316 } 2317 2318 /** 2319 * @return The model number for the device. 2320 */ 2321 public String getModelNumber() { 2322 return this.modelNumber == null ? null : this.modelNumber.getValue(); 2323 } 2324 2325 /** 2326 * @param value The model number for the device. 2327 */ 2328 public DeviceDefinition setModelNumber(String value) { 2329 if (Utilities.noString(value)) 2330 this.modelNumber = null; 2331 else { 2332 if (this.modelNumber == null) 2333 this.modelNumber = new StringType(); 2334 this.modelNumber.setValue(value); 2335 } 2336 return this; 2337 } 2338 2339 /** 2340 * @return {@link #type} (What kind of device or device system this is.) 2341 */ 2342 public CodeableConcept getType() { 2343 if (this.type == null) 2344 if (Configuration.errorOnAutoCreate()) 2345 throw new Error("Attempt to auto-create DeviceDefinition.type"); 2346 else if (Configuration.doAutoCreate()) 2347 this.type = new CodeableConcept(); // cc 2348 return this.type; 2349 } 2350 2351 public boolean hasType() { 2352 return this.type != null && !this.type.isEmpty(); 2353 } 2354 2355 /** 2356 * @param value {@link #type} (What kind of device or device system this is.) 2357 */ 2358 public DeviceDefinition setType(CodeableConcept value) { 2359 this.type = value; 2360 return this; 2361 } 2362 2363 /** 2364 * @return {@link #specialization} (The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication.) 2365 */ 2366 public List<DeviceDefinitionSpecializationComponent> getSpecialization() { 2367 if (this.specialization == null) 2368 this.specialization = new ArrayList<DeviceDefinitionSpecializationComponent>(); 2369 return this.specialization; 2370 } 2371 2372 /** 2373 * @return Returns a reference to <code>this</code> for easy method chaining 2374 */ 2375 public DeviceDefinition setSpecialization(List<DeviceDefinitionSpecializationComponent> theSpecialization) { 2376 this.specialization = theSpecialization; 2377 return this; 2378 } 2379 2380 public boolean hasSpecialization() { 2381 if (this.specialization == null) 2382 return false; 2383 for (DeviceDefinitionSpecializationComponent item : this.specialization) 2384 if (!item.isEmpty()) 2385 return true; 2386 return false; 2387 } 2388 2389 public DeviceDefinitionSpecializationComponent addSpecialization() { //3 2390 DeviceDefinitionSpecializationComponent t = new DeviceDefinitionSpecializationComponent(); 2391 if (this.specialization == null) 2392 this.specialization = new ArrayList<DeviceDefinitionSpecializationComponent>(); 2393 this.specialization.add(t); 2394 return t; 2395 } 2396 2397 public DeviceDefinition addSpecialization(DeviceDefinitionSpecializationComponent t) { //3 2398 if (t == null) 2399 return this; 2400 if (this.specialization == null) 2401 this.specialization = new ArrayList<DeviceDefinitionSpecializationComponent>(); 2402 this.specialization.add(t); 2403 return this; 2404 } 2405 2406 /** 2407 * @return The first repetition of repeating field {@link #specialization}, creating it if it does not already exist 2408 */ 2409 public DeviceDefinitionSpecializationComponent getSpecializationFirstRep() { 2410 if (getSpecialization().isEmpty()) { 2411 addSpecialization(); 2412 } 2413 return getSpecialization().get(0); 2414 } 2415 2416 /** 2417 * @return {@link #version} (The available versions of the device, e.g., software versions.) 2418 */ 2419 public List<StringType> getVersion() { 2420 if (this.version == null) 2421 this.version = new ArrayList<StringType>(); 2422 return this.version; 2423 } 2424 2425 /** 2426 * @return Returns a reference to <code>this</code> for easy method chaining 2427 */ 2428 public DeviceDefinition setVersion(List<StringType> theVersion) { 2429 this.version = theVersion; 2430 return this; 2431 } 2432 2433 public boolean hasVersion() { 2434 if (this.version == null) 2435 return false; 2436 for (StringType item : this.version) 2437 if (!item.isEmpty()) 2438 return true; 2439 return false; 2440 } 2441 2442 /** 2443 * @return {@link #version} (The available versions of the device, e.g., software versions.) 2444 */ 2445 public StringType addVersionElement() {//2 2446 StringType t = new StringType(); 2447 if (this.version == null) 2448 this.version = new ArrayList<StringType>(); 2449 this.version.add(t); 2450 return t; 2451 } 2452 2453 /** 2454 * @param value {@link #version} (The available versions of the device, e.g., software versions.) 2455 */ 2456 public DeviceDefinition addVersion(String value) { //1 2457 StringType t = new StringType(); 2458 t.setValue(value); 2459 if (this.version == null) 2460 this.version = new ArrayList<StringType>(); 2461 this.version.add(t); 2462 return this; 2463 } 2464 2465 /** 2466 * @param value {@link #version} (The available versions of the device, e.g., software versions.) 2467 */ 2468 public boolean hasVersion(String value) { 2469 if (this.version == null) 2470 return false; 2471 for (StringType v : this.version) 2472 if (v.getValue().equals(value)) // string 2473 return true; 2474 return false; 2475 } 2476 2477 /** 2478 * @return {@link #safety} (Safety characteristics of the device.) 2479 */ 2480 public List<CodeableConcept> getSafety() { 2481 if (this.safety == null) 2482 this.safety = new ArrayList<CodeableConcept>(); 2483 return this.safety; 2484 } 2485 2486 /** 2487 * @return Returns a reference to <code>this</code> for easy method chaining 2488 */ 2489 public DeviceDefinition setSafety(List<CodeableConcept> theSafety) { 2490 this.safety = theSafety; 2491 return this; 2492 } 2493 2494 public boolean hasSafety() { 2495 if (this.safety == null) 2496 return false; 2497 for (CodeableConcept item : this.safety) 2498 if (!item.isEmpty()) 2499 return true; 2500 return false; 2501 } 2502 2503 public CodeableConcept addSafety() { //3 2504 CodeableConcept t = new CodeableConcept(); 2505 if (this.safety == null) 2506 this.safety = new ArrayList<CodeableConcept>(); 2507 this.safety.add(t); 2508 return t; 2509 } 2510 2511 public DeviceDefinition addSafety(CodeableConcept t) { //3 2512 if (t == null) 2513 return this; 2514 if (this.safety == null) 2515 this.safety = new ArrayList<CodeableConcept>(); 2516 this.safety.add(t); 2517 return this; 2518 } 2519 2520 /** 2521 * @return The first repetition of repeating field {@link #safety}, creating it if it does not already exist 2522 */ 2523 public CodeableConcept getSafetyFirstRep() { 2524 if (getSafety().isEmpty()) { 2525 addSafety(); 2526 } 2527 return getSafety().get(0); 2528 } 2529 2530 /** 2531 * @return {@link #shelfLifeStorage} (Shelf Life and storage information.) 2532 */ 2533 public List<ProductShelfLife> getShelfLifeStorage() { 2534 if (this.shelfLifeStorage == null) 2535 this.shelfLifeStorage = new ArrayList<ProductShelfLife>(); 2536 return this.shelfLifeStorage; 2537 } 2538 2539 /** 2540 * @return Returns a reference to <code>this</code> for easy method chaining 2541 */ 2542 public DeviceDefinition setShelfLifeStorage(List<ProductShelfLife> theShelfLifeStorage) { 2543 this.shelfLifeStorage = theShelfLifeStorage; 2544 return this; 2545 } 2546 2547 public boolean hasShelfLifeStorage() { 2548 if (this.shelfLifeStorage == null) 2549 return false; 2550 for (ProductShelfLife item : this.shelfLifeStorage) 2551 if (!item.isEmpty()) 2552 return true; 2553 return false; 2554 } 2555 2556 public ProductShelfLife addShelfLifeStorage() { //3 2557 ProductShelfLife t = new ProductShelfLife(); 2558 if (this.shelfLifeStorage == null) 2559 this.shelfLifeStorage = new ArrayList<ProductShelfLife>(); 2560 this.shelfLifeStorage.add(t); 2561 return t; 2562 } 2563 2564 public DeviceDefinition addShelfLifeStorage(ProductShelfLife t) { //3 2565 if (t == null) 2566 return this; 2567 if (this.shelfLifeStorage == null) 2568 this.shelfLifeStorage = new ArrayList<ProductShelfLife>(); 2569 this.shelfLifeStorage.add(t); 2570 return this; 2571 } 2572 2573 /** 2574 * @return The first repetition of repeating field {@link #shelfLifeStorage}, creating it if it does not already exist 2575 */ 2576 public ProductShelfLife getShelfLifeStorageFirstRep() { 2577 if (getShelfLifeStorage().isEmpty()) { 2578 addShelfLifeStorage(); 2579 } 2580 return getShelfLifeStorage().get(0); 2581 } 2582 2583 /** 2584 * @return {@link #physicalCharacteristics} (Dimensions, color etc.) 2585 */ 2586 public ProdCharacteristic getPhysicalCharacteristics() { 2587 if (this.physicalCharacteristics == null) 2588 if (Configuration.errorOnAutoCreate()) 2589 throw new Error("Attempt to auto-create DeviceDefinition.physicalCharacteristics"); 2590 else if (Configuration.doAutoCreate()) 2591 this.physicalCharacteristics = new ProdCharacteristic(); // cc 2592 return this.physicalCharacteristics; 2593 } 2594 2595 public boolean hasPhysicalCharacteristics() { 2596 return this.physicalCharacteristics != null && !this.physicalCharacteristics.isEmpty(); 2597 } 2598 2599 /** 2600 * @param value {@link #physicalCharacteristics} (Dimensions, color etc.) 2601 */ 2602 public DeviceDefinition setPhysicalCharacteristics(ProdCharacteristic value) { 2603 this.physicalCharacteristics = value; 2604 return this; 2605 } 2606 2607 /** 2608 * @return {@link #languageCode} (Language code for the human-readable text strings produced by the device (all supported).) 2609 */ 2610 public List<CodeableConcept> getLanguageCode() { 2611 if (this.languageCode == null) 2612 this.languageCode = new ArrayList<CodeableConcept>(); 2613 return this.languageCode; 2614 } 2615 2616 /** 2617 * @return Returns a reference to <code>this</code> for easy method chaining 2618 */ 2619 public DeviceDefinition setLanguageCode(List<CodeableConcept> theLanguageCode) { 2620 this.languageCode = theLanguageCode; 2621 return this; 2622 } 2623 2624 public boolean hasLanguageCode() { 2625 if (this.languageCode == null) 2626 return false; 2627 for (CodeableConcept item : this.languageCode) 2628 if (!item.isEmpty()) 2629 return true; 2630 return false; 2631 } 2632 2633 public CodeableConcept addLanguageCode() { //3 2634 CodeableConcept t = new CodeableConcept(); 2635 if (this.languageCode == null) 2636 this.languageCode = new ArrayList<CodeableConcept>(); 2637 this.languageCode.add(t); 2638 return t; 2639 } 2640 2641 public DeviceDefinition addLanguageCode(CodeableConcept t) { //3 2642 if (t == null) 2643 return this; 2644 if (this.languageCode == null) 2645 this.languageCode = new ArrayList<CodeableConcept>(); 2646 this.languageCode.add(t); 2647 return this; 2648 } 2649 2650 /** 2651 * @return The first repetition of repeating field {@link #languageCode}, creating it if it does not already exist 2652 */ 2653 public CodeableConcept getLanguageCodeFirstRep() { 2654 if (getLanguageCode().isEmpty()) { 2655 addLanguageCode(); 2656 } 2657 return getLanguageCode().get(0); 2658 } 2659 2660 /** 2661 * @return {@link #capability} (Device capabilities.) 2662 */ 2663 public List<DeviceDefinitionCapabilityComponent> getCapability() { 2664 if (this.capability == null) 2665 this.capability = new ArrayList<DeviceDefinitionCapabilityComponent>(); 2666 return this.capability; 2667 } 2668 2669 /** 2670 * @return Returns a reference to <code>this</code> for easy method chaining 2671 */ 2672 public DeviceDefinition setCapability(List<DeviceDefinitionCapabilityComponent> theCapability) { 2673 this.capability = theCapability; 2674 return this; 2675 } 2676 2677 public boolean hasCapability() { 2678 if (this.capability == null) 2679 return false; 2680 for (DeviceDefinitionCapabilityComponent item : this.capability) 2681 if (!item.isEmpty()) 2682 return true; 2683 return false; 2684 } 2685 2686 public DeviceDefinitionCapabilityComponent addCapability() { //3 2687 DeviceDefinitionCapabilityComponent t = new DeviceDefinitionCapabilityComponent(); 2688 if (this.capability == null) 2689 this.capability = new ArrayList<DeviceDefinitionCapabilityComponent>(); 2690 this.capability.add(t); 2691 return t; 2692 } 2693 2694 public DeviceDefinition addCapability(DeviceDefinitionCapabilityComponent t) { //3 2695 if (t == null) 2696 return this; 2697 if (this.capability == null) 2698 this.capability = new ArrayList<DeviceDefinitionCapabilityComponent>(); 2699 this.capability.add(t); 2700 return this; 2701 } 2702 2703 /** 2704 * @return The first repetition of repeating field {@link #capability}, creating it if it does not already exist 2705 */ 2706 public DeviceDefinitionCapabilityComponent getCapabilityFirstRep() { 2707 if (getCapability().isEmpty()) { 2708 addCapability(); 2709 } 2710 return getCapability().get(0); 2711 } 2712 2713 /** 2714 * @return {@link #property} (The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.) 2715 */ 2716 public List<DeviceDefinitionPropertyComponent> getProperty() { 2717 if (this.property == null) 2718 this.property = new ArrayList<DeviceDefinitionPropertyComponent>(); 2719 return this.property; 2720 } 2721 2722 /** 2723 * @return Returns a reference to <code>this</code> for easy method chaining 2724 */ 2725 public DeviceDefinition setProperty(List<DeviceDefinitionPropertyComponent> theProperty) { 2726 this.property = theProperty; 2727 return this; 2728 } 2729 2730 public boolean hasProperty() { 2731 if (this.property == null) 2732 return false; 2733 for (DeviceDefinitionPropertyComponent item : this.property) 2734 if (!item.isEmpty()) 2735 return true; 2736 return false; 2737 } 2738 2739 public DeviceDefinitionPropertyComponent addProperty() { //3 2740 DeviceDefinitionPropertyComponent t = new DeviceDefinitionPropertyComponent(); 2741 if (this.property == null) 2742 this.property = new ArrayList<DeviceDefinitionPropertyComponent>(); 2743 this.property.add(t); 2744 return t; 2745 } 2746 2747 public DeviceDefinition addProperty(DeviceDefinitionPropertyComponent t) { //3 2748 if (t == null) 2749 return this; 2750 if (this.property == null) 2751 this.property = new ArrayList<DeviceDefinitionPropertyComponent>(); 2752 this.property.add(t); 2753 return this; 2754 } 2755 2756 /** 2757 * @return The first repetition of repeating field {@link #property}, creating it if it does not already exist 2758 */ 2759 public DeviceDefinitionPropertyComponent getPropertyFirstRep() { 2760 if (getProperty().isEmpty()) { 2761 addProperty(); 2762 } 2763 return getProperty().get(0); 2764 } 2765 2766 /** 2767 * @return {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) 2768 */ 2769 public Reference getOwner() { 2770 if (this.owner == null) 2771 if (Configuration.errorOnAutoCreate()) 2772 throw new Error("Attempt to auto-create DeviceDefinition.owner"); 2773 else if (Configuration.doAutoCreate()) 2774 this.owner = new Reference(); // cc 2775 return this.owner; 2776 } 2777 2778 public boolean hasOwner() { 2779 return this.owner != null && !this.owner.isEmpty(); 2780 } 2781 2782 /** 2783 * @param value {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) 2784 */ 2785 public DeviceDefinition setOwner(Reference value) { 2786 this.owner = value; 2787 return this; 2788 } 2789 2790 /** 2791 * @return {@link #owner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An organization that is responsible for the provision and ongoing maintenance of the device.) 2792 */ 2793 public Organization getOwnerTarget() { 2794 if (this.ownerTarget == null) 2795 if (Configuration.errorOnAutoCreate()) 2796 throw new Error("Attempt to auto-create DeviceDefinition.owner"); 2797 else if (Configuration.doAutoCreate()) 2798 this.ownerTarget = new Organization(); // aa 2799 return this.ownerTarget; 2800 } 2801 2802 /** 2803 * @param value {@link #owner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An organization that is responsible for the provision and ongoing maintenance of the device.) 2804 */ 2805 public DeviceDefinition setOwnerTarget(Organization value) { 2806 this.ownerTarget = value; 2807 return this; 2808 } 2809 2810 /** 2811 * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.) 2812 */ 2813 public List<ContactPoint> getContact() { 2814 if (this.contact == null) 2815 this.contact = new ArrayList<ContactPoint>(); 2816 return this.contact; 2817 } 2818 2819 /** 2820 * @return Returns a reference to <code>this</code> for easy method chaining 2821 */ 2822 public DeviceDefinition setContact(List<ContactPoint> theContact) { 2823 this.contact = theContact; 2824 return this; 2825 } 2826 2827 public boolean hasContact() { 2828 if (this.contact == null) 2829 return false; 2830 for (ContactPoint item : this.contact) 2831 if (!item.isEmpty()) 2832 return true; 2833 return false; 2834 } 2835 2836 public ContactPoint addContact() { //3 2837 ContactPoint t = new ContactPoint(); 2838 if (this.contact == null) 2839 this.contact = new ArrayList<ContactPoint>(); 2840 this.contact.add(t); 2841 return t; 2842 } 2843 2844 public DeviceDefinition addContact(ContactPoint t) { //3 2845 if (t == null) 2846 return this; 2847 if (this.contact == null) 2848 this.contact = new ArrayList<ContactPoint>(); 2849 this.contact.add(t); 2850 return this; 2851 } 2852 2853 /** 2854 * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist 2855 */ 2856 public ContactPoint getContactFirstRep() { 2857 if (getContact().isEmpty()) { 2858 addContact(); 2859 } 2860 return getContact().get(0); 2861 } 2862 2863 /** 2864 * @return {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 2865 */ 2866 public UriType getUrlElement() { 2867 if (this.url == null) 2868 if (Configuration.errorOnAutoCreate()) 2869 throw new Error("Attempt to auto-create DeviceDefinition.url"); 2870 else if (Configuration.doAutoCreate()) 2871 this.url = new UriType(); // bb 2872 return this.url; 2873 } 2874 2875 public boolean hasUrlElement() { 2876 return this.url != null && !this.url.isEmpty(); 2877 } 2878 2879 public boolean hasUrl() { 2880 return this.url != null && !this.url.isEmpty(); 2881 } 2882 2883 /** 2884 * @param value {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value 2885 */ 2886 public DeviceDefinition setUrlElement(UriType value) { 2887 this.url = value; 2888 return this; 2889 } 2890 2891 /** 2892 * @return A network address on which the device may be contacted directly. 2893 */ 2894 public String getUrl() { 2895 return this.url == null ? null : this.url.getValue(); 2896 } 2897 2898 /** 2899 * @param value A network address on which the device may be contacted directly. 2900 */ 2901 public DeviceDefinition setUrl(String value) { 2902 if (Utilities.noString(value)) 2903 this.url = null; 2904 else { 2905 if (this.url == null) 2906 this.url = new UriType(); 2907 this.url.setValue(value); 2908 } 2909 return this; 2910 } 2911 2912 /** 2913 * @return {@link #onlineInformation} (Access to on-line information about the device.). This is the underlying object with id, value and extensions. The accessor "getOnlineInformation" gives direct access to the value 2914 */ 2915 public UriType getOnlineInformationElement() { 2916 if (this.onlineInformation == null) 2917 if (Configuration.errorOnAutoCreate()) 2918 throw new Error("Attempt to auto-create DeviceDefinition.onlineInformation"); 2919 else if (Configuration.doAutoCreate()) 2920 this.onlineInformation = new UriType(); // bb 2921 return this.onlineInformation; 2922 } 2923 2924 public boolean hasOnlineInformationElement() { 2925 return this.onlineInformation != null && !this.onlineInformation.isEmpty(); 2926 } 2927 2928 public boolean hasOnlineInformation() { 2929 return this.onlineInformation != null && !this.onlineInformation.isEmpty(); 2930 } 2931 2932 /** 2933 * @param value {@link #onlineInformation} (Access to on-line information about the device.). This is the underlying object with id, value and extensions. The accessor "getOnlineInformation" gives direct access to the value 2934 */ 2935 public DeviceDefinition setOnlineInformationElement(UriType value) { 2936 this.onlineInformation = value; 2937 return this; 2938 } 2939 2940 /** 2941 * @return Access to on-line information about the device. 2942 */ 2943 public String getOnlineInformation() { 2944 return this.onlineInformation == null ? null : this.onlineInformation.getValue(); 2945 } 2946 2947 /** 2948 * @param value Access to on-line information about the device. 2949 */ 2950 public DeviceDefinition setOnlineInformation(String value) { 2951 if (Utilities.noString(value)) 2952 this.onlineInformation = null; 2953 else { 2954 if (this.onlineInformation == null) 2955 this.onlineInformation = new UriType(); 2956 this.onlineInformation.setValue(value); 2957 } 2958 return this; 2959 } 2960 2961 /** 2962 * @return {@link #note} (Descriptive information, usage information or implantation information that is not captured in an existing element.) 2963 */ 2964 public List<Annotation> getNote() { 2965 if (this.note == null) 2966 this.note = new ArrayList<Annotation>(); 2967 return this.note; 2968 } 2969 2970 /** 2971 * @return Returns a reference to <code>this</code> for easy method chaining 2972 */ 2973 public DeviceDefinition setNote(List<Annotation> theNote) { 2974 this.note = theNote; 2975 return this; 2976 } 2977 2978 public boolean hasNote() { 2979 if (this.note == null) 2980 return false; 2981 for (Annotation item : this.note) 2982 if (!item.isEmpty()) 2983 return true; 2984 return false; 2985 } 2986 2987 public Annotation addNote() { //3 2988 Annotation t = new Annotation(); 2989 if (this.note == null) 2990 this.note = new ArrayList<Annotation>(); 2991 this.note.add(t); 2992 return t; 2993 } 2994 2995 public DeviceDefinition addNote(Annotation t) { //3 2996 if (t == null) 2997 return this; 2998 if (this.note == null) 2999 this.note = new ArrayList<Annotation>(); 3000 this.note.add(t); 3001 return this; 3002 } 3003 3004 /** 3005 * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist 3006 */ 3007 public Annotation getNoteFirstRep() { 3008 if (getNote().isEmpty()) { 3009 addNote(); 3010 } 3011 return getNote().get(0); 3012 } 3013 3014 /** 3015 * @return {@link #quantity} (The quantity of the device present in the packaging (e.g. the number of devices present in a pack, or the number of devices in the same package of the medicinal product).) 3016 */ 3017 public Quantity getQuantity() { 3018 if (this.quantity == null) 3019 if (Configuration.errorOnAutoCreate()) 3020 throw new Error("Attempt to auto-create DeviceDefinition.quantity"); 3021 else if (Configuration.doAutoCreate()) 3022 this.quantity = new Quantity(); // cc 3023 return this.quantity; 3024 } 3025 3026 public boolean hasQuantity() { 3027 return this.quantity != null && !this.quantity.isEmpty(); 3028 } 3029 3030 /** 3031 * @param value {@link #quantity} (The quantity of the device present in the packaging (e.g. the number of devices present in a pack, or the number of devices in the same package of the medicinal product).) 3032 */ 3033 public DeviceDefinition setQuantity(Quantity value) { 3034 this.quantity = value; 3035 return this; 3036 } 3037 3038 /** 3039 * @return {@link #parentDevice} (The parent device it can be part of.) 3040 */ 3041 public Reference getParentDevice() { 3042 if (this.parentDevice == null) 3043 if (Configuration.errorOnAutoCreate()) 3044 throw new Error("Attempt to auto-create DeviceDefinition.parentDevice"); 3045 else if (Configuration.doAutoCreate()) 3046 this.parentDevice = new Reference(); // cc 3047 return this.parentDevice; 3048 } 3049 3050 public boolean hasParentDevice() { 3051 return this.parentDevice != null && !this.parentDevice.isEmpty(); 3052 } 3053 3054 /** 3055 * @param value {@link #parentDevice} (The parent device it can be part of.) 3056 */ 3057 public DeviceDefinition setParentDevice(Reference value) { 3058 this.parentDevice = value; 3059 return this; 3060 } 3061 3062 /** 3063 * @return {@link #parentDevice} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The parent device it can be part of.) 3064 */ 3065 public DeviceDefinition getParentDeviceTarget() { 3066 if (this.parentDeviceTarget == null) 3067 if (Configuration.errorOnAutoCreate()) 3068 throw new Error("Attempt to auto-create DeviceDefinition.parentDevice"); 3069 else if (Configuration.doAutoCreate()) 3070 this.parentDeviceTarget = new DeviceDefinition(); // aa 3071 return this.parentDeviceTarget; 3072 } 3073 3074 /** 3075 * @param value {@link #parentDevice} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The parent device it can be part of.) 3076 */ 3077 public DeviceDefinition setParentDeviceTarget(DeviceDefinition value) { 3078 this.parentDeviceTarget = value; 3079 return this; 3080 } 3081 3082 /** 3083 * @return {@link #material} (A substance used to create the material(s) of which the device is made.) 3084 */ 3085 public List<DeviceDefinitionMaterialComponent> getMaterial() { 3086 if (this.material == null) 3087 this.material = new ArrayList<DeviceDefinitionMaterialComponent>(); 3088 return this.material; 3089 } 3090 3091 /** 3092 * @return Returns a reference to <code>this</code> for easy method chaining 3093 */ 3094 public DeviceDefinition setMaterial(List<DeviceDefinitionMaterialComponent> theMaterial) { 3095 this.material = theMaterial; 3096 return this; 3097 } 3098 3099 public boolean hasMaterial() { 3100 if (this.material == null) 3101 return false; 3102 for (DeviceDefinitionMaterialComponent item : this.material) 3103 if (!item.isEmpty()) 3104 return true; 3105 return false; 3106 } 3107 3108 public DeviceDefinitionMaterialComponent addMaterial() { //3 3109 DeviceDefinitionMaterialComponent t = new DeviceDefinitionMaterialComponent(); 3110 if (this.material == null) 3111 this.material = new ArrayList<DeviceDefinitionMaterialComponent>(); 3112 this.material.add(t); 3113 return t; 3114 } 3115 3116 public DeviceDefinition addMaterial(DeviceDefinitionMaterialComponent t) { //3 3117 if (t == null) 3118 return this; 3119 if (this.material == null) 3120 this.material = new ArrayList<DeviceDefinitionMaterialComponent>(); 3121 this.material.add(t); 3122 return this; 3123 } 3124 3125 /** 3126 * @return The first repetition of repeating field {@link #material}, creating it if it does not already exist 3127 */ 3128 public DeviceDefinitionMaterialComponent getMaterialFirstRep() { 3129 if (getMaterial().isEmpty()) { 3130 addMaterial(); 3131 } 3132 return getMaterial().get(0); 3133 } 3134 3135 protected void listChildren(List<Property> children) { 3136 super.listChildren(children); 3137 children.add(new Property("identifier", "Identifier", "Unique instance identifiers assigned to a device by the software, manufacturers, other organizations or owners. For example: handle ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); 3138 children.add(new Property("udiDeviceIdentifier", "", "Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold.", 0, java.lang.Integer.MAX_VALUE, udiDeviceIdentifier)); 3139 children.add(new Property("manufacturer[x]", "string|Reference(Organization)", "A name of the manufacturer.", 0, 1, manufacturer)); 3140 children.add(new Property("deviceName", "", "A name given to the device to identify it.", 0, java.lang.Integer.MAX_VALUE, deviceName)); 3141 children.add(new Property("modelNumber", "string", "The model number for the device.", 0, 1, modelNumber)); 3142 children.add(new Property("type", "CodeableConcept", "What kind of device or device system this is.", 0, 1, type)); 3143 children.add(new Property("specialization", "", "The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication.", 0, java.lang.Integer.MAX_VALUE, specialization)); 3144 children.add(new Property("version", "string", "The available versions of the device, e.g., software versions.", 0, java.lang.Integer.MAX_VALUE, version)); 3145 children.add(new Property("safety", "CodeableConcept", "Safety characteristics of the device.", 0, java.lang.Integer.MAX_VALUE, safety)); 3146 children.add(new Property("shelfLifeStorage", "ProductShelfLife", "Shelf Life and storage information.", 0, java.lang.Integer.MAX_VALUE, shelfLifeStorage)); 3147 children.add(new Property("physicalCharacteristics", "ProdCharacteristic", "Dimensions, color etc.", 0, 1, physicalCharacteristics)); 3148 children.add(new Property("languageCode", "CodeableConcept", "Language code for the human-readable text strings produced by the device (all supported).", 0, java.lang.Integer.MAX_VALUE, languageCode)); 3149 children.add(new Property("capability", "", "Device capabilities.", 0, java.lang.Integer.MAX_VALUE, capability)); 3150 children.add(new Property("property", "", "The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.", 0, java.lang.Integer.MAX_VALUE, property)); 3151 children.add(new Property("owner", "Reference(Organization)", "An organization that is responsible for the provision and ongoing maintenance of the device.", 0, 1, owner)); 3152 children.add(new Property("contact", "ContactPoint", "Contact details for an organization or a particular human that is responsible for the device.", 0, java.lang.Integer.MAX_VALUE, contact)); 3153 children.add(new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, 1, url)); 3154 children.add(new Property("onlineInformation", "uri", "Access to on-line information about the device.", 0, 1, onlineInformation)); 3155 children.add(new Property("note", "Annotation", "Descriptive information, usage information or implantation information that is not captured in an existing element.", 0, java.lang.Integer.MAX_VALUE, note)); 3156 children.add(new Property("quantity", "Quantity", "The quantity of the device present in the packaging (e.g. the number of devices present in a pack, or the number of devices in the same package of the medicinal product).", 0, 1, quantity)); 3157 children.add(new Property("parentDevice", "Reference(DeviceDefinition)", "The parent device it can be part of.", 0, 1, parentDevice)); 3158 children.add(new Property("material", "", "A substance used to create the material(s) of which the device is made.", 0, java.lang.Integer.MAX_VALUE, material)); 3159 } 3160 3161 @Override 3162 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 3163 switch (_hash) { 3164 case -1618432855: /*identifier*/ return new Property("identifier", "Identifier", "Unique instance identifiers assigned to a device by the software, manufacturers, other organizations or owners. For example: handle ID.", 0, java.lang.Integer.MAX_VALUE, identifier); 3165 case -99121287: /*udiDeviceIdentifier*/ return new Property("udiDeviceIdentifier", "", "Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold.", 0, java.lang.Integer.MAX_VALUE, udiDeviceIdentifier); 3166 case 418079503: /*manufacturer[x]*/ return new Property("manufacturer[x]", "string|Reference(Organization)", "A name of the manufacturer.", 0, 1, manufacturer); 3167 case -1969347631: /*manufacturer*/ return new Property("manufacturer[x]", "string|Reference(Organization)", "A name of the manufacturer.", 0, 1, manufacturer); 3168 case -630681790: /*manufacturerString*/ return new Property("manufacturer[x]", "string|Reference(Organization)", "A name of the manufacturer.", 0, 1, manufacturer); 3169 case 1104934522: /*manufacturerReference*/ return new Property("manufacturer[x]", "string|Reference(Organization)", "A name of the manufacturer.", 0, 1, manufacturer); 3170 case 780988929: /*deviceName*/ return new Property("deviceName", "", "A name given to the device to identify it.", 0, java.lang.Integer.MAX_VALUE, deviceName); 3171 case 346619858: /*modelNumber*/ return new Property("modelNumber", "string", "The model number for the device.", 0, 1, modelNumber); 3172 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "What kind of device or device system this is.", 0, 1, type); 3173 case 682815883: /*specialization*/ return new Property("specialization", "", "The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication.", 0, java.lang.Integer.MAX_VALUE, specialization); 3174 case 351608024: /*version*/ return new Property("version", "string", "The available versions of the device, e.g., software versions.", 0, java.lang.Integer.MAX_VALUE, version); 3175 case -909893934: /*safety*/ return new Property("safety", "CodeableConcept", "Safety characteristics of the device.", 0, java.lang.Integer.MAX_VALUE, safety); 3176 case 172049237: /*shelfLifeStorage*/ return new Property("shelfLifeStorage", "ProductShelfLife", "Shelf Life and storage information.", 0, java.lang.Integer.MAX_VALUE, shelfLifeStorage); 3177 case -1599676319: /*physicalCharacteristics*/ return new Property("physicalCharacteristics", "ProdCharacteristic", "Dimensions, color etc.", 0, 1, physicalCharacteristics); 3178 case -2092349083: /*languageCode*/ return new Property("languageCode", "CodeableConcept", "Language code for the human-readable text strings produced by the device (all supported).", 0, java.lang.Integer.MAX_VALUE, languageCode); 3179 case -783669992: /*capability*/ return new Property("capability", "", "Device capabilities.", 0, java.lang.Integer.MAX_VALUE, capability); 3180 case -993141291: /*property*/ return new Property("property", "", "The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.", 0, java.lang.Integer.MAX_VALUE, property); 3181 case 106164915: /*owner*/ return new Property("owner", "Reference(Organization)", "An organization that is responsible for the provision and ongoing maintenance of the device.", 0, 1, owner); 3182 case 951526432: /*contact*/ return new Property("contact", "ContactPoint", "Contact details for an organization or a particular human that is responsible for the device.", 0, java.lang.Integer.MAX_VALUE, contact); 3183 case 116079: /*url*/ return new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, 1, url); 3184 case -788511527: /*onlineInformation*/ return new Property("onlineInformation", "uri", "Access to on-line information about the device.", 0, 1, onlineInformation); 3185 case 3387378: /*note*/ return new Property("note", "Annotation", "Descriptive information, usage information or implantation information that is not captured in an existing element.", 0, java.lang.Integer.MAX_VALUE, note); 3186 case -1285004149: /*quantity*/ return new Property("quantity", "Quantity", "The quantity of the device present in the packaging (e.g. the number of devices present in a pack, or the number of devices in the same package of the medicinal product).", 0, 1, quantity); 3187 case 620260256: /*parentDevice*/ return new Property("parentDevice", "Reference(DeviceDefinition)", "The parent device it can be part of.", 0, 1, parentDevice); 3188 case 299066663: /*material*/ return new Property("material", "", "A substance used to create the material(s) of which the device is made.", 0, java.lang.Integer.MAX_VALUE, material); 3189 default: return super.getNamedProperty(_hash, _name, _checkValid); 3190 } 3191 3192 } 3193 3194 @Override 3195 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 3196 switch (hash) { 3197 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier 3198 case -99121287: /*udiDeviceIdentifier*/ return this.udiDeviceIdentifier == null ? new Base[0] : this.udiDeviceIdentifier.toArray(new Base[this.udiDeviceIdentifier.size()]); // DeviceDefinitionUdiDeviceIdentifierComponent 3199 case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : new Base[] {this.manufacturer}; // Type 3200 case 780988929: /*deviceName*/ return this.deviceName == null ? new Base[0] : this.deviceName.toArray(new Base[this.deviceName.size()]); // DeviceDefinitionDeviceNameComponent 3201 case 346619858: /*modelNumber*/ return this.modelNumber == null ? new Base[0] : new Base[] {this.modelNumber}; // StringType 3202 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 3203 case 682815883: /*specialization*/ return this.specialization == null ? new Base[0] : this.specialization.toArray(new Base[this.specialization.size()]); // DeviceDefinitionSpecializationComponent 3204 case 351608024: /*version*/ return this.version == null ? new Base[0] : this.version.toArray(new Base[this.version.size()]); // StringType 3205 case -909893934: /*safety*/ return this.safety == null ? new Base[0] : this.safety.toArray(new Base[this.safety.size()]); // CodeableConcept 3206 case 172049237: /*shelfLifeStorage*/ return this.shelfLifeStorage == null ? new Base[0] : this.shelfLifeStorage.toArray(new Base[this.shelfLifeStorage.size()]); // ProductShelfLife 3207 case -1599676319: /*physicalCharacteristics*/ return this.physicalCharacteristics == null ? new Base[0] : new Base[] {this.physicalCharacteristics}; // ProdCharacteristic 3208 case -2092349083: /*languageCode*/ return this.languageCode == null ? new Base[0] : this.languageCode.toArray(new Base[this.languageCode.size()]); // CodeableConcept 3209 case -783669992: /*capability*/ return this.capability == null ? new Base[0] : this.capability.toArray(new Base[this.capability.size()]); // DeviceDefinitionCapabilityComponent 3210 case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // DeviceDefinitionPropertyComponent 3211 case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference 3212 case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactPoint 3213 case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType 3214 case -788511527: /*onlineInformation*/ return this.onlineInformation == null ? new Base[0] : new Base[] {this.onlineInformation}; // UriType 3215 case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation 3216 case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity 3217 case 620260256: /*parentDevice*/ return this.parentDevice == null ? new Base[0] : new Base[] {this.parentDevice}; // Reference 3218 case 299066663: /*material*/ return this.material == null ? new Base[0] : this.material.toArray(new Base[this.material.size()]); // DeviceDefinitionMaterialComponent 3219 default: return super.getProperty(hash, name, checkValid); 3220 } 3221 3222 } 3223 3224 @Override 3225 public Base setProperty(int hash, String name, Base value) throws FHIRException { 3226 switch (hash) { 3227 case -1618432855: // identifier 3228 this.getIdentifier().add(castToIdentifier(value)); // Identifier 3229 return value; 3230 case -99121287: // udiDeviceIdentifier 3231 this.getUdiDeviceIdentifier().add((DeviceDefinitionUdiDeviceIdentifierComponent) value); // DeviceDefinitionUdiDeviceIdentifierComponent 3232 return value; 3233 case -1969347631: // manufacturer 3234 this.manufacturer = castToType(value); // Type 3235 return value; 3236 case 780988929: // deviceName 3237 this.getDeviceName().add((DeviceDefinitionDeviceNameComponent) value); // DeviceDefinitionDeviceNameComponent 3238 return value; 3239 case 346619858: // modelNumber 3240 this.modelNumber = castToString(value); // StringType 3241 return value; 3242 case 3575610: // type 3243 this.type = castToCodeableConcept(value); // CodeableConcept 3244 return value; 3245 case 682815883: // specialization 3246 this.getSpecialization().add((DeviceDefinitionSpecializationComponent) value); // DeviceDefinitionSpecializationComponent 3247 return value; 3248 case 351608024: // version 3249 this.getVersion().add(castToString(value)); // StringType 3250 return value; 3251 case -909893934: // safety 3252 this.getSafety().add(castToCodeableConcept(value)); // CodeableConcept 3253 return value; 3254 case 172049237: // shelfLifeStorage 3255 this.getShelfLifeStorage().add(castToProductShelfLife(value)); // ProductShelfLife 3256 return value; 3257 case -1599676319: // physicalCharacteristics 3258 this.physicalCharacteristics = castToProdCharacteristic(value); // ProdCharacteristic 3259 return value; 3260 case -2092349083: // languageCode 3261 this.getLanguageCode().add(castToCodeableConcept(value)); // CodeableConcept 3262 return value; 3263 case -783669992: // capability 3264 this.getCapability().add((DeviceDefinitionCapabilityComponent) value); // DeviceDefinitionCapabilityComponent 3265 return value; 3266 case -993141291: // property 3267 this.getProperty().add((DeviceDefinitionPropertyComponent) value); // DeviceDefinitionPropertyComponent 3268 return value; 3269 case 106164915: // owner 3270 this.owner = castToReference(value); // Reference 3271 return value; 3272 case 951526432: // contact 3273 this.getContact().add(castToContactPoint(value)); // ContactPoint 3274 return value; 3275 case 116079: // url 3276 this.url = castToUri(value); // UriType 3277 return value; 3278 case -788511527: // onlineInformation 3279 this.onlineInformation = castToUri(value); // UriType 3280 return value; 3281 case 3387378: // note 3282 this.getNote().add(castToAnnotation(value)); // Annotation 3283 return value; 3284 case -1285004149: // quantity 3285 this.quantity = castToQuantity(value); // Quantity 3286 return value; 3287 case 620260256: // parentDevice 3288 this.parentDevice = castToReference(value); // Reference 3289 return value; 3290 case 299066663: // material 3291 this.getMaterial().add((DeviceDefinitionMaterialComponent) value); // DeviceDefinitionMaterialComponent 3292 return value; 3293 default: return super.setProperty(hash, name, value); 3294 } 3295 3296 } 3297 3298 @Override 3299 public Base setProperty(String name, Base value) throws FHIRException { 3300 if (name.equals("identifier")) { 3301 this.getIdentifier().add(castToIdentifier(value)); 3302 } else if (name.equals("udiDeviceIdentifier")) { 3303 this.getUdiDeviceIdentifier().add((DeviceDefinitionUdiDeviceIdentifierComponent) value); 3304 } else if (name.equals("manufacturer[x]")) { 3305 this.manufacturer = castToType(value); // Type 3306 } else if (name.equals("deviceName")) { 3307 this.getDeviceName().add((DeviceDefinitionDeviceNameComponent) value); 3308 } else if (name.equals("modelNumber")) { 3309 this.modelNumber = castToString(value); // StringType 3310 } else if (name.equals("type")) { 3311 this.type = castToCodeableConcept(value); // CodeableConcept 3312 } else if (name.equals("specialization")) { 3313 this.getSpecialization().add((DeviceDefinitionSpecializationComponent) value); 3314 } else if (name.equals("version")) { 3315 this.getVersion().add(castToString(value)); 3316 } else if (name.equals("safety")) { 3317 this.getSafety().add(castToCodeableConcept(value)); 3318 } else if (name.equals("shelfLifeStorage")) { 3319 this.getShelfLifeStorage().add(castToProductShelfLife(value)); 3320 } else if (name.equals("physicalCharacteristics")) { 3321 this.physicalCharacteristics = castToProdCharacteristic(value); // ProdCharacteristic 3322 } else if (name.equals("languageCode")) { 3323 this.getLanguageCode().add(castToCodeableConcept(value)); 3324 } else if (name.equals("capability")) { 3325 this.getCapability().add((DeviceDefinitionCapabilityComponent) value); 3326 } else if (name.equals("property")) { 3327 this.getProperty().add((DeviceDefinitionPropertyComponent) value); 3328 } else if (name.equals("owner")) { 3329 this.owner = castToReference(value); // Reference 3330 } else if (name.equals("contact")) { 3331 this.getContact().add(castToContactPoint(value)); 3332 } else if (name.equals("url")) { 3333 this.url = castToUri(value); // UriType 3334 } else if (name.equals("onlineInformation")) { 3335 this.onlineInformation = castToUri(value); // UriType 3336 } else if (name.equals("note")) { 3337 this.getNote().add(castToAnnotation(value)); 3338 } else if (name.equals("quantity")) { 3339 this.quantity = castToQuantity(value); // Quantity 3340 } else if (name.equals("parentDevice")) { 3341 this.parentDevice = castToReference(value); // Reference 3342 } else if (name.equals("material")) { 3343 this.getMaterial().add((DeviceDefinitionMaterialComponent) value); 3344 } else 3345 return super.setProperty(name, value); 3346 return value; 3347 } 3348 3349 @Override 3350 public Base makeProperty(int hash, String name) throws FHIRException { 3351 switch (hash) { 3352 case -1618432855: return addIdentifier(); 3353 case -99121287: return addUdiDeviceIdentifier(); 3354 case 418079503: return getManufacturer(); 3355 case -1969347631: return getManufacturer(); 3356 case 780988929: return addDeviceName(); 3357 case 346619858: return getModelNumberElement(); 3358 case 3575610: return getType(); 3359 case 682815883: return addSpecialization(); 3360 case 351608024: return addVersionElement(); 3361 case -909893934: return addSafety(); 3362 case 172049237: return addShelfLifeStorage(); 3363 case -1599676319: return getPhysicalCharacteristics(); 3364 case -2092349083: return addLanguageCode(); 3365 case -783669992: return addCapability(); 3366 case -993141291: return addProperty(); 3367 case 106164915: return getOwner(); 3368 case 951526432: return addContact(); 3369 case 116079: return getUrlElement(); 3370 case -788511527: return getOnlineInformationElement(); 3371 case 3387378: return addNote(); 3372 case -1285004149: return getQuantity(); 3373 case 620260256: return getParentDevice(); 3374 case 299066663: return addMaterial(); 3375 default: return super.makeProperty(hash, name); 3376 } 3377 3378 } 3379 3380 @Override 3381 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 3382 switch (hash) { 3383 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 3384 case -99121287: /*udiDeviceIdentifier*/ return new String[] {}; 3385 case -1969347631: /*manufacturer*/ return new String[] {"string", "Reference"}; 3386 case 780988929: /*deviceName*/ return new String[] {}; 3387 case 346619858: /*modelNumber*/ return new String[] {"string"}; 3388 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 3389 case 682815883: /*specialization*/ return new String[] {}; 3390 case 351608024: /*version*/ return new String[] {"string"}; 3391 case -909893934: /*safety*/ return new String[] {"CodeableConcept"}; 3392 case 172049237: /*shelfLifeStorage*/ return new String[] {"ProductShelfLife"}; 3393 case -1599676319: /*physicalCharacteristics*/ return new String[] {"ProdCharacteristic"}; 3394 case -2092349083: /*languageCode*/ return new String[] {"CodeableConcept"}; 3395 case -783669992: /*capability*/ return new String[] {}; 3396 case -993141291: /*property*/ return new String[] {}; 3397 case 106164915: /*owner*/ return new String[] {"Reference"}; 3398 case 951526432: /*contact*/ return new String[] {"ContactPoint"}; 3399 case 116079: /*url*/ return new String[] {"uri"}; 3400 case -788511527: /*onlineInformation*/ return new String[] {"uri"}; 3401 case 3387378: /*note*/ return new String[] {"Annotation"}; 3402 case -1285004149: /*quantity*/ return new String[] {"Quantity"}; 3403 case 620260256: /*parentDevice*/ return new String[] {"Reference"}; 3404 case 299066663: /*material*/ return new String[] {}; 3405 default: return super.getTypesForProperty(hash, name); 3406 } 3407 3408 } 3409 3410 @Override 3411 public Base addChild(String name) throws FHIRException { 3412 if (name.equals("identifier")) { 3413 return addIdentifier(); 3414 } 3415 else if (name.equals("udiDeviceIdentifier")) { 3416 return addUdiDeviceIdentifier(); 3417 } 3418 else if (name.equals("manufacturerString")) { 3419 this.manufacturer = new StringType(); 3420 return this.manufacturer; 3421 } 3422 else if (name.equals("manufacturerReference")) { 3423 this.manufacturer = new Reference(); 3424 return this.manufacturer; 3425 } 3426 else if (name.equals("deviceName")) { 3427 return addDeviceName(); 3428 } 3429 else if (name.equals("modelNumber")) { 3430 throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.modelNumber"); 3431 } 3432 else if (name.equals("type")) { 3433 this.type = new CodeableConcept(); 3434 return this.type; 3435 } 3436 else if (name.equals("specialization")) { 3437 return addSpecialization(); 3438 } 3439 else if (name.equals("version")) { 3440 throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.version"); 3441 } 3442 else if (name.equals("safety")) { 3443 return addSafety(); 3444 } 3445 else if (name.equals("shelfLifeStorage")) { 3446 return addShelfLifeStorage(); 3447 } 3448 else if (name.equals("physicalCharacteristics")) { 3449 this.physicalCharacteristics = new ProdCharacteristic(); 3450 return this.physicalCharacteristics; 3451 } 3452 else if (name.equals("languageCode")) { 3453 return addLanguageCode(); 3454 } 3455 else if (name.equals("capability")) { 3456 return addCapability(); 3457 } 3458 else if (name.equals("property")) { 3459 return addProperty(); 3460 } 3461 else if (name.equals("owner")) { 3462 this.owner = new Reference(); 3463 return this.owner; 3464 } 3465 else if (name.equals("contact")) { 3466 return addContact(); 3467 } 3468 else if (name.equals("url")) { 3469 throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.url"); 3470 } 3471 else if (name.equals("onlineInformation")) { 3472 throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.onlineInformation"); 3473 } 3474 else if (name.equals("note")) { 3475 return addNote(); 3476 } 3477 else if (name.equals("quantity")) { 3478 this.quantity = new Quantity(); 3479 return this.quantity; 3480 } 3481 else if (name.equals("parentDevice")) { 3482 this.parentDevice = new Reference(); 3483 return this.parentDevice; 3484 } 3485 else if (name.equals("material")) { 3486 return addMaterial(); 3487 } 3488 else 3489 return super.addChild(name); 3490 } 3491 3492 public String fhirType() { 3493 return "DeviceDefinition"; 3494 3495 } 3496 3497 public DeviceDefinition copy() { 3498 DeviceDefinition dst = new DeviceDefinition(); 3499 copyValues(dst); 3500 return dst; 3501 } 3502 3503 public void copyValues(DeviceDefinition dst) { 3504 super.copyValues(dst); 3505 if (identifier != null) { 3506 dst.identifier = new ArrayList<Identifier>(); 3507 for (Identifier i : identifier) 3508 dst.identifier.add(i.copy()); 3509 }; 3510 if (udiDeviceIdentifier != null) { 3511 dst.udiDeviceIdentifier = new ArrayList<DeviceDefinitionUdiDeviceIdentifierComponent>(); 3512 for (DeviceDefinitionUdiDeviceIdentifierComponent i : udiDeviceIdentifier) 3513 dst.udiDeviceIdentifier.add(i.copy()); 3514 }; 3515 dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); 3516 if (deviceName != null) { 3517 dst.deviceName = new ArrayList<DeviceDefinitionDeviceNameComponent>(); 3518 for (DeviceDefinitionDeviceNameComponent i : deviceName) 3519 dst.deviceName.add(i.copy()); 3520 }; 3521 dst.modelNumber = modelNumber == null ? null : modelNumber.copy(); 3522 dst.type = type == null ? null : type.copy(); 3523 if (specialization != null) { 3524 dst.specialization = new ArrayList<DeviceDefinitionSpecializationComponent>(); 3525 for (DeviceDefinitionSpecializationComponent i : specialization) 3526 dst.specialization.add(i.copy()); 3527 }; 3528 if (version != null) { 3529 dst.version = new ArrayList<StringType>(); 3530 for (StringType i : version) 3531 dst.version.add(i.copy()); 3532 }; 3533 if (safety != null) { 3534 dst.safety = new ArrayList<CodeableConcept>(); 3535 for (CodeableConcept i : safety) 3536 dst.safety.add(i.copy()); 3537 }; 3538 if (shelfLifeStorage != null) { 3539 dst.shelfLifeStorage = new ArrayList<ProductShelfLife>(); 3540 for (ProductShelfLife i : shelfLifeStorage) 3541 dst.shelfLifeStorage.add(i.copy()); 3542 }; 3543 dst.physicalCharacteristics = physicalCharacteristics == null ? null : physicalCharacteristics.copy(); 3544 if (languageCode != null) { 3545 dst.languageCode = new ArrayList<CodeableConcept>(); 3546 for (CodeableConcept i : languageCode) 3547 dst.languageCode.add(i.copy()); 3548 }; 3549 if (capability != null) { 3550 dst.capability = new ArrayList<DeviceDefinitionCapabilityComponent>(); 3551 for (DeviceDefinitionCapabilityComponent i : capability) 3552 dst.capability.add(i.copy()); 3553 }; 3554 if (property != null) { 3555 dst.property = new ArrayList<DeviceDefinitionPropertyComponent>(); 3556 for (DeviceDefinitionPropertyComponent i : property) 3557 dst.property.add(i.copy()); 3558 }; 3559 dst.owner = owner == null ? null : owner.copy(); 3560 if (contact != null) { 3561 dst.contact = new ArrayList<ContactPoint>(); 3562 for (ContactPoint i : contact) 3563 dst.contact.add(i.copy()); 3564 }; 3565 dst.url = url == null ? null : url.copy(); 3566 dst.onlineInformation = onlineInformation == null ? null : onlineInformation.copy(); 3567 if (note != null) { 3568 dst.note = new ArrayList<Annotation>(); 3569 for (Annotation i : note) 3570 dst.note.add(i.copy()); 3571 }; 3572 dst.quantity = quantity == null ? null : quantity.copy(); 3573 dst.parentDevice = parentDevice == null ? null : parentDevice.copy(); 3574 if (material != null) { 3575 dst.material = new ArrayList<DeviceDefinitionMaterialComponent>(); 3576 for (DeviceDefinitionMaterialComponent i : material) 3577 dst.material.add(i.copy()); 3578 }; 3579 } 3580 3581 protected DeviceDefinition typedCopy() { 3582 return copy(); 3583 } 3584 3585 @Override 3586 public boolean equalsDeep(Base other_) { 3587 if (!super.equalsDeep(other_)) 3588 return false; 3589 if (!(other_ instanceof DeviceDefinition)) 3590 return false; 3591 DeviceDefinition o = (DeviceDefinition) other_; 3592 return compareDeep(identifier, o.identifier, true) && compareDeep(udiDeviceIdentifier, o.udiDeviceIdentifier, true) 3593 && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(deviceName, o.deviceName, true) 3594 && compareDeep(modelNumber, o.modelNumber, true) && compareDeep(type, o.type, true) && compareDeep(specialization, o.specialization, true) 3595 && compareDeep(version, o.version, true) && compareDeep(safety, o.safety, true) && compareDeep(shelfLifeStorage, o.shelfLifeStorage, true) 3596 && compareDeep(physicalCharacteristics, o.physicalCharacteristics, true) && compareDeep(languageCode, o.languageCode, true) 3597 && compareDeep(capability, o.capability, true) && compareDeep(property, o.property, true) && compareDeep(owner, o.owner, true) 3598 && compareDeep(contact, o.contact, true) && compareDeep(url, o.url, true) && compareDeep(onlineInformation, o.onlineInformation, true) 3599 && compareDeep(note, o.note, true) && compareDeep(quantity, o.quantity, true) && compareDeep(parentDevice, o.parentDevice, true) 3600 && compareDeep(material, o.material, true); 3601 } 3602 3603 @Override 3604 public boolean equalsShallow(Base other_) { 3605 if (!super.equalsShallow(other_)) 3606 return false; 3607 if (!(other_ instanceof DeviceDefinition)) 3608 return false; 3609 DeviceDefinition o = (DeviceDefinition) other_; 3610 return compareValues(modelNumber, o.modelNumber, true) && compareValues(version, o.version, true) && compareValues(url, o.url, true) 3611 && compareValues(onlineInformation, o.onlineInformation, true); 3612 } 3613 3614 public boolean isEmpty() { 3615 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, udiDeviceIdentifier 3616 , manufacturer, deviceName, modelNumber, type, specialization, version, safety 3617 , shelfLifeStorage, physicalCharacteristics, languageCode, capability, property, owner 3618 , contact, url, onlineInformation, note, quantity, parentDevice, material); 3619 } 3620 3621 @Override 3622 public ResourceType getResourceType() { 3623 return ResourceType.DeviceDefinition; 3624 } 3625 3626 /** 3627 * Search parameter: <b>parent</b> 3628 * <p> 3629 * Description: <b>The parent DeviceDefinition resource</b><br> 3630 * Type: <b>reference</b><br> 3631 * Path: <b>DeviceDefinition.parentDevice</b><br> 3632 * </p> 3633 */ 3634 @SearchParamDefinition(name="parent", path="DeviceDefinition.parentDevice", description="The parent DeviceDefinition resource", type="reference", target={DeviceDefinition.class } ) 3635 public static final String SP_PARENT = "parent"; 3636 /** 3637 * <b>Fluent Client</b> search parameter constant for <b>parent</b> 3638 * <p> 3639 * Description: <b>The parent DeviceDefinition resource</b><br> 3640 * Type: <b>reference</b><br> 3641 * Path: <b>DeviceDefinition.parentDevice</b><br> 3642 * </p> 3643 */ 3644 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT); 3645 3646/** 3647 * Constant for fluent queries to be used to add include statements. Specifies 3648 * the path value of "<b>DeviceDefinition:parent</b>". 3649 */ 3650 public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("DeviceDefinition:parent").toLocked(); 3651 3652 /** 3653 * Search parameter: <b>identifier</b> 3654 * <p> 3655 * Description: <b>The identifier of the component</b><br> 3656 * Type: <b>token</b><br> 3657 * Path: <b>DeviceDefinition.identifier</b><br> 3658 * </p> 3659 */ 3660 @SearchParamDefinition(name="identifier", path="DeviceDefinition.identifier", description="The identifier of the component", type="token" ) 3661 public static final String SP_IDENTIFIER = "identifier"; 3662 /** 3663 * <b>Fluent Client</b> search parameter constant for <b>identifier</b> 3664 * <p> 3665 * Description: <b>The identifier of the component</b><br> 3666 * Type: <b>token</b><br> 3667 * Path: <b>DeviceDefinition.identifier</b><br> 3668 * </p> 3669 */ 3670 public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); 3671 3672 /** 3673 * Search parameter: <b>type</b> 3674 * <p> 3675 * Description: <b>The device component type</b><br> 3676 * Type: <b>token</b><br> 3677 * Path: <b>DeviceDefinition.type</b><br> 3678 * </p> 3679 */ 3680 @SearchParamDefinition(name="type", path="DeviceDefinition.type", description="The device component type", type="token" ) 3681 public static final String SP_TYPE = "type"; 3682 /** 3683 * <b>Fluent Client</b> search parameter constant for <b>type</b> 3684 * <p> 3685 * Description: <b>The device component type</b><br> 3686 * Type: <b>token</b><br> 3687 * Path: <b>DeviceDefinition.type</b><br> 3688 * </p> 3689 */ 3690 public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); 3691 3692 3693}