001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.r4.model.Enumerations.*;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046/**
047 * The characteristics, operational status and capabilities of a medical-related component of a medical device.
048 */
049@ResourceDef(name="DeviceComponent", profile="http://hl7.org/fhir/Profile/DeviceComponent")
050public class DeviceComponent extends DomainResource {
051
052    public enum MeasmntPrinciple {
053        /**
054         * Measurement principle isn't in the list.
055         */
056        OTHER, 
057        /**
058         * Measurement is done using the chemical principle.
059         */
060        CHEMICAL, 
061        /**
062         * Measurement is done using the electrical principle.
063         */
064        ELECTRICAL, 
065        /**
066         * Measurement is done using the impedance principle.
067         */
068        IMPEDANCE, 
069        /**
070         * Measurement is done using the nuclear principle.
071         */
072        NUCLEAR, 
073        /**
074         * Measurement is done using the optical principle.
075         */
076        OPTICAL, 
077        /**
078         * Measurement is done using the thermal principle.
079         */
080        THERMAL, 
081        /**
082         * Measurement is done using the biological principle.
083         */
084        BIOLOGICAL, 
085        /**
086         * Measurement is done using the mechanical principle.
087         */
088        MECHANICAL, 
089        /**
090         * Measurement is done using the acoustical principle.
091         */
092        ACOUSTICAL, 
093        /**
094         * Measurement is done using the manual principle.
095         */
096        MANUAL, 
097        /**
098         * added to help the parsers with the generic types
099         */
100        NULL;
101        public static MeasmntPrinciple fromCode(String codeString) throws FHIRException {
102            if (codeString == null || "".equals(codeString))
103                return null;
104        if ("other".equals(codeString))
105          return OTHER;
106        if ("chemical".equals(codeString))
107          return CHEMICAL;
108        if ("electrical".equals(codeString))
109          return ELECTRICAL;
110        if ("impedance".equals(codeString))
111          return IMPEDANCE;
112        if ("nuclear".equals(codeString))
113          return NUCLEAR;
114        if ("optical".equals(codeString))
115          return OPTICAL;
116        if ("thermal".equals(codeString))
117          return THERMAL;
118        if ("biological".equals(codeString))
119          return BIOLOGICAL;
120        if ("mechanical".equals(codeString))
121          return MECHANICAL;
122        if ("acoustical".equals(codeString))
123          return ACOUSTICAL;
124        if ("manual".equals(codeString))
125          return MANUAL;
126        if (Configuration.isAcceptInvalidEnums())
127          return null;
128        else
129          throw new FHIRException("Unknown MeasmntPrinciple code '"+codeString+"'");
130        }
131        public String toCode() {
132          switch (this) {
133            case OTHER: return "other";
134            case CHEMICAL: return "chemical";
135            case ELECTRICAL: return "electrical";
136            case IMPEDANCE: return "impedance";
137            case NUCLEAR: return "nuclear";
138            case OPTICAL: return "optical";
139            case THERMAL: return "thermal";
140            case BIOLOGICAL: return "biological";
141            case MECHANICAL: return "mechanical";
142            case ACOUSTICAL: return "acoustical";
143            case MANUAL: return "manual";
144            default: return "?";
145          }
146        }
147        public String getSystem() {
148          switch (this) {
149            case OTHER: return "http://hl7.org/fhir/measurement-principle";
150            case CHEMICAL: return "http://hl7.org/fhir/measurement-principle";
151            case ELECTRICAL: return "http://hl7.org/fhir/measurement-principle";
152            case IMPEDANCE: return "http://hl7.org/fhir/measurement-principle";
153            case NUCLEAR: return "http://hl7.org/fhir/measurement-principle";
154            case OPTICAL: return "http://hl7.org/fhir/measurement-principle";
155            case THERMAL: return "http://hl7.org/fhir/measurement-principle";
156            case BIOLOGICAL: return "http://hl7.org/fhir/measurement-principle";
157            case MECHANICAL: return "http://hl7.org/fhir/measurement-principle";
158            case ACOUSTICAL: return "http://hl7.org/fhir/measurement-principle";
159            case MANUAL: return "http://hl7.org/fhir/measurement-principle";
160            default: return "?";
161          }
162        }
163        public String getDefinition() {
164          switch (this) {
165            case OTHER: return "Measurement principle isn't in the list.";
166            case CHEMICAL: return "Measurement is done using the chemical principle.";
167            case ELECTRICAL: return "Measurement is done using the electrical principle.";
168            case IMPEDANCE: return "Measurement is done using the impedance principle.";
169            case NUCLEAR: return "Measurement is done using the nuclear principle.";
170            case OPTICAL: return "Measurement is done using the optical principle.";
171            case THERMAL: return "Measurement is done using the thermal principle.";
172            case BIOLOGICAL: return "Measurement is done using the biological principle.";
173            case MECHANICAL: return "Measurement is done using the mechanical principle.";
174            case ACOUSTICAL: return "Measurement is done using the acoustical principle.";
175            case MANUAL: return "Measurement is done using the manual principle.";
176            default: return "?";
177          }
178        }
179        public String getDisplay() {
180          switch (this) {
181            case OTHER: return "MSP Other";
182            case CHEMICAL: return "MSP Chemical";
183            case ELECTRICAL: return "MSP Electrical";
184            case IMPEDANCE: return "MSP Impedance";
185            case NUCLEAR: return "MSP Nuclear";
186            case OPTICAL: return "MSP Optical";
187            case THERMAL: return "MSP Thermal";
188            case BIOLOGICAL: return "MSP Biological";
189            case MECHANICAL: return "MSP Mechanical";
190            case ACOUSTICAL: return "MSP Acoustical";
191            case MANUAL: return "MSP Manual";
192            default: return "?";
193          }
194        }
195    }
196
197  public static class MeasmntPrincipleEnumFactory implements EnumFactory<MeasmntPrinciple> {
198    public MeasmntPrinciple fromCode(String codeString) throws IllegalArgumentException {
199      if (codeString == null || "".equals(codeString))
200            if (codeString == null || "".equals(codeString))
201                return null;
202        if ("other".equals(codeString))
203          return MeasmntPrinciple.OTHER;
204        if ("chemical".equals(codeString))
205          return MeasmntPrinciple.CHEMICAL;
206        if ("electrical".equals(codeString))
207          return MeasmntPrinciple.ELECTRICAL;
208        if ("impedance".equals(codeString))
209          return MeasmntPrinciple.IMPEDANCE;
210        if ("nuclear".equals(codeString))
211          return MeasmntPrinciple.NUCLEAR;
212        if ("optical".equals(codeString))
213          return MeasmntPrinciple.OPTICAL;
214        if ("thermal".equals(codeString))
215          return MeasmntPrinciple.THERMAL;
216        if ("biological".equals(codeString))
217          return MeasmntPrinciple.BIOLOGICAL;
218        if ("mechanical".equals(codeString))
219          return MeasmntPrinciple.MECHANICAL;
220        if ("acoustical".equals(codeString))
221          return MeasmntPrinciple.ACOUSTICAL;
222        if ("manual".equals(codeString))
223          return MeasmntPrinciple.MANUAL;
224        throw new IllegalArgumentException("Unknown MeasmntPrinciple code '"+codeString+"'");
225        }
226        public Enumeration<MeasmntPrinciple> fromType(Base code) throws FHIRException {
227          if (code == null)
228            return null;
229          if (code.isEmpty())
230            return new Enumeration<MeasmntPrinciple>(this);
231          String codeString = ((PrimitiveType) code).asStringValue();
232          if (codeString == null || "".equals(codeString))
233            return null;
234        if ("other".equals(codeString))
235          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.OTHER);
236        if ("chemical".equals(codeString))
237          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.CHEMICAL);
238        if ("electrical".equals(codeString))
239          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.ELECTRICAL);
240        if ("impedance".equals(codeString))
241          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.IMPEDANCE);
242        if ("nuclear".equals(codeString))
243          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.NUCLEAR);
244        if ("optical".equals(codeString))
245          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.OPTICAL);
246        if ("thermal".equals(codeString))
247          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.THERMAL);
248        if ("biological".equals(codeString))
249          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.BIOLOGICAL);
250        if ("mechanical".equals(codeString))
251          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.MECHANICAL);
252        if ("acoustical".equals(codeString))
253          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.ACOUSTICAL);
254        if ("manual".equals(codeString))
255          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.MANUAL);
256        throw new FHIRException("Unknown MeasmntPrinciple code '"+codeString+"'");
257        }
258    public String toCode(MeasmntPrinciple code) {
259      if (code == MeasmntPrinciple.OTHER)
260        return "other";
261      if (code == MeasmntPrinciple.CHEMICAL)
262        return "chemical";
263      if (code == MeasmntPrinciple.ELECTRICAL)
264        return "electrical";
265      if (code == MeasmntPrinciple.IMPEDANCE)
266        return "impedance";
267      if (code == MeasmntPrinciple.NUCLEAR)
268        return "nuclear";
269      if (code == MeasmntPrinciple.OPTICAL)
270        return "optical";
271      if (code == MeasmntPrinciple.THERMAL)
272        return "thermal";
273      if (code == MeasmntPrinciple.BIOLOGICAL)
274        return "biological";
275      if (code == MeasmntPrinciple.MECHANICAL)
276        return "mechanical";
277      if (code == MeasmntPrinciple.ACOUSTICAL)
278        return "acoustical";
279      if (code == MeasmntPrinciple.MANUAL)
280        return "manual";
281      return "?";
282      }
283    public String toSystem(MeasmntPrinciple code) {
284      return code.getSystem();
285      }
286    }
287
288    @Block()
289    public static class DeviceComponentProductionSpecificationComponent extends BackboneElement implements IBaseBackboneElement {
290        /**
291         * The specification type, such as, serial number, part number, hardware revision, software revision, etc.
292         */
293        @Child(name = "specType", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
294        @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." )
295        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/specification-type")
296        protected CodeableConcept specType;
297
298        /**
299         * 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.
300         */
301        @Child(name = "componentId", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=true)
302        @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." )
303        protected Identifier componentId;
304
305        /**
306         * The printable string defining the component.
307         */
308        @Child(name = "productionSpec", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
309        @Description(shortDefinition="A printable string defining the component", formalDefinition="The printable string defining the component." )
310        protected StringType productionSpec;
311
312        private static final long serialVersionUID = -1476597516L;
313
314    /**
315     * Constructor
316     */
317      public DeviceComponentProductionSpecificationComponent() {
318        super();
319      }
320
321        /**
322         * @return {@link #specType} (The specification type, such as, serial number, part number, hardware revision, software revision, etc.)
323         */
324        public CodeableConcept getSpecType() { 
325          if (this.specType == null)
326            if (Configuration.errorOnAutoCreate())
327              throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.specType");
328            else if (Configuration.doAutoCreate())
329              this.specType = new CodeableConcept(); // cc
330          return this.specType;
331        }
332
333        public boolean hasSpecType() { 
334          return this.specType != null && !this.specType.isEmpty();
335        }
336
337        /**
338         * @param value {@link #specType} (The specification type, such as, serial number, part number, hardware revision, software revision, etc.)
339         */
340        public DeviceComponentProductionSpecificationComponent setSpecType(CodeableConcept value) { 
341          this.specType = value;
342          return this;
343        }
344
345        /**
346         * @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.)
347         */
348        public Identifier getComponentId() { 
349          if (this.componentId == null)
350            if (Configuration.errorOnAutoCreate())
351              throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.componentId");
352            else if (Configuration.doAutoCreate())
353              this.componentId = new Identifier(); // cc
354          return this.componentId;
355        }
356
357        public boolean hasComponentId() { 
358          return this.componentId != null && !this.componentId.isEmpty();
359        }
360
361        /**
362         * @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.)
363         */
364        public DeviceComponentProductionSpecificationComponent setComponentId(Identifier value) { 
365          this.componentId = value;
366          return this;
367        }
368
369        /**
370         * @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
371         */
372        public StringType getProductionSpecElement() { 
373          if (this.productionSpec == null)
374            if (Configuration.errorOnAutoCreate())
375              throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.productionSpec");
376            else if (Configuration.doAutoCreate())
377              this.productionSpec = new StringType(); // bb
378          return this.productionSpec;
379        }
380
381        public boolean hasProductionSpecElement() { 
382          return this.productionSpec != null && !this.productionSpec.isEmpty();
383        }
384
385        public boolean hasProductionSpec() { 
386          return this.productionSpec != null && !this.productionSpec.isEmpty();
387        }
388
389        /**
390         * @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
391         */
392        public DeviceComponentProductionSpecificationComponent setProductionSpecElement(StringType value) { 
393          this.productionSpec = value;
394          return this;
395        }
396
397        /**
398         * @return The printable string defining the component.
399         */
400        public String getProductionSpec() { 
401          return this.productionSpec == null ? null : this.productionSpec.getValue();
402        }
403
404        /**
405         * @param value The printable string defining the component.
406         */
407        public DeviceComponentProductionSpecificationComponent setProductionSpec(String value) { 
408          if (Utilities.noString(value))
409            this.productionSpec = null;
410          else {
411            if (this.productionSpec == null)
412              this.productionSpec = new StringType();
413            this.productionSpec.setValue(value);
414          }
415          return this;
416        }
417
418        protected void listChildren(List<Property> children) {
419          super.listChildren(children);
420          children.add(new Property("specType", "CodeableConcept", "The specification type, such as, serial number, part number, hardware revision, software revision, etc.", 0, 1, specType));
421          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));
422          children.add(new Property("productionSpec", "string", "The printable string defining the component.", 0, 1, productionSpec));
423        }
424
425        @Override
426        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
427          switch (_hash) {
428          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);
429          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);
430          case 182147092: /*productionSpec*/  return new Property("productionSpec", "string", "The printable string defining the component.", 0, 1, productionSpec);
431          default: return super.getNamedProperty(_hash, _name, _checkValid);
432          }
433
434        }
435
436      @Override
437      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
438        switch (hash) {
439        case -2133482091: /*specType*/ return this.specType == null ? new Base[0] : new Base[] {this.specType}; // CodeableConcept
440        case -985933064: /*componentId*/ return this.componentId == null ? new Base[0] : new Base[] {this.componentId}; // Identifier
441        case 182147092: /*productionSpec*/ return this.productionSpec == null ? new Base[0] : new Base[] {this.productionSpec}; // StringType
442        default: return super.getProperty(hash, name, checkValid);
443        }
444
445      }
446
447      @Override
448      public Base setProperty(int hash, String name, Base value) throws FHIRException {
449        switch (hash) {
450        case -2133482091: // specType
451          this.specType = castToCodeableConcept(value); // CodeableConcept
452          return value;
453        case -985933064: // componentId
454          this.componentId = castToIdentifier(value); // Identifier
455          return value;
456        case 182147092: // productionSpec
457          this.productionSpec = castToString(value); // StringType
458          return value;
459        default: return super.setProperty(hash, name, value);
460        }
461
462      }
463
464      @Override
465      public Base setProperty(String name, Base value) throws FHIRException {
466        if (name.equals("specType")) {
467          this.specType = castToCodeableConcept(value); // CodeableConcept
468        } else if (name.equals("componentId")) {
469          this.componentId = castToIdentifier(value); // Identifier
470        } else if (name.equals("productionSpec")) {
471          this.productionSpec = castToString(value); // StringType
472        } else
473          return super.setProperty(name, value);
474        return value;
475      }
476
477      @Override
478      public Base makeProperty(int hash, String name) throws FHIRException {
479        switch (hash) {
480        case -2133482091:  return getSpecType(); 
481        case -985933064:  return getComponentId(); 
482        case 182147092:  return getProductionSpecElement();
483        default: return super.makeProperty(hash, name);
484        }
485
486      }
487
488      @Override
489      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
490        switch (hash) {
491        case -2133482091: /*specType*/ return new String[] {"CodeableConcept"};
492        case -985933064: /*componentId*/ return new String[] {"Identifier"};
493        case 182147092: /*productionSpec*/ return new String[] {"string"};
494        default: return super.getTypesForProperty(hash, name);
495        }
496
497      }
498
499      @Override
500      public Base addChild(String name) throws FHIRException {
501        if (name.equals("specType")) {
502          this.specType = new CodeableConcept();
503          return this.specType;
504        }
505        else if (name.equals("componentId")) {
506          this.componentId = new Identifier();
507          return this.componentId;
508        }
509        else if (name.equals("productionSpec")) {
510          throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.productionSpec");
511        }
512        else
513          return super.addChild(name);
514      }
515
516      public DeviceComponentProductionSpecificationComponent copy() {
517        DeviceComponentProductionSpecificationComponent dst = new DeviceComponentProductionSpecificationComponent();
518        copyValues(dst);
519        dst.specType = specType == null ? null : specType.copy();
520        dst.componentId = componentId == null ? null : componentId.copy();
521        dst.productionSpec = productionSpec == null ? null : productionSpec.copy();
522        return dst;
523      }
524
525      @Override
526      public boolean equalsDeep(Base other_) {
527        if (!super.equalsDeep(other_))
528          return false;
529        if (!(other_ instanceof DeviceComponentProductionSpecificationComponent))
530          return false;
531        DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other_;
532        return compareDeep(specType, o.specType, true) && compareDeep(componentId, o.componentId, true)
533           && compareDeep(productionSpec, o.productionSpec, true);
534      }
535
536      @Override
537      public boolean equalsShallow(Base other_) {
538        if (!super.equalsShallow(other_))
539          return false;
540        if (!(other_ instanceof DeviceComponentProductionSpecificationComponent))
541          return false;
542        DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other_;
543        return compareValues(productionSpec, o.productionSpec, true);
544      }
545
546      public boolean isEmpty() {
547        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(specType, componentId, productionSpec
548          );
549      }
550
551  public String fhirType() {
552    return "DeviceComponent.productionSpecification";
553
554  }
555
556  }
557
558    @Block()
559    public static class DeviceComponentPropertyComponent extends BackboneElement implements IBaseBackboneElement {
560        /**
561         * The code for the device property identifying the property being reported such as 'time capability'.
562         */
563        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
564        @Description(shortDefinition="Code that specifies the property", formalDefinition="The code for the device property identifying the property being reported such as 'time capability'." )
565        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-component-property")
566        protected CodeableConcept type;
567
568        /**
569         * The property value when the property being reported is a quantity such as the resolution of a real time clock.
570         */
571        @Child(name = "valueQuantity", type = {Quantity.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
572        @Description(shortDefinition="Property value as a quantity", formalDefinition="The property value when the property being reported is a quantity such as the resolution of a real time clock." )
573        protected List<Quantity> valueQuantity;
574
575        /**
576         * The property value when the property being reported is a code, such as the code indicating that the device supports a real time clock using absolute time.
577         */
578        @Child(name = "valueCode", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
579        @Description(shortDefinition="Property value as a code", formalDefinition="The property value when the property being reported is a code, such as the code indicating that the device supports a real time clock using absolute time." )
580        protected List<CodeableConcept> valueCode;
581
582        private static final long serialVersionUID = 1512172633L;
583
584    /**
585     * Constructor
586     */
587      public DeviceComponentPropertyComponent() {
588        super();
589      }
590
591    /**
592     * Constructor
593     */
594      public DeviceComponentPropertyComponent(CodeableConcept type) {
595        super();
596        this.type = type;
597      }
598
599        /**
600         * @return {@link #type} (The code for the device property identifying the property being reported such as 'time capability'.)
601         */
602        public CodeableConcept getType() { 
603          if (this.type == null)
604            if (Configuration.errorOnAutoCreate())
605              throw new Error("Attempt to auto-create DeviceComponentPropertyComponent.type");
606            else if (Configuration.doAutoCreate())
607              this.type = new CodeableConcept(); // cc
608          return this.type;
609        }
610
611        public boolean hasType() { 
612          return this.type != null && !this.type.isEmpty();
613        }
614
615        /**
616         * @param value {@link #type} (The code for the device property identifying the property being reported such as 'time capability'.)
617         */
618        public DeviceComponentPropertyComponent setType(CodeableConcept value) { 
619          this.type = value;
620          return this;
621        }
622
623        /**
624         * @return {@link #valueQuantity} (The property value when the property being reported is a quantity such as the resolution of a real time clock.)
625         */
626        public List<Quantity> getValueQuantity() { 
627          if (this.valueQuantity == null)
628            this.valueQuantity = new ArrayList<Quantity>();
629          return this.valueQuantity;
630        }
631
632        /**
633         * @return Returns a reference to <code>this</code> for easy method chaining
634         */
635        public DeviceComponentPropertyComponent setValueQuantity(List<Quantity> theValueQuantity) { 
636          this.valueQuantity = theValueQuantity;
637          return this;
638        }
639
640        public boolean hasValueQuantity() { 
641          if (this.valueQuantity == null)
642            return false;
643          for (Quantity item : this.valueQuantity)
644            if (!item.isEmpty())
645              return true;
646          return false;
647        }
648
649        public Quantity addValueQuantity() { //3
650          Quantity t = new Quantity();
651          if (this.valueQuantity == null)
652            this.valueQuantity = new ArrayList<Quantity>();
653          this.valueQuantity.add(t);
654          return t;
655        }
656
657        public DeviceComponentPropertyComponent addValueQuantity(Quantity t) { //3
658          if (t == null)
659            return this;
660          if (this.valueQuantity == null)
661            this.valueQuantity = new ArrayList<Quantity>();
662          this.valueQuantity.add(t);
663          return this;
664        }
665
666        /**
667         * @return The first repetition of repeating field {@link #valueQuantity}, creating it if it does not already exist
668         */
669        public Quantity getValueQuantityFirstRep() { 
670          if (getValueQuantity().isEmpty()) {
671            addValueQuantity();
672          }
673          return getValueQuantity().get(0);
674        }
675
676        /**
677         * @return {@link #valueCode} (The property value when the property being reported is a code, such as the code indicating that the device supports a real time clock using absolute time.)
678         */
679        public List<CodeableConcept> getValueCode() { 
680          if (this.valueCode == null)
681            this.valueCode = new ArrayList<CodeableConcept>();
682          return this.valueCode;
683        }
684
685        /**
686         * @return Returns a reference to <code>this</code> for easy method chaining
687         */
688        public DeviceComponentPropertyComponent setValueCode(List<CodeableConcept> theValueCode) { 
689          this.valueCode = theValueCode;
690          return this;
691        }
692
693        public boolean hasValueCode() { 
694          if (this.valueCode == null)
695            return false;
696          for (CodeableConcept item : this.valueCode)
697            if (!item.isEmpty())
698              return true;
699          return false;
700        }
701
702        public CodeableConcept addValueCode() { //3
703          CodeableConcept t = new CodeableConcept();
704          if (this.valueCode == null)
705            this.valueCode = new ArrayList<CodeableConcept>();
706          this.valueCode.add(t);
707          return t;
708        }
709
710        public DeviceComponentPropertyComponent addValueCode(CodeableConcept t) { //3
711          if (t == null)
712            return this;
713          if (this.valueCode == null)
714            this.valueCode = new ArrayList<CodeableConcept>();
715          this.valueCode.add(t);
716          return this;
717        }
718
719        /**
720         * @return The first repetition of repeating field {@link #valueCode}, creating it if it does not already exist
721         */
722        public CodeableConcept getValueCodeFirstRep() { 
723          if (getValueCode().isEmpty()) {
724            addValueCode();
725          }
726          return getValueCode().get(0);
727        }
728
729        protected void listChildren(List<Property> children) {
730          super.listChildren(children);
731          children.add(new Property("type", "CodeableConcept", "The code for the device property identifying the property being reported such as 'time capability'.", 0, 1, type));
732          children.add(new Property("valueQuantity", "Quantity", "The property value when the property being reported is a quantity such as the resolution of a real time clock.", 0, java.lang.Integer.MAX_VALUE, valueQuantity));
733          children.add(new Property("valueCode", "CodeableConcept", "The property value when the property being reported is a code, such as the code indicating that the device supports a real time clock using absolute time.", 0, java.lang.Integer.MAX_VALUE, valueCode));
734        }
735
736        @Override
737        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
738          switch (_hash) {
739          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The code for the device property identifying the property being reported such as 'time capability'.", 0, 1, type);
740          case -2029823716: /*valueQuantity*/  return new Property("valueQuantity", "Quantity", "The property value when the property being reported is a quantity such as the resolution of a real time clock.", 0, java.lang.Integer.MAX_VALUE, valueQuantity);
741          case -766209282: /*valueCode*/  return new Property("valueCode", "CodeableConcept", "The property value when the property being reported is a code, such as the code indicating that the device supports a real time clock using absolute time.", 0, java.lang.Integer.MAX_VALUE, valueCode);
742          default: return super.getNamedProperty(_hash, _name, _checkValid);
743          }
744
745        }
746
747      @Override
748      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
749        switch (hash) {
750        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
751        case -2029823716: /*valueQuantity*/ return this.valueQuantity == null ? new Base[0] : this.valueQuantity.toArray(new Base[this.valueQuantity.size()]); // Quantity
752        case -766209282: /*valueCode*/ return this.valueCode == null ? new Base[0] : this.valueCode.toArray(new Base[this.valueCode.size()]); // CodeableConcept
753        default: return super.getProperty(hash, name, checkValid);
754        }
755
756      }
757
758      @Override
759      public Base setProperty(int hash, String name, Base value) throws FHIRException {
760        switch (hash) {
761        case 3575610: // type
762          this.type = castToCodeableConcept(value); // CodeableConcept
763          return value;
764        case -2029823716: // valueQuantity
765          this.getValueQuantity().add(castToQuantity(value)); // Quantity
766          return value;
767        case -766209282: // valueCode
768          this.getValueCode().add(castToCodeableConcept(value)); // CodeableConcept
769          return value;
770        default: return super.setProperty(hash, name, value);
771        }
772
773      }
774
775      @Override
776      public Base setProperty(String name, Base value) throws FHIRException {
777        if (name.equals("type")) {
778          this.type = castToCodeableConcept(value); // CodeableConcept
779        } else if (name.equals("valueQuantity")) {
780          this.getValueQuantity().add(castToQuantity(value));
781        } else if (name.equals("valueCode")) {
782          this.getValueCode().add(castToCodeableConcept(value));
783        } else
784          return super.setProperty(name, value);
785        return value;
786      }
787
788      @Override
789      public Base makeProperty(int hash, String name) throws FHIRException {
790        switch (hash) {
791        case 3575610:  return getType(); 
792        case -2029823716:  return addValueQuantity(); 
793        case -766209282:  return addValueCode(); 
794        default: return super.makeProperty(hash, name);
795        }
796
797      }
798
799      @Override
800      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
801        switch (hash) {
802        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
803        case -2029823716: /*valueQuantity*/ return new String[] {"Quantity"};
804        case -766209282: /*valueCode*/ return new String[] {"CodeableConcept"};
805        default: return super.getTypesForProperty(hash, name);
806        }
807
808      }
809
810      @Override
811      public Base addChild(String name) throws FHIRException {
812        if (name.equals("type")) {
813          this.type = new CodeableConcept();
814          return this.type;
815        }
816        else if (name.equals("valueQuantity")) {
817          return addValueQuantity();
818        }
819        else if (name.equals("valueCode")) {
820          return addValueCode();
821        }
822        else
823          return super.addChild(name);
824      }
825
826      public DeviceComponentPropertyComponent copy() {
827        DeviceComponentPropertyComponent dst = new DeviceComponentPropertyComponent();
828        copyValues(dst);
829        dst.type = type == null ? null : type.copy();
830        if (valueQuantity != null) {
831          dst.valueQuantity = new ArrayList<Quantity>();
832          for (Quantity i : valueQuantity)
833            dst.valueQuantity.add(i.copy());
834        };
835        if (valueCode != null) {
836          dst.valueCode = new ArrayList<CodeableConcept>();
837          for (CodeableConcept i : valueCode)
838            dst.valueCode.add(i.copy());
839        };
840        return dst;
841      }
842
843      @Override
844      public boolean equalsDeep(Base other_) {
845        if (!super.equalsDeep(other_))
846          return false;
847        if (!(other_ instanceof DeviceComponentPropertyComponent))
848          return false;
849        DeviceComponentPropertyComponent o = (DeviceComponentPropertyComponent) other_;
850        return compareDeep(type, o.type, true) && compareDeep(valueQuantity, o.valueQuantity, true) && compareDeep(valueCode, o.valueCode, true)
851          ;
852      }
853
854      @Override
855      public boolean equalsShallow(Base other_) {
856        if (!super.equalsShallow(other_))
857          return false;
858        if (!(other_ instanceof DeviceComponentPropertyComponent))
859          return false;
860        DeviceComponentPropertyComponent o = (DeviceComponentPropertyComponent) other_;
861        return true;
862      }
863
864      public boolean isEmpty() {
865        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, valueQuantity, valueCode
866          );
867      }
868
869  public String fhirType() {
870    return "DeviceComponent.property";
871
872  }
873
874  }
875
876    /**
877     * Unique instance identifiers assigned to a device by the software, manufacturers, other organizations or owners. For example: handle ID.
878     */
879    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
880    @Description(shortDefinition="Instance identifier", formalDefinition="Unique instance identifiers assigned to a device by the software, manufacturers, other organizations or owners. For example: handle ID." )
881    protected List<Identifier> identifier;
882
883    /**
884     * The component type as defined in the object-oriented or metric nomenclature partition.
885     */
886    @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
887    @Description(shortDefinition="What kind of component it is", formalDefinition="The component type as defined in the object-oriented or metric nomenclature partition." )
888    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-kind")
889    protected CodeableConcept type;
890
891    /**
892     * The timestamp for the most recent system change which includes device configuration or setting change.
893     */
894    @Child(name = "lastSystemChange", type = {InstantType.class}, order=2, min=0, max=1, modifier=false, summary=true)
895    @Description(shortDefinition="Recent system change timestamp", formalDefinition="The timestamp for the most recent system change which includes device configuration or setting change." )
896    protected InstantType lastSystemChange;
897
898    /**
899     * The link to the source Device that contains administrative device information such as manufacture, serial number, etc.
900     */
901    @Child(name = "source", type = {Device.class}, order=3, min=0, max=1, modifier=false, summary=true)
902    @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." )
903    protected Reference source;
904
905    /**
906     * 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.)
907     */
908    protected Device sourceTarget;
909
910    /**
911     * The link to the parent resource. For example: Channel is linked to its VMD parent.
912     */
913    @Child(name = "parent", type = {DeviceComponent.class}, order=4, min=0, max=1, modifier=false, summary=true)
914    @Description(shortDefinition="Parent resource link", formalDefinition="The link to the parent resource. For example: Channel is linked to its VMD parent." )
915    protected Reference parent;
916
917    /**
918     * 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.)
919     */
920    protected DeviceComponent parentTarget;
921
922    /**
923     * The current operational status of the device. For example: On, Off, Standby, etc.
924     */
925    @Child(name = "operationalStatus", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
926    @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." )
927    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/operational-status")
928    protected List<CodeableConcept> operationalStatus;
929
930    /**
931     * The parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.
932     */
933    @Child(name = "parameterGroup", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true)
934    @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." )
935    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/parameter-group")
936    protected CodeableConcept parameterGroup;
937
938    /**
939     * The physical principle of the measurement. For example: thermal, chemical, acoustical, etc.
940     */
941    @Child(name = "measurementPrinciple", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
942    @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." )
943    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/measurement-principle")
944    protected Enumeration<MeasmntPrinciple> measurementPrinciple;
945
946    /**
947     * The production specification such as component revision, serial number, etc.
948     */
949    @Child(name = "productionSpecification", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
950    @Description(shortDefinition="Specification details such as Component Revisions, or Serial Numbers", formalDefinition="The production specification such as component revision, serial number, etc." )
951    protected List<DeviceComponentProductionSpecificationComponent> productionSpecification;
952
953    /**
954     * 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.
955     */
956    @Child(name = "languageCode", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true)
957    @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." )
958    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
959    protected CodeableConcept languageCode;
960
961    /**
962     * Other device properties expressed as a `type` which identifies the property and a value(s) either as a quantity or a code.
963     */
964    @Child(name = "property", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
965    @Description(shortDefinition="Other Attributes", formalDefinition="Other device properties expressed as a `type` which identifies the property and a value(s) either as a quantity or a code." )
966    protected List<DeviceComponentPropertyComponent> property;
967
968    private static final long serialVersionUID = -972124604L;
969
970  /**
971   * Constructor
972   */
973    public DeviceComponent() {
974      super();
975    }
976
977  /**
978   * Constructor
979   */
980    public DeviceComponent(CodeableConcept type) {
981      super();
982      this.type = type;
983    }
984
985    /**
986     * @return {@link #identifier} (Unique instance identifiers assigned to a device by the software, manufacturers, other organizations or owners. For example: handle ID.)
987     */
988    public List<Identifier> getIdentifier() { 
989      if (this.identifier == null)
990        this.identifier = new ArrayList<Identifier>();
991      return this.identifier;
992    }
993
994    /**
995     * @return Returns a reference to <code>this</code> for easy method chaining
996     */
997    public DeviceComponent setIdentifier(List<Identifier> theIdentifier) { 
998      this.identifier = theIdentifier;
999      return this;
1000    }
1001
1002    public boolean hasIdentifier() { 
1003      if (this.identifier == null)
1004        return false;
1005      for (Identifier item : this.identifier)
1006        if (!item.isEmpty())
1007          return true;
1008      return false;
1009    }
1010
1011    public Identifier addIdentifier() { //3
1012      Identifier t = new Identifier();
1013      if (this.identifier == null)
1014        this.identifier = new ArrayList<Identifier>();
1015      this.identifier.add(t);
1016      return t;
1017    }
1018
1019    public DeviceComponent addIdentifier(Identifier t) { //3
1020      if (t == null)
1021        return this;
1022      if (this.identifier == null)
1023        this.identifier = new ArrayList<Identifier>();
1024      this.identifier.add(t);
1025      return this;
1026    }
1027
1028    /**
1029     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1030     */
1031    public Identifier getIdentifierFirstRep() { 
1032      if (getIdentifier().isEmpty()) {
1033        addIdentifier();
1034      }
1035      return getIdentifier().get(0);
1036    }
1037
1038    /**
1039     * @return {@link #type} (The component type as defined in the object-oriented or metric nomenclature partition.)
1040     */
1041    public CodeableConcept getType() { 
1042      if (this.type == null)
1043        if (Configuration.errorOnAutoCreate())
1044          throw new Error("Attempt to auto-create DeviceComponent.type");
1045        else if (Configuration.doAutoCreate())
1046          this.type = new CodeableConcept(); // cc
1047      return this.type;
1048    }
1049
1050    public boolean hasType() { 
1051      return this.type != null && !this.type.isEmpty();
1052    }
1053
1054    /**
1055     * @param value {@link #type} (The component type as defined in the object-oriented or metric nomenclature partition.)
1056     */
1057    public DeviceComponent setType(CodeableConcept value) { 
1058      this.type = value;
1059      return this;
1060    }
1061
1062    /**
1063     * @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
1064     */
1065    public InstantType getLastSystemChangeElement() { 
1066      if (this.lastSystemChange == null)
1067        if (Configuration.errorOnAutoCreate())
1068          throw new Error("Attempt to auto-create DeviceComponent.lastSystemChange");
1069        else if (Configuration.doAutoCreate())
1070          this.lastSystemChange = new InstantType(); // bb
1071      return this.lastSystemChange;
1072    }
1073
1074    public boolean hasLastSystemChangeElement() { 
1075      return this.lastSystemChange != null && !this.lastSystemChange.isEmpty();
1076    }
1077
1078    public boolean hasLastSystemChange() { 
1079      return this.lastSystemChange != null && !this.lastSystemChange.isEmpty();
1080    }
1081
1082    /**
1083     * @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
1084     */
1085    public DeviceComponent setLastSystemChangeElement(InstantType value) { 
1086      this.lastSystemChange = value;
1087      return this;
1088    }
1089
1090    /**
1091     * @return The timestamp for the most recent system change which includes device configuration or setting change.
1092     */
1093    public Date getLastSystemChange() { 
1094      return this.lastSystemChange == null ? null : this.lastSystemChange.getValue();
1095    }
1096
1097    /**
1098     * @param value The timestamp for the most recent system change which includes device configuration or setting change.
1099     */
1100    public DeviceComponent setLastSystemChange(Date value) { 
1101      if (value == null)
1102        this.lastSystemChange = null;
1103      else {
1104        if (this.lastSystemChange == null)
1105          this.lastSystemChange = new InstantType();
1106        this.lastSystemChange.setValue(value);
1107      }
1108      return this;
1109    }
1110
1111    /**
1112     * @return {@link #source} (The link to the source Device that contains administrative device information such as manufacture, serial number, etc.)
1113     */
1114    public Reference getSource() { 
1115      if (this.source == null)
1116        if (Configuration.errorOnAutoCreate())
1117          throw new Error("Attempt to auto-create DeviceComponent.source");
1118        else if (Configuration.doAutoCreate())
1119          this.source = new Reference(); // cc
1120      return this.source;
1121    }
1122
1123    public boolean hasSource() { 
1124      return this.source != null && !this.source.isEmpty();
1125    }
1126
1127    /**
1128     * @param value {@link #source} (The link to the source Device that contains administrative device information such as manufacture, serial number, etc.)
1129     */
1130    public DeviceComponent setSource(Reference value) { 
1131      this.source = value;
1132      return this;
1133    }
1134
1135    /**
1136     * @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.)
1137     */
1138    public Device getSourceTarget() { 
1139      if (this.sourceTarget == null)
1140        if (Configuration.errorOnAutoCreate())
1141          throw new Error("Attempt to auto-create DeviceComponent.source");
1142        else if (Configuration.doAutoCreate())
1143          this.sourceTarget = new Device(); // aa
1144      return this.sourceTarget;
1145    }
1146
1147    /**
1148     * @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.)
1149     */
1150    public DeviceComponent setSourceTarget(Device value) { 
1151      this.sourceTarget = value;
1152      return this;
1153    }
1154
1155    /**
1156     * @return {@link #parent} (The link to the parent resource. For example: Channel is linked to its VMD parent.)
1157     */
1158    public Reference getParent() { 
1159      if (this.parent == null)
1160        if (Configuration.errorOnAutoCreate())
1161          throw new Error("Attempt to auto-create DeviceComponent.parent");
1162        else if (Configuration.doAutoCreate())
1163          this.parent = new Reference(); // cc
1164      return this.parent;
1165    }
1166
1167    public boolean hasParent() { 
1168      return this.parent != null && !this.parent.isEmpty();
1169    }
1170
1171    /**
1172     * @param value {@link #parent} (The link to the parent resource. For example: Channel is linked to its VMD parent.)
1173     */
1174    public DeviceComponent setParent(Reference value) { 
1175      this.parent = value;
1176      return this;
1177    }
1178
1179    /**
1180     * @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.)
1181     */
1182    public DeviceComponent getParentTarget() { 
1183      if (this.parentTarget == null)
1184        if (Configuration.errorOnAutoCreate())
1185          throw new Error("Attempt to auto-create DeviceComponent.parent");
1186        else if (Configuration.doAutoCreate())
1187          this.parentTarget = new DeviceComponent(); // aa
1188      return this.parentTarget;
1189    }
1190
1191    /**
1192     * @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.)
1193     */
1194    public DeviceComponent setParentTarget(DeviceComponent value) { 
1195      this.parentTarget = value;
1196      return this;
1197    }
1198
1199    /**
1200     * @return {@link #operationalStatus} (The current operational status of the device. For example: On, Off, Standby, etc.)
1201     */
1202    public List<CodeableConcept> getOperationalStatus() { 
1203      if (this.operationalStatus == null)
1204        this.operationalStatus = new ArrayList<CodeableConcept>();
1205      return this.operationalStatus;
1206    }
1207
1208    /**
1209     * @return Returns a reference to <code>this</code> for easy method chaining
1210     */
1211    public DeviceComponent setOperationalStatus(List<CodeableConcept> theOperationalStatus) { 
1212      this.operationalStatus = theOperationalStatus;
1213      return this;
1214    }
1215
1216    public boolean hasOperationalStatus() { 
1217      if (this.operationalStatus == null)
1218        return false;
1219      for (CodeableConcept item : this.operationalStatus)
1220        if (!item.isEmpty())
1221          return true;
1222      return false;
1223    }
1224
1225    public CodeableConcept addOperationalStatus() { //3
1226      CodeableConcept t = new CodeableConcept();
1227      if (this.operationalStatus == null)
1228        this.operationalStatus = new ArrayList<CodeableConcept>();
1229      this.operationalStatus.add(t);
1230      return t;
1231    }
1232
1233    public DeviceComponent addOperationalStatus(CodeableConcept t) { //3
1234      if (t == null)
1235        return this;
1236      if (this.operationalStatus == null)
1237        this.operationalStatus = new ArrayList<CodeableConcept>();
1238      this.operationalStatus.add(t);
1239      return this;
1240    }
1241
1242    /**
1243     * @return The first repetition of repeating field {@link #operationalStatus}, creating it if it does not already exist
1244     */
1245    public CodeableConcept getOperationalStatusFirstRep() { 
1246      if (getOperationalStatus().isEmpty()) {
1247        addOperationalStatus();
1248      }
1249      return getOperationalStatus().get(0);
1250    }
1251
1252    /**
1253     * @return {@link #parameterGroup} (The parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.)
1254     */
1255    public CodeableConcept getParameterGroup() { 
1256      if (this.parameterGroup == null)
1257        if (Configuration.errorOnAutoCreate())
1258          throw new Error("Attempt to auto-create DeviceComponent.parameterGroup");
1259        else if (Configuration.doAutoCreate())
1260          this.parameterGroup = new CodeableConcept(); // cc
1261      return this.parameterGroup;
1262    }
1263
1264    public boolean hasParameterGroup() { 
1265      return this.parameterGroup != null && !this.parameterGroup.isEmpty();
1266    }
1267
1268    /**
1269     * @param value {@link #parameterGroup} (The parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.)
1270     */
1271    public DeviceComponent setParameterGroup(CodeableConcept value) { 
1272      this.parameterGroup = value;
1273      return this;
1274    }
1275
1276    /**
1277     * @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
1278     */
1279    public Enumeration<MeasmntPrinciple> getMeasurementPrincipleElement() { 
1280      if (this.measurementPrinciple == null)
1281        if (Configuration.errorOnAutoCreate())
1282          throw new Error("Attempt to auto-create DeviceComponent.measurementPrinciple");
1283        else if (Configuration.doAutoCreate())
1284          this.measurementPrinciple = new Enumeration<MeasmntPrinciple>(new MeasmntPrincipleEnumFactory()); // bb
1285      return this.measurementPrinciple;
1286    }
1287
1288    public boolean hasMeasurementPrincipleElement() { 
1289      return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty();
1290    }
1291
1292    public boolean hasMeasurementPrinciple() { 
1293      return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty();
1294    }
1295
1296    /**
1297     * @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
1298     */
1299    public DeviceComponent setMeasurementPrincipleElement(Enumeration<MeasmntPrinciple> value) { 
1300      this.measurementPrinciple = value;
1301      return this;
1302    }
1303
1304    /**
1305     * @return The physical principle of the measurement. For example: thermal, chemical, acoustical, etc.
1306     */
1307    public MeasmntPrinciple getMeasurementPrinciple() { 
1308      return this.measurementPrinciple == null ? null : this.measurementPrinciple.getValue();
1309    }
1310
1311    /**
1312     * @param value The physical principle of the measurement. For example: thermal, chemical, acoustical, etc.
1313     */
1314    public DeviceComponent setMeasurementPrinciple(MeasmntPrinciple value) { 
1315      if (value == null)
1316        this.measurementPrinciple = null;
1317      else {
1318        if (this.measurementPrinciple == null)
1319          this.measurementPrinciple = new Enumeration<MeasmntPrinciple>(new MeasmntPrincipleEnumFactory());
1320        this.measurementPrinciple.setValue(value);
1321      }
1322      return this;
1323    }
1324
1325    /**
1326     * @return {@link #productionSpecification} (The production specification such as component revision, serial number, etc.)
1327     */
1328    public List<DeviceComponentProductionSpecificationComponent> getProductionSpecification() { 
1329      if (this.productionSpecification == null)
1330        this.productionSpecification = new ArrayList<DeviceComponentProductionSpecificationComponent>();
1331      return this.productionSpecification;
1332    }
1333
1334    /**
1335     * @return Returns a reference to <code>this</code> for easy method chaining
1336     */
1337    public DeviceComponent setProductionSpecification(List<DeviceComponentProductionSpecificationComponent> theProductionSpecification) { 
1338      this.productionSpecification = theProductionSpecification;
1339      return this;
1340    }
1341
1342    public boolean hasProductionSpecification() { 
1343      if (this.productionSpecification == null)
1344        return false;
1345      for (DeviceComponentProductionSpecificationComponent item : this.productionSpecification)
1346        if (!item.isEmpty())
1347          return true;
1348      return false;
1349    }
1350
1351    public DeviceComponentProductionSpecificationComponent addProductionSpecification() { //3
1352      DeviceComponentProductionSpecificationComponent t = new DeviceComponentProductionSpecificationComponent();
1353      if (this.productionSpecification == null)
1354        this.productionSpecification = new ArrayList<DeviceComponentProductionSpecificationComponent>();
1355      this.productionSpecification.add(t);
1356      return t;
1357    }
1358
1359    public DeviceComponent addProductionSpecification(DeviceComponentProductionSpecificationComponent t) { //3
1360      if (t == null)
1361        return this;
1362      if (this.productionSpecification == null)
1363        this.productionSpecification = new ArrayList<DeviceComponentProductionSpecificationComponent>();
1364      this.productionSpecification.add(t);
1365      return this;
1366    }
1367
1368    /**
1369     * @return The first repetition of repeating field {@link #productionSpecification}, creating it if it does not already exist
1370     */
1371    public DeviceComponentProductionSpecificationComponent getProductionSpecificationFirstRep() { 
1372      if (getProductionSpecification().isEmpty()) {
1373        addProductionSpecification();
1374      }
1375      return getProductionSpecification().get(0);
1376    }
1377
1378    /**
1379     * @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.)
1380     */
1381    public CodeableConcept getLanguageCode() { 
1382      if (this.languageCode == null)
1383        if (Configuration.errorOnAutoCreate())
1384          throw new Error("Attempt to auto-create DeviceComponent.languageCode");
1385        else if (Configuration.doAutoCreate())
1386          this.languageCode = new CodeableConcept(); // cc
1387      return this.languageCode;
1388    }
1389
1390    public boolean hasLanguageCode() { 
1391      return this.languageCode != null && !this.languageCode.isEmpty();
1392    }
1393
1394    /**
1395     * @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.)
1396     */
1397    public DeviceComponent setLanguageCode(CodeableConcept value) { 
1398      this.languageCode = value;
1399      return this;
1400    }
1401
1402    /**
1403     * @return {@link #property} (Other device properties expressed as a `type` which identifies the property and a value(s) either as a quantity or a code.)
1404     */
1405    public List<DeviceComponentPropertyComponent> getProperty() { 
1406      if (this.property == null)
1407        this.property = new ArrayList<DeviceComponentPropertyComponent>();
1408      return this.property;
1409    }
1410
1411    /**
1412     * @return Returns a reference to <code>this</code> for easy method chaining
1413     */
1414    public DeviceComponent setProperty(List<DeviceComponentPropertyComponent> theProperty) { 
1415      this.property = theProperty;
1416      return this;
1417    }
1418
1419    public boolean hasProperty() { 
1420      if (this.property == null)
1421        return false;
1422      for (DeviceComponentPropertyComponent item : this.property)
1423        if (!item.isEmpty())
1424          return true;
1425      return false;
1426    }
1427
1428    public DeviceComponentPropertyComponent addProperty() { //3
1429      DeviceComponentPropertyComponent t = new DeviceComponentPropertyComponent();
1430      if (this.property == null)
1431        this.property = new ArrayList<DeviceComponentPropertyComponent>();
1432      this.property.add(t);
1433      return t;
1434    }
1435
1436    public DeviceComponent addProperty(DeviceComponentPropertyComponent t) { //3
1437      if (t == null)
1438        return this;
1439      if (this.property == null)
1440        this.property = new ArrayList<DeviceComponentPropertyComponent>();
1441      this.property.add(t);
1442      return this;
1443    }
1444
1445    /**
1446     * @return The first repetition of repeating field {@link #property}, creating it if it does not already exist
1447     */
1448    public DeviceComponentPropertyComponent getPropertyFirstRep() { 
1449      if (getProperty().isEmpty()) {
1450        addProperty();
1451      }
1452      return getProperty().get(0);
1453    }
1454
1455      protected void listChildren(List<Property> children) {
1456        super.listChildren(children);
1457        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));
1458        children.add(new Property("type", "CodeableConcept", "The component type as defined in the object-oriented or metric nomenclature partition.", 0, 1, type));
1459        children.add(new Property("lastSystemChange", "instant", "The timestamp for the most recent system change which includes device configuration or setting change.", 0, 1, lastSystemChange));
1460        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));
1461        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));
1462        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));
1463        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));
1464        children.add(new Property("measurementPrinciple", "code", "The physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, 1, measurementPrinciple));
1465        children.add(new Property("productionSpecification", "", "The production specification such as component revision, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, productionSpecification));
1466        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));
1467        children.add(new Property("property", "", "Other device properties expressed as a `type` which identifies the property and a value(s) either as a quantity or a code.", 0, java.lang.Integer.MAX_VALUE, property));
1468      }
1469
1470      @Override
1471      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1472        switch (_hash) {
1473        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);
1474        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The component type as defined in the object-oriented or metric nomenclature partition.", 0, 1, type);
1475        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);
1476        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);
1477        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);
1478        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);
1479        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);
1480        case 24324384: /*measurementPrinciple*/  return new Property("measurementPrinciple", "code", "The physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, 1, measurementPrinciple);
1481        case -455527222: /*productionSpecification*/  return new Property("productionSpecification", "", "The production specification such as component revision, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, productionSpecification);
1482        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);
1483        case -993141291: /*property*/  return new Property("property", "", "Other device properties expressed as a `type` which identifies the property and a value(s) either as a quantity or a code.", 0, java.lang.Integer.MAX_VALUE, property);
1484        default: return super.getNamedProperty(_hash, _name, _checkValid);
1485        }
1486
1487      }
1488
1489      @Override
1490      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1491        switch (hash) {
1492        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1493        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1494        case -2072475531: /*lastSystemChange*/ return this.lastSystemChange == null ? new Base[0] : new Base[] {this.lastSystemChange}; // InstantType
1495        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference
1496        case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Reference
1497        case -2103166364: /*operationalStatus*/ return this.operationalStatus == null ? new Base[0] : this.operationalStatus.toArray(new Base[this.operationalStatus.size()]); // CodeableConcept
1498        case 1111110742: /*parameterGroup*/ return this.parameterGroup == null ? new Base[0] : new Base[] {this.parameterGroup}; // CodeableConcept
1499        case 24324384: /*measurementPrinciple*/ return this.measurementPrinciple == null ? new Base[0] : new Base[] {this.measurementPrinciple}; // Enumeration<MeasmntPrinciple>
1500        case -455527222: /*productionSpecification*/ return this.productionSpecification == null ? new Base[0] : this.productionSpecification.toArray(new Base[this.productionSpecification.size()]); // DeviceComponentProductionSpecificationComponent
1501        case -2092349083: /*languageCode*/ return this.languageCode == null ? new Base[0] : new Base[] {this.languageCode}; // CodeableConcept
1502        case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // DeviceComponentPropertyComponent
1503        default: return super.getProperty(hash, name, checkValid);
1504        }
1505
1506      }
1507
1508      @Override
1509      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1510        switch (hash) {
1511        case -1618432855: // identifier
1512          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1513          return value;
1514        case 3575610: // type
1515          this.type = castToCodeableConcept(value); // CodeableConcept
1516          return value;
1517        case -2072475531: // lastSystemChange
1518          this.lastSystemChange = castToInstant(value); // InstantType
1519          return value;
1520        case -896505829: // source
1521          this.source = castToReference(value); // Reference
1522          return value;
1523        case -995424086: // parent
1524          this.parent = castToReference(value); // Reference
1525          return value;
1526        case -2103166364: // operationalStatus
1527          this.getOperationalStatus().add(castToCodeableConcept(value)); // CodeableConcept
1528          return value;
1529        case 1111110742: // parameterGroup
1530          this.parameterGroup = castToCodeableConcept(value); // CodeableConcept
1531          return value;
1532        case 24324384: // measurementPrinciple
1533          value = new MeasmntPrincipleEnumFactory().fromType(castToCode(value));
1534          this.measurementPrinciple = (Enumeration) value; // Enumeration<MeasmntPrinciple>
1535          return value;
1536        case -455527222: // productionSpecification
1537          this.getProductionSpecification().add((DeviceComponentProductionSpecificationComponent) value); // DeviceComponentProductionSpecificationComponent
1538          return value;
1539        case -2092349083: // languageCode
1540          this.languageCode = castToCodeableConcept(value); // CodeableConcept
1541          return value;
1542        case -993141291: // property
1543          this.getProperty().add((DeviceComponentPropertyComponent) value); // DeviceComponentPropertyComponent
1544          return value;
1545        default: return super.setProperty(hash, name, value);
1546        }
1547
1548      }
1549
1550      @Override
1551      public Base setProperty(String name, Base value) throws FHIRException {
1552        if (name.equals("identifier")) {
1553          this.getIdentifier().add(castToIdentifier(value));
1554        } else if (name.equals("type")) {
1555          this.type = castToCodeableConcept(value); // CodeableConcept
1556        } else if (name.equals("lastSystemChange")) {
1557          this.lastSystemChange = castToInstant(value); // InstantType
1558        } else if (name.equals("source")) {
1559          this.source = castToReference(value); // Reference
1560        } else if (name.equals("parent")) {
1561          this.parent = castToReference(value); // Reference
1562        } else if (name.equals("operationalStatus")) {
1563          this.getOperationalStatus().add(castToCodeableConcept(value));
1564        } else if (name.equals("parameterGroup")) {
1565          this.parameterGroup = castToCodeableConcept(value); // CodeableConcept
1566        } else if (name.equals("measurementPrinciple")) {
1567          value = new MeasmntPrincipleEnumFactory().fromType(castToCode(value));
1568          this.measurementPrinciple = (Enumeration) value; // Enumeration<MeasmntPrinciple>
1569        } else if (name.equals("productionSpecification")) {
1570          this.getProductionSpecification().add((DeviceComponentProductionSpecificationComponent) value);
1571        } else if (name.equals("languageCode")) {
1572          this.languageCode = castToCodeableConcept(value); // CodeableConcept
1573        } else if (name.equals("property")) {
1574          this.getProperty().add((DeviceComponentPropertyComponent) value);
1575        } else
1576          return super.setProperty(name, value);
1577        return value;
1578      }
1579
1580      @Override
1581      public Base makeProperty(int hash, String name) throws FHIRException {
1582        switch (hash) {
1583        case -1618432855:  return addIdentifier(); 
1584        case 3575610:  return getType(); 
1585        case -2072475531:  return getLastSystemChangeElement();
1586        case -896505829:  return getSource(); 
1587        case -995424086:  return getParent(); 
1588        case -2103166364:  return addOperationalStatus(); 
1589        case 1111110742:  return getParameterGroup(); 
1590        case 24324384:  return getMeasurementPrincipleElement();
1591        case -455527222:  return addProductionSpecification(); 
1592        case -2092349083:  return getLanguageCode(); 
1593        case -993141291:  return addProperty(); 
1594        default: return super.makeProperty(hash, name);
1595        }
1596
1597      }
1598
1599      @Override
1600      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1601        switch (hash) {
1602        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1603        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1604        case -2072475531: /*lastSystemChange*/ return new String[] {"instant"};
1605        case -896505829: /*source*/ return new String[] {"Reference"};
1606        case -995424086: /*parent*/ return new String[] {"Reference"};
1607        case -2103166364: /*operationalStatus*/ return new String[] {"CodeableConcept"};
1608        case 1111110742: /*parameterGroup*/ return new String[] {"CodeableConcept"};
1609        case 24324384: /*measurementPrinciple*/ return new String[] {"code"};
1610        case -455527222: /*productionSpecification*/ return new String[] {};
1611        case -2092349083: /*languageCode*/ return new String[] {"CodeableConcept"};
1612        case -993141291: /*property*/ return new String[] {};
1613        default: return super.getTypesForProperty(hash, name);
1614        }
1615
1616      }
1617
1618      @Override
1619      public Base addChild(String name) throws FHIRException {
1620        if (name.equals("identifier")) {
1621          return addIdentifier();
1622        }
1623        else if (name.equals("type")) {
1624          this.type = new CodeableConcept();
1625          return this.type;
1626        }
1627        else if (name.equals("lastSystemChange")) {
1628          throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.lastSystemChange");
1629        }
1630        else if (name.equals("source")) {
1631          this.source = new Reference();
1632          return this.source;
1633        }
1634        else if (name.equals("parent")) {
1635          this.parent = new Reference();
1636          return this.parent;
1637        }
1638        else if (name.equals("operationalStatus")) {
1639          return addOperationalStatus();
1640        }
1641        else if (name.equals("parameterGroup")) {
1642          this.parameterGroup = new CodeableConcept();
1643          return this.parameterGroup;
1644        }
1645        else if (name.equals("measurementPrinciple")) {
1646          throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.measurementPrinciple");
1647        }
1648        else if (name.equals("productionSpecification")) {
1649          return addProductionSpecification();
1650        }
1651        else if (name.equals("languageCode")) {
1652          this.languageCode = new CodeableConcept();
1653          return this.languageCode;
1654        }
1655        else if (name.equals("property")) {
1656          return addProperty();
1657        }
1658        else
1659          return super.addChild(name);
1660      }
1661
1662  public String fhirType() {
1663    return "DeviceComponent";
1664
1665  }
1666
1667      public DeviceComponent copy() {
1668        DeviceComponent dst = new DeviceComponent();
1669        copyValues(dst);
1670        if (identifier != null) {
1671          dst.identifier = new ArrayList<Identifier>();
1672          for (Identifier i : identifier)
1673            dst.identifier.add(i.copy());
1674        };
1675        dst.type = type == null ? null : type.copy();
1676        dst.lastSystemChange = lastSystemChange == null ? null : lastSystemChange.copy();
1677        dst.source = source == null ? null : source.copy();
1678        dst.parent = parent == null ? null : parent.copy();
1679        if (operationalStatus != null) {
1680          dst.operationalStatus = new ArrayList<CodeableConcept>();
1681          for (CodeableConcept i : operationalStatus)
1682            dst.operationalStatus.add(i.copy());
1683        };
1684        dst.parameterGroup = parameterGroup == null ? null : parameterGroup.copy();
1685        dst.measurementPrinciple = measurementPrinciple == null ? null : measurementPrinciple.copy();
1686        if (productionSpecification != null) {
1687          dst.productionSpecification = new ArrayList<DeviceComponentProductionSpecificationComponent>();
1688          for (DeviceComponentProductionSpecificationComponent i : productionSpecification)
1689            dst.productionSpecification.add(i.copy());
1690        };
1691        dst.languageCode = languageCode == null ? null : languageCode.copy();
1692        if (property != null) {
1693          dst.property = new ArrayList<DeviceComponentPropertyComponent>();
1694          for (DeviceComponentPropertyComponent i : property)
1695            dst.property.add(i.copy());
1696        };
1697        return dst;
1698      }
1699
1700      protected DeviceComponent typedCopy() {
1701        return copy();
1702      }
1703
1704      @Override
1705      public boolean equalsDeep(Base other_) {
1706        if (!super.equalsDeep(other_))
1707          return false;
1708        if (!(other_ instanceof DeviceComponent))
1709          return false;
1710        DeviceComponent o = (DeviceComponent) other_;
1711        return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(lastSystemChange, o.lastSystemChange, true)
1712           && compareDeep(source, o.source, true) && compareDeep(parent, o.parent, true) && compareDeep(operationalStatus, o.operationalStatus, true)
1713           && compareDeep(parameterGroup, o.parameterGroup, true) && compareDeep(measurementPrinciple, o.measurementPrinciple, true)
1714           && compareDeep(productionSpecification, o.productionSpecification, true) && compareDeep(languageCode, o.languageCode, true)
1715           && compareDeep(property, o.property, true);
1716      }
1717
1718      @Override
1719      public boolean equalsShallow(Base other_) {
1720        if (!super.equalsShallow(other_))
1721          return false;
1722        if (!(other_ instanceof DeviceComponent))
1723          return false;
1724        DeviceComponent o = (DeviceComponent) other_;
1725        return compareValues(lastSystemChange, o.lastSystemChange, true) && compareValues(measurementPrinciple, o.measurementPrinciple, true)
1726          ;
1727      }
1728
1729      public boolean isEmpty() {
1730        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, lastSystemChange
1731          , source, parent, operationalStatus, parameterGroup, measurementPrinciple, productionSpecification
1732          , languageCode, property);
1733      }
1734
1735  @Override
1736  public ResourceType getResourceType() {
1737    return ResourceType.DeviceComponent;
1738   }
1739
1740 /**
1741   * Search parameter: <b>parent</b>
1742   * <p>
1743   * Description: <b>The parent DeviceComponent resource</b><br>
1744   * Type: <b>reference</b><br>
1745   * Path: <b>DeviceComponent.parent</b><br>
1746   * </p>
1747   */
1748  @SearchParamDefinition(name="parent", path="DeviceComponent.parent", description="The parent DeviceComponent resource", type="reference", target={DeviceComponent.class } )
1749  public static final String SP_PARENT = "parent";
1750 /**
1751   * <b>Fluent Client</b> search parameter constant for <b>parent</b>
1752   * <p>
1753   * Description: <b>The parent DeviceComponent resource</b><br>
1754   * Type: <b>reference</b><br>
1755   * Path: <b>DeviceComponent.parent</b><br>
1756   * </p>
1757   */
1758  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT);
1759
1760/**
1761   * Constant for fluent queries to be used to add include statements. Specifies
1762   * the path value of "<b>DeviceComponent:parent</b>".
1763   */
1764  public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("DeviceComponent:parent").toLocked();
1765
1766 /**
1767   * Search parameter: <b>identifier</b>
1768   * <p>
1769   * Description: <b>The identifier of the component</b><br>
1770   * Type: <b>token</b><br>
1771   * Path: <b>DeviceComponent.identifier</b><br>
1772   * </p>
1773   */
1774  @SearchParamDefinition(name="identifier", path="DeviceComponent.identifier", description="The identifier of the component", type="token" )
1775  public static final String SP_IDENTIFIER = "identifier";
1776 /**
1777   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1778   * <p>
1779   * Description: <b>The identifier of the component</b><br>
1780   * Type: <b>token</b><br>
1781   * Path: <b>DeviceComponent.identifier</b><br>
1782   * </p>
1783   */
1784  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1785
1786 /**
1787   * Search parameter: <b>source</b>
1788   * <p>
1789   * Description: <b>The device source</b><br>
1790   * Type: <b>reference</b><br>
1791   * Path: <b>DeviceComponent.source</b><br>
1792   * </p>
1793   */
1794  @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 } )
1795  public static final String SP_SOURCE = "source";
1796 /**
1797   * <b>Fluent Client</b> search parameter constant for <b>source</b>
1798   * <p>
1799   * Description: <b>The device source</b><br>
1800   * Type: <b>reference</b><br>
1801   * Path: <b>DeviceComponent.source</b><br>
1802   * </p>
1803   */
1804  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE);
1805
1806/**
1807   * Constant for fluent queries to be used to add include statements. Specifies
1808   * the path value of "<b>DeviceComponent:source</b>".
1809   */
1810  public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("DeviceComponent:source").toLocked();
1811
1812 /**
1813   * Search parameter: <b>type</b>
1814   * <p>
1815   * Description: <b>The device component type</b><br>
1816   * Type: <b>token</b><br>
1817   * Path: <b>DeviceComponent.type</b><br>
1818   * </p>
1819   */
1820  @SearchParamDefinition(name="type", path="DeviceComponent.type", description="The device component type", type="token" )
1821  public static final String SP_TYPE = "type";
1822 /**
1823   * <b>Fluent Client</b> search parameter constant for <b>type</b>
1824   * <p>
1825   * Description: <b>The device component type</b><br>
1826   * Type: <b>token</b><br>
1827   * Path: <b>DeviceComponent.type</b><br>
1828   * </p>
1829   */
1830  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
1831
1832
1833}
1834