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