001package org.hl7.fhir.dstu3.model; 002 003/*- 004 * #%L 005 * org.hl7.fhir.dstu3 006 * %% 007 * Copyright (C) 2014 - 2019 Health Level 7 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023/* 024 Copyright (c) 2011+, HL7, Inc. 025 All rights reserved. 026 027 Redistribution and use in source and binary forms, with or without modification, 028 are permitted provided that the following conditions are met: 029 030 * Redistributions of source code must retain the above copyright notice, this 031 list of conditions and the following disclaimer. 032 * Redistributions in binary form must reproduce the above copyright notice, 033 this list of conditions and the following disclaimer in the documentation 034 and/or other materials provided with the distribution. 035 * Neither the name of HL7 nor the names of its contributors may be used to 036 endorse or promote products derived from this software without specific 037 prior written permission. 038 039 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 040 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 041 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 042 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 043 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 044 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 045 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 046 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 047 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 048 POSSIBILITY OF SUCH DAMAGE. 049 050*/ 051 052// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x 053import java.util.ArrayList; 054import java.util.Date; 055import java.util.List; 056 057import org.hl7.fhir.exceptions.FHIRException; 058import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 059import org.hl7.fhir.utilities.Utilities; 060 061import ca.uhn.fhir.model.api.annotation.Block; 062import ca.uhn.fhir.model.api.annotation.Child; 063import ca.uhn.fhir.model.api.annotation.Description; 064import ca.uhn.fhir.model.api.annotation.ResourceDef; 065import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; 066/** 067 * The characteristics, operational status and capabilities of a medical-related component of a medical device. 068 */ 069@ResourceDef(name="DeviceComponent", profile="http://hl7.org/fhir/Profile/DeviceComponent") 070public class DeviceComponent extends DomainResource { 071 072 public enum MeasmntPrinciple { 073 /** 074 * Measurement principle isn't in the list. 075 */ 076 OTHER, 077 /** 078 * Measurement is done using the chemical principle. 079 */ 080 CHEMICAL, 081 /** 082 * Measurement is done using the electrical principle. 083 */ 084 ELECTRICAL, 085 /** 086 * Measurement is done using the impedance principle. 087 */ 088 IMPEDANCE, 089 /** 090 * Measurement is done using the nuclear principle. 091 */ 092 NUCLEAR, 093 /** 094 * Measurement is done using the optical principle. 095 */ 096 OPTICAL, 097 /** 098 * Measurement is done using the thermal principle. 099 */ 100 THERMAL, 101 /** 102 * Measurement is done using the biological principle. 103 */ 104 BIOLOGICAL, 105 /** 106 * Measurement is done using the mechanical principle. 107 */ 108 MECHANICAL, 109 /** 110 * Measurement is done using the acoustical principle. 111 */ 112 ACOUSTICAL, 113 /** 114 * Measurement is done using the manual principle. 115 */ 116 MANUAL, 117 /** 118 * added to help the parsers with the generic types 119 */ 120 NULL; 121 public static MeasmntPrinciple fromCode(String codeString) throws FHIRException { 122 if (codeString == null || "".equals(codeString)) 123 return null; 124 if ("other".equals(codeString)) 125 return OTHER; 126 if ("chemical".equals(codeString)) 127 return CHEMICAL; 128 if ("electrical".equals(codeString)) 129 return ELECTRICAL; 130 if ("impedance".equals(codeString)) 131 return IMPEDANCE; 132 if ("nuclear".equals(codeString)) 133 return NUCLEAR; 134 if ("optical".equals(codeString)) 135 return OPTICAL; 136 if ("thermal".equals(codeString)) 137 return THERMAL; 138 if ("biological".equals(codeString)) 139 return BIOLOGICAL; 140 if ("mechanical".equals(codeString)) 141 return MECHANICAL; 142 if ("acoustical".equals(codeString)) 143 return ACOUSTICAL; 144 if ("manual".equals(codeString)) 145 return MANUAL; 146 if (Configuration.isAcceptInvalidEnums()) 147 return null; 148 else 149 throw new FHIRException("Unknown MeasmntPrinciple code '"+codeString+"'"); 150 } 151 public String toCode() { 152 switch (this) { 153 case OTHER: return "other"; 154 case CHEMICAL: return "chemical"; 155 case ELECTRICAL: return "electrical"; 156 case IMPEDANCE: return "impedance"; 157 case NUCLEAR: return "nuclear"; 158 case OPTICAL: return "optical"; 159 case THERMAL: return "thermal"; 160 case BIOLOGICAL: return "biological"; 161 case MECHANICAL: return "mechanical"; 162 case ACOUSTICAL: return "acoustical"; 163 case MANUAL: return "manual"; 164 default: return "?"; 165 } 166 } 167 public String getSystem() { 168 switch (this) { 169 case OTHER: return "http://hl7.org/fhir/measurement-principle"; 170 case CHEMICAL: return "http://hl7.org/fhir/measurement-principle"; 171 case ELECTRICAL: return "http://hl7.org/fhir/measurement-principle"; 172 case IMPEDANCE: return "http://hl7.org/fhir/measurement-principle"; 173 case NUCLEAR: return "http://hl7.org/fhir/measurement-principle"; 174 case OPTICAL: return "http://hl7.org/fhir/measurement-principle"; 175 case THERMAL: return "http://hl7.org/fhir/measurement-principle"; 176 case BIOLOGICAL: return "http://hl7.org/fhir/measurement-principle"; 177 case MECHANICAL: return "http://hl7.org/fhir/measurement-principle"; 178 case ACOUSTICAL: return "http://hl7.org/fhir/measurement-principle"; 179 case MANUAL: return "http://hl7.org/fhir/measurement-principle"; 180 default: return "?"; 181 } 182 } 183 public String getDefinition() { 184 switch (this) { 185 case OTHER: return "Measurement principle isn't in the list."; 186 case CHEMICAL: return "Measurement is done using the chemical principle."; 187 case ELECTRICAL: return "Measurement is done using the electrical principle."; 188 case IMPEDANCE: return "Measurement is done using the impedance principle."; 189 case NUCLEAR: return "Measurement is done using the nuclear principle."; 190 case OPTICAL: return "Measurement is done using the optical principle."; 191 case THERMAL: return "Measurement is done using the thermal principle."; 192 case BIOLOGICAL: return "Measurement is done using the biological principle."; 193 case MECHANICAL: return "Measurement is done using the mechanical principle."; 194 case ACOUSTICAL: return "Measurement is done using the acoustical principle."; 195 case MANUAL: return "Measurement is done using the manual principle."; 196 default: return "?"; 197 } 198 } 199 public String getDisplay() { 200 switch (this) { 201 case OTHER: return "MSP Other"; 202 case CHEMICAL: return "MSP Chemical"; 203 case ELECTRICAL: return "MSP Electrical"; 204 case IMPEDANCE: return "MSP Impedance"; 205 case NUCLEAR: return "MSP Nuclear"; 206 case OPTICAL: return "MSP Optical"; 207 case THERMAL: return "MSP Thermal"; 208 case BIOLOGICAL: return "MSP Biological"; 209 case MECHANICAL: return "MSP Mechanical"; 210 case ACOUSTICAL: return "MSP Acoustical"; 211 case MANUAL: return "MSP Manual"; 212 default: return "?"; 213 } 214 } 215 } 216 217 public static class MeasmntPrincipleEnumFactory implements EnumFactory<MeasmntPrinciple> { 218 public MeasmntPrinciple fromCode(String codeString) throws IllegalArgumentException { 219 if (codeString == null || "".equals(codeString)) 220 if (codeString == null || "".equals(codeString)) 221 return null; 222 if ("other".equals(codeString)) 223 return MeasmntPrinciple.OTHER; 224 if ("chemical".equals(codeString)) 225 return MeasmntPrinciple.CHEMICAL; 226 if ("electrical".equals(codeString)) 227 return MeasmntPrinciple.ELECTRICAL; 228 if ("impedance".equals(codeString)) 229 return MeasmntPrinciple.IMPEDANCE; 230 if ("nuclear".equals(codeString)) 231 return MeasmntPrinciple.NUCLEAR; 232 if ("optical".equals(codeString)) 233 return MeasmntPrinciple.OPTICAL; 234 if ("thermal".equals(codeString)) 235 return MeasmntPrinciple.THERMAL; 236 if ("biological".equals(codeString)) 237 return MeasmntPrinciple.BIOLOGICAL; 238 if ("mechanical".equals(codeString)) 239 return MeasmntPrinciple.MECHANICAL; 240 if ("acoustical".equals(codeString)) 241 return MeasmntPrinciple.ACOUSTICAL; 242 if ("manual".equals(codeString)) 243 return MeasmntPrinciple.MANUAL; 244 throw new IllegalArgumentException("Unknown MeasmntPrinciple code '"+codeString+"'"); 245 } 246 public Enumeration<MeasmntPrinciple> fromType(Base code) throws FHIRException { 247 if (code == null) 248 return null; 249 if (code.isEmpty()) 250 return new Enumeration<MeasmntPrinciple>(this); 251 String codeString = ((PrimitiveType) code).asStringValue(); 252 if (codeString == null || "".equals(codeString)) 253 return null; 254 if ("other".equals(codeString)) 255 return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.OTHER); 256 if ("chemical".equals(codeString)) 257 return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.CHEMICAL); 258 if ("electrical".equals(codeString)) 259 return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.ELECTRICAL); 260 if ("impedance".equals(codeString)) 261 return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.IMPEDANCE); 262 if ("nuclear".equals(codeString)) 263 return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.NUCLEAR); 264 if ("optical".equals(codeString)) 265 return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.OPTICAL); 266 if ("thermal".equals(codeString)) 267 return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.THERMAL); 268 if ("biological".equals(codeString)) 269 return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.BIOLOGICAL); 270 if ("mechanical".equals(codeString)) 271 return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.MECHANICAL); 272 if ("acoustical".equals(codeString)) 273 return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.ACOUSTICAL); 274 if ("manual".equals(codeString)) 275 return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.MANUAL); 276 throw new FHIRException("Unknown MeasmntPrinciple code '"+codeString+"'"); 277 } 278 public String toCode(MeasmntPrinciple code) { 279 if (code == MeasmntPrinciple.OTHER) 280 return "other"; 281 if (code == MeasmntPrinciple.CHEMICAL) 282 return "chemical"; 283 if (code == MeasmntPrinciple.ELECTRICAL) 284 return "electrical"; 285 if (code == MeasmntPrinciple.IMPEDANCE) 286 return "impedance"; 287 if (code == MeasmntPrinciple.NUCLEAR) 288 return "nuclear"; 289 if (code == MeasmntPrinciple.OPTICAL) 290 return "optical"; 291 if (code == MeasmntPrinciple.THERMAL) 292 return "thermal"; 293 if (code == MeasmntPrinciple.BIOLOGICAL) 294 return "biological"; 295 if (code == MeasmntPrinciple.MECHANICAL) 296 return "mechanical"; 297 if (code == MeasmntPrinciple.ACOUSTICAL) 298 return "acoustical"; 299 if (code == MeasmntPrinciple.MANUAL) 300 return "manual"; 301 return "?"; 302 } 303 public String toSystem(MeasmntPrinciple code) { 304 return code.getSystem(); 305 } 306 } 307 308 @Block() 309 public static class DeviceComponentProductionSpecificationComponent extends BackboneElement implements IBaseBackboneElement { 310 /** 311 * The specification type, such as, serial number, part number, hardware revision, software revision, etc. 312 */ 313 @Child(name = "specType", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) 314 @Description(shortDefinition="Type or kind of production specification, for example serial number or software revision", formalDefinition="The specification type, such as, serial number, part number, hardware revision, software revision, etc." ) 315 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/specification-type") 316 protected CodeableConcept specType; 317 318 /** 319 * The internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacturer can make use of. 320 */ 321 @Child(name = "componentId", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=true) 322 @Description(shortDefinition="Internal component unique identification", formalDefinition="The internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacturer can make use of." ) 323 protected Identifier componentId; 324 325 /** 326 * The printable string defining the component. 327 */ 328 @Child(name = "productionSpec", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) 329 @Description(shortDefinition="A printable string defining the component", formalDefinition="The printable string defining the component." ) 330 protected StringType productionSpec; 331 332 private static final long serialVersionUID = -1476597516L; 333 334 /** 335 * Constructor 336 */ 337 public DeviceComponentProductionSpecificationComponent() { 338 super(); 339 } 340 341 /** 342 * @return {@link #specType} (The specification type, such as, serial number, part number, hardware revision, software revision, etc.) 343 */ 344 public CodeableConcept getSpecType() { 345 if (this.specType == null) 346 if (Configuration.errorOnAutoCreate()) 347 throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.specType"); 348 else if (Configuration.doAutoCreate()) 349 this.specType = new CodeableConcept(); // cc 350 return this.specType; 351 } 352 353 public boolean hasSpecType() { 354 return this.specType != null && !this.specType.isEmpty(); 355 } 356 357 /** 358 * @param value {@link #specType} (The specification type, such as, serial number, part number, hardware revision, software revision, etc.) 359 */ 360 public DeviceComponentProductionSpecificationComponent setSpecType(CodeableConcept value) { 361 this.specType = value; 362 return this; 363 } 364 365 /** 366 * @return {@link #componentId} (The internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacturer can make use of.) 367 */ 368 public Identifier getComponentId() { 369 if (this.componentId == null) 370 if (Configuration.errorOnAutoCreate()) 371 throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.componentId"); 372 else if (Configuration.doAutoCreate()) 373 this.componentId = new Identifier(); // cc 374 return this.componentId; 375 } 376 377 public boolean hasComponentId() { 378 return this.componentId != null && !this.componentId.isEmpty(); 379 } 380 381 /** 382 * @param value {@link #componentId} (The internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacturer can make use of.) 383 */ 384 public DeviceComponentProductionSpecificationComponent setComponentId(Identifier value) { 385 this.componentId = value; 386 return this; 387 } 388 389 /** 390 * @return {@link #productionSpec} (The printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value 391 */ 392 public StringType getProductionSpecElement() { 393 if (this.productionSpec == null) 394 if (Configuration.errorOnAutoCreate()) 395 throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.productionSpec"); 396 else if (Configuration.doAutoCreate()) 397 this.productionSpec = new StringType(); // bb 398 return this.productionSpec; 399 } 400 401 public boolean hasProductionSpecElement() { 402 return this.productionSpec != null && !this.productionSpec.isEmpty(); 403 } 404 405 public boolean hasProductionSpec() { 406 return this.productionSpec != null && !this.productionSpec.isEmpty(); 407 } 408 409 /** 410 * @param value {@link #productionSpec} (The printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value 411 */ 412 public DeviceComponentProductionSpecificationComponent setProductionSpecElement(StringType value) { 413 this.productionSpec = value; 414 return this; 415 } 416 417 /** 418 * @return The printable string defining the component. 419 */ 420 public String getProductionSpec() { 421 return this.productionSpec == null ? null : this.productionSpec.getValue(); 422 } 423 424 /** 425 * @param value The printable string defining the component. 426 */ 427 public DeviceComponentProductionSpecificationComponent setProductionSpec(String value) { 428 if (Utilities.noString(value)) 429 this.productionSpec = null; 430 else { 431 if (this.productionSpec == null) 432 this.productionSpec = new StringType(); 433 this.productionSpec.setValue(value); 434 } 435 return this; 436 } 437 438 protected void listChildren(List<Property> children) { 439 super.listChildren(children); 440 children.add(new Property("specType", "CodeableConcept", "The specification type, such as, serial number, part number, hardware revision, software revision, etc.", 0, 1, specType)); 441 children.add(new Property("componentId", "Identifier", "The internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacturer can make use of.", 0, 1, componentId)); 442 children.add(new Property("productionSpec", "string", "The printable string defining the component.", 0, 1, productionSpec)); 443 } 444 445 @Override 446 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 447 switch (_hash) { 448 case -2133482091: /*specType*/ return new Property("specType", "CodeableConcept", "The specification type, such as, serial number, part number, hardware revision, software revision, etc.", 0, 1, specType); 449 case -985933064: /*componentId*/ return new Property("componentId", "Identifier", "The internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacturer can make use of.", 0, 1, componentId); 450 case 182147092: /*productionSpec*/ return new Property("productionSpec", "string", "The printable string defining the component.", 0, 1, productionSpec); 451 default: return super.getNamedProperty(_hash, _name, _checkValid); 452 } 453 454 } 455 456 @Override 457 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 458 switch (hash) { 459 case -2133482091: /*specType*/ return this.specType == null ? new Base[0] : new Base[] {this.specType}; // CodeableConcept 460 case -985933064: /*componentId*/ return this.componentId == null ? new Base[0] : new Base[] {this.componentId}; // Identifier 461 case 182147092: /*productionSpec*/ return this.productionSpec == null ? new Base[0] : new Base[] {this.productionSpec}; // StringType 462 default: return super.getProperty(hash, name, checkValid); 463 } 464 465 } 466 467 @Override 468 public Base setProperty(int hash, String name, Base value) throws FHIRException { 469 switch (hash) { 470 case -2133482091: // specType 471 this.specType = castToCodeableConcept(value); // CodeableConcept 472 return value; 473 case -985933064: // componentId 474 this.componentId = castToIdentifier(value); // Identifier 475 return value; 476 case 182147092: // productionSpec 477 this.productionSpec = castToString(value); // StringType 478 return value; 479 default: return super.setProperty(hash, name, value); 480 } 481 482 } 483 484 @Override 485 public Base setProperty(String name, Base value) throws FHIRException { 486 if (name.equals("specType")) { 487 this.specType = castToCodeableConcept(value); // CodeableConcept 488 } else if (name.equals("componentId")) { 489 this.componentId = castToIdentifier(value); // Identifier 490 } else if (name.equals("productionSpec")) { 491 this.productionSpec = castToString(value); // StringType 492 } else 493 return super.setProperty(name, value); 494 return value; 495 } 496 497 @Override 498 public Base makeProperty(int hash, String name) throws FHIRException { 499 switch (hash) { 500 case -2133482091: return getSpecType(); 501 case -985933064: return getComponentId(); 502 case 182147092: return getProductionSpecElement(); 503 default: return super.makeProperty(hash, name); 504 } 505 506 } 507 508 @Override 509 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 510 switch (hash) { 511 case -2133482091: /*specType*/ return new String[] {"CodeableConcept"}; 512 case -985933064: /*componentId*/ return new String[] {"Identifier"}; 513 case 182147092: /*productionSpec*/ return new String[] {"string"}; 514 default: return super.getTypesForProperty(hash, name); 515 } 516 517 } 518 519 @Override 520 public Base addChild(String name) throws FHIRException { 521 if (name.equals("specType")) { 522 this.specType = new CodeableConcept(); 523 return this.specType; 524 } 525 else if (name.equals("componentId")) { 526 this.componentId = new Identifier(); 527 return this.componentId; 528 } 529 else if (name.equals("productionSpec")) { 530 throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.productionSpec"); 531 } 532 else 533 return super.addChild(name); 534 } 535 536 public DeviceComponentProductionSpecificationComponent copy() { 537 DeviceComponentProductionSpecificationComponent dst = new DeviceComponentProductionSpecificationComponent(); 538 copyValues(dst); 539 dst.specType = specType == null ? null : specType.copy(); 540 dst.componentId = componentId == null ? null : componentId.copy(); 541 dst.productionSpec = productionSpec == null ? null : productionSpec.copy(); 542 return dst; 543 } 544 545 @Override 546 public boolean equalsDeep(Base other_) { 547 if (!super.equalsDeep(other_)) 548 return false; 549 if (!(other_ instanceof DeviceComponentProductionSpecificationComponent)) 550 return false; 551 DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other_; 552 return compareDeep(specType, o.specType, true) && compareDeep(componentId, o.componentId, true) 553 && compareDeep(productionSpec, o.productionSpec, true); 554 } 555 556 @Override 557 public boolean equalsShallow(Base other_) { 558 if (!super.equalsShallow(other_)) 559 return false; 560 if (!(other_ instanceof DeviceComponentProductionSpecificationComponent)) 561 return false; 562 DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other_; 563 return compareValues(productionSpec, o.productionSpec, true); 564 } 565 566 public boolean isEmpty() { 567 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(specType, componentId, productionSpec 568 ); 569 } 570 571 public String fhirType() { 572 return "DeviceComponent.productionSpecification"; 573 574 } 575 576 } 577 578 /** 579 * The locally assigned unique identification by the software. For example: handle ID. 580 */ 581 @Child(name = "identifier", type = {Identifier.class}, order=0, min=1, max=1, modifier=false, summary=true) 582 @Description(shortDefinition="Instance id assigned by the software stack", formalDefinition="The locally assigned unique identification by the software. For example: handle ID." ) 583 protected Identifier identifier; 584 585 /** 586 * The component type as defined in the object-oriented or metric nomenclature partition. 587 */ 588 @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) 589 @Description(shortDefinition="What kind of component it is", formalDefinition="The component type as defined in the object-oriented or metric nomenclature partition." ) 590 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-kind") 591 protected CodeableConcept type; 592 593 /** 594 * The timestamp for the most recent system change which includes device configuration or setting change. 595 */ 596 @Child(name = "lastSystemChange", type = {InstantType.class}, order=2, min=0, max=1, modifier=false, summary=true) 597 @Description(shortDefinition="Recent system change timestamp", formalDefinition="The timestamp for the most recent system change which includes device configuration or setting change." ) 598 protected InstantType lastSystemChange; 599 600 /** 601 * The link to the source Device that contains administrative device information such as manufacture, serial number, etc. 602 */ 603 @Child(name = "source", type = {Device.class}, order=3, min=0, max=1, modifier=false, summary=true) 604 @Description(shortDefinition="Top-level device resource link", formalDefinition="The link to the source Device that contains administrative device information such as manufacture, serial number, etc." ) 605 protected Reference source; 606 607 /** 608 * The actual object that is the target of the reference (The link to the source Device that contains administrative device information such as manufacture, serial number, etc.) 609 */ 610 protected Device sourceTarget; 611 612 /** 613 * The link to the parent resource. For example: Channel is linked to its VMD parent. 614 */ 615 @Child(name = "parent", type = {DeviceComponent.class}, order=4, min=0, max=1, modifier=false, summary=true) 616 @Description(shortDefinition="Parent resource link", formalDefinition="The link to the parent resource. For example: Channel is linked to its VMD parent." ) 617 protected Reference parent; 618 619 /** 620 * The actual object that is the target of the reference (The link to the parent resource. For example: Channel is linked to its VMD parent.) 621 */ 622 protected DeviceComponent parentTarget; 623 624 /** 625 * The current operational status of the device. For example: On, Off, Standby, etc. 626 */ 627 @Child(name = "operationalStatus", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 628 @Description(shortDefinition="Current operational status of the component, for example On, Off or Standby", formalDefinition="The current operational status of the device. For example: On, Off, Standby, etc." ) 629 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/operational-status") 630 protected List<CodeableConcept> operationalStatus; 631 632 /** 633 * The parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular. 634 */ 635 @Child(name = "parameterGroup", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) 636 @Description(shortDefinition="Current supported parameter group", formalDefinition="The parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular." ) 637 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/parameter-group") 638 protected CodeableConcept parameterGroup; 639 640 /** 641 * The physical principle of the measurement. For example: thermal, chemical, acoustical, etc. 642 */ 643 @Child(name = "measurementPrinciple", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true) 644 @Description(shortDefinition="other | chemical | electrical | impedance | nuclear | optical | thermal | biological | mechanical | acoustical | manual+", formalDefinition="The physical principle of the measurement. For example: thermal, chemical, acoustical, etc." ) 645 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measurement-principle") 646 protected Enumeration<MeasmntPrinciple> measurementPrinciple; 647 648 /** 649 * The production specification such as component revision, serial number, etc. 650 */ 651 @Child(name = "productionSpecification", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 652 @Description(shortDefinition="Specification details such as Component Revisions, or Serial Numbers", formalDefinition="The production specification such as component revision, serial number, etc." ) 653 protected List<DeviceComponentProductionSpecificationComponent> productionSpecification; 654 655 /** 656 * The language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US. 657 */ 658 @Child(name = "languageCode", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true) 659 @Description(shortDefinition="Language code for the human-readable text strings produced by the device", formalDefinition="The language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US." ) 660 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages") 661 protected CodeableConcept languageCode; 662 663 private static final long serialVersionUID = 32987426L; 664 665 /** 666 * Constructor 667 */ 668 public DeviceComponent() { 669 super(); 670 } 671 672 /** 673 * Constructor 674 */ 675 public DeviceComponent(Identifier identifier, CodeableConcept type) { 676 super(); 677 this.identifier = identifier; 678 this.type = type; 679 } 680 681 /** 682 * @return {@link #identifier} (The locally assigned unique identification by the software. For example: handle ID.) 683 */ 684 public Identifier getIdentifier() { 685 if (this.identifier == null) 686 if (Configuration.errorOnAutoCreate()) 687 throw new Error("Attempt to auto-create DeviceComponent.identifier"); 688 else if (Configuration.doAutoCreate()) 689 this.identifier = new Identifier(); // cc 690 return this.identifier; 691 } 692 693 public boolean hasIdentifier() { 694 return this.identifier != null && !this.identifier.isEmpty(); 695 } 696 697 /** 698 * @param value {@link #identifier} (The locally assigned unique identification by the software. For example: handle ID.) 699 */ 700 public DeviceComponent setIdentifier(Identifier value) { 701 this.identifier = value; 702 return this; 703 } 704 705 /** 706 * @return {@link #type} (The component type as defined in the object-oriented or metric nomenclature partition.) 707 */ 708 public CodeableConcept getType() { 709 if (this.type == null) 710 if (Configuration.errorOnAutoCreate()) 711 throw new Error("Attempt to auto-create DeviceComponent.type"); 712 else if (Configuration.doAutoCreate()) 713 this.type = new CodeableConcept(); // cc 714 return this.type; 715 } 716 717 public boolean hasType() { 718 return this.type != null && !this.type.isEmpty(); 719 } 720 721 /** 722 * @param value {@link #type} (The component type as defined in the object-oriented or metric nomenclature partition.) 723 */ 724 public DeviceComponent setType(CodeableConcept value) { 725 this.type = value; 726 return this; 727 } 728 729 /** 730 * @return {@link #lastSystemChange} (The timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value 731 */ 732 public InstantType getLastSystemChangeElement() { 733 if (this.lastSystemChange == null) 734 if (Configuration.errorOnAutoCreate()) 735 throw new Error("Attempt to auto-create DeviceComponent.lastSystemChange"); 736 else if (Configuration.doAutoCreate()) 737 this.lastSystemChange = new InstantType(); // bb 738 return this.lastSystemChange; 739 } 740 741 public boolean hasLastSystemChangeElement() { 742 return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); 743 } 744 745 public boolean hasLastSystemChange() { 746 return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); 747 } 748 749 /** 750 * @param value {@link #lastSystemChange} (The timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value 751 */ 752 public DeviceComponent setLastSystemChangeElement(InstantType value) { 753 this.lastSystemChange = value; 754 return this; 755 } 756 757 /** 758 * @return The timestamp for the most recent system change which includes device configuration or setting change. 759 */ 760 public Date getLastSystemChange() { 761 return this.lastSystemChange == null ? null : this.lastSystemChange.getValue(); 762 } 763 764 /** 765 * @param value The timestamp for the most recent system change which includes device configuration or setting change. 766 */ 767 public DeviceComponent setLastSystemChange(Date value) { 768 if (value == null) 769 this.lastSystemChange = null; 770 else { 771 if (this.lastSystemChange == null) 772 this.lastSystemChange = new InstantType(); 773 this.lastSystemChange.setValue(value); 774 } 775 return this; 776 } 777 778 /** 779 * @return {@link #source} (The link to the source Device that contains administrative device information such as manufacture, serial number, etc.) 780 */ 781 public Reference getSource() { 782 if (this.source == null) 783 if (Configuration.errorOnAutoCreate()) 784 throw new Error("Attempt to auto-create DeviceComponent.source"); 785 else if (Configuration.doAutoCreate()) 786 this.source = new Reference(); // cc 787 return this.source; 788 } 789 790 public boolean hasSource() { 791 return this.source != null && !this.source.isEmpty(); 792 } 793 794 /** 795 * @param value {@link #source} (The link to the source Device that contains administrative device information such as manufacture, serial number, etc.) 796 */ 797 public DeviceComponent setSource(Reference value) { 798 this.source = value; 799 return this; 800 } 801 802 /** 803 * @return {@link #source} 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 link to the source Device that contains administrative device information such as manufacture, serial number, etc.) 804 */ 805 public Device getSourceTarget() { 806 if (this.sourceTarget == null) 807 if (Configuration.errorOnAutoCreate()) 808 throw new Error("Attempt to auto-create DeviceComponent.source"); 809 else if (Configuration.doAutoCreate()) 810 this.sourceTarget = new Device(); // aa 811 return this.sourceTarget; 812 } 813 814 /** 815 * @param value {@link #source} 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 link to the source Device that contains administrative device information such as manufacture, serial number, etc.) 816 */ 817 public DeviceComponent setSourceTarget(Device value) { 818 this.sourceTarget = value; 819 return this; 820 } 821 822 /** 823 * @return {@link #parent} (The link to the parent resource. For example: Channel is linked to its VMD parent.) 824 */ 825 public Reference getParent() { 826 if (this.parent == null) 827 if (Configuration.errorOnAutoCreate()) 828 throw new Error("Attempt to auto-create DeviceComponent.parent"); 829 else if (Configuration.doAutoCreate()) 830 this.parent = new Reference(); // cc 831 return this.parent; 832 } 833 834 public boolean hasParent() { 835 return this.parent != null && !this.parent.isEmpty(); 836 } 837 838 /** 839 * @param value {@link #parent} (The link to the parent resource. For example: Channel is linked to its VMD parent.) 840 */ 841 public DeviceComponent setParent(Reference value) { 842 this.parent = value; 843 return this; 844 } 845 846 /** 847 * @return {@link #parent} 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 link to the parent resource. For example: Channel is linked to its VMD parent.) 848 */ 849 public DeviceComponent getParentTarget() { 850 if (this.parentTarget == null) 851 if (Configuration.errorOnAutoCreate()) 852 throw new Error("Attempt to auto-create DeviceComponent.parent"); 853 else if (Configuration.doAutoCreate()) 854 this.parentTarget = new DeviceComponent(); // aa 855 return this.parentTarget; 856 } 857 858 /** 859 * @param value {@link #parent} 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 link to the parent resource. For example: Channel is linked to its VMD parent.) 860 */ 861 public DeviceComponent setParentTarget(DeviceComponent value) { 862 this.parentTarget = value; 863 return this; 864 } 865 866 /** 867 * @return {@link #operationalStatus} (The current operational status of the device. For example: On, Off, Standby, etc.) 868 */ 869 public List<CodeableConcept> getOperationalStatus() { 870 if (this.operationalStatus == null) 871 this.operationalStatus = new ArrayList<CodeableConcept>(); 872 return this.operationalStatus; 873 } 874 875 /** 876 * @return Returns a reference to <code>this</code> for easy method chaining 877 */ 878 public DeviceComponent setOperationalStatus(List<CodeableConcept> theOperationalStatus) { 879 this.operationalStatus = theOperationalStatus; 880 return this; 881 } 882 883 public boolean hasOperationalStatus() { 884 if (this.operationalStatus == null) 885 return false; 886 for (CodeableConcept item : this.operationalStatus) 887 if (!item.isEmpty()) 888 return true; 889 return false; 890 } 891 892 public CodeableConcept addOperationalStatus() { //3 893 CodeableConcept t = new CodeableConcept(); 894 if (this.operationalStatus == null) 895 this.operationalStatus = new ArrayList<CodeableConcept>(); 896 this.operationalStatus.add(t); 897 return t; 898 } 899 900 public DeviceComponent addOperationalStatus(CodeableConcept t) { //3 901 if (t == null) 902 return this; 903 if (this.operationalStatus == null) 904 this.operationalStatus = new ArrayList<CodeableConcept>(); 905 this.operationalStatus.add(t); 906 return this; 907 } 908 909 /** 910 * @return The first repetition of repeating field {@link #operationalStatus}, creating it if it does not already exist 911 */ 912 public CodeableConcept getOperationalStatusFirstRep() { 913 if (getOperationalStatus().isEmpty()) { 914 addOperationalStatus(); 915 } 916 return getOperationalStatus().get(0); 917 } 918 919 /** 920 * @return {@link #parameterGroup} (The parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.) 921 */ 922 public CodeableConcept getParameterGroup() { 923 if (this.parameterGroup == null) 924 if (Configuration.errorOnAutoCreate()) 925 throw new Error("Attempt to auto-create DeviceComponent.parameterGroup"); 926 else if (Configuration.doAutoCreate()) 927 this.parameterGroup = new CodeableConcept(); // cc 928 return this.parameterGroup; 929 } 930 931 public boolean hasParameterGroup() { 932 return this.parameterGroup != null && !this.parameterGroup.isEmpty(); 933 } 934 935 /** 936 * @param value {@link #parameterGroup} (The parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.) 937 */ 938 public DeviceComponent setParameterGroup(CodeableConcept value) { 939 this.parameterGroup = value; 940 return this; 941 } 942 943 /** 944 * @return {@link #measurementPrinciple} (The physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value 945 */ 946 public Enumeration<MeasmntPrinciple> getMeasurementPrincipleElement() { 947 if (this.measurementPrinciple == null) 948 if (Configuration.errorOnAutoCreate()) 949 throw new Error("Attempt to auto-create DeviceComponent.measurementPrinciple"); 950 else if (Configuration.doAutoCreate()) 951 this.measurementPrinciple = new Enumeration<MeasmntPrinciple>(new MeasmntPrincipleEnumFactory()); // bb 952 return this.measurementPrinciple; 953 } 954 955 public boolean hasMeasurementPrincipleElement() { 956 return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); 957 } 958 959 public boolean hasMeasurementPrinciple() { 960 return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); 961 } 962 963 /** 964 * @param value {@link #measurementPrinciple} (The physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value 965 */ 966 public DeviceComponent setMeasurementPrincipleElement(Enumeration<MeasmntPrinciple> value) { 967 this.measurementPrinciple = value; 968 return this; 969 } 970 971 /** 972 * @return The physical principle of the measurement. For example: thermal, chemical, acoustical, etc. 973 */ 974 public MeasmntPrinciple getMeasurementPrinciple() { 975 return this.measurementPrinciple == null ? null : this.measurementPrinciple.getValue(); 976 } 977 978 /** 979 * @param value The physical principle of the measurement. For example: thermal, chemical, acoustical, etc. 980 */ 981 public DeviceComponent setMeasurementPrinciple(MeasmntPrinciple value) { 982 if (value == null) 983 this.measurementPrinciple = null; 984 else { 985 if (this.measurementPrinciple == null) 986 this.measurementPrinciple = new Enumeration<MeasmntPrinciple>(new MeasmntPrincipleEnumFactory()); 987 this.measurementPrinciple.setValue(value); 988 } 989 return this; 990 } 991 992 /** 993 * @return {@link #productionSpecification} (The production specification such as component revision, serial number, etc.) 994 */ 995 public List<DeviceComponentProductionSpecificationComponent> getProductionSpecification() { 996 if (this.productionSpecification == null) 997 this.productionSpecification = new ArrayList<DeviceComponentProductionSpecificationComponent>(); 998 return this.productionSpecification; 999 } 1000 1001 /** 1002 * @return Returns a reference to <code>this</code> for easy method chaining 1003 */ 1004 public DeviceComponent setProductionSpecification(List<DeviceComponentProductionSpecificationComponent> theProductionSpecification) { 1005 this.productionSpecification = theProductionSpecification; 1006 return this; 1007 } 1008 1009 public boolean hasProductionSpecification() { 1010 if (this.productionSpecification == null) 1011 return false; 1012 for (DeviceComponentProductionSpecificationComponent item : this.productionSpecification) 1013 if (!item.isEmpty()) 1014 return true; 1015 return false; 1016 } 1017 1018 public DeviceComponentProductionSpecificationComponent addProductionSpecification() { //3 1019 DeviceComponentProductionSpecificationComponent t = new DeviceComponentProductionSpecificationComponent(); 1020 if (this.productionSpecification == null) 1021 this.productionSpecification = new ArrayList<DeviceComponentProductionSpecificationComponent>(); 1022 this.productionSpecification.add(t); 1023 return t; 1024 } 1025 1026 public DeviceComponent addProductionSpecification(DeviceComponentProductionSpecificationComponent t) { //3 1027 if (t == null) 1028 return this; 1029 if (this.productionSpecification == null) 1030 this.productionSpecification = new ArrayList<DeviceComponentProductionSpecificationComponent>(); 1031 this.productionSpecification.add(t); 1032 return this; 1033 } 1034 1035 /** 1036 * @return The first repetition of repeating field {@link #productionSpecification}, creating it if it does not already exist 1037 */ 1038 public DeviceComponentProductionSpecificationComponent getProductionSpecificationFirstRep() { 1039 if (getProductionSpecification().isEmpty()) { 1040 addProductionSpecification(); 1041 } 1042 return getProductionSpecification().get(0); 1043 } 1044 1045 /** 1046 * @return {@link #languageCode} (The language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) 1047 */ 1048 public CodeableConcept getLanguageCode() { 1049 if (this.languageCode == null) 1050 if (Configuration.errorOnAutoCreate()) 1051 throw new Error("Attempt to auto-create DeviceComponent.languageCode"); 1052 else if (Configuration.doAutoCreate()) 1053 this.languageCode = new CodeableConcept(); // cc 1054 return this.languageCode; 1055 } 1056 1057 public boolean hasLanguageCode() { 1058 return this.languageCode != null && !this.languageCode.isEmpty(); 1059 } 1060 1061 /** 1062 * @param value {@link #languageCode} (The language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) 1063 */ 1064 public DeviceComponent setLanguageCode(CodeableConcept value) { 1065 this.languageCode = value; 1066 return this; 1067 } 1068 1069 protected void listChildren(List<Property> children) { 1070 super.listChildren(children); 1071 children.add(new Property("identifier", "Identifier", "The locally assigned unique identification by the software. For example: handle ID.", 0, 1, identifier)); 1072 children.add(new Property("type", "CodeableConcept", "The component type as defined in the object-oriented or metric nomenclature partition.", 0, 1, type)); 1073 children.add(new Property("lastSystemChange", "instant", "The timestamp for the most recent system change which includes device configuration or setting change.", 0, 1, lastSystemChange)); 1074 children.add(new Property("source", "Reference(Device)", "The link to the source Device that contains administrative device information such as manufacture, serial number, etc.", 0, 1, source)); 1075 children.add(new Property("parent", "Reference(DeviceComponent)", "The link to the parent resource. For example: Channel is linked to its VMD parent.", 0, 1, parent)); 1076 children.add(new Property("operationalStatus", "CodeableConcept", "The current operational status of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalStatus)); 1077 children.add(new Property("parameterGroup", "CodeableConcept", "The parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.", 0, 1, parameterGroup)); 1078 children.add(new Property("measurementPrinciple", "code", "The physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, 1, measurementPrinciple)); 1079 children.add(new Property("productionSpecification", "", "The production specification such as component revision, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, productionSpecification)); 1080 children.add(new Property("languageCode", "CodeableConcept", "The language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.", 0, 1, languageCode)); 1081 } 1082 1083 @Override 1084 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1085 switch (_hash) { 1086 case -1618432855: /*identifier*/ return new Property("identifier", "Identifier", "The locally assigned unique identification by the software. For example: handle ID.", 0, 1, identifier); 1087 case 3575610: /*type*/ return new Property("type", "CodeableConcept", "The component type as defined in the object-oriented or metric nomenclature partition.", 0, 1, type); 1088 case -2072475531: /*lastSystemChange*/ return new Property("lastSystemChange", "instant", "The timestamp for the most recent system change which includes device configuration or setting change.", 0, 1, lastSystemChange); 1089 case -896505829: /*source*/ return new Property("source", "Reference(Device)", "The link to the source Device that contains administrative device information such as manufacture, serial number, etc.", 0, 1, source); 1090 case -995424086: /*parent*/ return new Property("parent", "Reference(DeviceComponent)", "The link to the parent resource. For example: Channel is linked to its VMD parent.", 0, 1, parent); 1091 case -2103166364: /*operationalStatus*/ return new Property("operationalStatus", "CodeableConcept", "The current operational status of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalStatus); 1092 case 1111110742: /*parameterGroup*/ return new Property("parameterGroup", "CodeableConcept", "The parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.", 0, 1, parameterGroup); 1093 case 24324384: /*measurementPrinciple*/ return new Property("measurementPrinciple", "code", "The physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, 1, measurementPrinciple); 1094 case -455527222: /*productionSpecification*/ return new Property("productionSpecification", "", "The production specification such as component revision, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, productionSpecification); 1095 case -2092349083: /*languageCode*/ return new Property("languageCode", "CodeableConcept", "The language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.", 0, 1, languageCode); 1096 default: return super.getNamedProperty(_hash, _name, _checkValid); 1097 } 1098 1099 } 1100 1101 @Override 1102 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1103 switch (hash) { 1104 case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier 1105 case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept 1106 case -2072475531: /*lastSystemChange*/ return this.lastSystemChange == null ? new Base[0] : new Base[] {this.lastSystemChange}; // InstantType 1107 case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference 1108 case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Reference 1109 case -2103166364: /*operationalStatus*/ return this.operationalStatus == null ? new Base[0] : this.operationalStatus.toArray(new Base[this.operationalStatus.size()]); // CodeableConcept 1110 case 1111110742: /*parameterGroup*/ return this.parameterGroup == null ? new Base[0] : new Base[] {this.parameterGroup}; // CodeableConcept 1111 case 24324384: /*measurementPrinciple*/ return this.measurementPrinciple == null ? new Base[0] : new Base[] {this.measurementPrinciple}; // Enumeration<MeasmntPrinciple> 1112 case -455527222: /*productionSpecification*/ return this.productionSpecification == null ? new Base[0] : this.productionSpecification.toArray(new Base[this.productionSpecification.size()]); // DeviceComponentProductionSpecificationComponent 1113 case -2092349083: /*languageCode*/ return this.languageCode == null ? new Base[0] : new Base[] {this.languageCode}; // CodeableConcept 1114 default: return super.getProperty(hash, name, checkValid); 1115 } 1116 1117 } 1118 1119 @Override 1120 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1121 switch (hash) { 1122 case -1618432855: // identifier 1123 this.identifier = castToIdentifier(value); // Identifier 1124 return value; 1125 case 3575610: // type 1126 this.type = castToCodeableConcept(value); // CodeableConcept 1127 return value; 1128 case -2072475531: // lastSystemChange 1129 this.lastSystemChange = castToInstant(value); // InstantType 1130 return value; 1131 case -896505829: // source 1132 this.source = castToReference(value); // Reference 1133 return value; 1134 case -995424086: // parent 1135 this.parent = castToReference(value); // Reference 1136 return value; 1137 case -2103166364: // operationalStatus 1138 this.getOperationalStatus().add(castToCodeableConcept(value)); // CodeableConcept 1139 return value; 1140 case 1111110742: // parameterGroup 1141 this.parameterGroup = castToCodeableConcept(value); // CodeableConcept 1142 return value; 1143 case 24324384: // measurementPrinciple 1144 value = new MeasmntPrincipleEnumFactory().fromType(castToCode(value)); 1145 this.measurementPrinciple = (Enumeration) value; // Enumeration<MeasmntPrinciple> 1146 return value; 1147 case -455527222: // productionSpecification 1148 this.getProductionSpecification().add((DeviceComponentProductionSpecificationComponent) value); // DeviceComponentProductionSpecificationComponent 1149 return value; 1150 case -2092349083: // languageCode 1151 this.languageCode = castToCodeableConcept(value); // CodeableConcept 1152 return value; 1153 default: return super.setProperty(hash, name, value); 1154 } 1155 1156 } 1157 1158 @Override 1159 public Base setProperty(String name, Base value) throws FHIRException { 1160 if (name.equals("identifier")) { 1161 this.identifier = castToIdentifier(value); // Identifier 1162 } else if (name.equals("type")) { 1163 this.type = castToCodeableConcept(value); // CodeableConcept 1164 } else if (name.equals("lastSystemChange")) { 1165 this.lastSystemChange = castToInstant(value); // InstantType 1166 } else if (name.equals("source")) { 1167 this.source = castToReference(value); // Reference 1168 } else if (name.equals("parent")) { 1169 this.parent = castToReference(value); // Reference 1170 } else if (name.equals("operationalStatus")) { 1171 this.getOperationalStatus().add(castToCodeableConcept(value)); 1172 } else if (name.equals("parameterGroup")) { 1173 this.parameterGroup = castToCodeableConcept(value); // CodeableConcept 1174 } else if (name.equals("measurementPrinciple")) { 1175 value = new MeasmntPrincipleEnumFactory().fromType(castToCode(value)); 1176 this.measurementPrinciple = (Enumeration) value; // Enumeration<MeasmntPrinciple> 1177 } else if (name.equals("productionSpecification")) { 1178 this.getProductionSpecification().add((DeviceComponentProductionSpecificationComponent) value); 1179 } else if (name.equals("languageCode")) { 1180 this.languageCode = castToCodeableConcept(value); // CodeableConcept 1181 } else 1182 return super.setProperty(name, value); 1183 return value; 1184 } 1185 1186 @Override 1187 public Base makeProperty(int hash, String name) throws FHIRException { 1188 switch (hash) { 1189 case -1618432855: return getIdentifier(); 1190 case 3575610: return getType(); 1191 case -2072475531: return getLastSystemChangeElement(); 1192 case -896505829: return getSource(); 1193 case -995424086: return getParent(); 1194 case -2103166364: return addOperationalStatus(); 1195 case 1111110742: return getParameterGroup(); 1196 case 24324384: return getMeasurementPrincipleElement(); 1197 case -455527222: return addProductionSpecification(); 1198 case -2092349083: return getLanguageCode(); 1199 default: return super.makeProperty(hash, name); 1200 } 1201 1202 } 1203 1204 @Override 1205 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1206 switch (hash) { 1207 case -1618432855: /*identifier*/ return new String[] {"Identifier"}; 1208 case 3575610: /*type*/ return new String[] {"CodeableConcept"}; 1209 case -2072475531: /*lastSystemChange*/ return new String[] {"instant"}; 1210 case -896505829: /*source*/ return new String[] {"Reference"}; 1211 case -995424086: /*parent*/ return new String[] {"Reference"}; 1212 case -2103166364: /*operationalStatus*/ return new String[] {"CodeableConcept"}; 1213 case 1111110742: /*parameterGroup*/ return new String[] {"CodeableConcept"}; 1214 case 24324384: /*measurementPrinciple*/ return new String[] {"code"}; 1215 case -455527222: /*productionSpecification*/ return new String[] {}; 1216 case -2092349083: /*languageCode*/ return new String[] {"CodeableConcept"}; 1217 default: return super.getTypesForProperty(hash, name); 1218 } 1219 1220 } 1221 1222 @Override 1223 public Base addChild(String name) throws FHIRException { 1224 if (name.equals("identifier")) { 1225 this.identifier = new Identifier(); 1226 return this.identifier; 1227 } 1228 else if (name.equals("type")) { 1229 this.type = new CodeableConcept(); 1230 return this.type; 1231 } 1232 else if (name.equals("lastSystemChange")) { 1233 throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.lastSystemChange"); 1234 } 1235 else if (name.equals("source")) { 1236 this.source = new Reference(); 1237 return this.source; 1238 } 1239 else if (name.equals("parent")) { 1240 this.parent = new Reference(); 1241 return this.parent; 1242 } 1243 else if (name.equals("operationalStatus")) { 1244 return addOperationalStatus(); 1245 } 1246 else if (name.equals("parameterGroup")) { 1247 this.parameterGroup = new CodeableConcept(); 1248 return this.parameterGroup; 1249 } 1250 else if (name.equals("measurementPrinciple")) { 1251 throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.measurementPrinciple"); 1252 } 1253 else if (name.equals("productionSpecification")) { 1254 return addProductionSpecification(); 1255 } 1256 else if (name.equals("languageCode")) { 1257 this.languageCode = new CodeableConcept(); 1258 return this.languageCode; 1259 } 1260 else 1261 return super.addChild(name); 1262 } 1263 1264 public String fhirType() { 1265 return "DeviceComponent"; 1266 1267 } 1268 1269 public DeviceComponent copy() { 1270 DeviceComponent dst = new DeviceComponent(); 1271 copyValues(dst); 1272 dst.identifier = identifier == null ? null : identifier.copy(); 1273 dst.type = type == null ? null : type.copy(); 1274 dst.lastSystemChange = lastSystemChange == null ? null : lastSystemChange.copy(); 1275 dst.source = source == null ? null : source.copy(); 1276 dst.parent = parent == null ? null : parent.copy(); 1277 if (operationalStatus != null) { 1278 dst.operationalStatus = new ArrayList<CodeableConcept>(); 1279 for (CodeableConcept i : operationalStatus) 1280 dst.operationalStatus.add(i.copy()); 1281 }; 1282 dst.parameterGroup = parameterGroup == null ? null : parameterGroup.copy(); 1283 dst.measurementPrinciple = measurementPrinciple == null ? null : measurementPrinciple.copy(); 1284 if (productionSpecification != null) { 1285 dst.productionSpecification = new ArrayList<DeviceComponentProductionSpecificationComponent>(); 1286 for (DeviceComponentProductionSpecificationComponent i : productionSpecification) 1287 dst.productionSpecification.add(i.copy()); 1288 }; 1289 dst.languageCode = languageCode == null ? null : languageCode.copy(); 1290 return dst; 1291 } 1292 1293 protected DeviceComponent typedCopy() { 1294 return copy(); 1295 } 1296 1297 @Override 1298 public boolean equalsDeep(Base other_) { 1299 if (!super.equalsDeep(other_)) 1300 return false; 1301 if (!(other_ instanceof DeviceComponent)) 1302 return false; 1303 DeviceComponent o = (DeviceComponent) other_; 1304 return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(lastSystemChange, o.lastSystemChange, true) 1305 && compareDeep(source, o.source, true) && compareDeep(parent, o.parent, true) && compareDeep(operationalStatus, o.operationalStatus, true) 1306 && compareDeep(parameterGroup, o.parameterGroup, true) && compareDeep(measurementPrinciple, o.measurementPrinciple, true) 1307 && compareDeep(productionSpecification, o.productionSpecification, true) && compareDeep(languageCode, o.languageCode, true) 1308 ; 1309 } 1310 1311 @Override 1312 public boolean equalsShallow(Base other_) { 1313 if (!super.equalsShallow(other_)) 1314 return false; 1315 if (!(other_ instanceof DeviceComponent)) 1316 return false; 1317 DeviceComponent o = (DeviceComponent) other_; 1318 return compareValues(lastSystemChange, o.lastSystemChange, true) && compareValues(measurementPrinciple, o.measurementPrinciple, true) 1319 ; 1320 } 1321 1322 public boolean isEmpty() { 1323 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, lastSystemChange 1324 , source, parent, operationalStatus, parameterGroup, measurementPrinciple, productionSpecification 1325 , languageCode); 1326 } 1327 1328 @Override 1329 public ResourceType getResourceType() { 1330 return ResourceType.DeviceComponent; 1331 } 1332 1333 /** 1334 * Search parameter: <b>parent</b> 1335 * <p> 1336 * Description: <b>The parent DeviceComponent resource</b><br> 1337 * Type: <b>reference</b><br> 1338 * Path: <b>DeviceComponent.parent</b><br> 1339 * </p> 1340 */ 1341 @SearchParamDefinition(name="parent", path="DeviceComponent.parent", description="The parent DeviceComponent resource", type="reference", target={DeviceComponent.class } ) 1342 public static final String SP_PARENT = "parent"; 1343 /** 1344 * <b>Fluent Client</b> search parameter constant for <b>parent</b> 1345 * <p> 1346 * Description: <b>The parent DeviceComponent resource</b><br> 1347 * Type: <b>reference</b><br> 1348 * Path: <b>DeviceComponent.parent</b><br> 1349 * </p> 1350 */ 1351 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT); 1352 1353/** 1354 * Constant for fluent queries to be used to add include statements. Specifies 1355 * the path value of "<b>DeviceComponent:parent</b>". 1356 */ 1357 public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("DeviceComponent:parent").toLocked(); 1358 1359 /** 1360 * Search parameter: <b>identifier</b> 1361 * <p> 1362 * Description: <b>The identifier of the component</b><br> 1363 * Type: <b>token</b><br> 1364 * Path: <b>DeviceComponent.identifier</b><br> 1365 * </p> 1366 */ 1367 @SearchParamDefinition(name="identifier", path="DeviceComponent.identifier", description="The identifier of the component", type="token" ) 1368 public static final String SP_IDENTIFIER = "identifier"; 1369 /** 1370 * <b>Fluent Client</b> search parameter constant for <b>identifier</b> 1371 * <p> 1372 * Description: <b>The identifier of the component</b><br> 1373 * Type: <b>token</b><br> 1374 * Path: <b>DeviceComponent.identifier</b><br> 1375 * </p> 1376 */ 1377 public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); 1378 1379 /** 1380 * Search parameter: <b>source</b> 1381 * <p> 1382 * Description: <b>The device source</b><br> 1383 * Type: <b>reference</b><br> 1384 * Path: <b>DeviceComponent.source</b><br> 1385 * </p> 1386 */ 1387 @SearchParamDefinition(name="source", path="DeviceComponent.source", description="The device source", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device") }, target={Device.class } ) 1388 public static final String SP_SOURCE = "source"; 1389 /** 1390 * <b>Fluent Client</b> search parameter constant for <b>source</b> 1391 * <p> 1392 * Description: <b>The device source</b><br> 1393 * Type: <b>reference</b><br> 1394 * Path: <b>DeviceComponent.source</b><br> 1395 * </p> 1396 */ 1397 public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); 1398 1399/** 1400 * Constant for fluent queries to be used to add include statements. Specifies 1401 * the path value of "<b>DeviceComponent:source</b>". 1402 */ 1403 public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("DeviceComponent:source").toLocked(); 1404 1405 /** 1406 * Search parameter: <b>type</b> 1407 * <p> 1408 * Description: <b>The device component type</b><br> 1409 * Type: <b>token</b><br> 1410 * Path: <b>DeviceComponent.type</b><br> 1411 * </p> 1412 */ 1413 @SearchParamDefinition(name="type", path="DeviceComponent.type", description="The device component type", type="token" ) 1414 public static final String SP_TYPE = "type"; 1415 /** 1416 * <b>Fluent Client</b> search parameter constant for <b>type</b> 1417 * <p> 1418 * Description: <b>The device component type</b><br> 1419 * Type: <b>token</b><br> 1420 * Path: <b>DeviceComponent.type</b><br> 1421 * </p> 1422 */ 1423 public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); 1424 1425 1426} 1427