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, Dec 27, 2018 10:06-0500 for FHIR v4.0.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 = "valueQuantity", 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> valueQuantity;
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 = 1512172633L;
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 #valueQuantity} (Property value as a quantity.)
1329         */
1330        public List<Quantity> getValueQuantity() { 
1331          if (this.valueQuantity == null)
1332            this.valueQuantity = new ArrayList<Quantity>();
1333          return this.valueQuantity;
1334        }
1335
1336        /**
1337         * @return Returns a reference to <code>this</code> for easy method chaining
1338         */
1339        public DeviceDefinitionPropertyComponent setValueQuantity(List<Quantity> theValueQuantity) { 
1340          this.valueQuantity = theValueQuantity;
1341          return this;
1342        }
1343
1344        public boolean hasValueQuantity() { 
1345          if (this.valueQuantity == null)
1346            return false;
1347          for (Quantity item : this.valueQuantity)
1348            if (!item.isEmpty())
1349              return true;
1350          return false;
1351        }
1352
1353        public Quantity addValueQuantity() { //3
1354          Quantity t = new Quantity();
1355          if (this.valueQuantity == null)
1356            this.valueQuantity = new ArrayList<Quantity>();
1357          this.valueQuantity.add(t);
1358          return t;
1359        }
1360
1361        public DeviceDefinitionPropertyComponent addValueQuantity(Quantity t) { //3
1362          if (t == null)
1363            return this;
1364          if (this.valueQuantity == null)
1365            this.valueQuantity = new ArrayList<Quantity>();
1366          this.valueQuantity.add(t);
1367          return this;
1368        }
1369
1370        /**
1371         * @return The first repetition of repeating field {@link #valueQuantity}, creating it if it does not already exist
1372         */
1373        public Quantity getValueQuantityFirstRep() { 
1374          if (getValueQuantity().isEmpty()) {
1375            addValueQuantity();
1376          }
1377          return getValueQuantity().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("valueQuantity", "Quantity", "Property value as a quantity.", 0, java.lang.Integer.MAX_VALUE, valueQuantity));
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 -2029823716: /*valueQuantity*/  return new Property("valueQuantity", "Quantity", "Property value as a quantity.", 0, java.lang.Integer.MAX_VALUE, valueQuantity);
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 -2029823716: /*valueQuantity*/ return this.valueQuantity == null ? new Base[0] : this.valueQuantity.toArray(new Base[this.valueQuantity.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 -2029823716: // valueQuantity
1469          this.getValueQuantity().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("valueQuantity")) {
1484          this.getValueQuantity().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 -2029823716:  return addValueQuantity(); 
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 -2029823716: /*valueQuantity*/ 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("valueQuantity")) {
1521          return addValueQuantity();
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 (valueQuantity != null) {
1535          dst.valueQuantity = new ArrayList<Quantity>();
1536          for (Quantity i : valueQuantity)
1537            dst.valueQuantity.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(valueQuantity, o.valueQuantity, 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, valueQuantity, 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 available versions of the device, e.g., software versions.
1926     */
1927    @Child(name = "version", type = {StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1928    @Description(shortDefinition="Available versions", formalDefinition="The available versions of the device, e.g., software versions." )
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    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-safety")
1937    protected List<CodeableConcept> safety;
1938
1939    /**
1940     * Shelf Life and storage information.
1941     */
1942    @Child(name = "shelfLifeStorage", type = {ProductShelfLife.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1943    @Description(shortDefinition="Shelf Life and storage information", formalDefinition="Shelf Life and storage information." )
1944    protected List<ProductShelfLife> shelfLifeStorage;
1945
1946    /**
1947     * Dimensions, color etc.
1948     */
1949    @Child(name = "physicalCharacteristics", type = {ProdCharacteristic.class}, order=10, min=0, max=1, modifier=false, summary=false)
1950    @Description(shortDefinition="Dimensions, color etc.", formalDefinition="Dimensions, color etc." )
1951    protected ProdCharacteristic physicalCharacteristics;
1952
1953    /**
1954     * Language code for the human-readable text strings produced by the device (all supported).
1955     */
1956    @Child(name = "languageCode", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1957    @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)." )
1958    protected List<CodeableConcept> languageCode;
1959
1960    /**
1961     * Device capabilities.
1962     */
1963    @Child(name = "capability", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1964    @Description(shortDefinition="Device capabilities", formalDefinition="Device capabilities." )
1965    protected List<DeviceDefinitionCapabilityComponent> capability;
1966
1967    /**
1968     * The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.
1969     */
1970    @Child(name = "property", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1971    @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." )
1972    protected List<DeviceDefinitionPropertyComponent> property;
1973
1974    /**
1975     * An organization that is responsible for the provision and ongoing maintenance of the device.
1976     */
1977    @Child(name = "owner", type = {Organization.class}, order=14, min=0, max=1, modifier=false, summary=false)
1978    @Description(shortDefinition="Organization responsible for device", formalDefinition="An organization that is responsible for the provision and ongoing maintenance of the device." )
1979    protected Reference owner;
1980
1981    /**
1982     * The actual object that is the target of the reference (An organization that is responsible for the provision and ongoing maintenance of the device.)
1983     */
1984    protected Organization ownerTarget;
1985
1986    /**
1987     * Contact details for an organization or a particular human that is responsible for the device.
1988     */
1989    @Child(name = "contact", type = {ContactPoint.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1990    @Description(shortDefinition="Details for human/organization for support", formalDefinition="Contact details for an organization or a particular human that is responsible for the device." )
1991    protected List<ContactPoint> contact;
1992
1993    /**
1994     * A network address on which the device may be contacted directly.
1995     */
1996    @Child(name = "url", type = {UriType.class}, order=16, min=0, max=1, modifier=false, summary=false)
1997    @Description(shortDefinition="Network address to contact device", formalDefinition="A network address on which the device may be contacted directly." )
1998    protected UriType url;
1999
2000    /**
2001     * Access to on-line information about the device.
2002     */
2003    @Child(name = "onlineInformation", type = {UriType.class}, order=17, min=0, max=1, modifier=false, summary=false)
2004    @Description(shortDefinition="Access to on-line information", formalDefinition="Access to on-line information about the device." )
2005    protected UriType onlineInformation;
2006
2007    /**
2008     * Descriptive information, usage information or implantation information that is not captured in an existing element.
2009     */
2010    @Child(name = "note", type = {Annotation.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2011    @Description(shortDefinition="Device notes and comments", formalDefinition="Descriptive information, usage information or implantation information that is not captured in an existing element." )
2012    protected List<Annotation> note;
2013
2014    /**
2015     * 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).
2016     */
2017    @Child(name = "quantity", type = {Quantity.class}, order=19, min=0, max=1, modifier=false, summary=false)
2018    @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)." )
2019    protected Quantity quantity;
2020
2021    /**
2022     * The parent device it can be part of.
2023     */
2024    @Child(name = "parentDevice", type = {DeviceDefinition.class}, order=20, min=0, max=1, modifier=false, summary=true)
2025    @Description(shortDefinition="The parent device it can be part of", formalDefinition="The parent device it can be part of." )
2026    protected Reference parentDevice;
2027
2028    /**
2029     * The actual object that is the target of the reference (The parent device it can be part of.)
2030     */
2031    protected DeviceDefinition parentDeviceTarget;
2032
2033    /**
2034     * A substance used to create the material(s) of which the device is made.
2035     */
2036    @Child(name = "material", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2037    @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." )
2038    protected List<DeviceDefinitionMaterialComponent> material;
2039
2040    private static final long serialVersionUID = -2041532433L;
2041
2042  /**
2043   * Constructor
2044   */
2045    public DeviceDefinition() {
2046      super();
2047    }
2048
2049    /**
2050     * @return {@link #identifier} (Unique instance identifiers assigned to a device by the software, manufacturers, other organizations or owners. For example: handle ID.)
2051     */
2052    public List<Identifier> getIdentifier() { 
2053      if (this.identifier == null)
2054        this.identifier = new ArrayList<Identifier>();
2055      return this.identifier;
2056    }
2057
2058    /**
2059     * @return Returns a reference to <code>this</code> for easy method chaining
2060     */
2061    public DeviceDefinition setIdentifier(List<Identifier> theIdentifier) { 
2062      this.identifier = theIdentifier;
2063      return this;
2064    }
2065
2066    public boolean hasIdentifier() { 
2067      if (this.identifier == null)
2068        return false;
2069      for (Identifier item : this.identifier)
2070        if (!item.isEmpty())
2071          return true;
2072      return false;
2073    }
2074
2075    public Identifier addIdentifier() { //3
2076      Identifier t = new Identifier();
2077      if (this.identifier == null)
2078        this.identifier = new ArrayList<Identifier>();
2079      this.identifier.add(t);
2080      return t;
2081    }
2082
2083    public DeviceDefinition addIdentifier(Identifier t) { //3
2084      if (t == null)
2085        return this;
2086      if (this.identifier == null)
2087        this.identifier = new ArrayList<Identifier>();
2088      this.identifier.add(t);
2089      return this;
2090    }
2091
2092    /**
2093     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
2094     */
2095    public Identifier getIdentifierFirstRep() { 
2096      if (getIdentifier().isEmpty()) {
2097        addIdentifier();
2098      }
2099      return getIdentifier().get(0);
2100    }
2101
2102    /**
2103     * @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.)
2104     */
2105    public List<DeviceDefinitionUdiDeviceIdentifierComponent> getUdiDeviceIdentifier() { 
2106      if (this.udiDeviceIdentifier == null)
2107        this.udiDeviceIdentifier = new ArrayList<DeviceDefinitionUdiDeviceIdentifierComponent>();
2108      return this.udiDeviceIdentifier;
2109    }
2110
2111    /**
2112     * @return Returns a reference to <code>this</code> for easy method chaining
2113     */
2114    public DeviceDefinition setUdiDeviceIdentifier(List<DeviceDefinitionUdiDeviceIdentifierComponent> theUdiDeviceIdentifier) { 
2115      this.udiDeviceIdentifier = theUdiDeviceIdentifier;
2116      return this;
2117    }
2118
2119    public boolean hasUdiDeviceIdentifier() { 
2120      if (this.udiDeviceIdentifier == null)
2121        return false;
2122      for (DeviceDefinitionUdiDeviceIdentifierComponent item : this.udiDeviceIdentifier)
2123        if (!item.isEmpty())
2124          return true;
2125      return false;
2126    }
2127
2128    public DeviceDefinitionUdiDeviceIdentifierComponent addUdiDeviceIdentifier() { //3
2129      DeviceDefinitionUdiDeviceIdentifierComponent t = new DeviceDefinitionUdiDeviceIdentifierComponent();
2130      if (this.udiDeviceIdentifier == null)
2131        this.udiDeviceIdentifier = new ArrayList<DeviceDefinitionUdiDeviceIdentifierComponent>();
2132      this.udiDeviceIdentifier.add(t);
2133      return t;
2134    }
2135
2136    public DeviceDefinition addUdiDeviceIdentifier(DeviceDefinitionUdiDeviceIdentifierComponent t) { //3
2137      if (t == null)
2138        return this;
2139      if (this.udiDeviceIdentifier == null)
2140        this.udiDeviceIdentifier = new ArrayList<DeviceDefinitionUdiDeviceIdentifierComponent>();
2141      this.udiDeviceIdentifier.add(t);
2142      return this;
2143    }
2144
2145    /**
2146     * @return The first repetition of repeating field {@link #udiDeviceIdentifier}, creating it if it does not already exist
2147     */
2148    public DeviceDefinitionUdiDeviceIdentifierComponent getUdiDeviceIdentifierFirstRep() { 
2149      if (getUdiDeviceIdentifier().isEmpty()) {
2150        addUdiDeviceIdentifier();
2151      }
2152      return getUdiDeviceIdentifier().get(0);
2153    }
2154
2155    /**
2156     * @return {@link #manufacturer} (A name of the manufacturer.)
2157     */
2158    public Type getManufacturer() { 
2159      return this.manufacturer;
2160    }
2161
2162    /**
2163     * @return {@link #manufacturer} (A name of the manufacturer.)
2164     */
2165    public StringType getManufacturerStringType() throws FHIRException { 
2166      if (this.manufacturer == null)
2167        this.manufacturer = new StringType();
2168      if (!(this.manufacturer instanceof StringType))
2169        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.manufacturer.getClass().getName()+" was encountered");
2170      return (StringType) this.manufacturer;
2171    }
2172
2173    public boolean hasManufacturerStringType() { 
2174      return this != null && this.manufacturer instanceof StringType;
2175    }
2176
2177    /**
2178     * @return {@link #manufacturer} (A name of the manufacturer.)
2179     */
2180    public Reference getManufacturerReference() throws FHIRException { 
2181      if (this.manufacturer == null)
2182        this.manufacturer = new Reference();
2183      if (!(this.manufacturer instanceof Reference))
2184        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.manufacturer.getClass().getName()+" was encountered");
2185      return (Reference) this.manufacturer;
2186    }
2187
2188    public boolean hasManufacturerReference() { 
2189      return this != null && this.manufacturer instanceof Reference;
2190    }
2191
2192    public boolean hasManufacturer() { 
2193      return this.manufacturer != null && !this.manufacturer.isEmpty();
2194    }
2195
2196    /**
2197     * @param value {@link #manufacturer} (A name of the manufacturer.)
2198     */
2199    public DeviceDefinition setManufacturer(Type value) { 
2200      if (value != null && !(value instanceof StringType || value instanceof Reference))
2201        throw new Error("Not the right type for DeviceDefinition.manufacturer[x]: "+value.fhirType());
2202      this.manufacturer = value;
2203      return this;
2204    }
2205
2206    /**
2207     * @return {@link #deviceName} (A name given to the device to identify it.)
2208     */
2209    public List<DeviceDefinitionDeviceNameComponent> getDeviceName() { 
2210      if (this.deviceName == null)
2211        this.deviceName = new ArrayList<DeviceDefinitionDeviceNameComponent>();
2212      return this.deviceName;
2213    }
2214
2215    /**
2216     * @return Returns a reference to <code>this</code> for easy method chaining
2217     */
2218    public DeviceDefinition setDeviceName(List<DeviceDefinitionDeviceNameComponent> theDeviceName) { 
2219      this.deviceName = theDeviceName;
2220      return this;
2221    }
2222
2223    public boolean hasDeviceName() { 
2224      if (this.deviceName == null)
2225        return false;
2226      for (DeviceDefinitionDeviceNameComponent item : this.deviceName)
2227        if (!item.isEmpty())
2228          return true;
2229      return false;
2230    }
2231
2232    public DeviceDefinitionDeviceNameComponent addDeviceName() { //3
2233      DeviceDefinitionDeviceNameComponent t = new DeviceDefinitionDeviceNameComponent();
2234      if (this.deviceName == null)
2235        this.deviceName = new ArrayList<DeviceDefinitionDeviceNameComponent>();
2236      this.deviceName.add(t);
2237      return t;
2238    }
2239
2240    public DeviceDefinition addDeviceName(DeviceDefinitionDeviceNameComponent t) { //3
2241      if (t == null)
2242        return this;
2243      if (this.deviceName == null)
2244        this.deviceName = new ArrayList<DeviceDefinitionDeviceNameComponent>();
2245      this.deviceName.add(t);
2246      return this;
2247    }
2248
2249    /**
2250     * @return The first repetition of repeating field {@link #deviceName}, creating it if it does not already exist
2251     */
2252    public DeviceDefinitionDeviceNameComponent getDeviceNameFirstRep() { 
2253      if (getDeviceName().isEmpty()) {
2254        addDeviceName();
2255      }
2256      return getDeviceName().get(0);
2257    }
2258
2259    /**
2260     * @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
2261     */
2262    public StringType getModelNumberElement() { 
2263      if (this.modelNumber == null)
2264        if (Configuration.errorOnAutoCreate())
2265          throw new Error("Attempt to auto-create DeviceDefinition.modelNumber");
2266        else if (Configuration.doAutoCreate())
2267          this.modelNumber = new StringType(); // bb
2268      return this.modelNumber;
2269    }
2270
2271    public boolean hasModelNumberElement() { 
2272      return this.modelNumber != null && !this.modelNumber.isEmpty();
2273    }
2274
2275    public boolean hasModelNumber() { 
2276      return this.modelNumber != null && !this.modelNumber.isEmpty();
2277    }
2278
2279    /**
2280     * @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
2281     */
2282    public DeviceDefinition setModelNumberElement(StringType value) { 
2283      this.modelNumber = value;
2284      return this;
2285    }
2286
2287    /**
2288     * @return The model number for the device.
2289     */
2290    public String getModelNumber() { 
2291      return this.modelNumber == null ? null : this.modelNumber.getValue();
2292    }
2293
2294    /**
2295     * @param value The model number for the device.
2296     */
2297    public DeviceDefinition setModelNumber(String value) { 
2298      if (Utilities.noString(value))
2299        this.modelNumber = null;
2300      else {
2301        if (this.modelNumber == null)
2302          this.modelNumber = new StringType();
2303        this.modelNumber.setValue(value);
2304      }
2305      return this;
2306    }
2307
2308    /**
2309     * @return {@link #type} (What kind of device or device system this is.)
2310     */
2311    public CodeableConcept getType() { 
2312      if (this.type == null)
2313        if (Configuration.errorOnAutoCreate())
2314          throw new Error("Attempt to auto-create DeviceDefinition.type");
2315        else if (Configuration.doAutoCreate())
2316          this.type = new CodeableConcept(); // cc
2317      return this.type;
2318    }
2319
2320    public boolean hasType() { 
2321      return this.type != null && !this.type.isEmpty();
2322    }
2323
2324    /**
2325     * @param value {@link #type} (What kind of device or device system this is.)
2326     */
2327    public DeviceDefinition setType(CodeableConcept value) { 
2328      this.type = value;
2329      return this;
2330    }
2331
2332    /**
2333     * @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.)
2334     */
2335    public List<DeviceDefinitionSpecializationComponent> getSpecialization() { 
2336      if (this.specialization == null)
2337        this.specialization = new ArrayList<DeviceDefinitionSpecializationComponent>();
2338      return this.specialization;
2339    }
2340
2341    /**
2342     * @return Returns a reference to <code>this</code> for easy method chaining
2343     */
2344    public DeviceDefinition setSpecialization(List<DeviceDefinitionSpecializationComponent> theSpecialization) { 
2345      this.specialization = theSpecialization;
2346      return this;
2347    }
2348
2349    public boolean hasSpecialization() { 
2350      if (this.specialization == null)
2351        return false;
2352      for (DeviceDefinitionSpecializationComponent item : this.specialization)
2353        if (!item.isEmpty())
2354          return true;
2355      return false;
2356    }
2357
2358    public DeviceDefinitionSpecializationComponent addSpecialization() { //3
2359      DeviceDefinitionSpecializationComponent t = new DeviceDefinitionSpecializationComponent();
2360      if (this.specialization == null)
2361        this.specialization = new ArrayList<DeviceDefinitionSpecializationComponent>();
2362      this.specialization.add(t);
2363      return t;
2364    }
2365
2366    public DeviceDefinition addSpecialization(DeviceDefinitionSpecializationComponent t) { //3
2367      if (t == null)
2368        return this;
2369      if (this.specialization == null)
2370        this.specialization = new ArrayList<DeviceDefinitionSpecializationComponent>();
2371      this.specialization.add(t);
2372      return this;
2373    }
2374
2375    /**
2376     * @return The first repetition of repeating field {@link #specialization}, creating it if it does not already exist
2377     */
2378    public DeviceDefinitionSpecializationComponent getSpecializationFirstRep() { 
2379      if (getSpecialization().isEmpty()) {
2380        addSpecialization();
2381      }
2382      return getSpecialization().get(0);
2383    }
2384
2385    /**
2386     * @return {@link #version} (The available versions of the device, e.g., software versions.)
2387     */
2388    public List<StringType> getVersion() { 
2389      if (this.version == null)
2390        this.version = new ArrayList<StringType>();
2391      return this.version;
2392    }
2393
2394    /**
2395     * @return Returns a reference to <code>this</code> for easy method chaining
2396     */
2397    public DeviceDefinition setVersion(List<StringType> theVersion) { 
2398      this.version = theVersion;
2399      return this;
2400    }
2401
2402    public boolean hasVersion() { 
2403      if (this.version == null)
2404        return false;
2405      for (StringType item : this.version)
2406        if (!item.isEmpty())
2407          return true;
2408      return false;
2409    }
2410
2411    /**
2412     * @return {@link #version} (The available versions of the device, e.g., software versions.)
2413     */
2414    public StringType addVersionElement() {//2 
2415      StringType t = new StringType();
2416      if (this.version == null)
2417        this.version = new ArrayList<StringType>();
2418      this.version.add(t);
2419      return t;
2420    }
2421
2422    /**
2423     * @param value {@link #version} (The available versions of the device, e.g., software versions.)
2424     */
2425    public DeviceDefinition addVersion(String value) { //1
2426      StringType t = new StringType();
2427      t.setValue(value);
2428      if (this.version == null)
2429        this.version = new ArrayList<StringType>();
2430      this.version.add(t);
2431      return this;
2432    }
2433
2434    /**
2435     * @param value {@link #version} (The available versions of the device, e.g., software versions.)
2436     */
2437    public boolean hasVersion(String value) { 
2438      if (this.version == null)
2439        return false;
2440      for (StringType v : this.version)
2441        if (v.getValue().equals(value)) // string
2442          return true;
2443      return false;
2444    }
2445
2446    /**
2447     * @return {@link #safety} (Safety characteristics of the device.)
2448     */
2449    public List<CodeableConcept> getSafety() { 
2450      if (this.safety == null)
2451        this.safety = new ArrayList<CodeableConcept>();
2452      return this.safety;
2453    }
2454
2455    /**
2456     * @return Returns a reference to <code>this</code> for easy method chaining
2457     */
2458    public DeviceDefinition setSafety(List<CodeableConcept> theSafety) { 
2459      this.safety = theSafety;
2460      return this;
2461    }
2462
2463    public boolean hasSafety() { 
2464      if (this.safety == null)
2465        return false;
2466      for (CodeableConcept item : this.safety)
2467        if (!item.isEmpty())
2468          return true;
2469      return false;
2470    }
2471
2472    public CodeableConcept addSafety() { //3
2473      CodeableConcept t = new CodeableConcept();
2474      if (this.safety == null)
2475        this.safety = new ArrayList<CodeableConcept>();
2476      this.safety.add(t);
2477      return t;
2478    }
2479
2480    public DeviceDefinition addSafety(CodeableConcept t) { //3
2481      if (t == null)
2482        return this;
2483      if (this.safety == null)
2484        this.safety = new ArrayList<CodeableConcept>();
2485      this.safety.add(t);
2486      return this;
2487    }
2488
2489    /**
2490     * @return The first repetition of repeating field {@link #safety}, creating it if it does not already exist
2491     */
2492    public CodeableConcept getSafetyFirstRep() { 
2493      if (getSafety().isEmpty()) {
2494        addSafety();
2495      }
2496      return getSafety().get(0);
2497    }
2498
2499    /**
2500     * @return {@link #shelfLifeStorage} (Shelf Life and storage information.)
2501     */
2502    public List<ProductShelfLife> getShelfLifeStorage() { 
2503      if (this.shelfLifeStorage == null)
2504        this.shelfLifeStorage = new ArrayList<ProductShelfLife>();
2505      return this.shelfLifeStorage;
2506    }
2507
2508    /**
2509     * @return Returns a reference to <code>this</code> for easy method chaining
2510     */
2511    public DeviceDefinition setShelfLifeStorage(List<ProductShelfLife> theShelfLifeStorage) { 
2512      this.shelfLifeStorage = theShelfLifeStorage;
2513      return this;
2514    }
2515
2516    public boolean hasShelfLifeStorage() { 
2517      if (this.shelfLifeStorage == null)
2518        return false;
2519      for (ProductShelfLife item : this.shelfLifeStorage)
2520        if (!item.isEmpty())
2521          return true;
2522      return false;
2523    }
2524
2525    public ProductShelfLife addShelfLifeStorage() { //3
2526      ProductShelfLife t = new ProductShelfLife();
2527      if (this.shelfLifeStorage == null)
2528        this.shelfLifeStorage = new ArrayList<ProductShelfLife>();
2529      this.shelfLifeStorage.add(t);
2530      return t;
2531    }
2532
2533    public DeviceDefinition addShelfLifeStorage(ProductShelfLife t) { //3
2534      if (t == null)
2535        return this;
2536      if (this.shelfLifeStorage == null)
2537        this.shelfLifeStorage = new ArrayList<ProductShelfLife>();
2538      this.shelfLifeStorage.add(t);
2539      return this;
2540    }
2541
2542    /**
2543     * @return The first repetition of repeating field {@link #shelfLifeStorage}, creating it if it does not already exist
2544     */
2545    public ProductShelfLife getShelfLifeStorageFirstRep() { 
2546      if (getShelfLifeStorage().isEmpty()) {
2547        addShelfLifeStorage();
2548      }
2549      return getShelfLifeStorage().get(0);
2550    }
2551
2552    /**
2553     * @return {@link #physicalCharacteristics} (Dimensions, color etc.)
2554     */
2555    public ProdCharacteristic getPhysicalCharacteristics() { 
2556      if (this.physicalCharacteristics == null)
2557        if (Configuration.errorOnAutoCreate())
2558          throw new Error("Attempt to auto-create DeviceDefinition.physicalCharacteristics");
2559        else if (Configuration.doAutoCreate())
2560          this.physicalCharacteristics = new ProdCharacteristic(); // cc
2561      return this.physicalCharacteristics;
2562    }
2563
2564    public boolean hasPhysicalCharacteristics() { 
2565      return this.physicalCharacteristics != null && !this.physicalCharacteristics.isEmpty();
2566    }
2567
2568    /**
2569     * @param value {@link #physicalCharacteristics} (Dimensions, color etc.)
2570     */
2571    public DeviceDefinition setPhysicalCharacteristics(ProdCharacteristic value) { 
2572      this.physicalCharacteristics = value;
2573      return this;
2574    }
2575
2576    /**
2577     * @return {@link #languageCode} (Language code for the human-readable text strings produced by the device (all supported).)
2578     */
2579    public List<CodeableConcept> getLanguageCode() { 
2580      if (this.languageCode == null)
2581        this.languageCode = new ArrayList<CodeableConcept>();
2582      return this.languageCode;
2583    }
2584
2585    /**
2586     * @return Returns a reference to <code>this</code> for easy method chaining
2587     */
2588    public DeviceDefinition setLanguageCode(List<CodeableConcept> theLanguageCode) { 
2589      this.languageCode = theLanguageCode;
2590      return this;
2591    }
2592
2593    public boolean hasLanguageCode() { 
2594      if (this.languageCode == null)
2595        return false;
2596      for (CodeableConcept item : this.languageCode)
2597        if (!item.isEmpty())
2598          return true;
2599      return false;
2600    }
2601
2602    public CodeableConcept addLanguageCode() { //3
2603      CodeableConcept t = new CodeableConcept();
2604      if (this.languageCode == null)
2605        this.languageCode = new ArrayList<CodeableConcept>();
2606      this.languageCode.add(t);
2607      return t;
2608    }
2609
2610    public DeviceDefinition addLanguageCode(CodeableConcept t) { //3
2611      if (t == null)
2612        return this;
2613      if (this.languageCode == null)
2614        this.languageCode = new ArrayList<CodeableConcept>();
2615      this.languageCode.add(t);
2616      return this;
2617    }
2618
2619    /**
2620     * @return The first repetition of repeating field {@link #languageCode}, creating it if it does not already exist
2621     */
2622    public CodeableConcept getLanguageCodeFirstRep() { 
2623      if (getLanguageCode().isEmpty()) {
2624        addLanguageCode();
2625      }
2626      return getLanguageCode().get(0);
2627    }
2628
2629    /**
2630     * @return {@link #capability} (Device capabilities.)
2631     */
2632    public List<DeviceDefinitionCapabilityComponent> getCapability() { 
2633      if (this.capability == null)
2634        this.capability = new ArrayList<DeviceDefinitionCapabilityComponent>();
2635      return this.capability;
2636    }
2637
2638    /**
2639     * @return Returns a reference to <code>this</code> for easy method chaining
2640     */
2641    public DeviceDefinition setCapability(List<DeviceDefinitionCapabilityComponent> theCapability) { 
2642      this.capability = theCapability;
2643      return this;
2644    }
2645
2646    public boolean hasCapability() { 
2647      if (this.capability == null)
2648        return false;
2649      for (DeviceDefinitionCapabilityComponent item : this.capability)
2650        if (!item.isEmpty())
2651          return true;
2652      return false;
2653    }
2654
2655    public DeviceDefinitionCapabilityComponent addCapability() { //3
2656      DeviceDefinitionCapabilityComponent t = new DeviceDefinitionCapabilityComponent();
2657      if (this.capability == null)
2658        this.capability = new ArrayList<DeviceDefinitionCapabilityComponent>();
2659      this.capability.add(t);
2660      return t;
2661    }
2662
2663    public DeviceDefinition addCapability(DeviceDefinitionCapabilityComponent t) { //3
2664      if (t == null)
2665        return this;
2666      if (this.capability == null)
2667        this.capability = new ArrayList<DeviceDefinitionCapabilityComponent>();
2668      this.capability.add(t);
2669      return this;
2670    }
2671
2672    /**
2673     * @return The first repetition of repeating field {@link #capability}, creating it if it does not already exist
2674     */
2675    public DeviceDefinitionCapabilityComponent getCapabilityFirstRep() { 
2676      if (getCapability().isEmpty()) {
2677        addCapability();
2678      }
2679      return getCapability().get(0);
2680    }
2681
2682    /**
2683     * @return {@link #property} (The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.)
2684     */
2685    public List<DeviceDefinitionPropertyComponent> getProperty() { 
2686      if (this.property == null)
2687        this.property = new ArrayList<DeviceDefinitionPropertyComponent>();
2688      return this.property;
2689    }
2690
2691    /**
2692     * @return Returns a reference to <code>this</code> for easy method chaining
2693     */
2694    public DeviceDefinition setProperty(List<DeviceDefinitionPropertyComponent> theProperty) { 
2695      this.property = theProperty;
2696      return this;
2697    }
2698
2699    public boolean hasProperty() { 
2700      if (this.property == null)
2701        return false;
2702      for (DeviceDefinitionPropertyComponent item : this.property)
2703        if (!item.isEmpty())
2704          return true;
2705      return false;
2706    }
2707
2708    public DeviceDefinitionPropertyComponent addProperty() { //3
2709      DeviceDefinitionPropertyComponent t = new DeviceDefinitionPropertyComponent();
2710      if (this.property == null)
2711        this.property = new ArrayList<DeviceDefinitionPropertyComponent>();
2712      this.property.add(t);
2713      return t;
2714    }
2715
2716    public DeviceDefinition addProperty(DeviceDefinitionPropertyComponent t) { //3
2717      if (t == null)
2718        return this;
2719      if (this.property == null)
2720        this.property = new ArrayList<DeviceDefinitionPropertyComponent>();
2721      this.property.add(t);
2722      return this;
2723    }
2724
2725    /**
2726     * @return The first repetition of repeating field {@link #property}, creating it if it does not already exist
2727     */
2728    public DeviceDefinitionPropertyComponent getPropertyFirstRep() { 
2729      if (getProperty().isEmpty()) {
2730        addProperty();
2731      }
2732      return getProperty().get(0);
2733    }
2734
2735    /**
2736     * @return {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.)
2737     */
2738    public Reference getOwner() { 
2739      if (this.owner == null)
2740        if (Configuration.errorOnAutoCreate())
2741          throw new Error("Attempt to auto-create DeviceDefinition.owner");
2742        else if (Configuration.doAutoCreate())
2743          this.owner = new Reference(); // cc
2744      return this.owner;
2745    }
2746
2747    public boolean hasOwner() { 
2748      return this.owner != null && !this.owner.isEmpty();
2749    }
2750
2751    /**
2752     * @param value {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.)
2753     */
2754    public DeviceDefinition setOwner(Reference value) { 
2755      this.owner = value;
2756      return this;
2757    }
2758
2759    /**
2760     * @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.)
2761     */
2762    public Organization getOwnerTarget() { 
2763      if (this.ownerTarget == null)
2764        if (Configuration.errorOnAutoCreate())
2765          throw new Error("Attempt to auto-create DeviceDefinition.owner");
2766        else if (Configuration.doAutoCreate())
2767          this.ownerTarget = new Organization(); // aa
2768      return this.ownerTarget;
2769    }
2770
2771    /**
2772     * @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.)
2773     */
2774    public DeviceDefinition setOwnerTarget(Organization value) { 
2775      this.ownerTarget = value;
2776      return this;
2777    }
2778
2779    /**
2780     * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.)
2781     */
2782    public List<ContactPoint> getContact() { 
2783      if (this.contact == null)
2784        this.contact = new ArrayList<ContactPoint>();
2785      return this.contact;
2786    }
2787
2788    /**
2789     * @return Returns a reference to <code>this</code> for easy method chaining
2790     */
2791    public DeviceDefinition setContact(List<ContactPoint> theContact) { 
2792      this.contact = theContact;
2793      return this;
2794    }
2795
2796    public boolean hasContact() { 
2797      if (this.contact == null)
2798        return false;
2799      for (ContactPoint item : this.contact)
2800        if (!item.isEmpty())
2801          return true;
2802      return false;
2803    }
2804
2805    public ContactPoint addContact() { //3
2806      ContactPoint t = new ContactPoint();
2807      if (this.contact == null)
2808        this.contact = new ArrayList<ContactPoint>();
2809      this.contact.add(t);
2810      return t;
2811    }
2812
2813    public DeviceDefinition addContact(ContactPoint t) { //3
2814      if (t == null)
2815        return this;
2816      if (this.contact == null)
2817        this.contact = new ArrayList<ContactPoint>();
2818      this.contact.add(t);
2819      return this;
2820    }
2821
2822    /**
2823     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
2824     */
2825    public ContactPoint getContactFirstRep() { 
2826      if (getContact().isEmpty()) {
2827        addContact();
2828      }
2829      return getContact().get(0);
2830    }
2831
2832    /**
2833     * @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
2834     */
2835    public UriType getUrlElement() { 
2836      if (this.url == null)
2837        if (Configuration.errorOnAutoCreate())
2838          throw new Error("Attempt to auto-create DeviceDefinition.url");
2839        else if (Configuration.doAutoCreate())
2840          this.url = new UriType(); // bb
2841      return this.url;
2842    }
2843
2844    public boolean hasUrlElement() { 
2845      return this.url != null && !this.url.isEmpty();
2846    }
2847
2848    public boolean hasUrl() { 
2849      return this.url != null && !this.url.isEmpty();
2850    }
2851
2852    /**
2853     * @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
2854     */
2855    public DeviceDefinition setUrlElement(UriType value) { 
2856      this.url = value;
2857      return this;
2858    }
2859
2860    /**
2861     * @return A network address on which the device may be contacted directly.
2862     */
2863    public String getUrl() { 
2864      return this.url == null ? null : this.url.getValue();
2865    }
2866
2867    /**
2868     * @param value A network address on which the device may be contacted directly.
2869     */
2870    public DeviceDefinition setUrl(String value) { 
2871      if (Utilities.noString(value))
2872        this.url = null;
2873      else {
2874        if (this.url == null)
2875          this.url = new UriType();
2876        this.url.setValue(value);
2877      }
2878      return this;
2879    }
2880
2881    /**
2882     * @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
2883     */
2884    public UriType getOnlineInformationElement() { 
2885      if (this.onlineInformation == null)
2886        if (Configuration.errorOnAutoCreate())
2887          throw new Error("Attempt to auto-create DeviceDefinition.onlineInformation");
2888        else if (Configuration.doAutoCreate())
2889          this.onlineInformation = new UriType(); // bb
2890      return this.onlineInformation;
2891    }
2892
2893    public boolean hasOnlineInformationElement() { 
2894      return this.onlineInformation != null && !this.onlineInformation.isEmpty();
2895    }
2896
2897    public boolean hasOnlineInformation() { 
2898      return this.onlineInformation != null && !this.onlineInformation.isEmpty();
2899    }
2900
2901    /**
2902     * @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
2903     */
2904    public DeviceDefinition setOnlineInformationElement(UriType value) { 
2905      this.onlineInformation = value;
2906      return this;
2907    }
2908
2909    /**
2910     * @return Access to on-line information about the device.
2911     */
2912    public String getOnlineInformation() { 
2913      return this.onlineInformation == null ? null : this.onlineInformation.getValue();
2914    }
2915
2916    /**
2917     * @param value Access to on-line information about the device.
2918     */
2919    public DeviceDefinition setOnlineInformation(String value) { 
2920      if (Utilities.noString(value))
2921        this.onlineInformation = null;
2922      else {
2923        if (this.onlineInformation == null)
2924          this.onlineInformation = new UriType();
2925        this.onlineInformation.setValue(value);
2926      }
2927      return this;
2928    }
2929
2930    /**
2931     * @return {@link #note} (Descriptive information, usage information or implantation information that is not captured in an existing element.)
2932     */
2933    public List<Annotation> getNote() { 
2934      if (this.note == null)
2935        this.note = new ArrayList<Annotation>();
2936      return this.note;
2937    }
2938
2939    /**
2940     * @return Returns a reference to <code>this</code> for easy method chaining
2941     */
2942    public DeviceDefinition setNote(List<Annotation> theNote) { 
2943      this.note = theNote;
2944      return this;
2945    }
2946
2947    public boolean hasNote() { 
2948      if (this.note == null)
2949        return false;
2950      for (Annotation item : this.note)
2951        if (!item.isEmpty())
2952          return true;
2953      return false;
2954    }
2955
2956    public Annotation addNote() { //3
2957      Annotation t = new Annotation();
2958      if (this.note == null)
2959        this.note = new ArrayList<Annotation>();
2960      this.note.add(t);
2961      return t;
2962    }
2963
2964    public DeviceDefinition addNote(Annotation t) { //3
2965      if (t == null)
2966        return this;
2967      if (this.note == null)
2968        this.note = new ArrayList<Annotation>();
2969      this.note.add(t);
2970      return this;
2971    }
2972
2973    /**
2974     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
2975     */
2976    public Annotation getNoteFirstRep() { 
2977      if (getNote().isEmpty()) {
2978        addNote();
2979      }
2980      return getNote().get(0);
2981    }
2982
2983    /**
2984     * @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).)
2985     */
2986    public Quantity getQuantity() { 
2987      if (this.quantity == null)
2988        if (Configuration.errorOnAutoCreate())
2989          throw new Error("Attempt to auto-create DeviceDefinition.quantity");
2990        else if (Configuration.doAutoCreate())
2991          this.quantity = new Quantity(); // cc
2992      return this.quantity;
2993    }
2994
2995    public boolean hasQuantity() { 
2996      return this.quantity != null && !this.quantity.isEmpty();
2997    }
2998
2999    /**
3000     * @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).)
3001     */
3002    public DeviceDefinition setQuantity(Quantity value) { 
3003      this.quantity = value;
3004      return this;
3005    }
3006
3007    /**
3008     * @return {@link #parentDevice} (The parent device it can be part of.)
3009     */
3010    public Reference getParentDevice() { 
3011      if (this.parentDevice == null)
3012        if (Configuration.errorOnAutoCreate())
3013          throw new Error("Attempt to auto-create DeviceDefinition.parentDevice");
3014        else if (Configuration.doAutoCreate())
3015          this.parentDevice = new Reference(); // cc
3016      return this.parentDevice;
3017    }
3018
3019    public boolean hasParentDevice() { 
3020      return this.parentDevice != null && !this.parentDevice.isEmpty();
3021    }
3022
3023    /**
3024     * @param value {@link #parentDevice} (The parent device it can be part of.)
3025     */
3026    public DeviceDefinition setParentDevice(Reference value) { 
3027      this.parentDevice = value;
3028      return this;
3029    }
3030
3031    /**
3032     * @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.)
3033     */
3034    public DeviceDefinition getParentDeviceTarget() { 
3035      if (this.parentDeviceTarget == null)
3036        if (Configuration.errorOnAutoCreate())
3037          throw new Error("Attempt to auto-create DeviceDefinition.parentDevice");
3038        else if (Configuration.doAutoCreate())
3039          this.parentDeviceTarget = new DeviceDefinition(); // aa
3040      return this.parentDeviceTarget;
3041    }
3042
3043    /**
3044     * @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.)
3045     */
3046    public DeviceDefinition setParentDeviceTarget(DeviceDefinition value) { 
3047      this.parentDeviceTarget = value;
3048      return this;
3049    }
3050
3051    /**
3052     * @return {@link #material} (A substance used to create the material(s) of which the device is made.)
3053     */
3054    public List<DeviceDefinitionMaterialComponent> getMaterial() { 
3055      if (this.material == null)
3056        this.material = new ArrayList<DeviceDefinitionMaterialComponent>();
3057      return this.material;
3058    }
3059
3060    /**
3061     * @return Returns a reference to <code>this</code> for easy method chaining
3062     */
3063    public DeviceDefinition setMaterial(List<DeviceDefinitionMaterialComponent> theMaterial) { 
3064      this.material = theMaterial;
3065      return this;
3066    }
3067
3068    public boolean hasMaterial() { 
3069      if (this.material == null)
3070        return false;
3071      for (DeviceDefinitionMaterialComponent item : this.material)
3072        if (!item.isEmpty())
3073          return true;
3074      return false;
3075    }
3076
3077    public DeviceDefinitionMaterialComponent addMaterial() { //3
3078      DeviceDefinitionMaterialComponent t = new DeviceDefinitionMaterialComponent();
3079      if (this.material == null)
3080        this.material = new ArrayList<DeviceDefinitionMaterialComponent>();
3081      this.material.add(t);
3082      return t;
3083    }
3084
3085    public DeviceDefinition addMaterial(DeviceDefinitionMaterialComponent t) { //3
3086      if (t == null)
3087        return this;
3088      if (this.material == null)
3089        this.material = new ArrayList<DeviceDefinitionMaterialComponent>();
3090      this.material.add(t);
3091      return this;
3092    }
3093
3094    /**
3095     * @return The first repetition of repeating field {@link #material}, creating it if it does not already exist
3096     */
3097    public DeviceDefinitionMaterialComponent getMaterialFirstRep() { 
3098      if (getMaterial().isEmpty()) {
3099        addMaterial();
3100      }
3101      return getMaterial().get(0);
3102    }
3103
3104      protected void listChildren(List<Property> children) {
3105        super.listChildren(children);
3106        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));
3107        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));
3108        children.add(new Property("manufacturer[x]", "string|Reference(Organization)", "A name of the manufacturer.", 0, 1, manufacturer));
3109        children.add(new Property("deviceName", "", "A name given to the device to identify it.", 0, java.lang.Integer.MAX_VALUE, deviceName));
3110        children.add(new Property("modelNumber", "string", "The model number for the device.", 0, 1, modelNumber));
3111        children.add(new Property("type", "CodeableConcept", "What kind of device or device system this is.", 0, 1, type));
3112        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));
3113        children.add(new Property("version", "string", "The available versions of the device, e.g., software versions.", 0, java.lang.Integer.MAX_VALUE, version));
3114        children.add(new Property("safety", "CodeableConcept", "Safety characteristics of the device.", 0, java.lang.Integer.MAX_VALUE, safety));
3115        children.add(new Property("shelfLifeStorage", "ProductShelfLife", "Shelf Life and storage information.", 0, java.lang.Integer.MAX_VALUE, shelfLifeStorage));
3116        children.add(new Property("physicalCharacteristics", "ProdCharacteristic", "Dimensions, color etc.", 0, 1, physicalCharacteristics));
3117        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));
3118        children.add(new Property("capability", "", "Device capabilities.", 0, java.lang.Integer.MAX_VALUE, capability));
3119        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));
3120        children.add(new Property("owner", "Reference(Organization)", "An organization that is responsible for the provision and ongoing maintenance of the device.", 0, 1, owner));
3121        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));
3122        children.add(new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, 1, url));
3123        children.add(new Property("onlineInformation", "uri", "Access to on-line information about the device.", 0, 1, onlineInformation));
3124        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));
3125        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));
3126        children.add(new Property("parentDevice", "Reference(DeviceDefinition)", "The parent device it can be part of.", 0, 1, parentDevice));
3127        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));
3128      }
3129
3130      @Override
3131      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3132        switch (_hash) {
3133        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);
3134        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);
3135        case 418079503: /*manufacturer[x]*/  return new Property("manufacturer[x]", "string|Reference(Organization)", "A name of the manufacturer.", 0, 1, manufacturer);
3136        case -1969347631: /*manufacturer*/  return new Property("manufacturer[x]", "string|Reference(Organization)", "A name of the manufacturer.", 0, 1, manufacturer);
3137        case -630681790: /*manufacturerString*/  return new Property("manufacturer[x]", "string|Reference(Organization)", "A name of the manufacturer.", 0, 1, manufacturer);
3138        case 1104934522: /*manufacturerReference*/  return new Property("manufacturer[x]", "string|Reference(Organization)", "A name of the manufacturer.", 0, 1, manufacturer);
3139        case 780988929: /*deviceName*/  return new Property("deviceName", "", "A name given to the device to identify it.", 0, java.lang.Integer.MAX_VALUE, deviceName);
3140        case 346619858: /*modelNumber*/  return new Property("modelNumber", "string", "The model number for the device.", 0, 1, modelNumber);
3141        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "What kind of device or device system this is.", 0, 1, type);
3142        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);
3143        case 351608024: /*version*/  return new Property("version", "string", "The available versions of the device, e.g., software versions.", 0, java.lang.Integer.MAX_VALUE, version);
3144        case -909893934: /*safety*/  return new Property("safety", "CodeableConcept", "Safety characteristics of the device.", 0, java.lang.Integer.MAX_VALUE, safety);
3145        case 172049237: /*shelfLifeStorage*/  return new Property("shelfLifeStorage", "ProductShelfLife", "Shelf Life and storage information.", 0, java.lang.Integer.MAX_VALUE, shelfLifeStorage);
3146        case -1599676319: /*physicalCharacteristics*/  return new Property("physicalCharacteristics", "ProdCharacteristic", "Dimensions, color etc.", 0, 1, physicalCharacteristics);
3147        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);
3148        case -783669992: /*capability*/  return new Property("capability", "", "Device capabilities.", 0, java.lang.Integer.MAX_VALUE, capability);
3149        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);
3150        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);
3151        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);
3152        case 116079: /*url*/  return new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, 1, url);
3153        case -788511527: /*onlineInformation*/  return new Property("onlineInformation", "uri", "Access to on-line information about the device.", 0, 1, onlineInformation);
3154        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);
3155        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);
3156        case 620260256: /*parentDevice*/  return new Property("parentDevice", "Reference(DeviceDefinition)", "The parent device it can be part of.", 0, 1, parentDevice);
3157        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);
3158        default: return super.getNamedProperty(_hash, _name, _checkValid);
3159        }
3160
3161      }
3162
3163      @Override
3164      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3165        switch (hash) {
3166        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3167        case -99121287: /*udiDeviceIdentifier*/ return this.udiDeviceIdentifier == null ? new Base[0] : this.udiDeviceIdentifier.toArray(new Base[this.udiDeviceIdentifier.size()]); // DeviceDefinitionUdiDeviceIdentifierComponent
3168        case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : new Base[] {this.manufacturer}; // Type
3169        case 780988929: /*deviceName*/ return this.deviceName == null ? new Base[0] : this.deviceName.toArray(new Base[this.deviceName.size()]); // DeviceDefinitionDeviceNameComponent
3170        case 346619858: /*modelNumber*/ return this.modelNumber == null ? new Base[0] : new Base[] {this.modelNumber}; // StringType
3171        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3172        case 682815883: /*specialization*/ return this.specialization == null ? new Base[0] : this.specialization.toArray(new Base[this.specialization.size()]); // DeviceDefinitionSpecializationComponent
3173        case 351608024: /*version*/ return this.version == null ? new Base[0] : this.version.toArray(new Base[this.version.size()]); // StringType
3174        case -909893934: /*safety*/ return this.safety == null ? new Base[0] : this.safety.toArray(new Base[this.safety.size()]); // CodeableConcept
3175        case 172049237: /*shelfLifeStorage*/ return this.shelfLifeStorage == null ? new Base[0] : this.shelfLifeStorage.toArray(new Base[this.shelfLifeStorage.size()]); // ProductShelfLife
3176        case -1599676319: /*physicalCharacteristics*/ return this.physicalCharacteristics == null ? new Base[0] : new Base[] {this.physicalCharacteristics}; // ProdCharacteristic
3177        case -2092349083: /*languageCode*/ return this.languageCode == null ? new Base[0] : this.languageCode.toArray(new Base[this.languageCode.size()]); // CodeableConcept
3178        case -783669992: /*capability*/ return this.capability == null ? new Base[0] : this.capability.toArray(new Base[this.capability.size()]); // DeviceDefinitionCapabilityComponent
3179        case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // DeviceDefinitionPropertyComponent
3180        case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference
3181        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactPoint
3182        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
3183        case -788511527: /*onlineInformation*/ return this.onlineInformation == null ? new Base[0] : new Base[] {this.onlineInformation}; // UriType
3184        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
3185        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
3186        case 620260256: /*parentDevice*/ return this.parentDevice == null ? new Base[0] : new Base[] {this.parentDevice}; // Reference
3187        case 299066663: /*material*/ return this.material == null ? new Base[0] : this.material.toArray(new Base[this.material.size()]); // DeviceDefinitionMaterialComponent
3188        default: return super.getProperty(hash, name, checkValid);
3189        }
3190
3191      }
3192
3193      @Override
3194      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3195        switch (hash) {
3196        case -1618432855: // identifier
3197          this.getIdentifier().add(castToIdentifier(value)); // Identifier
3198          return value;
3199        case -99121287: // udiDeviceIdentifier
3200          this.getUdiDeviceIdentifier().add((DeviceDefinitionUdiDeviceIdentifierComponent) value); // DeviceDefinitionUdiDeviceIdentifierComponent
3201          return value;
3202        case -1969347631: // manufacturer
3203          this.manufacturer = castToType(value); // Type
3204          return value;
3205        case 780988929: // deviceName
3206          this.getDeviceName().add((DeviceDefinitionDeviceNameComponent) value); // DeviceDefinitionDeviceNameComponent
3207          return value;
3208        case 346619858: // modelNumber
3209          this.modelNumber = castToString(value); // StringType
3210          return value;
3211        case 3575610: // type
3212          this.type = castToCodeableConcept(value); // CodeableConcept
3213          return value;
3214        case 682815883: // specialization
3215          this.getSpecialization().add((DeviceDefinitionSpecializationComponent) value); // DeviceDefinitionSpecializationComponent
3216          return value;
3217        case 351608024: // version
3218          this.getVersion().add(castToString(value)); // StringType
3219          return value;
3220        case -909893934: // safety
3221          this.getSafety().add(castToCodeableConcept(value)); // CodeableConcept
3222          return value;
3223        case 172049237: // shelfLifeStorage
3224          this.getShelfLifeStorage().add(castToProductShelfLife(value)); // ProductShelfLife
3225          return value;
3226        case -1599676319: // physicalCharacteristics
3227          this.physicalCharacteristics = castToProdCharacteristic(value); // ProdCharacteristic
3228          return value;
3229        case -2092349083: // languageCode
3230          this.getLanguageCode().add(castToCodeableConcept(value)); // CodeableConcept
3231          return value;
3232        case -783669992: // capability
3233          this.getCapability().add((DeviceDefinitionCapabilityComponent) value); // DeviceDefinitionCapabilityComponent
3234          return value;
3235        case -993141291: // property
3236          this.getProperty().add((DeviceDefinitionPropertyComponent) value); // DeviceDefinitionPropertyComponent
3237          return value;
3238        case 106164915: // owner
3239          this.owner = castToReference(value); // Reference
3240          return value;
3241        case 951526432: // contact
3242          this.getContact().add(castToContactPoint(value)); // ContactPoint
3243          return value;
3244        case 116079: // url
3245          this.url = castToUri(value); // UriType
3246          return value;
3247        case -788511527: // onlineInformation
3248          this.onlineInformation = castToUri(value); // UriType
3249          return value;
3250        case 3387378: // note
3251          this.getNote().add(castToAnnotation(value)); // Annotation
3252          return value;
3253        case -1285004149: // quantity
3254          this.quantity = castToQuantity(value); // Quantity
3255          return value;
3256        case 620260256: // parentDevice
3257          this.parentDevice = castToReference(value); // Reference
3258          return value;
3259        case 299066663: // material
3260          this.getMaterial().add((DeviceDefinitionMaterialComponent) value); // DeviceDefinitionMaterialComponent
3261          return value;
3262        default: return super.setProperty(hash, name, value);
3263        }
3264
3265      }
3266
3267      @Override
3268      public Base setProperty(String name, Base value) throws FHIRException {
3269        if (name.equals("identifier")) {
3270          this.getIdentifier().add(castToIdentifier(value));
3271        } else if (name.equals("udiDeviceIdentifier")) {
3272          this.getUdiDeviceIdentifier().add((DeviceDefinitionUdiDeviceIdentifierComponent) value);
3273        } else if (name.equals("manufacturer[x]")) {
3274          this.manufacturer = castToType(value); // Type
3275        } else if (name.equals("deviceName")) {
3276          this.getDeviceName().add((DeviceDefinitionDeviceNameComponent) value);
3277        } else if (name.equals("modelNumber")) {
3278          this.modelNumber = castToString(value); // StringType
3279        } else if (name.equals("type")) {
3280          this.type = castToCodeableConcept(value); // CodeableConcept
3281        } else if (name.equals("specialization")) {
3282          this.getSpecialization().add((DeviceDefinitionSpecializationComponent) value);
3283        } else if (name.equals("version")) {
3284          this.getVersion().add(castToString(value));
3285        } else if (name.equals("safety")) {
3286          this.getSafety().add(castToCodeableConcept(value));
3287        } else if (name.equals("shelfLifeStorage")) {
3288          this.getShelfLifeStorage().add(castToProductShelfLife(value));
3289        } else if (name.equals("physicalCharacteristics")) {
3290          this.physicalCharacteristics = castToProdCharacteristic(value); // ProdCharacteristic
3291        } else if (name.equals("languageCode")) {
3292          this.getLanguageCode().add(castToCodeableConcept(value));
3293        } else if (name.equals("capability")) {
3294          this.getCapability().add((DeviceDefinitionCapabilityComponent) value);
3295        } else if (name.equals("property")) {
3296          this.getProperty().add((DeviceDefinitionPropertyComponent) value);
3297        } else if (name.equals("owner")) {
3298          this.owner = castToReference(value); // Reference
3299        } else if (name.equals("contact")) {
3300          this.getContact().add(castToContactPoint(value));
3301        } else if (name.equals("url")) {
3302          this.url = castToUri(value); // UriType
3303        } else if (name.equals("onlineInformation")) {
3304          this.onlineInformation = castToUri(value); // UriType
3305        } else if (name.equals("note")) {
3306          this.getNote().add(castToAnnotation(value));
3307        } else if (name.equals("quantity")) {
3308          this.quantity = castToQuantity(value); // Quantity
3309        } else if (name.equals("parentDevice")) {
3310          this.parentDevice = castToReference(value); // Reference
3311        } else if (name.equals("material")) {
3312          this.getMaterial().add((DeviceDefinitionMaterialComponent) value);
3313        } else
3314          return super.setProperty(name, value);
3315        return value;
3316      }
3317
3318      @Override
3319      public Base makeProperty(int hash, String name) throws FHIRException {
3320        switch (hash) {
3321        case -1618432855:  return addIdentifier(); 
3322        case -99121287:  return addUdiDeviceIdentifier(); 
3323        case 418079503:  return getManufacturer(); 
3324        case -1969347631:  return getManufacturer(); 
3325        case 780988929:  return addDeviceName(); 
3326        case 346619858:  return getModelNumberElement();
3327        case 3575610:  return getType(); 
3328        case 682815883:  return addSpecialization(); 
3329        case 351608024:  return addVersionElement();
3330        case -909893934:  return addSafety(); 
3331        case 172049237:  return addShelfLifeStorage(); 
3332        case -1599676319:  return getPhysicalCharacteristics(); 
3333        case -2092349083:  return addLanguageCode(); 
3334        case -783669992:  return addCapability(); 
3335        case -993141291:  return addProperty(); 
3336        case 106164915:  return getOwner(); 
3337        case 951526432:  return addContact(); 
3338        case 116079:  return getUrlElement();
3339        case -788511527:  return getOnlineInformationElement();
3340        case 3387378:  return addNote(); 
3341        case -1285004149:  return getQuantity(); 
3342        case 620260256:  return getParentDevice(); 
3343        case 299066663:  return addMaterial(); 
3344        default: return super.makeProperty(hash, name);
3345        }
3346
3347      }
3348
3349      @Override
3350      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3351        switch (hash) {
3352        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3353        case -99121287: /*udiDeviceIdentifier*/ return new String[] {};
3354        case -1969347631: /*manufacturer*/ return new String[] {"string", "Reference"};
3355        case 780988929: /*deviceName*/ return new String[] {};
3356        case 346619858: /*modelNumber*/ return new String[] {"string"};
3357        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3358        case 682815883: /*specialization*/ return new String[] {};
3359        case 351608024: /*version*/ return new String[] {"string"};
3360        case -909893934: /*safety*/ return new String[] {"CodeableConcept"};
3361        case 172049237: /*shelfLifeStorage*/ return new String[] {"ProductShelfLife"};
3362        case -1599676319: /*physicalCharacteristics*/ return new String[] {"ProdCharacteristic"};
3363        case -2092349083: /*languageCode*/ return new String[] {"CodeableConcept"};
3364        case -783669992: /*capability*/ return new String[] {};
3365        case -993141291: /*property*/ return new String[] {};
3366        case 106164915: /*owner*/ return new String[] {"Reference"};
3367        case 951526432: /*contact*/ return new String[] {"ContactPoint"};
3368        case 116079: /*url*/ return new String[] {"uri"};
3369        case -788511527: /*onlineInformation*/ return new String[] {"uri"};
3370        case 3387378: /*note*/ return new String[] {"Annotation"};
3371        case -1285004149: /*quantity*/ return new String[] {"Quantity"};
3372        case 620260256: /*parentDevice*/ return new String[] {"Reference"};
3373        case 299066663: /*material*/ return new String[] {};
3374        default: return super.getTypesForProperty(hash, name);
3375        }
3376
3377      }
3378
3379      @Override
3380      public Base addChild(String name) throws FHIRException {
3381        if (name.equals("identifier")) {
3382          return addIdentifier();
3383        }
3384        else if (name.equals("udiDeviceIdentifier")) {
3385          return addUdiDeviceIdentifier();
3386        }
3387        else if (name.equals("manufacturerString")) {
3388          this.manufacturer = new StringType();
3389          return this.manufacturer;
3390        }
3391        else if (name.equals("manufacturerReference")) {
3392          this.manufacturer = new Reference();
3393          return this.manufacturer;
3394        }
3395        else if (name.equals("deviceName")) {
3396          return addDeviceName();
3397        }
3398        else if (name.equals("modelNumber")) {
3399          throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.modelNumber");
3400        }
3401        else if (name.equals("type")) {
3402          this.type = new CodeableConcept();
3403          return this.type;
3404        }
3405        else if (name.equals("specialization")) {
3406          return addSpecialization();
3407        }
3408        else if (name.equals("version")) {
3409          throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.version");
3410        }
3411        else if (name.equals("safety")) {
3412          return addSafety();
3413        }
3414        else if (name.equals("shelfLifeStorage")) {
3415          return addShelfLifeStorage();
3416        }
3417        else if (name.equals("physicalCharacteristics")) {
3418          this.physicalCharacteristics = new ProdCharacteristic();
3419          return this.physicalCharacteristics;
3420        }
3421        else if (name.equals("languageCode")) {
3422          return addLanguageCode();
3423        }
3424        else if (name.equals("capability")) {
3425          return addCapability();
3426        }
3427        else if (name.equals("property")) {
3428          return addProperty();
3429        }
3430        else if (name.equals("owner")) {
3431          this.owner = new Reference();
3432          return this.owner;
3433        }
3434        else if (name.equals("contact")) {
3435          return addContact();
3436        }
3437        else if (name.equals("url")) {
3438          throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.url");
3439        }
3440        else if (name.equals("onlineInformation")) {
3441          throw new FHIRException("Cannot call addChild on a primitive type DeviceDefinition.onlineInformation");
3442        }
3443        else if (name.equals("note")) {
3444          return addNote();
3445        }
3446        else if (name.equals("quantity")) {
3447          this.quantity = new Quantity();
3448          return this.quantity;
3449        }
3450        else if (name.equals("parentDevice")) {
3451          this.parentDevice = new Reference();
3452          return this.parentDevice;
3453        }
3454        else if (name.equals("material")) {
3455          return addMaterial();
3456        }
3457        else
3458          return super.addChild(name);
3459      }
3460
3461  public String fhirType() {
3462    return "DeviceDefinition";
3463
3464  }
3465
3466      public DeviceDefinition copy() {
3467        DeviceDefinition dst = new DeviceDefinition();
3468        copyValues(dst);
3469        if (identifier != null) {
3470          dst.identifier = new ArrayList<Identifier>();
3471          for (Identifier i : identifier)
3472            dst.identifier.add(i.copy());
3473        };
3474        if (udiDeviceIdentifier != null) {
3475          dst.udiDeviceIdentifier = new ArrayList<DeviceDefinitionUdiDeviceIdentifierComponent>();
3476          for (DeviceDefinitionUdiDeviceIdentifierComponent i : udiDeviceIdentifier)
3477            dst.udiDeviceIdentifier.add(i.copy());
3478        };
3479        dst.manufacturer = manufacturer == null ? null : manufacturer.copy();
3480        if (deviceName != null) {
3481          dst.deviceName = new ArrayList<DeviceDefinitionDeviceNameComponent>();
3482          for (DeviceDefinitionDeviceNameComponent i : deviceName)
3483            dst.deviceName.add(i.copy());
3484        };
3485        dst.modelNumber = modelNumber == null ? null : modelNumber.copy();
3486        dst.type = type == null ? null : type.copy();
3487        if (specialization != null) {
3488          dst.specialization = new ArrayList<DeviceDefinitionSpecializationComponent>();
3489          for (DeviceDefinitionSpecializationComponent i : specialization)
3490            dst.specialization.add(i.copy());
3491        };
3492        if (version != null) {
3493          dst.version = new ArrayList<StringType>();
3494          for (StringType i : version)
3495            dst.version.add(i.copy());
3496        };
3497        if (safety != null) {
3498          dst.safety = new ArrayList<CodeableConcept>();
3499          for (CodeableConcept i : safety)
3500            dst.safety.add(i.copy());
3501        };
3502        if (shelfLifeStorage != null) {
3503          dst.shelfLifeStorage = new ArrayList<ProductShelfLife>();
3504          for (ProductShelfLife i : shelfLifeStorage)
3505            dst.shelfLifeStorage.add(i.copy());
3506        };
3507        dst.physicalCharacteristics = physicalCharacteristics == null ? null : physicalCharacteristics.copy();
3508        if (languageCode != null) {
3509          dst.languageCode = new ArrayList<CodeableConcept>();
3510          for (CodeableConcept i : languageCode)
3511            dst.languageCode.add(i.copy());
3512        };
3513        if (capability != null) {
3514          dst.capability = new ArrayList<DeviceDefinitionCapabilityComponent>();
3515          for (DeviceDefinitionCapabilityComponent i : capability)
3516            dst.capability.add(i.copy());
3517        };
3518        if (property != null) {
3519          dst.property = new ArrayList<DeviceDefinitionPropertyComponent>();
3520          for (DeviceDefinitionPropertyComponent i : property)
3521            dst.property.add(i.copy());
3522        };
3523        dst.owner = owner == null ? null : owner.copy();
3524        if (contact != null) {
3525          dst.contact = new ArrayList<ContactPoint>();
3526          for (ContactPoint i : contact)
3527            dst.contact.add(i.copy());
3528        };
3529        dst.url = url == null ? null : url.copy();
3530        dst.onlineInformation = onlineInformation == null ? null : onlineInformation.copy();
3531        if (note != null) {
3532          dst.note = new ArrayList<Annotation>();
3533          for (Annotation i : note)
3534            dst.note.add(i.copy());
3535        };
3536        dst.quantity = quantity == null ? null : quantity.copy();
3537        dst.parentDevice = parentDevice == null ? null : parentDevice.copy();
3538        if (material != null) {
3539          dst.material = new ArrayList<DeviceDefinitionMaterialComponent>();
3540          for (DeviceDefinitionMaterialComponent i : material)
3541            dst.material.add(i.copy());
3542        };
3543        return dst;
3544      }
3545
3546      protected DeviceDefinition typedCopy() {
3547        return copy();
3548      }
3549
3550      @Override
3551      public boolean equalsDeep(Base other_) {
3552        if (!super.equalsDeep(other_))
3553          return false;
3554        if (!(other_ instanceof DeviceDefinition))
3555          return false;
3556        DeviceDefinition o = (DeviceDefinition) other_;
3557        return compareDeep(identifier, o.identifier, true) && compareDeep(udiDeviceIdentifier, o.udiDeviceIdentifier, true)
3558           && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(deviceName, o.deviceName, true)
3559           && compareDeep(modelNumber, o.modelNumber, true) && compareDeep(type, o.type, true) && compareDeep(specialization, o.specialization, true)
3560           && compareDeep(version, o.version, true) && compareDeep(safety, o.safety, true) && compareDeep(shelfLifeStorage, o.shelfLifeStorage, true)
3561           && compareDeep(physicalCharacteristics, o.physicalCharacteristics, true) && compareDeep(languageCode, o.languageCode, true)
3562           && compareDeep(capability, o.capability, true) && compareDeep(property, o.property, true) && compareDeep(owner, o.owner, true)
3563           && compareDeep(contact, o.contact, true) && compareDeep(url, o.url, true) && compareDeep(onlineInformation, o.onlineInformation, true)
3564           && compareDeep(note, o.note, true) && compareDeep(quantity, o.quantity, true) && compareDeep(parentDevice, o.parentDevice, true)
3565           && compareDeep(material, o.material, true);
3566      }
3567
3568      @Override
3569      public boolean equalsShallow(Base other_) {
3570        if (!super.equalsShallow(other_))
3571          return false;
3572        if (!(other_ instanceof DeviceDefinition))
3573          return false;
3574        DeviceDefinition o = (DeviceDefinition) other_;
3575        return compareValues(modelNumber, o.modelNumber, true) && compareValues(version, o.version, true) && compareValues(url, o.url, true)
3576           && compareValues(onlineInformation, o.onlineInformation, true);
3577      }
3578
3579      public boolean isEmpty() {
3580        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, udiDeviceIdentifier
3581          , manufacturer, deviceName, modelNumber, type, specialization, version, safety
3582          , shelfLifeStorage, physicalCharacteristics, languageCode, capability, property, owner
3583          , contact, url, onlineInformation, note, quantity, parentDevice, material);
3584      }
3585
3586  @Override
3587  public ResourceType getResourceType() {
3588    return ResourceType.DeviceDefinition;
3589   }
3590
3591 /**
3592   * Search parameter: <b>parent</b>
3593   * <p>
3594   * Description: <b>The parent DeviceDefinition resource</b><br>
3595   * Type: <b>reference</b><br>
3596   * Path: <b>DeviceDefinition.parentDevice</b><br>
3597   * </p>
3598   */
3599  @SearchParamDefinition(name="parent", path="DeviceDefinition.parentDevice", description="The parent DeviceDefinition resource", type="reference", target={DeviceDefinition.class } )
3600  public static final String SP_PARENT = "parent";
3601 /**
3602   * <b>Fluent Client</b> search parameter constant for <b>parent</b>
3603   * <p>
3604   * Description: <b>The parent DeviceDefinition resource</b><br>
3605   * Type: <b>reference</b><br>
3606   * Path: <b>DeviceDefinition.parentDevice</b><br>
3607   * </p>
3608   */
3609  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT);
3610
3611/**
3612   * Constant for fluent queries to be used to add include statements. Specifies
3613   * the path value of "<b>DeviceDefinition:parent</b>".
3614   */
3615  public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("DeviceDefinition:parent").toLocked();
3616
3617 /**
3618   * Search parameter: <b>identifier</b>
3619   * <p>
3620   * Description: <b>The identifier of the component</b><br>
3621   * Type: <b>token</b><br>
3622   * Path: <b>DeviceDefinition.identifier</b><br>
3623   * </p>
3624   */
3625  @SearchParamDefinition(name="identifier", path="DeviceDefinition.identifier", description="The identifier of the component", type="token" )
3626  public static final String SP_IDENTIFIER = "identifier";
3627 /**
3628   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3629   * <p>
3630   * Description: <b>The identifier of the component</b><br>
3631   * Type: <b>token</b><br>
3632   * Path: <b>DeviceDefinition.identifier</b><br>
3633   * </p>
3634   */
3635  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3636
3637 /**
3638   * Search parameter: <b>type</b>
3639   * <p>
3640   * Description: <b>The device component type</b><br>
3641   * Type: <b>token</b><br>
3642   * Path: <b>DeviceDefinition.type</b><br>
3643   * </p>
3644   */
3645  @SearchParamDefinition(name="type", path="DeviceDefinition.type", description="The device component type", type="token" )
3646  public static final String SP_TYPE = "type";
3647 /**
3648   * <b>Fluent Client</b> search parameter constant for <b>type</b>
3649   * <p>
3650   * Description: <b>The device component type</b><br>
3651   * Type: <b>token</b><br>
3652   * Path: <b>DeviceDefinition.type</b><br>
3653   * </p>
3654   */
3655  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
3656
3657
3658}
3659