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