001package org.hl7.fhir.dstu2016may.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 8, 2016 03:05+1000 for FHIR v1.4.0
033import java.util.ArrayList;
034import java.util.Date;
035import java.util.List;
036
037import org.hl7.fhir.exceptions.FHIRException;
038import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
039import org.hl7.fhir.utilities.Utilities;
040
041import ca.uhn.fhir.model.api.annotation.Block;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.Description;
044import ca.uhn.fhir.model.api.annotation.ResourceDef;
045import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
046/**
047 * Describes 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
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        throw new FHIRException("Unknown MeasmntPrinciple code '"+codeString+"'");
127        }
128        public String toCode() {
129          switch (this) {
130            case OTHER: return "other";
131            case CHEMICAL: return "chemical";
132            case ELECTRICAL: return "electrical";
133            case IMPEDANCE: return "impedance";
134            case NUCLEAR: return "nuclear";
135            case OPTICAL: return "optical";
136            case THERMAL: return "thermal";
137            case BIOLOGICAL: return "biological";
138            case MECHANICAL: return "mechanical";
139            case ACOUSTICAL: return "acoustical";
140            case MANUAL: return "manual";
141            default: return "?";
142          }
143        }
144        public String getSystem() {
145          switch (this) {
146            case OTHER: return "http://hl7.org/fhir/measurement-principle";
147            case CHEMICAL: return "http://hl7.org/fhir/measurement-principle";
148            case ELECTRICAL: return "http://hl7.org/fhir/measurement-principle";
149            case IMPEDANCE: return "http://hl7.org/fhir/measurement-principle";
150            case NUCLEAR: return "http://hl7.org/fhir/measurement-principle";
151            case OPTICAL: return "http://hl7.org/fhir/measurement-principle";
152            case THERMAL: return "http://hl7.org/fhir/measurement-principle";
153            case BIOLOGICAL: return "http://hl7.org/fhir/measurement-principle";
154            case MECHANICAL: return "http://hl7.org/fhir/measurement-principle";
155            case ACOUSTICAL: return "http://hl7.org/fhir/measurement-principle";
156            case MANUAL: return "http://hl7.org/fhir/measurement-principle";
157            default: return "?";
158          }
159        }
160        public String getDefinition() {
161          switch (this) {
162            case OTHER: return "Measurement principle isn't in the list.";
163            case CHEMICAL: return "Measurement is done using the chemical principle.";
164            case ELECTRICAL: return "Measurement is done using the electrical principle.";
165            case IMPEDANCE: return "Measurement is done using the impedance principle.";
166            case NUCLEAR: return "Measurement is done using the nuclear principle.";
167            case OPTICAL: return "Measurement is done using the optical principle.";
168            case THERMAL: return "Measurement is done using the thermal principle.";
169            case BIOLOGICAL: return "Measurement is done using the biological principle.";
170            case MECHANICAL: return "Measurement is done using the mechanical principle.";
171            case ACOUSTICAL: return "Measurement is done using the acoustical principle.";
172            case MANUAL: return "Measurement is done using the manual principle.";
173            default: return "?";
174          }
175        }
176        public String getDisplay() {
177          switch (this) {
178            case OTHER: return "MSP Other";
179            case CHEMICAL: return "MSP Chemical";
180            case ELECTRICAL: return "MSP Electrical";
181            case IMPEDANCE: return "MSP Impedance";
182            case NUCLEAR: return "MSP Nuclear";
183            case OPTICAL: return "MSP Optical";
184            case THERMAL: return "MSP Thermal";
185            case BIOLOGICAL: return "MSP Biological";
186            case MECHANICAL: return "MSP Mechanical";
187            case ACOUSTICAL: return "MSP Acoustical";
188            case MANUAL: return "MSP Manual";
189            default: return "?";
190          }
191        }
192    }
193
194  public static class MeasmntPrincipleEnumFactory implements EnumFactory<MeasmntPrinciple> {
195    public MeasmntPrinciple fromCode(String codeString) throws IllegalArgumentException {
196      if (codeString == null || "".equals(codeString))
197            if (codeString == null || "".equals(codeString))
198                return null;
199        if ("other".equals(codeString))
200          return MeasmntPrinciple.OTHER;
201        if ("chemical".equals(codeString))
202          return MeasmntPrinciple.CHEMICAL;
203        if ("electrical".equals(codeString))
204          return MeasmntPrinciple.ELECTRICAL;
205        if ("impedance".equals(codeString))
206          return MeasmntPrinciple.IMPEDANCE;
207        if ("nuclear".equals(codeString))
208          return MeasmntPrinciple.NUCLEAR;
209        if ("optical".equals(codeString))
210          return MeasmntPrinciple.OPTICAL;
211        if ("thermal".equals(codeString))
212          return MeasmntPrinciple.THERMAL;
213        if ("biological".equals(codeString))
214          return MeasmntPrinciple.BIOLOGICAL;
215        if ("mechanical".equals(codeString))
216          return MeasmntPrinciple.MECHANICAL;
217        if ("acoustical".equals(codeString))
218          return MeasmntPrinciple.ACOUSTICAL;
219        if ("manual".equals(codeString))
220          return MeasmntPrinciple.MANUAL;
221        throw new IllegalArgumentException("Unknown MeasmntPrinciple code '"+codeString+"'");
222        }
223        public Enumeration<MeasmntPrinciple> fromType(Base code) throws FHIRException {
224          if (code == null || code.isEmpty())
225            return null;
226          String codeString = ((PrimitiveType) code).asStringValue();
227          if (codeString == null || "".equals(codeString))
228            return null;
229        if ("other".equals(codeString))
230          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.OTHER);
231        if ("chemical".equals(codeString))
232          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.CHEMICAL);
233        if ("electrical".equals(codeString))
234          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.ELECTRICAL);
235        if ("impedance".equals(codeString))
236          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.IMPEDANCE);
237        if ("nuclear".equals(codeString))
238          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.NUCLEAR);
239        if ("optical".equals(codeString))
240          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.OPTICAL);
241        if ("thermal".equals(codeString))
242          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.THERMAL);
243        if ("biological".equals(codeString))
244          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.BIOLOGICAL);
245        if ("mechanical".equals(codeString))
246          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.MECHANICAL);
247        if ("acoustical".equals(codeString))
248          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.ACOUSTICAL);
249        if ("manual".equals(codeString))
250          return new Enumeration<MeasmntPrinciple>(this, MeasmntPrinciple.MANUAL);
251        throw new FHIRException("Unknown MeasmntPrinciple code '"+codeString+"'");
252        }
253    public String toCode(MeasmntPrinciple code) {
254      if (code == MeasmntPrinciple.OTHER)
255        return "other";
256      if (code == MeasmntPrinciple.CHEMICAL)
257        return "chemical";
258      if (code == MeasmntPrinciple.ELECTRICAL)
259        return "electrical";
260      if (code == MeasmntPrinciple.IMPEDANCE)
261        return "impedance";
262      if (code == MeasmntPrinciple.NUCLEAR)
263        return "nuclear";
264      if (code == MeasmntPrinciple.OPTICAL)
265        return "optical";
266      if (code == MeasmntPrinciple.THERMAL)
267        return "thermal";
268      if (code == MeasmntPrinciple.BIOLOGICAL)
269        return "biological";
270      if (code == MeasmntPrinciple.MECHANICAL)
271        return "mechanical";
272      if (code == MeasmntPrinciple.ACOUSTICAL)
273        return "acoustical";
274      if (code == MeasmntPrinciple.MANUAL)
275        return "manual";
276      return "?";
277      }
278    public String toSystem(MeasmntPrinciple code) {
279      return code.getSystem();
280      }
281    }
282
283    @Block()
284    public static class DeviceComponentProductionSpecificationComponent extends BackboneElement implements IBaseBackboneElement {
285        /**
286         * Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.
287         */
288        @Child(name = "specType", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
289        @Description(shortDefinition="Specification type", formalDefinition="Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc." )
290        protected CodeableConcept specType;
291
292        /**
293         * Describes 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 manufacture can make use of.
294         */
295        @Child(name = "componentId", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=true)
296        @Description(shortDefinition="Internal component unique identification", formalDefinition="Describes 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 manufacture can make use of." )
297        protected Identifier componentId;
298
299        /**
300         * Describes the printable string defining the component.
301         */
302        @Child(name = "productionSpec", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
303        @Description(shortDefinition="A printable string defining the component", formalDefinition="Describes the printable string defining the component." )
304        protected StringType productionSpec;
305
306        private static final long serialVersionUID = -1476597516L;
307
308    /**
309     * Constructor
310     */
311      public DeviceComponentProductionSpecificationComponent() {
312        super();
313      }
314
315        /**
316         * @return {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.)
317         */
318        public CodeableConcept getSpecType() { 
319          if (this.specType == null)
320            if (Configuration.errorOnAutoCreate())
321              throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.specType");
322            else if (Configuration.doAutoCreate())
323              this.specType = new CodeableConcept(); // cc
324          return this.specType;
325        }
326
327        public boolean hasSpecType() { 
328          return this.specType != null && !this.specType.isEmpty();
329        }
330
331        /**
332         * @param value {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.)
333         */
334        public DeviceComponentProductionSpecificationComponent setSpecType(CodeableConcept value) { 
335          this.specType = value;
336          return this;
337        }
338
339        /**
340         * @return {@link #componentId} (Describes 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 manufacture can make use of.)
341         */
342        public Identifier getComponentId() { 
343          if (this.componentId == null)
344            if (Configuration.errorOnAutoCreate())
345              throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.componentId");
346            else if (Configuration.doAutoCreate())
347              this.componentId = new Identifier(); // cc
348          return this.componentId;
349        }
350
351        public boolean hasComponentId() { 
352          return this.componentId != null && !this.componentId.isEmpty();
353        }
354
355        /**
356         * @param value {@link #componentId} (Describes 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 manufacture can make use of.)
357         */
358        public DeviceComponentProductionSpecificationComponent setComponentId(Identifier value) { 
359          this.componentId = value;
360          return this;
361        }
362
363        /**
364         * @return {@link #productionSpec} (Describes 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
365         */
366        public StringType getProductionSpecElement() { 
367          if (this.productionSpec == null)
368            if (Configuration.errorOnAutoCreate())
369              throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.productionSpec");
370            else if (Configuration.doAutoCreate())
371              this.productionSpec = new StringType(); // bb
372          return this.productionSpec;
373        }
374
375        public boolean hasProductionSpecElement() { 
376          return this.productionSpec != null && !this.productionSpec.isEmpty();
377        }
378
379        public boolean hasProductionSpec() { 
380          return this.productionSpec != null && !this.productionSpec.isEmpty();
381        }
382
383        /**
384         * @param value {@link #productionSpec} (Describes 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
385         */
386        public DeviceComponentProductionSpecificationComponent setProductionSpecElement(StringType value) { 
387          this.productionSpec = value;
388          return this;
389        }
390
391        /**
392         * @return Describes the printable string defining the component.
393         */
394        public String getProductionSpec() { 
395          return this.productionSpec == null ? null : this.productionSpec.getValue();
396        }
397
398        /**
399         * @param value Describes the printable string defining the component.
400         */
401        public DeviceComponentProductionSpecificationComponent setProductionSpec(String value) { 
402          if (Utilities.noString(value))
403            this.productionSpec = null;
404          else {
405            if (this.productionSpec == null)
406              this.productionSpec = new StringType();
407            this.productionSpec.setValue(value);
408          }
409          return this;
410        }
411
412        protected void listChildren(List<Property> childrenList) {
413          super.listChildren(childrenList);
414          childrenList.add(new Property("specType", "CodeableConcept", "Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.", 0, java.lang.Integer.MAX_VALUE, specType));
415          childrenList.add(new Property("componentId", "Identifier", "Describes 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 manufacture can make use of.", 0, java.lang.Integer.MAX_VALUE, componentId));
416          childrenList.add(new Property("productionSpec", "string", "Describes the printable string defining the component.", 0, java.lang.Integer.MAX_VALUE, productionSpec));
417        }
418
419      @Override
420      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
421        switch (hash) {
422        case -2133482091: /*specType*/ return this.specType == null ? new Base[0] : new Base[] {this.specType}; // CodeableConcept
423        case -985933064: /*componentId*/ return this.componentId == null ? new Base[0] : new Base[] {this.componentId}; // Identifier
424        case 182147092: /*productionSpec*/ return this.productionSpec == null ? new Base[0] : new Base[] {this.productionSpec}; // StringType
425        default: return super.getProperty(hash, name, checkValid);
426        }
427
428      }
429
430      @Override
431      public void setProperty(int hash, String name, Base value) throws FHIRException {
432        switch (hash) {
433        case -2133482091: // specType
434          this.specType = castToCodeableConcept(value); // CodeableConcept
435          break;
436        case -985933064: // componentId
437          this.componentId = castToIdentifier(value); // Identifier
438          break;
439        case 182147092: // productionSpec
440          this.productionSpec = castToString(value); // StringType
441          break;
442        default: super.setProperty(hash, name, value);
443        }
444
445      }
446
447      @Override
448      public void setProperty(String name, Base value) throws FHIRException {
449        if (name.equals("specType"))
450          this.specType = castToCodeableConcept(value); // CodeableConcept
451        else if (name.equals("componentId"))
452          this.componentId = castToIdentifier(value); // Identifier
453        else if (name.equals("productionSpec"))
454          this.productionSpec = castToString(value); // StringType
455        else
456          super.setProperty(name, value);
457      }
458
459      @Override
460      public Base makeProperty(int hash, String name) throws FHIRException {
461        switch (hash) {
462        case -2133482091:  return getSpecType(); // CodeableConcept
463        case -985933064:  return getComponentId(); // Identifier
464        case 182147092: throw new FHIRException("Cannot make property productionSpec as it is not a complex type"); // StringType
465        default: return super.makeProperty(hash, name);
466        }
467
468      }
469
470      @Override
471      public Base addChild(String name) throws FHIRException {
472        if (name.equals("specType")) {
473          this.specType = new CodeableConcept();
474          return this.specType;
475        }
476        else if (name.equals("componentId")) {
477          this.componentId = new Identifier();
478          return this.componentId;
479        }
480        else if (name.equals("productionSpec")) {
481          throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.productionSpec");
482        }
483        else
484          return super.addChild(name);
485      }
486
487      public DeviceComponentProductionSpecificationComponent copy() {
488        DeviceComponentProductionSpecificationComponent dst = new DeviceComponentProductionSpecificationComponent();
489        copyValues(dst);
490        dst.specType = specType == null ? null : specType.copy();
491        dst.componentId = componentId == null ? null : componentId.copy();
492        dst.productionSpec = productionSpec == null ? null : productionSpec.copy();
493        return dst;
494      }
495
496      @Override
497      public boolean equalsDeep(Base other) {
498        if (!super.equalsDeep(other))
499          return false;
500        if (!(other instanceof DeviceComponentProductionSpecificationComponent))
501          return false;
502        DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other;
503        return compareDeep(specType, o.specType, true) && compareDeep(componentId, o.componentId, true)
504           && compareDeep(productionSpec, o.productionSpec, true);
505      }
506
507      @Override
508      public boolean equalsShallow(Base other) {
509        if (!super.equalsShallow(other))
510          return false;
511        if (!(other instanceof DeviceComponentProductionSpecificationComponent))
512          return false;
513        DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other;
514        return compareValues(productionSpec, o.productionSpec, true);
515      }
516
517      public boolean isEmpty() {
518        return super.isEmpty() && (specType == null || specType.isEmpty()) && (componentId == null || componentId.isEmpty())
519           && (productionSpec == null || productionSpec.isEmpty());
520      }
521
522  public String fhirType() {
523    return "DeviceComponent.productionSpecification";
524
525  }
526
527  }
528
529    /**
530     * Describes the specific component type as defined in the object-oriented or metric nomenclature partition.
531     */
532    @Child(name = "type", type = {CodeableConcept.class}, order=0, min=1, max=1, modifier=false, summary=true)
533    @Description(shortDefinition="What kind of component it is", formalDefinition="Describes the specific component type as defined in the object-oriented or metric nomenclature partition." )
534    protected CodeableConcept type;
535
536    /**
537     * Describes the local assigned unique identification by the software. For example: handle ID.
538     */
539    @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true)
540    @Description(shortDefinition="Instance id assigned by the software stack", formalDefinition="Describes the local assigned unique identification by the software. For example: handle ID." )
541    protected Identifier identifier;
542
543    /**
544     * Describes the timestamp for the most recent system change which includes device configuration or setting change.
545     */
546    @Child(name = "lastSystemChange", type = {InstantType.class}, order=2, min=1, max=1, modifier=false, summary=true)
547    @Description(shortDefinition="Recent system change timestamp", formalDefinition="Describes the timestamp for the most recent system change which includes device configuration or setting change." )
548    protected InstantType lastSystemChange;
549
550    /**
551     * Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.
552     */
553    @Child(name = "source", type = {Device.class}, order=3, min=0, max=1, modifier=false, summary=true)
554    @Description(shortDefinition="A source device of this component", formalDefinition="Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc." )
555    protected Reference source;
556
557    /**
558     * The actual object that is the target of the reference (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.)
559     */
560    protected Device sourceTarget;
561
562    /**
563     * Describes the link to the parent resource. For example: Channel is linked to its VMD parent.
564     */
565    @Child(name = "parent", type = {DeviceComponent.class}, order=4, min=0, max=1, modifier=false, summary=true)
566    @Description(shortDefinition="Parent resource link", formalDefinition="Describes the link to the parent resource. For example: Channel is linked to its VMD parent." )
567    protected Reference parent;
568
569    /**
570     * The actual object that is the target of the reference (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.)
571     */
572    protected DeviceComponent parentTarget;
573
574    /**
575     * Indicates current operational status of the device. For example: On, Off, Standby, etc.
576     */
577    @Child(name = "operationalStatus", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
578    @Description(shortDefinition="Component operational status", formalDefinition="Indicates current operational status of the device. For example: On, Off, Standby, etc." )
579    protected List<CodeableConcept> operationalStatus;
580
581    /**
582     * Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.
583     */
584    @Child(name = "parameterGroup", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true)
585    @Description(shortDefinition="Current supported parameter group", formalDefinition="Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular." )
586    protected CodeableConcept parameterGroup;
587
588    /**
589     * Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.
590     */
591    @Child(name = "measurementPrinciple", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
592    @Description(shortDefinition="other | chemical | electrical | impedance | nuclear | optical | thermal | biological | mechanical | acoustical | manual+", formalDefinition="Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc." )
593    protected Enumeration<MeasmntPrinciple> measurementPrinciple;
594
595    /**
596     * Describes the production specification such as component revision, serial number, etc.
597     */
598    @Child(name = "productionSpecification", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
599    @Description(shortDefinition="Production specification of the component", formalDefinition="Describes the production specification such as component revision, serial number, etc." )
600    protected List<DeviceComponentProductionSpecificationComponent> productionSpecification;
601
602    /**
603     * Describes 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.
604     */
605    @Child(name = "languageCode", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true)
606    @Description(shortDefinition="Language code for the human-readable text strings produced by the device", formalDefinition="Describes 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." )
607    protected CodeableConcept languageCode;
608
609    private static final long serialVersionUID = -1742890034L;
610
611  /**
612   * Constructor
613   */
614    public DeviceComponent() {
615      super();
616    }
617
618  /**
619   * Constructor
620   */
621    public DeviceComponent(CodeableConcept type, Identifier identifier, InstantType lastSystemChange) {
622      super();
623      this.type = type;
624      this.identifier = identifier;
625      this.lastSystemChange = lastSystemChange;
626    }
627
628    /**
629     * @return {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.)
630     */
631    public CodeableConcept getType() { 
632      if (this.type == null)
633        if (Configuration.errorOnAutoCreate())
634          throw new Error("Attempt to auto-create DeviceComponent.type");
635        else if (Configuration.doAutoCreate())
636          this.type = new CodeableConcept(); // cc
637      return this.type;
638    }
639
640    public boolean hasType() { 
641      return this.type != null && !this.type.isEmpty();
642    }
643
644    /**
645     * @param value {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.)
646     */
647    public DeviceComponent setType(CodeableConcept value) { 
648      this.type = value;
649      return this;
650    }
651
652    /**
653     * @return {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.)
654     */
655    public Identifier getIdentifier() { 
656      if (this.identifier == null)
657        if (Configuration.errorOnAutoCreate())
658          throw new Error("Attempt to auto-create DeviceComponent.identifier");
659        else if (Configuration.doAutoCreate())
660          this.identifier = new Identifier(); // cc
661      return this.identifier;
662    }
663
664    public boolean hasIdentifier() { 
665      return this.identifier != null && !this.identifier.isEmpty();
666    }
667
668    /**
669     * @param value {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.)
670     */
671    public DeviceComponent setIdentifier(Identifier value) { 
672      this.identifier = value;
673      return this;
674    }
675
676    /**
677     * @return {@link #lastSystemChange} (Describes 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
678     */
679    public InstantType getLastSystemChangeElement() { 
680      if (this.lastSystemChange == null)
681        if (Configuration.errorOnAutoCreate())
682          throw new Error("Attempt to auto-create DeviceComponent.lastSystemChange");
683        else if (Configuration.doAutoCreate())
684          this.lastSystemChange = new InstantType(); // bb
685      return this.lastSystemChange;
686    }
687
688    public boolean hasLastSystemChangeElement() { 
689      return this.lastSystemChange != null && !this.lastSystemChange.isEmpty();
690    }
691
692    public boolean hasLastSystemChange() { 
693      return this.lastSystemChange != null && !this.lastSystemChange.isEmpty();
694    }
695
696    /**
697     * @param value {@link #lastSystemChange} (Describes 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
698     */
699    public DeviceComponent setLastSystemChangeElement(InstantType value) { 
700      this.lastSystemChange = value;
701      return this;
702    }
703
704    /**
705     * @return Describes the timestamp for the most recent system change which includes device configuration or setting change.
706     */
707    public Date getLastSystemChange() { 
708      return this.lastSystemChange == null ? null : this.lastSystemChange.getValue();
709    }
710
711    /**
712     * @param value Describes the timestamp for the most recent system change which includes device configuration or setting change.
713     */
714    public DeviceComponent setLastSystemChange(Date value) { 
715        if (this.lastSystemChange == null)
716          this.lastSystemChange = new InstantType();
717        this.lastSystemChange.setValue(value);
718      return this;
719    }
720
721    /**
722     * @return {@link #source} (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.)
723     */
724    public Reference getSource() { 
725      if (this.source == null)
726        if (Configuration.errorOnAutoCreate())
727          throw new Error("Attempt to auto-create DeviceComponent.source");
728        else if (Configuration.doAutoCreate())
729          this.source = new Reference(); // cc
730      return this.source;
731    }
732
733    public boolean hasSource() { 
734      return this.source != null && !this.source.isEmpty();
735    }
736
737    /**
738     * @param value {@link #source} (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.)
739     */
740    public DeviceComponent setSource(Reference value) { 
741      this.source = value;
742      return this;
743    }
744
745    /**
746     * @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. (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.)
747     */
748    public Device getSourceTarget() { 
749      if (this.sourceTarget == null)
750        if (Configuration.errorOnAutoCreate())
751          throw new Error("Attempt to auto-create DeviceComponent.source");
752        else if (Configuration.doAutoCreate())
753          this.sourceTarget = new Device(); // aa
754      return this.sourceTarget;
755    }
756
757    /**
758     * @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. (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.)
759     */
760    public DeviceComponent setSourceTarget(Device value) { 
761      this.sourceTarget = value;
762      return this;
763    }
764
765    /**
766     * @return {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.)
767     */
768    public Reference getParent() { 
769      if (this.parent == null)
770        if (Configuration.errorOnAutoCreate())
771          throw new Error("Attempt to auto-create DeviceComponent.parent");
772        else if (Configuration.doAutoCreate())
773          this.parent = new Reference(); // cc
774      return this.parent;
775    }
776
777    public boolean hasParent() { 
778      return this.parent != null && !this.parent.isEmpty();
779    }
780
781    /**
782     * @param value {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.)
783     */
784    public DeviceComponent setParent(Reference value) { 
785      this.parent = value;
786      return this;
787    }
788
789    /**
790     * @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. (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.)
791     */
792    public DeviceComponent getParentTarget() { 
793      if (this.parentTarget == null)
794        if (Configuration.errorOnAutoCreate())
795          throw new Error("Attempt to auto-create DeviceComponent.parent");
796        else if (Configuration.doAutoCreate())
797          this.parentTarget = new DeviceComponent(); // aa
798      return this.parentTarget;
799    }
800
801    /**
802     * @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. (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.)
803     */
804    public DeviceComponent setParentTarget(DeviceComponent value) { 
805      this.parentTarget = value;
806      return this;
807    }
808
809    /**
810     * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.)
811     */
812    public List<CodeableConcept> getOperationalStatus() { 
813      if (this.operationalStatus == null)
814        this.operationalStatus = new ArrayList<CodeableConcept>();
815      return this.operationalStatus;
816    }
817
818    public boolean hasOperationalStatus() { 
819      if (this.operationalStatus == null)
820        return false;
821      for (CodeableConcept item : this.operationalStatus)
822        if (!item.isEmpty())
823          return true;
824      return false;
825    }
826
827    /**
828     * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.)
829     */
830    // syntactic sugar
831    public CodeableConcept addOperationalStatus() { //3
832      CodeableConcept t = new CodeableConcept();
833      if (this.operationalStatus == null)
834        this.operationalStatus = new ArrayList<CodeableConcept>();
835      this.operationalStatus.add(t);
836      return t;
837    }
838
839    // syntactic sugar
840    public DeviceComponent addOperationalStatus(CodeableConcept t) { //3
841      if (t == null)
842        return this;
843      if (this.operationalStatus == null)
844        this.operationalStatus = new ArrayList<CodeableConcept>();
845      this.operationalStatus.add(t);
846      return this;
847    }
848
849    /**
850     * @return {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.)
851     */
852    public CodeableConcept getParameterGroup() { 
853      if (this.parameterGroup == null)
854        if (Configuration.errorOnAutoCreate())
855          throw new Error("Attempt to auto-create DeviceComponent.parameterGroup");
856        else if (Configuration.doAutoCreate())
857          this.parameterGroup = new CodeableConcept(); // cc
858      return this.parameterGroup;
859    }
860
861    public boolean hasParameterGroup() { 
862      return this.parameterGroup != null && !this.parameterGroup.isEmpty();
863    }
864
865    /**
866     * @param value {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.)
867     */
868    public DeviceComponent setParameterGroup(CodeableConcept value) { 
869      this.parameterGroup = value;
870      return this;
871    }
872
873    /**
874     * @return {@link #measurementPrinciple} (Describes 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
875     */
876    public Enumeration<MeasmntPrinciple> getMeasurementPrincipleElement() { 
877      if (this.measurementPrinciple == null)
878        if (Configuration.errorOnAutoCreate())
879          throw new Error("Attempt to auto-create DeviceComponent.measurementPrinciple");
880        else if (Configuration.doAutoCreate())
881          this.measurementPrinciple = new Enumeration<MeasmntPrinciple>(new MeasmntPrincipleEnumFactory()); // bb
882      return this.measurementPrinciple;
883    }
884
885    public boolean hasMeasurementPrincipleElement() { 
886      return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty();
887    }
888
889    public boolean hasMeasurementPrinciple() { 
890      return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty();
891    }
892
893    /**
894     * @param value {@link #measurementPrinciple} (Describes 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
895     */
896    public DeviceComponent setMeasurementPrincipleElement(Enumeration<MeasmntPrinciple> value) { 
897      this.measurementPrinciple = value;
898      return this;
899    }
900
901    /**
902     * @return Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.
903     */
904    public MeasmntPrinciple getMeasurementPrinciple() { 
905      return this.measurementPrinciple == null ? null : this.measurementPrinciple.getValue();
906    }
907
908    /**
909     * @param value Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.
910     */
911    public DeviceComponent setMeasurementPrinciple(MeasmntPrinciple value) { 
912      if (value == null)
913        this.measurementPrinciple = null;
914      else {
915        if (this.measurementPrinciple == null)
916          this.measurementPrinciple = new Enumeration<MeasmntPrinciple>(new MeasmntPrincipleEnumFactory());
917        this.measurementPrinciple.setValue(value);
918      }
919      return this;
920    }
921
922    /**
923     * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.)
924     */
925    public List<DeviceComponentProductionSpecificationComponent> getProductionSpecification() { 
926      if (this.productionSpecification == null)
927        this.productionSpecification = new ArrayList<DeviceComponentProductionSpecificationComponent>();
928      return this.productionSpecification;
929    }
930
931    public boolean hasProductionSpecification() { 
932      if (this.productionSpecification == null)
933        return false;
934      for (DeviceComponentProductionSpecificationComponent item : this.productionSpecification)
935        if (!item.isEmpty())
936          return true;
937      return false;
938    }
939
940    /**
941     * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.)
942     */
943    // syntactic sugar
944    public DeviceComponentProductionSpecificationComponent addProductionSpecification() { //3
945      DeviceComponentProductionSpecificationComponent t = new DeviceComponentProductionSpecificationComponent();
946      if (this.productionSpecification == null)
947        this.productionSpecification = new ArrayList<DeviceComponentProductionSpecificationComponent>();
948      this.productionSpecification.add(t);
949      return t;
950    }
951
952    // syntactic sugar
953    public DeviceComponent addProductionSpecification(DeviceComponentProductionSpecificationComponent t) { //3
954      if (t == null)
955        return this;
956      if (this.productionSpecification == null)
957        this.productionSpecification = new ArrayList<DeviceComponentProductionSpecificationComponent>();
958      this.productionSpecification.add(t);
959      return this;
960    }
961
962    /**
963     * @return {@link #languageCode} (Describes 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.)
964     */
965    public CodeableConcept getLanguageCode() { 
966      if (this.languageCode == null)
967        if (Configuration.errorOnAutoCreate())
968          throw new Error("Attempt to auto-create DeviceComponent.languageCode");
969        else if (Configuration.doAutoCreate())
970          this.languageCode = new CodeableConcept(); // cc
971      return this.languageCode;
972    }
973
974    public boolean hasLanguageCode() { 
975      return this.languageCode != null && !this.languageCode.isEmpty();
976    }
977
978    /**
979     * @param value {@link #languageCode} (Describes 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.)
980     */
981    public DeviceComponent setLanguageCode(CodeableConcept value) { 
982      this.languageCode = value;
983      return this;
984    }
985
986      protected void listChildren(List<Property> childrenList) {
987        super.listChildren(childrenList);
988        childrenList.add(new Property("type", "CodeableConcept", "Describes the specific component type as defined in the object-oriented or metric nomenclature partition.", 0, java.lang.Integer.MAX_VALUE, type));
989        childrenList.add(new Property("identifier", "Identifier", "Describes the local assigned unique identification by the software. For example: handle ID.", 0, java.lang.Integer.MAX_VALUE, identifier));
990        childrenList.add(new Property("lastSystemChange", "instant", "Describes the timestamp for the most recent system change which includes device configuration or setting change.", 0, java.lang.Integer.MAX_VALUE, lastSystemChange));
991        childrenList.add(new Property("source", "Reference(Device)", "Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, source));
992        childrenList.add(new Property("parent", "Reference(DeviceComponent)", "Describes the link to the parent resource. For example: Channel is linked to its VMD parent.", 0, java.lang.Integer.MAX_VALUE, parent));
993        childrenList.add(new Property("operationalStatus", "CodeableConcept", "Indicates current operational status of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalStatus));
994        childrenList.add(new Property("parameterGroup", "CodeableConcept", "Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.", 0, java.lang.Integer.MAX_VALUE, parameterGroup));
995        childrenList.add(new Property("measurementPrinciple", "code", "Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, java.lang.Integer.MAX_VALUE, measurementPrinciple));
996        childrenList.add(new Property("productionSpecification", "", "Describes the production specification such as component revision, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, productionSpecification));
997        childrenList.add(new Property("languageCode", "CodeableConcept", "Describes 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, java.lang.Integer.MAX_VALUE, languageCode));
998      }
999
1000      @Override
1001      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1002        switch (hash) {
1003        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1004        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
1005        case -2072475531: /*lastSystemChange*/ return this.lastSystemChange == null ? new Base[0] : new Base[] {this.lastSystemChange}; // InstantType
1006        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference
1007        case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Reference
1008        case -2103166364: /*operationalStatus*/ return this.operationalStatus == null ? new Base[0] : this.operationalStatus.toArray(new Base[this.operationalStatus.size()]); // CodeableConcept
1009        case 1111110742: /*parameterGroup*/ return this.parameterGroup == null ? new Base[0] : new Base[] {this.parameterGroup}; // CodeableConcept
1010        case 24324384: /*measurementPrinciple*/ return this.measurementPrinciple == null ? new Base[0] : new Base[] {this.measurementPrinciple}; // Enumeration<MeasmntPrinciple>
1011        case -455527222: /*productionSpecification*/ return this.productionSpecification == null ? new Base[0] : this.productionSpecification.toArray(new Base[this.productionSpecification.size()]); // DeviceComponentProductionSpecificationComponent
1012        case -2092349083: /*languageCode*/ return this.languageCode == null ? new Base[0] : new Base[] {this.languageCode}; // CodeableConcept
1013        default: return super.getProperty(hash, name, checkValid);
1014        }
1015
1016      }
1017
1018      @Override
1019      public void setProperty(int hash, String name, Base value) throws FHIRException {
1020        switch (hash) {
1021        case 3575610: // type
1022          this.type = castToCodeableConcept(value); // CodeableConcept
1023          break;
1024        case -1618432855: // identifier
1025          this.identifier = castToIdentifier(value); // Identifier
1026          break;
1027        case -2072475531: // lastSystemChange
1028          this.lastSystemChange = castToInstant(value); // InstantType
1029          break;
1030        case -896505829: // source
1031          this.source = castToReference(value); // Reference
1032          break;
1033        case -995424086: // parent
1034          this.parent = castToReference(value); // Reference
1035          break;
1036        case -2103166364: // operationalStatus
1037          this.getOperationalStatus().add(castToCodeableConcept(value)); // CodeableConcept
1038          break;
1039        case 1111110742: // parameterGroup
1040          this.parameterGroup = castToCodeableConcept(value); // CodeableConcept
1041          break;
1042        case 24324384: // measurementPrinciple
1043          this.measurementPrinciple = new MeasmntPrincipleEnumFactory().fromType(value); // Enumeration<MeasmntPrinciple>
1044          break;
1045        case -455527222: // productionSpecification
1046          this.getProductionSpecification().add((DeviceComponentProductionSpecificationComponent) value); // DeviceComponentProductionSpecificationComponent
1047          break;
1048        case -2092349083: // languageCode
1049          this.languageCode = castToCodeableConcept(value); // CodeableConcept
1050          break;
1051        default: super.setProperty(hash, name, value);
1052        }
1053
1054      }
1055
1056      @Override
1057      public void setProperty(String name, Base value) throws FHIRException {
1058        if (name.equals("type"))
1059          this.type = castToCodeableConcept(value); // CodeableConcept
1060        else if (name.equals("identifier"))
1061          this.identifier = castToIdentifier(value); // Identifier
1062        else if (name.equals("lastSystemChange"))
1063          this.lastSystemChange = castToInstant(value); // InstantType
1064        else if (name.equals("source"))
1065          this.source = castToReference(value); // Reference
1066        else if (name.equals("parent"))
1067          this.parent = castToReference(value); // Reference
1068        else if (name.equals("operationalStatus"))
1069          this.getOperationalStatus().add(castToCodeableConcept(value));
1070        else if (name.equals("parameterGroup"))
1071          this.parameterGroup = castToCodeableConcept(value); // CodeableConcept
1072        else if (name.equals("measurementPrinciple"))
1073          this.measurementPrinciple = new MeasmntPrincipleEnumFactory().fromType(value); // Enumeration<MeasmntPrinciple>
1074        else if (name.equals("productionSpecification"))
1075          this.getProductionSpecification().add((DeviceComponentProductionSpecificationComponent) value);
1076        else if (name.equals("languageCode"))
1077          this.languageCode = castToCodeableConcept(value); // CodeableConcept
1078        else
1079          super.setProperty(name, value);
1080      }
1081
1082      @Override
1083      public Base makeProperty(int hash, String name) throws FHIRException {
1084        switch (hash) {
1085        case 3575610:  return getType(); // CodeableConcept
1086        case -1618432855:  return getIdentifier(); // Identifier
1087        case -2072475531: throw new FHIRException("Cannot make property lastSystemChange as it is not a complex type"); // InstantType
1088        case -896505829:  return getSource(); // Reference
1089        case -995424086:  return getParent(); // Reference
1090        case -2103166364:  return addOperationalStatus(); // CodeableConcept
1091        case 1111110742:  return getParameterGroup(); // CodeableConcept
1092        case 24324384: throw new FHIRException("Cannot make property measurementPrinciple as it is not a complex type"); // Enumeration<MeasmntPrinciple>
1093        case -455527222:  return addProductionSpecification(); // DeviceComponentProductionSpecificationComponent
1094        case -2092349083:  return getLanguageCode(); // CodeableConcept
1095        default: return super.makeProperty(hash, name);
1096        }
1097
1098      }
1099
1100      @Override
1101      public Base addChild(String name) throws FHIRException {
1102        if (name.equals("type")) {
1103          this.type = new CodeableConcept();
1104          return this.type;
1105        }
1106        else if (name.equals("identifier")) {
1107          this.identifier = new Identifier();
1108          return this.identifier;
1109        }
1110        else if (name.equals("lastSystemChange")) {
1111          throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.lastSystemChange");
1112        }
1113        else if (name.equals("source")) {
1114          this.source = new Reference();
1115          return this.source;
1116        }
1117        else if (name.equals("parent")) {
1118          this.parent = new Reference();
1119          return this.parent;
1120        }
1121        else if (name.equals("operationalStatus")) {
1122          return addOperationalStatus();
1123        }
1124        else if (name.equals("parameterGroup")) {
1125          this.parameterGroup = new CodeableConcept();
1126          return this.parameterGroup;
1127        }
1128        else if (name.equals("measurementPrinciple")) {
1129          throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.measurementPrinciple");
1130        }
1131        else if (name.equals("productionSpecification")) {
1132          return addProductionSpecification();
1133        }
1134        else if (name.equals("languageCode")) {
1135          this.languageCode = new CodeableConcept();
1136          return this.languageCode;
1137        }
1138        else
1139          return super.addChild(name);
1140      }
1141
1142  public String fhirType() {
1143    return "DeviceComponent";
1144
1145  }
1146
1147      public DeviceComponent copy() {
1148        DeviceComponent dst = new DeviceComponent();
1149        copyValues(dst);
1150        dst.type = type == null ? null : type.copy();
1151        dst.identifier = identifier == null ? null : identifier.copy();
1152        dst.lastSystemChange = lastSystemChange == null ? null : lastSystemChange.copy();
1153        dst.source = source == null ? null : source.copy();
1154        dst.parent = parent == null ? null : parent.copy();
1155        if (operationalStatus != null) {
1156          dst.operationalStatus = new ArrayList<CodeableConcept>();
1157          for (CodeableConcept i : operationalStatus)
1158            dst.operationalStatus.add(i.copy());
1159        };
1160        dst.parameterGroup = parameterGroup == null ? null : parameterGroup.copy();
1161        dst.measurementPrinciple = measurementPrinciple == null ? null : measurementPrinciple.copy();
1162        if (productionSpecification != null) {
1163          dst.productionSpecification = new ArrayList<DeviceComponentProductionSpecificationComponent>();
1164          for (DeviceComponentProductionSpecificationComponent i : productionSpecification)
1165            dst.productionSpecification.add(i.copy());
1166        };
1167        dst.languageCode = languageCode == null ? null : languageCode.copy();
1168        return dst;
1169      }
1170
1171      protected DeviceComponent typedCopy() {
1172        return copy();
1173      }
1174
1175      @Override
1176      public boolean equalsDeep(Base other) {
1177        if (!super.equalsDeep(other))
1178          return false;
1179        if (!(other instanceof DeviceComponent))
1180          return false;
1181        DeviceComponent o = (DeviceComponent) other;
1182        return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(lastSystemChange, o.lastSystemChange, true)
1183           && compareDeep(source, o.source, true) && compareDeep(parent, o.parent, true) && compareDeep(operationalStatus, o.operationalStatus, true)
1184           && compareDeep(parameterGroup, o.parameterGroup, true) && compareDeep(measurementPrinciple, o.measurementPrinciple, true)
1185           && compareDeep(productionSpecification, o.productionSpecification, true) && compareDeep(languageCode, o.languageCode, true)
1186          ;
1187      }
1188
1189      @Override
1190      public boolean equalsShallow(Base other) {
1191        if (!super.equalsShallow(other))
1192          return false;
1193        if (!(other instanceof DeviceComponent))
1194          return false;
1195        DeviceComponent o = (DeviceComponent) other;
1196        return compareValues(lastSystemChange, o.lastSystemChange, true) && compareValues(measurementPrinciple, o.measurementPrinciple, true)
1197          ;
1198      }
1199
1200      public boolean isEmpty() {
1201        return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty())
1202           && (lastSystemChange == null || lastSystemChange.isEmpty()) && (source == null || source.isEmpty())
1203           && (parent == null || parent.isEmpty()) && (operationalStatus == null || operationalStatus.isEmpty())
1204           && (parameterGroup == null || parameterGroup.isEmpty()) && (measurementPrinciple == null || measurementPrinciple.isEmpty())
1205           && (productionSpecification == null || productionSpecification.isEmpty()) && (languageCode == null || languageCode.isEmpty())
1206          ;
1207      }
1208
1209  @Override
1210  public ResourceType getResourceType() {
1211    return ResourceType.DeviceComponent;
1212   }
1213
1214 /**
1215   * Search parameter: <b>source</b>
1216   * <p>
1217   * Description: <b>The device source</b><br>
1218   * Type: <b>reference</b><br>
1219   * Path: <b>DeviceComponent.source</b><br>
1220   * </p>
1221   */
1222  @SearchParamDefinition(name="source", path="DeviceComponent.source", description="The device source", type="reference" )
1223  public static final String SP_SOURCE = "source";
1224 /**
1225   * <b>Fluent Client</b> search parameter constant for <b>source</b>
1226   * <p>
1227   * Description: <b>The device source</b><br>
1228   * Type: <b>reference</b><br>
1229   * Path: <b>DeviceComponent.source</b><br>
1230   * </p>
1231   */
1232  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE);
1233
1234/**
1235   * Constant for fluent queries to be used to add include statements. Specifies
1236   * the path value of "<b>DeviceComponent:source</b>".
1237   */
1238  public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("DeviceComponent:source").toLocked();
1239
1240 /**
1241   * Search parameter: <b>parent</b>
1242   * <p>
1243   * Description: <b>The parent DeviceComponent resource</b><br>
1244   * Type: <b>reference</b><br>
1245   * Path: <b>DeviceComponent.parent</b><br>
1246   * </p>
1247   */
1248  @SearchParamDefinition(name="parent", path="DeviceComponent.parent", description="The parent DeviceComponent resource", type="reference" )
1249  public static final String SP_PARENT = "parent";
1250 /**
1251   * <b>Fluent Client</b> search parameter constant for <b>parent</b>
1252   * <p>
1253   * Description: <b>The parent DeviceComponent resource</b><br>
1254   * Type: <b>reference</b><br>
1255   * Path: <b>DeviceComponent.parent</b><br>
1256   * </p>
1257   */
1258  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT);
1259
1260/**
1261   * Constant for fluent queries to be used to add include statements. Specifies
1262   * the path value of "<b>DeviceComponent:parent</b>".
1263   */
1264  public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("DeviceComponent:parent").toLocked();
1265
1266 /**
1267   * Search parameter: <b>type</b>
1268   * <p>
1269   * Description: <b>The device component type</b><br>
1270   * Type: <b>token</b><br>
1271   * Path: <b>DeviceComponent.type</b><br>
1272   * </p>
1273   */
1274  @SearchParamDefinition(name="type", path="DeviceComponent.type", description="The device component type", type="token" )
1275  public static final String SP_TYPE = "type";
1276 /**
1277   * <b>Fluent Client</b> search parameter constant for <b>type</b>
1278   * <p>
1279   * Description: <b>The device component type</b><br>
1280   * Type: <b>token</b><br>
1281   * Path: <b>DeviceComponent.type</b><br>
1282   * </p>
1283   */
1284  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
1285
1286
1287}
1288