001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * This resource describes the properties (regulated, has real time clock, etc.), adminstrative (manufacturer name, model number, serial number, firmware, etc), and type (knee replacement, blood pressure cuff, MRI, etc.) of a physical unit (these values do not change much within a given module, for example the serail number, manufacturer name, and model number). An actual unit may consist of several modules in a distinct hierarchy and these are represented by multiple Device resources and bound through the 'parent' element.
052 */
053@ResourceDef(name="Device", profile="http://hl7.org/fhir/StructureDefinition/Device")
054public class Device extends DomainResource {
055
056    public enum FHIRDeviceStatus {
057        /**
058         * The device is available for use.  Note: For *implanted devices*  this means that the device is implanted in the patient.
059         */
060        ACTIVE, 
061        /**
062         * The device is no longer available for use (e.g. lost, expired, damaged).  Note: For *implanted devices*  this means that the device has been removed from the patient.
063         */
064        INACTIVE, 
065        /**
066         * The device was entered in error and voided.
067         */
068        ENTEREDINERROR, 
069        /**
070         * added to help the parsers with the generic types
071         */
072        NULL;
073        public static FHIRDeviceStatus fromCode(String codeString) throws FHIRException {
074            if (codeString == null || "".equals(codeString))
075                return null;
076        if ("active".equals(codeString))
077          return ACTIVE;
078        if ("inactive".equals(codeString))
079          return INACTIVE;
080        if ("entered-in-error".equals(codeString))
081          return ENTEREDINERROR;
082        if (Configuration.isAcceptInvalidEnums())
083          return null;
084        else
085          throw new FHIRException("Unknown FHIRDeviceStatus code '"+codeString+"'");
086        }
087        public String toCode() {
088          switch (this) {
089            case ACTIVE: return "active";
090            case INACTIVE: return "inactive";
091            case ENTEREDINERROR: return "entered-in-error";
092            default: return "?";
093          }
094        }
095        public String getSystem() {
096          switch (this) {
097            case ACTIVE: return "http://hl7.org/fhir/device-status";
098            case INACTIVE: return "http://hl7.org/fhir/device-status";
099            case ENTEREDINERROR: return "http://hl7.org/fhir/device-status";
100            default: return "?";
101          }
102        }
103        public String getDefinition() {
104          switch (this) {
105            case ACTIVE: return "The device is available for use.  Note: For *implanted devices*  this means that the device is implanted in the patient.";
106            case INACTIVE: return "The device is no longer available for use (e.g. lost, expired, damaged).  Note: For *implanted devices*  this means that the device has been removed from the patient.";
107            case ENTEREDINERROR: return "The device was entered in error and voided.";
108            default: return "?";
109          }
110        }
111        public String getDisplay() {
112          switch (this) {
113            case ACTIVE: return "Active";
114            case INACTIVE: return "Inactive";
115            case ENTEREDINERROR: return "Entered in Error";
116            default: return "?";
117          }
118        }
119    }
120
121  public static class FHIRDeviceStatusEnumFactory implements EnumFactory<FHIRDeviceStatus> {
122    public FHIRDeviceStatus fromCode(String codeString) throws IllegalArgumentException {
123      if (codeString == null || "".equals(codeString))
124            if (codeString == null || "".equals(codeString))
125                return null;
126        if ("active".equals(codeString))
127          return FHIRDeviceStatus.ACTIVE;
128        if ("inactive".equals(codeString))
129          return FHIRDeviceStatus.INACTIVE;
130        if ("entered-in-error".equals(codeString))
131          return FHIRDeviceStatus.ENTEREDINERROR;
132        throw new IllegalArgumentException("Unknown FHIRDeviceStatus code '"+codeString+"'");
133        }
134        public Enumeration<FHIRDeviceStatus> fromType(Base code) throws FHIRException {
135          if (code == null)
136            return null;
137          if (code.isEmpty())
138            return new Enumeration<FHIRDeviceStatus>(this);
139          String codeString = ((PrimitiveType) code).asStringValue();
140          if (codeString == null || "".equals(codeString))
141            return null;
142        if ("active".equals(codeString))
143          return new Enumeration<FHIRDeviceStatus>(this, FHIRDeviceStatus.ACTIVE);
144        if ("inactive".equals(codeString))
145          return new Enumeration<FHIRDeviceStatus>(this, FHIRDeviceStatus.INACTIVE);
146        if ("entered-in-error".equals(codeString))
147          return new Enumeration<FHIRDeviceStatus>(this, FHIRDeviceStatus.ENTEREDINERROR);
148        throw new FHIRException("Unknown FHIRDeviceStatus code '"+codeString+"'");
149        }
150    public String toCode(FHIRDeviceStatus code) {
151      if (code == FHIRDeviceStatus.ACTIVE)
152        return "active";
153      if (code == FHIRDeviceStatus.INACTIVE)
154        return "inactive";
155      if (code == FHIRDeviceStatus.ENTEREDINERROR)
156        return "entered-in-error";
157      return "?";
158      }
159    public String toSystem(FHIRDeviceStatus code) {
160      return code.getSystem();
161      }
162    }
163
164    public enum UDIEntryType {
165        /**
166         * a barcodescanner captured the data from the device label.
167         */
168        BARCODE, 
169        /**
170         * An RFID chip reader captured the data from the device label.
171         */
172        RFID, 
173        /**
174         * The data was read from the label by a person and manually entered. (e.g.  via a keyboard).
175         */
176        MANUAL, 
177        /**
178         * The data originated from a patient's implant card and was read by an operator.
179         */
180        CARD, 
181        /**
182         * The data originated from a patient source and was not directly scanned or read from a label or card.
183         */
184        SELFREPORTED, 
185        /**
186         * The UDI information was received electronically from the device through a communication protocol, such as the IEEE 11073 20601 version 4 exchange protocol over Bluetooth or USB.
187         */
188        ELECTRONICTRANSMISSION, 
189        /**
190         * The method of data capture has not been determined.
191         */
192        UNKNOWN, 
193        /**
194         * added to help the parsers with the generic types
195         */
196        NULL;
197        public static UDIEntryType fromCode(String codeString) throws FHIRException {
198            if (codeString == null || "".equals(codeString))
199                return null;
200        if ("barcode".equals(codeString))
201          return BARCODE;
202        if ("rfid".equals(codeString))
203          return RFID;
204        if ("manual".equals(codeString))
205          return MANUAL;
206        if ("card".equals(codeString))
207          return CARD;
208        if ("self-reported".equals(codeString))
209          return SELFREPORTED;
210        if ("electronic-transmission".equals(codeString))
211          return ELECTRONICTRANSMISSION;
212        if ("unknown".equals(codeString))
213          return UNKNOWN;
214        if (Configuration.isAcceptInvalidEnums())
215          return null;
216        else
217          throw new FHIRException("Unknown UDIEntryType code '"+codeString+"'");
218        }
219        public String toCode() {
220          switch (this) {
221            case BARCODE: return "barcode";
222            case RFID: return "rfid";
223            case MANUAL: return "manual";
224            case CARD: return "card";
225            case SELFREPORTED: return "self-reported";
226            case ELECTRONICTRANSMISSION: return "electronic-transmission";
227            case UNKNOWN: return "unknown";
228            default: return "?";
229          }
230        }
231        public String getSystem() {
232          switch (this) {
233            case BARCODE: return "http://hl7.org/fhir/udi-entry-type";
234            case RFID: return "http://hl7.org/fhir/udi-entry-type";
235            case MANUAL: return "http://hl7.org/fhir/udi-entry-type";
236            case CARD: return "http://hl7.org/fhir/udi-entry-type";
237            case SELFREPORTED: return "http://hl7.org/fhir/udi-entry-type";
238            case ELECTRONICTRANSMISSION: return "http://hl7.org/fhir/udi-entry-type";
239            case UNKNOWN: return "http://hl7.org/fhir/udi-entry-type";
240            default: return "?";
241          }
242        }
243        public String getDefinition() {
244          switch (this) {
245            case BARCODE: return "a barcodescanner captured the data from the device label.";
246            case RFID: return "An RFID chip reader captured the data from the device label.";
247            case MANUAL: return "The data was read from the label by a person and manually entered. (e.g.  via a keyboard).";
248            case CARD: return "The data originated from a patient's implant card and was read by an operator.";
249            case SELFREPORTED: return "The data originated from a patient source and was not directly scanned or read from a label or card.";
250            case ELECTRONICTRANSMISSION: return "The UDI information was received electronically from the device through a communication protocol, such as the IEEE 11073 20601 version 4 exchange protocol over Bluetooth or USB.";
251            case UNKNOWN: return "The method of data capture has not been determined.";
252            default: return "?";
253          }
254        }
255        public String getDisplay() {
256          switch (this) {
257            case BARCODE: return "Barcode";
258            case RFID: return "RFID";
259            case MANUAL: return "Manual";
260            case CARD: return "Card";
261            case SELFREPORTED: return "Self Reported";
262            case ELECTRONICTRANSMISSION: return "Electronic Transmission";
263            case UNKNOWN: return "Unknown";
264            default: return "?";
265          }
266        }
267    }
268
269  public static class UDIEntryTypeEnumFactory implements EnumFactory<UDIEntryType> {
270    public UDIEntryType fromCode(String codeString) throws IllegalArgumentException {
271      if (codeString == null || "".equals(codeString))
272            if (codeString == null || "".equals(codeString))
273                return null;
274        if ("barcode".equals(codeString))
275          return UDIEntryType.BARCODE;
276        if ("rfid".equals(codeString))
277          return UDIEntryType.RFID;
278        if ("manual".equals(codeString))
279          return UDIEntryType.MANUAL;
280        if ("card".equals(codeString))
281          return UDIEntryType.CARD;
282        if ("self-reported".equals(codeString))
283          return UDIEntryType.SELFREPORTED;
284        if ("electronic-transmission".equals(codeString))
285          return UDIEntryType.ELECTRONICTRANSMISSION;
286        if ("unknown".equals(codeString))
287          return UDIEntryType.UNKNOWN;
288        throw new IllegalArgumentException("Unknown UDIEntryType code '"+codeString+"'");
289        }
290        public Enumeration<UDIEntryType> fromType(Base code) throws FHIRException {
291          if (code == null)
292            return null;
293          if (code.isEmpty())
294            return new Enumeration<UDIEntryType>(this);
295          String codeString = ((PrimitiveType) code).asStringValue();
296          if (codeString == null || "".equals(codeString))
297            return null;
298        if ("barcode".equals(codeString))
299          return new Enumeration<UDIEntryType>(this, UDIEntryType.BARCODE);
300        if ("rfid".equals(codeString))
301          return new Enumeration<UDIEntryType>(this, UDIEntryType.RFID);
302        if ("manual".equals(codeString))
303          return new Enumeration<UDIEntryType>(this, UDIEntryType.MANUAL);
304        if ("card".equals(codeString))
305          return new Enumeration<UDIEntryType>(this, UDIEntryType.CARD);
306        if ("self-reported".equals(codeString))
307          return new Enumeration<UDIEntryType>(this, UDIEntryType.SELFREPORTED);
308        if ("electronic-transmission".equals(codeString))
309          return new Enumeration<UDIEntryType>(this, UDIEntryType.ELECTRONICTRANSMISSION);
310        if ("unknown".equals(codeString))
311          return new Enumeration<UDIEntryType>(this, UDIEntryType.UNKNOWN);
312        throw new FHIRException("Unknown UDIEntryType code '"+codeString+"'");
313        }
314    public String toCode(UDIEntryType code) {
315      if (code == UDIEntryType.BARCODE)
316        return "barcode";
317      if (code == UDIEntryType.RFID)
318        return "rfid";
319      if (code == UDIEntryType.MANUAL)
320        return "manual";
321      if (code == UDIEntryType.CARD)
322        return "card";
323      if (code == UDIEntryType.SELFREPORTED)
324        return "self-reported";
325      if (code == UDIEntryType.ELECTRONICTRANSMISSION)
326        return "electronic-transmission";
327      if (code == UDIEntryType.UNKNOWN)
328        return "unknown";
329      return "?";
330      }
331    public String toSystem(UDIEntryType code) {
332      return code.getSystem();
333      }
334    }
335
336    @Block()
337    public static class DeviceUdiCarrierComponent extends BackboneElement implements IBaseBackboneElement {
338        /**
339         * The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device.
340         */
341        @Child(name = "deviceIdentifier", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
342        @Description(shortDefinition="Mandatory fixed portion of UDI", formalDefinition="The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device." )
343        protected StringType deviceIdentifier;
344
345        /**
346         * Organization that is charged with issuing UDIs for devices. For example, the US FDA issuers include: 
3471) GS1: http://hl7.org/fhir/NamingSystem/gs1-di, 
3482) HIBCC: http://hl7.org/fhir/NamingSystem/hibcc-diI, 
3493) ICCBBA for blood containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
3504) ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-other-di # Informationsstelle für Arzneispezialitäten (IFA GmbH) (EU only): http://hl7.org/fhir/NamingSystem/ifa-gmbh-di.
351         */
352        @Child(name = "issuer", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false)
353        @Description(shortDefinition="UDI Issuing Organization", formalDefinition="Organization that is charged with issuing UDIs for devices. For example, the US FDA issuers include: \n1) GS1: http://hl7.org/fhir/NamingSystem/gs1-di, \n2) HIBCC: http://hl7.org/fhir/NamingSystem/hibcc-diI, \n3) ICCBBA for blood containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di, \n4) ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-other-di # Informationsstelle für Arzneispezialitäten (IFA GmbH) (EU only): http://hl7.org/fhir/NamingSystem/ifa-gmbh-di." )
354        protected UriType issuer;
355
356        /**
357         * The identity of the authoritative source for UDI generation within a jurisdiction. All UDIs are globally unique within a single namespace with the appropriate repository uri as the system. For example, UDIs of devices managed in the U.S. by the FDA, the value is http://hl7.org/fhir/NamingSystem/us-fda-udi or in the European Union by the European Commission http://hl7.org/fhir/NamingSystem/eu-ec-udi.
358         */
359        @Child(name = "jurisdiction", type = {UriType.class}, order=3, min=0, max=1, modifier=false, summary=false)
360        @Description(shortDefinition="Regional UDI authority", formalDefinition="The identity of the authoritative source for UDI generation within a jurisdiction. All UDIs are globally unique within a single namespace with the appropriate repository uri as the system. For example, UDIs of devices managed in the U.S. by the FDA, the value is http://hl7.org/fhir/NamingSystem/us-fda-udi or in the European Union by the European Commission http://hl7.org/fhir/NamingSystem/eu-ec-udi." )
361        protected UriType jurisdiction;
362
363        /**
364         * The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - e.g., a barcode or RFID.   Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded.
365         */
366        @Child(name = "carrierAIDC", type = {Base64BinaryType.class}, order=4, min=0, max=1, modifier=false, summary=true)
367        @Description(shortDefinition="UDI Machine Readable Barcode String", formalDefinition="The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - e.g., a barcode or RFID.   Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded." )
368        protected Base64BinaryType carrierAIDC;
369
370        /**
371         * The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.
372         */
373        @Child(name = "carrierHRF", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
374        @Description(shortDefinition="UDI Human Readable Barcode String", formalDefinition="The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device." )
375        protected StringType carrierHRF;
376
377        /**
378         * A coded entry to indicate how the data was entered.
379         */
380        @Child(name = "entryType", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false)
381        @Description(shortDefinition="barcode | rfid | manual | card | self-reported | electronic-transmission | unknown", formalDefinition="A coded entry to indicate how the data was entered." )
382        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/udi-entry-type")
383        protected Enumeration<UDIEntryType> entryType;
384
385        private static final long serialVersionUID = -191630425L;
386
387    /**
388     * Constructor
389     */
390      public DeviceUdiCarrierComponent() {
391        super();
392      }
393
394    /**
395     * Constructor
396     */
397      public DeviceUdiCarrierComponent(String deviceIdentifier) {
398        super();
399        this.setDeviceIdentifier(deviceIdentifier);
400      }
401
402        /**
403         * @return {@link #deviceIdentifier} (The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device.). This is the underlying object with id, value and extensions. The accessor "getDeviceIdentifier" gives direct access to the value
404         */
405        public StringType getDeviceIdentifierElement() { 
406          if (this.deviceIdentifier == null)
407            if (Configuration.errorOnAutoCreate())
408              throw new Error("Attempt to auto-create DeviceUdiCarrierComponent.deviceIdentifier");
409            else if (Configuration.doAutoCreate())
410              this.deviceIdentifier = new StringType(); // bb
411          return this.deviceIdentifier;
412        }
413
414        public boolean hasDeviceIdentifierElement() { 
415          return this.deviceIdentifier != null && !this.deviceIdentifier.isEmpty();
416        }
417
418        public boolean hasDeviceIdentifier() { 
419          return this.deviceIdentifier != null && !this.deviceIdentifier.isEmpty();
420        }
421
422        /**
423         * @param value {@link #deviceIdentifier} (The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device.). This is the underlying object with id, value and extensions. The accessor "getDeviceIdentifier" gives direct access to the value
424         */
425        public DeviceUdiCarrierComponent setDeviceIdentifierElement(StringType value) { 
426          this.deviceIdentifier = value;
427          return this;
428        }
429
430        /**
431         * @return The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device.
432         */
433        public String getDeviceIdentifier() { 
434          return this.deviceIdentifier == null ? null : this.deviceIdentifier.getValue();
435        }
436
437        /**
438         * @param value The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device.
439         */
440        public DeviceUdiCarrierComponent setDeviceIdentifier(String value) { 
441            if (this.deviceIdentifier == null)
442              this.deviceIdentifier = new StringType();
443            this.deviceIdentifier.setValue(value);
444          return this;
445        }
446
447        /**
448         * @return {@link #issuer} (Organization that is charged with issuing UDIs for devices. For example, the US FDA issuers include: 
4491) GS1: http://hl7.org/fhir/NamingSystem/gs1-di, 
4502) HIBCC: http://hl7.org/fhir/NamingSystem/hibcc-diI, 
4513) ICCBBA for blood containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
4524) ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-other-di # Informationsstelle für Arzneispezialitäten (IFA GmbH) (EU only): http://hl7.org/fhir/NamingSystem/ifa-gmbh-di.). This is the underlying object with id, value and extensions. The accessor "getIssuer" gives direct access to the value
453         */
454        public UriType getIssuerElement() { 
455          if (this.issuer == null)
456            if (Configuration.errorOnAutoCreate())
457              throw new Error("Attempt to auto-create DeviceUdiCarrierComponent.issuer");
458            else if (Configuration.doAutoCreate())
459              this.issuer = new UriType(); // bb
460          return this.issuer;
461        }
462
463        public boolean hasIssuerElement() { 
464          return this.issuer != null && !this.issuer.isEmpty();
465        }
466
467        public boolean hasIssuer() { 
468          return this.issuer != null && !this.issuer.isEmpty();
469        }
470
471        /**
472         * @param value {@link #issuer} (Organization that is charged with issuing UDIs for devices. For example, the US FDA issuers include: 
4731) GS1: http://hl7.org/fhir/NamingSystem/gs1-di, 
4742) HIBCC: http://hl7.org/fhir/NamingSystem/hibcc-diI, 
4753) ICCBBA for blood containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
4764) ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-other-di # Informationsstelle für Arzneispezialitäten (IFA GmbH) (EU only): http://hl7.org/fhir/NamingSystem/ifa-gmbh-di.). This is the underlying object with id, value and extensions. The accessor "getIssuer" gives direct access to the value
477         */
478        public DeviceUdiCarrierComponent setIssuerElement(UriType value) { 
479          this.issuer = value;
480          return this;
481        }
482
483        /**
484         * @return Organization that is charged with issuing UDIs for devices. For example, the US FDA issuers include: 
4851) GS1: http://hl7.org/fhir/NamingSystem/gs1-di, 
4862) HIBCC: http://hl7.org/fhir/NamingSystem/hibcc-diI, 
4873) ICCBBA for blood containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
4884) ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-other-di # Informationsstelle für Arzneispezialitäten (IFA GmbH) (EU only): http://hl7.org/fhir/NamingSystem/ifa-gmbh-di.
489         */
490        public String getIssuer() { 
491          return this.issuer == null ? null : this.issuer.getValue();
492        }
493
494        /**
495         * @param value Organization that is charged with issuing UDIs for devices. For example, the US FDA issuers include: 
4961) GS1: http://hl7.org/fhir/NamingSystem/gs1-di, 
4972) HIBCC: http://hl7.org/fhir/NamingSystem/hibcc-diI, 
4983) ICCBBA for blood containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
4994) ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-other-di # Informationsstelle für Arzneispezialitäten (IFA GmbH) (EU only): http://hl7.org/fhir/NamingSystem/ifa-gmbh-di.
500         */
501        public DeviceUdiCarrierComponent setIssuer(String value) { 
502          if (Utilities.noString(value))
503            this.issuer = null;
504          else {
505            if (this.issuer == null)
506              this.issuer = new UriType();
507            this.issuer.setValue(value);
508          }
509          return this;
510        }
511
512        /**
513         * @return {@link #jurisdiction} (The identity of the authoritative source for UDI generation within a jurisdiction. All UDIs are globally unique within a single namespace with the appropriate repository uri as the system. For example, UDIs of devices managed in the U.S. by the FDA, the value is http://hl7.org/fhir/NamingSystem/us-fda-udi or in the European Union by the European Commission http://hl7.org/fhir/NamingSystem/eu-ec-udi.). This is the underlying object with id, value and extensions. The accessor "getJurisdiction" gives direct access to the value
514         */
515        public UriType getJurisdictionElement() { 
516          if (this.jurisdiction == null)
517            if (Configuration.errorOnAutoCreate())
518              throw new Error("Attempt to auto-create DeviceUdiCarrierComponent.jurisdiction");
519            else if (Configuration.doAutoCreate())
520              this.jurisdiction = new UriType(); // bb
521          return this.jurisdiction;
522        }
523
524        public boolean hasJurisdictionElement() { 
525          return this.jurisdiction != null && !this.jurisdiction.isEmpty();
526        }
527
528        public boolean hasJurisdiction() { 
529          return this.jurisdiction != null && !this.jurisdiction.isEmpty();
530        }
531
532        /**
533         * @param value {@link #jurisdiction} (The identity of the authoritative source for UDI generation within a jurisdiction. All UDIs are globally unique within a single namespace with the appropriate repository uri as the system. For example, UDIs of devices managed in the U.S. by the FDA, the value is http://hl7.org/fhir/NamingSystem/us-fda-udi or in the European Union by the European Commission http://hl7.org/fhir/NamingSystem/eu-ec-udi.). This is the underlying object with id, value and extensions. The accessor "getJurisdiction" gives direct access to the value
534         */
535        public DeviceUdiCarrierComponent setJurisdictionElement(UriType value) { 
536          this.jurisdiction = value;
537          return this;
538        }
539
540        /**
541         * @return The identity of the authoritative source for UDI generation within a jurisdiction. All UDIs are globally unique within a single namespace with the appropriate repository uri as the system. For example, UDIs of devices managed in the U.S. by the FDA, the value is http://hl7.org/fhir/NamingSystem/us-fda-udi or in the European Union by the European Commission http://hl7.org/fhir/NamingSystem/eu-ec-udi.
542         */
543        public String getJurisdiction() { 
544          return this.jurisdiction == null ? null : this.jurisdiction.getValue();
545        }
546
547        /**
548         * @param value The identity of the authoritative source for UDI generation within a jurisdiction. All UDIs are globally unique within a single namespace with the appropriate repository uri as the system. For example, UDIs of devices managed in the U.S. by the FDA, the value is http://hl7.org/fhir/NamingSystem/us-fda-udi or in the European Union by the European Commission http://hl7.org/fhir/NamingSystem/eu-ec-udi.
549         */
550        public DeviceUdiCarrierComponent setJurisdiction(String value) { 
551          if (Utilities.noString(value))
552            this.jurisdiction = null;
553          else {
554            if (this.jurisdiction == null)
555              this.jurisdiction = new UriType();
556            this.jurisdiction.setValue(value);
557          }
558          return this;
559        }
560
561        /**
562         * @return {@link #carrierAIDC} (The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - e.g., a barcode or RFID.   Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getCarrierAIDC" gives direct access to the value
563         */
564        public Base64BinaryType getCarrierAIDCElement() { 
565          if (this.carrierAIDC == null)
566            if (Configuration.errorOnAutoCreate())
567              throw new Error("Attempt to auto-create DeviceUdiCarrierComponent.carrierAIDC");
568            else if (Configuration.doAutoCreate())
569              this.carrierAIDC = new Base64BinaryType(); // bb
570          return this.carrierAIDC;
571        }
572
573        public boolean hasCarrierAIDCElement() { 
574          return this.carrierAIDC != null && !this.carrierAIDC.isEmpty();
575        }
576
577        public boolean hasCarrierAIDC() { 
578          return this.carrierAIDC != null && !this.carrierAIDC.isEmpty();
579        }
580
581        /**
582         * @param value {@link #carrierAIDC} (The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - e.g., a barcode or RFID.   Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getCarrierAIDC" gives direct access to the value
583         */
584        public DeviceUdiCarrierComponent setCarrierAIDCElement(Base64BinaryType value) { 
585          this.carrierAIDC = value;
586          return this;
587        }
588
589        /**
590         * @return The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - e.g., a barcode or RFID.   Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded.
591         */
592        public byte[] getCarrierAIDC() { 
593          return this.carrierAIDC == null ? null : this.carrierAIDC.getValue();
594        }
595
596        /**
597         * @param value The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - e.g., a barcode or RFID.   Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded.
598         */
599        public DeviceUdiCarrierComponent setCarrierAIDC(byte[] value) { 
600          if (value == null)
601            this.carrierAIDC = null;
602          else {
603            if (this.carrierAIDC == null)
604              this.carrierAIDC = new Base64BinaryType();
605            this.carrierAIDC.setValue(value);
606          }
607          return this;
608        }
609
610        /**
611         * @return {@link #carrierHRF} (The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.). This is the underlying object with id, value and extensions. The accessor "getCarrierHRF" gives direct access to the value
612         */
613        public StringType getCarrierHRFElement() { 
614          if (this.carrierHRF == null)
615            if (Configuration.errorOnAutoCreate())
616              throw new Error("Attempt to auto-create DeviceUdiCarrierComponent.carrierHRF");
617            else if (Configuration.doAutoCreate())
618              this.carrierHRF = new StringType(); // bb
619          return this.carrierHRF;
620        }
621
622        public boolean hasCarrierHRFElement() { 
623          return this.carrierHRF != null && !this.carrierHRF.isEmpty();
624        }
625
626        public boolean hasCarrierHRF() { 
627          return this.carrierHRF != null && !this.carrierHRF.isEmpty();
628        }
629
630        /**
631         * @param value {@link #carrierHRF} (The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.). This is the underlying object with id, value and extensions. The accessor "getCarrierHRF" gives direct access to the value
632         */
633        public DeviceUdiCarrierComponent setCarrierHRFElement(StringType value) { 
634          this.carrierHRF = value;
635          return this;
636        }
637
638        /**
639         * @return The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.
640         */
641        public String getCarrierHRF() { 
642          return this.carrierHRF == null ? null : this.carrierHRF.getValue();
643        }
644
645        /**
646         * @param value The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.
647         */
648        public DeviceUdiCarrierComponent setCarrierHRF(String value) { 
649          if (Utilities.noString(value))
650            this.carrierHRF = null;
651          else {
652            if (this.carrierHRF == null)
653              this.carrierHRF = new StringType();
654            this.carrierHRF.setValue(value);
655          }
656          return this;
657        }
658
659        /**
660         * @return {@link #entryType} (A coded entry to indicate how the data was entered.). This is the underlying object with id, value and extensions. The accessor "getEntryType" gives direct access to the value
661         */
662        public Enumeration<UDIEntryType> getEntryTypeElement() { 
663          if (this.entryType == null)
664            if (Configuration.errorOnAutoCreate())
665              throw new Error("Attempt to auto-create DeviceUdiCarrierComponent.entryType");
666            else if (Configuration.doAutoCreate())
667              this.entryType = new Enumeration<UDIEntryType>(new UDIEntryTypeEnumFactory()); // bb
668          return this.entryType;
669        }
670
671        public boolean hasEntryTypeElement() { 
672          return this.entryType != null && !this.entryType.isEmpty();
673        }
674
675        public boolean hasEntryType() { 
676          return this.entryType != null && !this.entryType.isEmpty();
677        }
678
679        /**
680         * @param value {@link #entryType} (A coded entry to indicate how the data was entered.). This is the underlying object with id, value and extensions. The accessor "getEntryType" gives direct access to the value
681         */
682        public DeviceUdiCarrierComponent setEntryTypeElement(Enumeration<UDIEntryType> value) { 
683          this.entryType = value;
684          return this;
685        }
686
687        /**
688         * @return A coded entry to indicate how the data was entered.
689         */
690        public UDIEntryType getEntryType() { 
691          return this.entryType == null ? null : this.entryType.getValue();
692        }
693
694        /**
695         * @param value A coded entry to indicate how the data was entered.
696         */
697        public DeviceUdiCarrierComponent setEntryType(UDIEntryType value) { 
698          if (value == null)
699            this.entryType = null;
700          else {
701            if (this.entryType == null)
702              this.entryType = new Enumeration<UDIEntryType>(new UDIEntryTypeEnumFactory());
703            this.entryType.setValue(value);
704          }
705          return this;
706        }
707
708        protected void listChildren(List<Property> children) {
709          super.listChildren(children);
710          children.add(new Property("deviceIdentifier", "string", "The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device.", 0, 1, deviceIdentifier));
711          children.add(new Property("issuer", "uri", "Organization that is charged with issuing UDIs for devices. For example, the US FDA issuers include: \n1) GS1: http://hl7.org/fhir/NamingSystem/gs1-di, \n2) HIBCC: http://hl7.org/fhir/NamingSystem/hibcc-diI, \n3) ICCBBA for blood containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di, \n4) ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-other-di # Informationsstelle für Arzneispezialitäten (IFA GmbH) (EU only): http://hl7.org/fhir/NamingSystem/ifa-gmbh-di.", 0, 1, issuer));
712          children.add(new Property("jurisdiction", "uri", "The identity of the authoritative source for UDI generation within a jurisdiction. All UDIs are globally unique within a single namespace with the appropriate repository uri as the system. For example, UDIs of devices managed in the U.S. by the FDA, the value is http://hl7.org/fhir/NamingSystem/us-fda-udi or in the European Union by the European Commission http://hl7.org/fhir/NamingSystem/eu-ec-udi.", 0, 1, jurisdiction));
713          children.add(new Property("carrierAIDC", "base64Binary", "The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - e.g., a barcode or RFID.   Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded.", 0, 1, carrierAIDC));
714          children.add(new Property("carrierHRF", "string", "The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.", 0, 1, carrierHRF));
715          children.add(new Property("entryType", "code", "A coded entry to indicate how the data was entered.", 0, 1, entryType));
716        }
717
718        @Override
719        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
720          switch (_hash) {
721          case 1322005407: /*deviceIdentifier*/  return new Property("deviceIdentifier", "string", "The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device.", 0, 1, deviceIdentifier);
722          case -1179159879: /*issuer*/  return new Property("issuer", "uri", "Organization that is charged with issuing UDIs for devices. For example, the US FDA issuers include: \n1) GS1: http://hl7.org/fhir/NamingSystem/gs1-di, \n2) HIBCC: http://hl7.org/fhir/NamingSystem/hibcc-diI, \n3) ICCBBA for blood containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di, \n4) ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-other-di # Informationsstelle für Arzneispezialitäten (IFA GmbH) (EU only): http://hl7.org/fhir/NamingSystem/ifa-gmbh-di.", 0, 1, issuer);
723          case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "uri", "The identity of the authoritative source for UDI generation within a jurisdiction. All UDIs are globally unique within a single namespace with the appropriate repository uri as the system. For example, UDIs of devices managed in the U.S. by the FDA, the value is http://hl7.org/fhir/NamingSystem/us-fda-udi or in the European Union by the European Commission http://hl7.org/fhir/NamingSystem/eu-ec-udi.", 0, 1, jurisdiction);
724          case -768521825: /*carrierAIDC*/  return new Property("carrierAIDC", "base64Binary", "The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - e.g., a barcode or RFID.   Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded.", 0, 1, carrierAIDC);
725          case 806499972: /*carrierHRF*/  return new Property("carrierHRF", "string", "The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.", 0, 1, carrierHRF);
726          case -479362356: /*entryType*/  return new Property("entryType", "code", "A coded entry to indicate how the data was entered.", 0, 1, entryType);
727          default: return super.getNamedProperty(_hash, _name, _checkValid);
728          }
729
730        }
731
732      @Override
733      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
734        switch (hash) {
735        case 1322005407: /*deviceIdentifier*/ return this.deviceIdentifier == null ? new Base[0] : new Base[] {this.deviceIdentifier}; // StringType
736        case -1179159879: /*issuer*/ return this.issuer == null ? new Base[0] : new Base[] {this.issuer}; // UriType
737        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : new Base[] {this.jurisdiction}; // UriType
738        case -768521825: /*carrierAIDC*/ return this.carrierAIDC == null ? new Base[0] : new Base[] {this.carrierAIDC}; // Base64BinaryType
739        case 806499972: /*carrierHRF*/ return this.carrierHRF == null ? new Base[0] : new Base[] {this.carrierHRF}; // StringType
740        case -479362356: /*entryType*/ return this.entryType == null ? new Base[0] : new Base[] {this.entryType}; // Enumeration<UDIEntryType>
741        default: return super.getProperty(hash, name, checkValid);
742        }
743
744      }
745
746      @Override
747      public Base setProperty(int hash, String name, Base value) throws FHIRException {
748        switch (hash) {
749        case 1322005407: // deviceIdentifier
750          this.deviceIdentifier = TypeConvertor.castToString(value); // StringType
751          return value;
752        case -1179159879: // issuer
753          this.issuer = TypeConvertor.castToUri(value); // UriType
754          return value;
755        case -507075711: // jurisdiction
756          this.jurisdiction = TypeConvertor.castToUri(value); // UriType
757          return value;
758        case -768521825: // carrierAIDC
759          this.carrierAIDC = TypeConvertor.castToBase64Binary(value); // Base64BinaryType
760          return value;
761        case 806499972: // carrierHRF
762          this.carrierHRF = TypeConvertor.castToString(value); // StringType
763          return value;
764        case -479362356: // entryType
765          value = new UDIEntryTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
766          this.entryType = (Enumeration) value; // Enumeration<UDIEntryType>
767          return value;
768        default: return super.setProperty(hash, name, value);
769        }
770
771      }
772
773      @Override
774      public Base setProperty(String name, Base value) throws FHIRException {
775        if (name.equals("deviceIdentifier")) {
776          this.deviceIdentifier = TypeConvertor.castToString(value); // StringType
777        } else if (name.equals("issuer")) {
778          this.issuer = TypeConvertor.castToUri(value); // UriType
779        } else if (name.equals("jurisdiction")) {
780          this.jurisdiction = TypeConvertor.castToUri(value); // UriType
781        } else if (name.equals("carrierAIDC")) {
782          this.carrierAIDC = TypeConvertor.castToBase64Binary(value); // Base64BinaryType
783        } else if (name.equals("carrierHRF")) {
784          this.carrierHRF = TypeConvertor.castToString(value); // StringType
785        } else if (name.equals("entryType")) {
786          value = new UDIEntryTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
787          this.entryType = (Enumeration) value; // Enumeration<UDIEntryType>
788        } else
789          return super.setProperty(name, value);
790        return value;
791      }
792
793      @Override
794      public Base makeProperty(int hash, String name) throws FHIRException {
795        switch (hash) {
796        case 1322005407:  return getDeviceIdentifierElement();
797        case -1179159879:  return getIssuerElement();
798        case -507075711:  return getJurisdictionElement();
799        case -768521825:  return getCarrierAIDCElement();
800        case 806499972:  return getCarrierHRFElement();
801        case -479362356:  return getEntryTypeElement();
802        default: return super.makeProperty(hash, name);
803        }
804
805      }
806
807      @Override
808      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
809        switch (hash) {
810        case 1322005407: /*deviceIdentifier*/ return new String[] {"string"};
811        case -1179159879: /*issuer*/ return new String[] {"uri"};
812        case -507075711: /*jurisdiction*/ return new String[] {"uri"};
813        case -768521825: /*carrierAIDC*/ return new String[] {"base64Binary"};
814        case 806499972: /*carrierHRF*/ return new String[] {"string"};
815        case -479362356: /*entryType*/ return new String[] {"code"};
816        default: return super.getTypesForProperty(hash, name);
817        }
818
819      }
820
821      @Override
822      public Base addChild(String name) throws FHIRException {
823        if (name.equals("deviceIdentifier")) {
824          throw new FHIRException("Cannot call addChild on a primitive type Device.udiCarrier.deviceIdentifier");
825        }
826        else if (name.equals("issuer")) {
827          throw new FHIRException("Cannot call addChild on a primitive type Device.udiCarrier.issuer");
828        }
829        else if (name.equals("jurisdiction")) {
830          throw new FHIRException("Cannot call addChild on a primitive type Device.udiCarrier.jurisdiction");
831        }
832        else if (name.equals("carrierAIDC")) {
833          throw new FHIRException("Cannot call addChild on a primitive type Device.udiCarrier.carrierAIDC");
834        }
835        else if (name.equals("carrierHRF")) {
836          throw new FHIRException("Cannot call addChild on a primitive type Device.udiCarrier.carrierHRF");
837        }
838        else if (name.equals("entryType")) {
839          throw new FHIRException("Cannot call addChild on a primitive type Device.udiCarrier.entryType");
840        }
841        else
842          return super.addChild(name);
843      }
844
845      public DeviceUdiCarrierComponent copy() {
846        DeviceUdiCarrierComponent dst = new DeviceUdiCarrierComponent();
847        copyValues(dst);
848        return dst;
849      }
850
851      public void copyValues(DeviceUdiCarrierComponent dst) {
852        super.copyValues(dst);
853        dst.deviceIdentifier = deviceIdentifier == null ? null : deviceIdentifier.copy();
854        dst.issuer = issuer == null ? null : issuer.copy();
855        dst.jurisdiction = jurisdiction == null ? null : jurisdiction.copy();
856        dst.carrierAIDC = carrierAIDC == null ? null : carrierAIDC.copy();
857        dst.carrierHRF = carrierHRF == null ? null : carrierHRF.copy();
858        dst.entryType = entryType == null ? null : entryType.copy();
859      }
860
861      @Override
862      public boolean equalsDeep(Base other_) {
863        if (!super.equalsDeep(other_))
864          return false;
865        if (!(other_ instanceof DeviceUdiCarrierComponent))
866          return false;
867        DeviceUdiCarrierComponent o = (DeviceUdiCarrierComponent) other_;
868        return compareDeep(deviceIdentifier, o.deviceIdentifier, true) && compareDeep(issuer, o.issuer, true)
869           && compareDeep(jurisdiction, o.jurisdiction, true) && compareDeep(carrierAIDC, o.carrierAIDC, true)
870           && compareDeep(carrierHRF, o.carrierHRF, true) && compareDeep(entryType, o.entryType, true);
871      }
872
873      @Override
874      public boolean equalsShallow(Base other_) {
875        if (!super.equalsShallow(other_))
876          return false;
877        if (!(other_ instanceof DeviceUdiCarrierComponent))
878          return false;
879        DeviceUdiCarrierComponent o = (DeviceUdiCarrierComponent) other_;
880        return compareValues(deviceIdentifier, o.deviceIdentifier, true) && compareValues(issuer, o.issuer, true)
881           && compareValues(jurisdiction, o.jurisdiction, true) && compareValues(carrierAIDC, o.carrierAIDC, true)
882           && compareValues(carrierHRF, o.carrierHRF, true) && compareValues(entryType, o.entryType, true);
883      }
884
885      public boolean isEmpty() {
886        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(deviceIdentifier, issuer, jurisdiction
887          , carrierAIDC, carrierHRF, entryType);
888      }
889
890  public String fhirType() {
891    return "Device.udiCarrier";
892
893  }
894
895  }
896
897    @Block()
898    public static class DeviceDeviceNameComponent extends BackboneElement implements IBaseBackboneElement {
899        /**
900         * The name that identifies the device.
901         */
902        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
903        @Description(shortDefinition="The name that identifies the device", formalDefinition="The name that identifies the device." )
904        protected StringType name;
905
906        /**
907         * The type of deviceName. Note that ManufactureDeviceName means that the name is the name as given by the manufacturer, not the name of the manufacturer.
908RegisteredName | UserFriendlyName | PatientReportedName.
909         */
910        @Child(name = "type", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false)
911        @Description(shortDefinition="registered-name | user-friendly-name | patient-reported-name", formalDefinition="The type of deviceName. Note that ManufactureDeviceName means that the name is the name as given by the manufacturer, not the name of the manufacturer.\nRegisteredName | UserFriendlyName | PatientReportedName." )
912        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-nametype")
913        protected Enumeration<DeviceNameType> type;
914
915        private static final long serialVersionUID = 918983440L;
916
917    /**
918     * Constructor
919     */
920      public DeviceDeviceNameComponent() {
921        super();
922      }
923
924    /**
925     * Constructor
926     */
927      public DeviceDeviceNameComponent(String name, DeviceNameType type) {
928        super();
929        this.setName(name);
930        this.setType(type);
931      }
932
933        /**
934         * @return {@link #name} (The name that identifies the device.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
935         */
936        public StringType getNameElement() { 
937          if (this.name == null)
938            if (Configuration.errorOnAutoCreate())
939              throw new Error("Attempt to auto-create DeviceDeviceNameComponent.name");
940            else if (Configuration.doAutoCreate())
941              this.name = new StringType(); // bb
942          return this.name;
943        }
944
945        public boolean hasNameElement() { 
946          return this.name != null && !this.name.isEmpty();
947        }
948
949        public boolean hasName() { 
950          return this.name != null && !this.name.isEmpty();
951        }
952
953        /**
954         * @param value {@link #name} (The name that identifies the device.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
955         */
956        public DeviceDeviceNameComponent setNameElement(StringType value) { 
957          this.name = value;
958          return this;
959        }
960
961        /**
962         * @return The name that identifies the device.
963         */
964        public String getName() { 
965          return this.name == null ? null : this.name.getValue();
966        }
967
968        /**
969         * @param value The name that identifies the device.
970         */
971        public DeviceDeviceNameComponent setName(String value) { 
972            if (this.name == null)
973              this.name = new StringType();
974            this.name.setValue(value);
975          return this;
976        }
977
978        /**
979         * @return {@link #type} (The type of deviceName. Note that ManufactureDeviceName means that the name is the name as given by the manufacturer, not the name of the manufacturer.
980RegisteredName | UserFriendlyName | PatientReportedName.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
981         */
982        public Enumeration<DeviceNameType> getTypeElement() { 
983          if (this.type == null)
984            if (Configuration.errorOnAutoCreate())
985              throw new Error("Attempt to auto-create DeviceDeviceNameComponent.type");
986            else if (Configuration.doAutoCreate())
987              this.type = new Enumeration<DeviceNameType>(new DeviceNameTypeEnumFactory()); // bb
988          return this.type;
989        }
990
991        public boolean hasTypeElement() { 
992          return this.type != null && !this.type.isEmpty();
993        }
994
995        public boolean hasType() { 
996          return this.type != null && !this.type.isEmpty();
997        }
998
999        /**
1000         * @param value {@link #type} (The type of deviceName. Note that ManufactureDeviceName means that the name is the name as given by the manufacturer, not the name of the manufacturer.
1001RegisteredName | UserFriendlyName | PatientReportedName.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1002         */
1003        public DeviceDeviceNameComponent setTypeElement(Enumeration<DeviceNameType> value) { 
1004          this.type = value;
1005          return this;
1006        }
1007
1008        /**
1009         * @return The type of deviceName. Note that ManufactureDeviceName means that the name is the name as given by the manufacturer, not the name of the manufacturer.
1010RegisteredName | UserFriendlyName | PatientReportedName.
1011         */
1012        public DeviceNameType getType() { 
1013          return this.type == null ? null : this.type.getValue();
1014        }
1015
1016        /**
1017         * @param value The type of deviceName. Note that ManufactureDeviceName means that the name is the name as given by the manufacturer, not the name of the manufacturer.
1018RegisteredName | UserFriendlyName | PatientReportedName.
1019         */
1020        public DeviceDeviceNameComponent setType(DeviceNameType value) { 
1021            if (this.type == null)
1022              this.type = new Enumeration<DeviceNameType>(new DeviceNameTypeEnumFactory());
1023            this.type.setValue(value);
1024          return this;
1025        }
1026
1027        protected void listChildren(List<Property> children) {
1028          super.listChildren(children);
1029          children.add(new Property("name", "string", "The name that identifies the device.", 0, 1, name));
1030          children.add(new Property("type", "code", "The type of deviceName. Note that ManufactureDeviceName means that the name is the name as given by the manufacturer, not the name of the manufacturer.\nRegisteredName | UserFriendlyName | PatientReportedName.", 0, 1, type));
1031        }
1032
1033        @Override
1034        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1035          switch (_hash) {
1036          case 3373707: /*name*/  return new Property("name", "string", "The name that identifies the device.", 0, 1, name);
1037          case 3575610: /*type*/  return new Property("type", "code", "The type of deviceName. Note that ManufactureDeviceName means that the name is the name as given by the manufacturer, not the name of the manufacturer.\nRegisteredName | UserFriendlyName | PatientReportedName.", 0, 1, type);
1038          default: return super.getNamedProperty(_hash, _name, _checkValid);
1039          }
1040
1041        }
1042
1043      @Override
1044      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1045        switch (hash) {
1046        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1047        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<DeviceNameType>
1048        default: return super.getProperty(hash, name, checkValid);
1049        }
1050
1051      }
1052
1053      @Override
1054      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1055        switch (hash) {
1056        case 3373707: // name
1057          this.name = TypeConvertor.castToString(value); // StringType
1058          return value;
1059        case 3575610: // type
1060          value = new DeviceNameTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1061          this.type = (Enumeration) value; // Enumeration<DeviceNameType>
1062          return value;
1063        default: return super.setProperty(hash, name, value);
1064        }
1065
1066      }
1067
1068      @Override
1069      public Base setProperty(String name, Base value) throws FHIRException {
1070        if (name.equals("name")) {
1071          this.name = TypeConvertor.castToString(value); // StringType
1072        } else if (name.equals("type")) {
1073          value = new DeviceNameTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1074          this.type = (Enumeration) value; // Enumeration<DeviceNameType>
1075        } else
1076          return super.setProperty(name, value);
1077        return value;
1078      }
1079
1080      @Override
1081      public Base makeProperty(int hash, String name) throws FHIRException {
1082        switch (hash) {
1083        case 3373707:  return getNameElement();
1084        case 3575610:  return getTypeElement();
1085        default: return super.makeProperty(hash, name);
1086        }
1087
1088      }
1089
1090      @Override
1091      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1092        switch (hash) {
1093        case 3373707: /*name*/ return new String[] {"string"};
1094        case 3575610: /*type*/ return new String[] {"code"};
1095        default: return super.getTypesForProperty(hash, name);
1096        }
1097
1098      }
1099
1100      @Override
1101      public Base addChild(String name) throws FHIRException {
1102        if (name.equals("name")) {
1103          throw new FHIRException("Cannot call addChild on a primitive type Device.deviceName.name");
1104        }
1105        else if (name.equals("type")) {
1106          throw new FHIRException("Cannot call addChild on a primitive type Device.deviceName.type");
1107        }
1108        else
1109          return super.addChild(name);
1110      }
1111
1112      public DeviceDeviceNameComponent copy() {
1113        DeviceDeviceNameComponent dst = new DeviceDeviceNameComponent();
1114        copyValues(dst);
1115        return dst;
1116      }
1117
1118      public void copyValues(DeviceDeviceNameComponent dst) {
1119        super.copyValues(dst);
1120        dst.name = name == null ? null : name.copy();
1121        dst.type = type == null ? null : type.copy();
1122      }
1123
1124      @Override
1125      public boolean equalsDeep(Base other_) {
1126        if (!super.equalsDeep(other_))
1127          return false;
1128        if (!(other_ instanceof DeviceDeviceNameComponent))
1129          return false;
1130        DeviceDeviceNameComponent o = (DeviceDeviceNameComponent) other_;
1131        return compareDeep(name, o.name, true) && compareDeep(type, o.type, true);
1132      }
1133
1134      @Override
1135      public boolean equalsShallow(Base other_) {
1136        if (!super.equalsShallow(other_))
1137          return false;
1138        if (!(other_ instanceof DeviceDeviceNameComponent))
1139          return false;
1140        DeviceDeviceNameComponent o = (DeviceDeviceNameComponent) other_;
1141        return compareValues(name, o.name, true) && compareValues(type, o.type, true);
1142      }
1143
1144      public boolean isEmpty() {
1145        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, type);
1146      }
1147
1148  public String fhirType() {
1149    return "Device.deviceName";
1150
1151  }
1152
1153  }
1154
1155    @Block()
1156    public static class DeviceVersionComponent extends BackboneElement implements IBaseBackboneElement {
1157        /**
1158         * The type of the device version, e.g. manufacturer, approved, internal.
1159         */
1160        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
1161        @Description(shortDefinition="The type of the device version, e.g. manufacturer, approved, internal", formalDefinition="The type of the device version, e.g. manufacturer, approved, internal." )
1162        protected CodeableConcept type;
1163
1164        /**
1165         * The hardware or software module of the device to which the version applies.
1166         */
1167        @Child(name = "component", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=false)
1168        @Description(shortDefinition="The hardware or software module of the device to which the version applies", formalDefinition="The hardware or software module of the device to which the version applies." )
1169        protected Identifier component;
1170
1171        /**
1172         * The version text.
1173         */
1174        @Child(name = "value", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=false)
1175        @Description(shortDefinition="The version text", formalDefinition="The version text." )
1176        protected StringType value;
1177
1178        private static final long serialVersionUID = 645214295L;
1179
1180    /**
1181     * Constructor
1182     */
1183      public DeviceVersionComponent() {
1184        super();
1185      }
1186
1187    /**
1188     * Constructor
1189     */
1190      public DeviceVersionComponent(String value) {
1191        super();
1192        this.setValue(value);
1193      }
1194
1195        /**
1196         * @return {@link #type} (The type of the device version, e.g. manufacturer, approved, internal.)
1197         */
1198        public CodeableConcept getType() { 
1199          if (this.type == null)
1200            if (Configuration.errorOnAutoCreate())
1201              throw new Error("Attempt to auto-create DeviceVersionComponent.type");
1202            else if (Configuration.doAutoCreate())
1203              this.type = new CodeableConcept(); // cc
1204          return this.type;
1205        }
1206
1207        public boolean hasType() { 
1208          return this.type != null && !this.type.isEmpty();
1209        }
1210
1211        /**
1212         * @param value {@link #type} (The type of the device version, e.g. manufacturer, approved, internal.)
1213         */
1214        public DeviceVersionComponent setType(CodeableConcept value) { 
1215          this.type = value;
1216          return this;
1217        }
1218
1219        /**
1220         * @return {@link #component} (The hardware or software module of the device to which the version applies.)
1221         */
1222        public Identifier getComponent() { 
1223          if (this.component == null)
1224            if (Configuration.errorOnAutoCreate())
1225              throw new Error("Attempt to auto-create DeviceVersionComponent.component");
1226            else if (Configuration.doAutoCreate())
1227              this.component = new Identifier(); // cc
1228          return this.component;
1229        }
1230
1231        public boolean hasComponent() { 
1232          return this.component != null && !this.component.isEmpty();
1233        }
1234
1235        /**
1236         * @param value {@link #component} (The hardware or software module of the device to which the version applies.)
1237         */
1238        public DeviceVersionComponent setComponent(Identifier value) { 
1239          this.component = value;
1240          return this;
1241        }
1242
1243        /**
1244         * @return {@link #value} (The version text.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
1245         */
1246        public StringType getValueElement() { 
1247          if (this.value == null)
1248            if (Configuration.errorOnAutoCreate())
1249              throw new Error("Attempt to auto-create DeviceVersionComponent.value");
1250            else if (Configuration.doAutoCreate())
1251              this.value = new StringType(); // bb
1252          return this.value;
1253        }
1254
1255        public boolean hasValueElement() { 
1256          return this.value != null && !this.value.isEmpty();
1257        }
1258
1259        public boolean hasValue() { 
1260          return this.value != null && !this.value.isEmpty();
1261        }
1262
1263        /**
1264         * @param value {@link #value} (The version text.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
1265         */
1266        public DeviceVersionComponent setValueElement(StringType value) { 
1267          this.value = value;
1268          return this;
1269        }
1270
1271        /**
1272         * @return The version text.
1273         */
1274        public String getValue() { 
1275          return this.value == null ? null : this.value.getValue();
1276        }
1277
1278        /**
1279         * @param value The version text.
1280         */
1281        public DeviceVersionComponent setValue(String value) { 
1282            if (this.value == null)
1283              this.value = new StringType();
1284            this.value.setValue(value);
1285          return this;
1286        }
1287
1288        protected void listChildren(List<Property> children) {
1289          super.listChildren(children);
1290          children.add(new Property("type", "CodeableConcept", "The type of the device version, e.g. manufacturer, approved, internal.", 0, 1, type));
1291          children.add(new Property("component", "Identifier", "The hardware or software module of the device to which the version applies.", 0, 1, component));
1292          children.add(new Property("value", "string", "The version text.", 0, 1, value));
1293        }
1294
1295        @Override
1296        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1297          switch (_hash) {
1298          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The type of the device version, e.g. manufacturer, approved, internal.", 0, 1, type);
1299          case -1399907075: /*component*/  return new Property("component", "Identifier", "The hardware or software module of the device to which the version applies.", 0, 1, component);
1300          case 111972721: /*value*/  return new Property("value", "string", "The version text.", 0, 1, value);
1301          default: return super.getNamedProperty(_hash, _name, _checkValid);
1302          }
1303
1304        }
1305
1306      @Override
1307      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1308        switch (hash) {
1309        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1310        case -1399907075: /*component*/ return this.component == null ? new Base[0] : new Base[] {this.component}; // Identifier
1311        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
1312        default: return super.getProperty(hash, name, checkValid);
1313        }
1314
1315      }
1316
1317      @Override
1318      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1319        switch (hash) {
1320        case 3575610: // type
1321          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1322          return value;
1323        case -1399907075: // component
1324          this.component = TypeConvertor.castToIdentifier(value); // Identifier
1325          return value;
1326        case 111972721: // value
1327          this.value = TypeConvertor.castToString(value); // StringType
1328          return value;
1329        default: return super.setProperty(hash, name, value);
1330        }
1331
1332      }
1333
1334      @Override
1335      public Base setProperty(String name, Base value) throws FHIRException {
1336        if (name.equals("type")) {
1337          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1338        } else if (name.equals("component")) {
1339          this.component = TypeConvertor.castToIdentifier(value); // Identifier
1340        } else if (name.equals("value")) {
1341          this.value = TypeConvertor.castToString(value); // StringType
1342        } else
1343          return super.setProperty(name, value);
1344        return value;
1345      }
1346
1347      @Override
1348      public Base makeProperty(int hash, String name) throws FHIRException {
1349        switch (hash) {
1350        case 3575610:  return getType();
1351        case -1399907075:  return getComponent();
1352        case 111972721:  return getValueElement();
1353        default: return super.makeProperty(hash, name);
1354        }
1355
1356      }
1357
1358      @Override
1359      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1360        switch (hash) {
1361        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1362        case -1399907075: /*component*/ return new String[] {"Identifier"};
1363        case 111972721: /*value*/ return new String[] {"string"};
1364        default: return super.getTypesForProperty(hash, name);
1365        }
1366
1367      }
1368
1369      @Override
1370      public Base addChild(String name) throws FHIRException {
1371        if (name.equals("type")) {
1372          this.type = new CodeableConcept();
1373          return this.type;
1374        }
1375        else if (name.equals("component")) {
1376          this.component = new Identifier();
1377          return this.component;
1378        }
1379        else if (name.equals("value")) {
1380          throw new FHIRException("Cannot call addChild on a primitive type Device.version.value");
1381        }
1382        else
1383          return super.addChild(name);
1384      }
1385
1386      public DeviceVersionComponent copy() {
1387        DeviceVersionComponent dst = new DeviceVersionComponent();
1388        copyValues(dst);
1389        return dst;
1390      }
1391
1392      public void copyValues(DeviceVersionComponent dst) {
1393        super.copyValues(dst);
1394        dst.type = type == null ? null : type.copy();
1395        dst.component = component == null ? null : component.copy();
1396        dst.value = value == null ? null : value.copy();
1397      }
1398
1399      @Override
1400      public boolean equalsDeep(Base other_) {
1401        if (!super.equalsDeep(other_))
1402          return false;
1403        if (!(other_ instanceof DeviceVersionComponent))
1404          return false;
1405        DeviceVersionComponent o = (DeviceVersionComponent) other_;
1406        return compareDeep(type, o.type, true) && compareDeep(component, o.component, true) && compareDeep(value, o.value, true)
1407          ;
1408      }
1409
1410      @Override
1411      public boolean equalsShallow(Base other_) {
1412        if (!super.equalsShallow(other_))
1413          return false;
1414        if (!(other_ instanceof DeviceVersionComponent))
1415          return false;
1416        DeviceVersionComponent o = (DeviceVersionComponent) other_;
1417        return compareValues(value, o.value, true);
1418      }
1419
1420      public boolean isEmpty() {
1421        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, component, value);
1422      }
1423
1424  public String fhirType() {
1425    return "Device.version";
1426
1427  }
1428
1429  }
1430
1431    @Block()
1432    public static class DevicePropertyComponent extends BackboneElement implements IBaseBackboneElement {
1433        /**
1434         * Code that specifies the property being represented. No codes are specified but the MDC codes are an example: https://build.fhir.org/mdc.html.
1435         */
1436        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1437        @Description(shortDefinition="Code that specifies the property being represented", formalDefinition="Code that specifies the property being represented. No codes are specified but the MDC codes are an example: https://build.fhir.org/mdc.html." )
1438        protected CodeableConcept type;
1439
1440        /**
1441         * Property value - can be a code, quantity, boolean, string or attachment.
1442         */
1443        @Child(name = "value", type = {Quantity.class, CodeableConcept.class, StringType.class, BooleanType.class, IntegerType.class, Range.class, Attachment.class}, order=2, min=0, max=1, modifier=false, summary=false)
1444        @Description(shortDefinition="Property value - as a code, quantity, boolean, string or attachmment", formalDefinition="Property value - can be a code, quantity, boolean, string or attachment." )
1445        protected DataType value;
1446
1447        private static final long serialVersionUID = -1659186716L;
1448
1449    /**
1450     * Constructor
1451     */
1452      public DevicePropertyComponent() {
1453        super();
1454      }
1455
1456    /**
1457     * Constructor
1458     */
1459      public DevicePropertyComponent(CodeableConcept type) {
1460        super();
1461        this.setType(type);
1462      }
1463
1464        /**
1465         * @return {@link #type} (Code that specifies the property being represented. No codes are specified but the MDC codes are an example: https://build.fhir.org/mdc.html.)
1466         */
1467        public CodeableConcept getType() { 
1468          if (this.type == null)
1469            if (Configuration.errorOnAutoCreate())
1470              throw new Error("Attempt to auto-create DevicePropertyComponent.type");
1471            else if (Configuration.doAutoCreate())
1472              this.type = new CodeableConcept(); // cc
1473          return this.type;
1474        }
1475
1476        public boolean hasType() { 
1477          return this.type != null && !this.type.isEmpty();
1478        }
1479
1480        /**
1481         * @param value {@link #type} (Code that specifies the property being represented. No codes are specified but the MDC codes are an example: https://build.fhir.org/mdc.html.)
1482         */
1483        public DevicePropertyComponent setType(CodeableConcept value) { 
1484          this.type = value;
1485          return this;
1486        }
1487
1488        /**
1489         * @return {@link #value} (Property value - can be a code, quantity, boolean, string or attachment.)
1490         */
1491        public DataType getValue() { 
1492          return this.value;
1493        }
1494
1495        /**
1496         * @return {@link #value} (Property value - can be a code, quantity, boolean, string or attachment.)
1497         */
1498        public Quantity getValueQuantity() throws FHIRException { 
1499          if (this.value == null)
1500            this.value = new Quantity();
1501          if (!(this.value instanceof Quantity))
1502            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
1503          return (Quantity) this.value;
1504        }
1505
1506        public boolean hasValueQuantity() { 
1507          return this != null && this.value instanceof Quantity;
1508        }
1509
1510        /**
1511         * @return {@link #value} (Property value - can be a code, quantity, boolean, string or attachment.)
1512         */
1513        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
1514          if (this.value == null)
1515            this.value = new CodeableConcept();
1516          if (!(this.value instanceof CodeableConcept))
1517            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
1518          return (CodeableConcept) this.value;
1519        }
1520
1521        public boolean hasValueCodeableConcept() { 
1522          return this != null && this.value instanceof CodeableConcept;
1523        }
1524
1525        /**
1526         * @return {@link #value} (Property value - can be a code, quantity, boolean, string or attachment.)
1527         */
1528        public StringType getValueStringType() throws FHIRException { 
1529          if (this.value == null)
1530            this.value = new StringType();
1531          if (!(this.value instanceof StringType))
1532            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
1533          return (StringType) this.value;
1534        }
1535
1536        public boolean hasValueStringType() { 
1537          return this != null && this.value instanceof StringType;
1538        }
1539
1540        /**
1541         * @return {@link #value} (Property value - can be a code, quantity, boolean, string or attachment.)
1542         */
1543        public BooleanType getValueBooleanType() throws FHIRException { 
1544          if (this.value == null)
1545            this.value = new BooleanType();
1546          if (!(this.value instanceof BooleanType))
1547            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
1548          return (BooleanType) this.value;
1549        }
1550
1551        public boolean hasValueBooleanType() { 
1552          return this != null && this.value instanceof BooleanType;
1553        }
1554
1555        /**
1556         * @return {@link #value} (Property value - can be a code, quantity, boolean, string or attachment.)
1557         */
1558        public IntegerType getValueIntegerType() throws FHIRException { 
1559          if (this.value == null)
1560            this.value = new IntegerType();
1561          if (!(this.value instanceof IntegerType))
1562            throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered");
1563          return (IntegerType) this.value;
1564        }
1565
1566        public boolean hasValueIntegerType() { 
1567          return this != null && this.value instanceof IntegerType;
1568        }
1569
1570        /**
1571         * @return {@link #value} (Property value - can be a code, quantity, boolean, string or attachment.)
1572         */
1573        public Range getValueRange() throws FHIRException { 
1574          if (this.value == null)
1575            this.value = new Range();
1576          if (!(this.value instanceof Range))
1577            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
1578          return (Range) this.value;
1579        }
1580
1581        public boolean hasValueRange() { 
1582          return this != null && this.value instanceof Range;
1583        }
1584
1585        /**
1586         * @return {@link #value} (Property value - can be a code, quantity, boolean, string or attachment.)
1587         */
1588        public Attachment getValueAttachment() throws FHIRException { 
1589          if (this.value == null)
1590            this.value = new Attachment();
1591          if (!(this.value instanceof Attachment))
1592            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered");
1593          return (Attachment) this.value;
1594        }
1595
1596        public boolean hasValueAttachment() { 
1597          return this != null && this.value instanceof Attachment;
1598        }
1599
1600        public boolean hasValue() { 
1601          return this.value != null && !this.value.isEmpty();
1602        }
1603
1604        /**
1605         * @param value {@link #value} (Property value - can be a code, quantity, boolean, string or attachment.)
1606         */
1607        public DevicePropertyComponent setValue(DataType value) { 
1608          if (value != null && !(value instanceof Quantity || value instanceof CodeableConcept || value instanceof StringType || value instanceof BooleanType || value instanceof IntegerType || value instanceof Range || value instanceof Attachment))
1609            throw new Error("Not the right type for Device.property.value[x]: "+value.fhirType());
1610          this.value = value;
1611          return this;
1612        }
1613
1614        protected void listChildren(List<Property> children) {
1615          super.listChildren(children);
1616          children.add(new Property("type", "CodeableConcept", "Code that specifies the property being represented. No codes are specified but the MDC codes are an example: https://build.fhir.org/mdc.html.", 0, 1, type));
1617          children.add(new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Attachment", "Property value - can be a code, quantity, boolean, string or attachment.", 0, 1, value));
1618        }
1619
1620        @Override
1621        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1622          switch (_hash) {
1623          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Code that specifies the property being represented. No codes are specified but the MDC codes are an example: https://build.fhir.org/mdc.html.", 0, 1, type);
1624          case -1410166417: /*value[x]*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Attachment", "Property value - can be a code, quantity, boolean, string or attachment.", 0, 1, value);
1625          case 111972721: /*value*/  return new Property("value[x]", "Quantity|CodeableConcept|string|boolean|integer|Range|Attachment", "Property value - can be a code, quantity, boolean, string or attachment.", 0, 1, value);
1626          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "Property value - can be a code, quantity, boolean, string or attachment.", 0, 1, value);
1627          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept", "Property value - can be a code, quantity, boolean, string or attachment.", 0, 1, value);
1628          case -1424603934: /*valueString*/  return new Property("value[x]", "string", "Property value - can be a code, quantity, boolean, string or attachment.", 0, 1, value);
1629          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "Property value - can be a code, quantity, boolean, string or attachment.", 0, 1, value);
1630          case -1668204915: /*valueInteger*/  return new Property("value[x]", "integer", "Property value - can be a code, quantity, boolean, string or attachment.", 0, 1, value);
1631          case 2030761548: /*valueRange*/  return new Property("value[x]", "Range", "Property value - can be a code, quantity, boolean, string or attachment.", 0, 1, value);
1632          case -475566732: /*valueAttachment*/  return new Property("value[x]", "Attachment", "Property value - can be a code, quantity, boolean, string or attachment.", 0, 1, value);
1633          default: return super.getNamedProperty(_hash, _name, _checkValid);
1634          }
1635
1636        }
1637
1638      @Override
1639      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1640        switch (hash) {
1641        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1642        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
1643        default: return super.getProperty(hash, name, checkValid);
1644        }
1645
1646      }
1647
1648      @Override
1649      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1650        switch (hash) {
1651        case 3575610: // type
1652          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1653          return value;
1654        case 111972721: // value
1655          this.value = TypeConvertor.castToType(value); // DataType
1656          return value;
1657        default: return super.setProperty(hash, name, value);
1658        }
1659
1660      }
1661
1662      @Override
1663      public Base setProperty(String name, Base value) throws FHIRException {
1664        if (name.equals("type")) {
1665          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1666        } else if (name.equals("value[x]")) {
1667          this.value = TypeConvertor.castToType(value); // DataType
1668        } else
1669          return super.setProperty(name, value);
1670        return value;
1671      }
1672
1673      @Override
1674      public Base makeProperty(int hash, String name) throws FHIRException {
1675        switch (hash) {
1676        case 3575610:  return getType();
1677        case -1410166417:  return getValue();
1678        case 111972721:  return getValue();
1679        default: return super.makeProperty(hash, name);
1680        }
1681
1682      }
1683
1684      @Override
1685      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1686        switch (hash) {
1687        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1688        case 111972721: /*value*/ return new String[] {"Quantity", "CodeableConcept", "string", "boolean", "integer", "Range", "Attachment"};
1689        default: return super.getTypesForProperty(hash, name);
1690        }
1691
1692      }
1693
1694      @Override
1695      public Base addChild(String name) throws FHIRException {
1696        if (name.equals("type")) {
1697          this.type = new CodeableConcept();
1698          return this.type;
1699        }
1700        else if (name.equals("valueQuantity")) {
1701          this.value = new Quantity();
1702          return this.value;
1703        }
1704        else if (name.equals("valueCodeableConcept")) {
1705          this.value = new CodeableConcept();
1706          return this.value;
1707        }
1708        else if (name.equals("valueString")) {
1709          this.value = new StringType();
1710          return this.value;
1711        }
1712        else if (name.equals("valueBoolean")) {
1713          this.value = new BooleanType();
1714          return this.value;
1715        }
1716        else if (name.equals("valueInteger")) {
1717          this.value = new IntegerType();
1718          return this.value;
1719        }
1720        else if (name.equals("valueRange")) {
1721          this.value = new Range();
1722          return this.value;
1723        }
1724        else if (name.equals("valueAttachment")) {
1725          this.value = new Attachment();
1726          return this.value;
1727        }
1728        else
1729          return super.addChild(name);
1730      }
1731
1732      public DevicePropertyComponent copy() {
1733        DevicePropertyComponent dst = new DevicePropertyComponent();
1734        copyValues(dst);
1735        return dst;
1736      }
1737
1738      public void copyValues(DevicePropertyComponent dst) {
1739        super.copyValues(dst);
1740        dst.type = type == null ? null : type.copy();
1741        dst.value = value == null ? null : value.copy();
1742      }
1743
1744      @Override
1745      public boolean equalsDeep(Base other_) {
1746        if (!super.equalsDeep(other_))
1747          return false;
1748        if (!(other_ instanceof DevicePropertyComponent))
1749          return false;
1750        DevicePropertyComponent o = (DevicePropertyComponent) other_;
1751        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true);
1752      }
1753
1754      @Override
1755      public boolean equalsShallow(Base other_) {
1756        if (!super.equalsShallow(other_))
1757          return false;
1758        if (!(other_ instanceof DevicePropertyComponent))
1759          return false;
1760        DevicePropertyComponent o = (DevicePropertyComponent) other_;
1761        return true;
1762      }
1763
1764      public boolean isEmpty() {
1765        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value);
1766      }
1767
1768  public String fhirType() {
1769    return "Device.property";
1770
1771  }
1772
1773  }
1774
1775    @Block()
1776    public static class DeviceOperationalStatusComponent extends BackboneElement implements IBaseBackboneElement {
1777        /**
1778         * on |off | standby.
1779         */
1780        @Child(name = "value", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1781        @Description(shortDefinition="on |off | standby", formalDefinition="on |off | standby." )
1782        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-operationalstatus")
1783        protected CodeableConcept value;
1784
1785        /**
1786         * The reasons given for the current operational status - i.e. why is the device switched on etc.
1787         */
1788        @Child(name = "reason", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1789        @Description(shortDefinition="The reasons given for the current operational status", formalDefinition="The reasons given for the current operational status - i.e. why is the device switched on etc." )
1790        protected List<CodeableConcept> reason;
1791
1792        private static final long serialVersionUID = 1425627429L;
1793
1794    /**
1795     * Constructor
1796     */
1797      public DeviceOperationalStatusComponent() {
1798        super();
1799      }
1800
1801    /**
1802     * Constructor
1803     */
1804      public DeviceOperationalStatusComponent(CodeableConcept value) {
1805        super();
1806        this.setValue(value);
1807      }
1808
1809        /**
1810         * @return {@link #value} (on |off | standby.)
1811         */
1812        public CodeableConcept getValue() { 
1813          if (this.value == null)
1814            if (Configuration.errorOnAutoCreate())
1815              throw new Error("Attempt to auto-create DeviceOperationalStatusComponent.value");
1816            else if (Configuration.doAutoCreate())
1817              this.value = new CodeableConcept(); // cc
1818          return this.value;
1819        }
1820
1821        public boolean hasValue() { 
1822          return this.value != null && !this.value.isEmpty();
1823        }
1824
1825        /**
1826         * @param value {@link #value} (on |off | standby.)
1827         */
1828        public DeviceOperationalStatusComponent setValue(CodeableConcept value) { 
1829          this.value = value;
1830          return this;
1831        }
1832
1833        /**
1834         * @return {@link #reason} (The reasons given for the current operational status - i.e. why is the device switched on etc.)
1835         */
1836        public List<CodeableConcept> getReason() { 
1837          if (this.reason == null)
1838            this.reason = new ArrayList<CodeableConcept>();
1839          return this.reason;
1840        }
1841
1842        /**
1843         * @return Returns a reference to <code>this</code> for easy method chaining
1844         */
1845        public DeviceOperationalStatusComponent setReason(List<CodeableConcept> theReason) { 
1846          this.reason = theReason;
1847          return this;
1848        }
1849
1850        public boolean hasReason() { 
1851          if (this.reason == null)
1852            return false;
1853          for (CodeableConcept item : this.reason)
1854            if (!item.isEmpty())
1855              return true;
1856          return false;
1857        }
1858
1859        public CodeableConcept addReason() { //3
1860          CodeableConcept t = new CodeableConcept();
1861          if (this.reason == null)
1862            this.reason = new ArrayList<CodeableConcept>();
1863          this.reason.add(t);
1864          return t;
1865        }
1866
1867        public DeviceOperationalStatusComponent addReason(CodeableConcept t) { //3
1868          if (t == null)
1869            return this;
1870          if (this.reason == null)
1871            this.reason = new ArrayList<CodeableConcept>();
1872          this.reason.add(t);
1873          return this;
1874        }
1875
1876        /**
1877         * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
1878         */
1879        public CodeableConcept getReasonFirstRep() { 
1880          if (getReason().isEmpty()) {
1881            addReason();
1882          }
1883          return getReason().get(0);
1884        }
1885
1886        protected void listChildren(List<Property> children) {
1887          super.listChildren(children);
1888          children.add(new Property("value", "CodeableConcept", "on |off | standby.", 0, 1, value));
1889          children.add(new Property("reason", "CodeableConcept", "The reasons given for the current operational status - i.e. why is the device switched on etc.", 0, java.lang.Integer.MAX_VALUE, reason));
1890        }
1891
1892        @Override
1893        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1894          switch (_hash) {
1895          case 111972721: /*value*/  return new Property("value", "CodeableConcept", "on |off | standby.", 0, 1, value);
1896          case -934964668: /*reason*/  return new Property("reason", "CodeableConcept", "The reasons given for the current operational status - i.e. why is the device switched on etc.", 0, java.lang.Integer.MAX_VALUE, reason);
1897          default: return super.getNamedProperty(_hash, _name, _checkValid);
1898          }
1899
1900        }
1901
1902      @Override
1903      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1904        switch (hash) {
1905        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // CodeableConcept
1906        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept
1907        default: return super.getProperty(hash, name, checkValid);
1908        }
1909
1910      }
1911
1912      @Override
1913      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1914        switch (hash) {
1915        case 111972721: // value
1916          this.value = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1917          return value;
1918        case -934964668: // reason
1919          this.getReason().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1920          return value;
1921        default: return super.setProperty(hash, name, value);
1922        }
1923
1924      }
1925
1926      @Override
1927      public Base setProperty(String name, Base value) throws FHIRException {
1928        if (name.equals("value")) {
1929          this.value = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1930        } else if (name.equals("reason")) {
1931          this.getReason().add(TypeConvertor.castToCodeableConcept(value));
1932        } else
1933          return super.setProperty(name, value);
1934        return value;
1935      }
1936
1937      @Override
1938      public Base makeProperty(int hash, String name) throws FHIRException {
1939        switch (hash) {
1940        case 111972721:  return getValue();
1941        case -934964668:  return addReason(); 
1942        default: return super.makeProperty(hash, name);
1943        }
1944
1945      }
1946
1947      @Override
1948      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1949        switch (hash) {
1950        case 111972721: /*value*/ return new String[] {"CodeableConcept"};
1951        case -934964668: /*reason*/ return new String[] {"CodeableConcept"};
1952        default: return super.getTypesForProperty(hash, name);
1953        }
1954
1955      }
1956
1957      @Override
1958      public Base addChild(String name) throws FHIRException {
1959        if (name.equals("value")) {
1960          this.value = new CodeableConcept();
1961          return this.value;
1962        }
1963        else if (name.equals("reason")) {
1964          return addReason();
1965        }
1966        else
1967          return super.addChild(name);
1968      }
1969
1970      public DeviceOperationalStatusComponent copy() {
1971        DeviceOperationalStatusComponent dst = new DeviceOperationalStatusComponent();
1972        copyValues(dst);
1973        return dst;
1974      }
1975
1976      public void copyValues(DeviceOperationalStatusComponent dst) {
1977        super.copyValues(dst);
1978        dst.value = value == null ? null : value.copy();
1979        if (reason != null) {
1980          dst.reason = new ArrayList<CodeableConcept>();
1981          for (CodeableConcept i : reason)
1982            dst.reason.add(i.copy());
1983        };
1984      }
1985
1986      @Override
1987      public boolean equalsDeep(Base other_) {
1988        if (!super.equalsDeep(other_))
1989          return false;
1990        if (!(other_ instanceof DeviceOperationalStatusComponent))
1991          return false;
1992        DeviceOperationalStatusComponent o = (DeviceOperationalStatusComponent) other_;
1993        return compareDeep(value, o.value, true) && compareDeep(reason, o.reason, true);
1994      }
1995
1996      @Override
1997      public boolean equalsShallow(Base other_) {
1998        if (!super.equalsShallow(other_))
1999          return false;
2000        if (!(other_ instanceof DeviceOperationalStatusComponent))
2001          return false;
2002        DeviceOperationalStatusComponent o = (DeviceOperationalStatusComponent) other_;
2003        return true;
2004      }
2005
2006      public boolean isEmpty() {
2007        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value, reason);
2008      }
2009
2010  public String fhirType() {
2011    return "Device.operationalStatus";
2012
2013  }
2014
2015  }
2016
2017    @Block()
2018    public static class DeviceAssociationStatusComponent extends BackboneElement implements IBaseBackboneElement {
2019        /**
2020         * implanted|explanted|attached.
2021         */
2022        @Child(name = "value", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
2023        @Description(shortDefinition="implanted|explanted|attached", formalDefinition="implanted|explanted|attached." )
2024        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-associationstatus")
2025        protected CodeableConcept value;
2026
2027        /**
2028         * The reasons given for the current association status - i.e. why is the device explanted, or attached to the patient, etc.
2029         */
2030        @Child(name = "reason", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2031        @Description(shortDefinition="The reasons given for the current association status", formalDefinition="The reasons given for the current association status - i.e. why is the device explanted, or attached to the patient, etc." )
2032        protected List<CodeableConcept> reason;
2033
2034        private static final long serialVersionUID = 1425627429L;
2035
2036    /**
2037     * Constructor
2038     */
2039      public DeviceAssociationStatusComponent() {
2040        super();
2041      }
2042
2043    /**
2044     * Constructor
2045     */
2046      public DeviceAssociationStatusComponent(CodeableConcept value) {
2047        super();
2048        this.setValue(value);
2049      }
2050
2051        /**
2052         * @return {@link #value} (implanted|explanted|attached.)
2053         */
2054        public CodeableConcept getValue() { 
2055          if (this.value == null)
2056            if (Configuration.errorOnAutoCreate())
2057              throw new Error("Attempt to auto-create DeviceAssociationStatusComponent.value");
2058            else if (Configuration.doAutoCreate())
2059              this.value = new CodeableConcept(); // cc
2060          return this.value;
2061        }
2062
2063        public boolean hasValue() { 
2064          return this.value != null && !this.value.isEmpty();
2065        }
2066
2067        /**
2068         * @param value {@link #value} (implanted|explanted|attached.)
2069         */
2070        public DeviceAssociationStatusComponent setValue(CodeableConcept value) { 
2071          this.value = value;
2072          return this;
2073        }
2074
2075        /**
2076         * @return {@link #reason} (The reasons given for the current association status - i.e. why is the device explanted, or attached to the patient, etc.)
2077         */
2078        public List<CodeableConcept> getReason() { 
2079          if (this.reason == null)
2080            this.reason = new ArrayList<CodeableConcept>();
2081          return this.reason;
2082        }
2083
2084        /**
2085         * @return Returns a reference to <code>this</code> for easy method chaining
2086         */
2087        public DeviceAssociationStatusComponent setReason(List<CodeableConcept> theReason) { 
2088          this.reason = theReason;
2089          return this;
2090        }
2091
2092        public boolean hasReason() { 
2093          if (this.reason == null)
2094            return false;
2095          for (CodeableConcept item : this.reason)
2096            if (!item.isEmpty())
2097              return true;
2098          return false;
2099        }
2100
2101        public CodeableConcept addReason() { //3
2102          CodeableConcept t = new CodeableConcept();
2103          if (this.reason == null)
2104            this.reason = new ArrayList<CodeableConcept>();
2105          this.reason.add(t);
2106          return t;
2107        }
2108
2109        public DeviceAssociationStatusComponent addReason(CodeableConcept t) { //3
2110          if (t == null)
2111            return this;
2112          if (this.reason == null)
2113            this.reason = new ArrayList<CodeableConcept>();
2114          this.reason.add(t);
2115          return this;
2116        }
2117
2118        /**
2119         * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
2120         */
2121        public CodeableConcept getReasonFirstRep() { 
2122          if (getReason().isEmpty()) {
2123            addReason();
2124          }
2125          return getReason().get(0);
2126        }
2127
2128        protected void listChildren(List<Property> children) {
2129          super.listChildren(children);
2130          children.add(new Property("value", "CodeableConcept", "implanted|explanted|attached.", 0, 1, value));
2131          children.add(new Property("reason", "CodeableConcept", "The reasons given for the current association status - i.e. why is the device explanted, or attached to the patient, etc.", 0, java.lang.Integer.MAX_VALUE, reason));
2132        }
2133
2134        @Override
2135        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2136          switch (_hash) {
2137          case 111972721: /*value*/  return new Property("value", "CodeableConcept", "implanted|explanted|attached.", 0, 1, value);
2138          case -934964668: /*reason*/  return new Property("reason", "CodeableConcept", "The reasons given for the current association status - i.e. why is the device explanted, or attached to the patient, etc.", 0, java.lang.Integer.MAX_VALUE, reason);
2139          default: return super.getNamedProperty(_hash, _name, _checkValid);
2140          }
2141
2142        }
2143
2144      @Override
2145      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2146        switch (hash) {
2147        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // CodeableConcept
2148        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept
2149        default: return super.getProperty(hash, name, checkValid);
2150        }
2151
2152      }
2153
2154      @Override
2155      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2156        switch (hash) {
2157        case 111972721: // value
2158          this.value = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2159          return value;
2160        case -934964668: // reason
2161          this.getReason().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2162          return value;
2163        default: return super.setProperty(hash, name, value);
2164        }
2165
2166      }
2167
2168      @Override
2169      public Base setProperty(String name, Base value) throws FHIRException {
2170        if (name.equals("value")) {
2171          this.value = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2172        } else if (name.equals("reason")) {
2173          this.getReason().add(TypeConvertor.castToCodeableConcept(value));
2174        } else
2175          return super.setProperty(name, value);
2176        return value;
2177      }
2178
2179      @Override
2180      public Base makeProperty(int hash, String name) throws FHIRException {
2181        switch (hash) {
2182        case 111972721:  return getValue();
2183        case -934964668:  return addReason(); 
2184        default: return super.makeProperty(hash, name);
2185        }
2186
2187      }
2188
2189      @Override
2190      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2191        switch (hash) {
2192        case 111972721: /*value*/ return new String[] {"CodeableConcept"};
2193        case -934964668: /*reason*/ return new String[] {"CodeableConcept"};
2194        default: return super.getTypesForProperty(hash, name);
2195        }
2196
2197      }
2198
2199      @Override
2200      public Base addChild(String name) throws FHIRException {
2201        if (name.equals("value")) {
2202          this.value = new CodeableConcept();
2203          return this.value;
2204        }
2205        else if (name.equals("reason")) {
2206          return addReason();
2207        }
2208        else
2209          return super.addChild(name);
2210      }
2211
2212      public DeviceAssociationStatusComponent copy() {
2213        DeviceAssociationStatusComponent dst = new DeviceAssociationStatusComponent();
2214        copyValues(dst);
2215        return dst;
2216      }
2217
2218      public void copyValues(DeviceAssociationStatusComponent dst) {
2219        super.copyValues(dst);
2220        dst.value = value == null ? null : value.copy();
2221        if (reason != null) {
2222          dst.reason = new ArrayList<CodeableConcept>();
2223          for (CodeableConcept i : reason)
2224            dst.reason.add(i.copy());
2225        };
2226      }
2227
2228      @Override
2229      public boolean equalsDeep(Base other_) {
2230        if (!super.equalsDeep(other_))
2231          return false;
2232        if (!(other_ instanceof DeviceAssociationStatusComponent))
2233          return false;
2234        DeviceAssociationStatusComponent o = (DeviceAssociationStatusComponent) other_;
2235        return compareDeep(value, o.value, true) && compareDeep(reason, o.reason, true);
2236      }
2237
2238      @Override
2239      public boolean equalsShallow(Base other_) {
2240        if (!super.equalsShallow(other_))
2241          return false;
2242        if (!(other_ instanceof DeviceAssociationStatusComponent))
2243          return false;
2244        DeviceAssociationStatusComponent o = (DeviceAssociationStatusComponent) other_;
2245        return true;
2246      }
2247
2248      public boolean isEmpty() {
2249        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value, reason);
2250      }
2251
2252  public String fhirType() {
2253    return "Device.associationStatus";
2254
2255  }
2256
2257  }
2258
2259    @Block()
2260    public static class DeviceLinkComponent extends BackboneElement implements IBaseBackboneElement {
2261        /**
2262         * The type indicates the relationship of the related device to the device instance.
2263         */
2264        @Child(name = "relation", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false)
2265        @Description(shortDefinition="The type indicates the relationship of the related device to the device instance", formalDefinition="The type indicates the relationship of the related device to the device instance." )
2266        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-relationtype")
2267        protected Coding relation;
2268
2269        /**
2270         * A reference to the linked device.
2271         */
2272        @Child(name = "relatedDevice", type = {CodeableReference.class}, order=2, min=1, max=1, modifier=false, summary=false)
2273        @Description(shortDefinition="A reference to the linked device", formalDefinition="A reference to the linked device." )
2274        protected CodeableReference relatedDevice;
2275
2276        private static final long serialVersionUID = 627614461L;
2277
2278    /**
2279     * Constructor
2280     */
2281      public DeviceLinkComponent() {
2282        super();
2283      }
2284
2285    /**
2286     * Constructor
2287     */
2288      public DeviceLinkComponent(Coding relation, CodeableReference relatedDevice) {
2289        super();
2290        this.setRelation(relation);
2291        this.setRelatedDevice(relatedDevice);
2292      }
2293
2294        /**
2295         * @return {@link #relation} (The type indicates the relationship of the related device to the device instance.)
2296         */
2297        public Coding getRelation() { 
2298          if (this.relation == null)
2299            if (Configuration.errorOnAutoCreate())
2300              throw new Error("Attempt to auto-create DeviceLinkComponent.relation");
2301            else if (Configuration.doAutoCreate())
2302              this.relation = new Coding(); // cc
2303          return this.relation;
2304        }
2305
2306        public boolean hasRelation() { 
2307          return this.relation != null && !this.relation.isEmpty();
2308        }
2309
2310        /**
2311         * @param value {@link #relation} (The type indicates the relationship of the related device to the device instance.)
2312         */
2313        public DeviceLinkComponent setRelation(Coding value) { 
2314          this.relation = value;
2315          return this;
2316        }
2317
2318        /**
2319         * @return {@link #relatedDevice} (A reference to the linked device.)
2320         */
2321        public CodeableReference getRelatedDevice() { 
2322          if (this.relatedDevice == null)
2323            if (Configuration.errorOnAutoCreate())
2324              throw new Error("Attempt to auto-create DeviceLinkComponent.relatedDevice");
2325            else if (Configuration.doAutoCreate())
2326              this.relatedDevice = new CodeableReference(); // cc
2327          return this.relatedDevice;
2328        }
2329
2330        public boolean hasRelatedDevice() { 
2331          return this.relatedDevice != null && !this.relatedDevice.isEmpty();
2332        }
2333
2334        /**
2335         * @param value {@link #relatedDevice} (A reference to the linked device.)
2336         */
2337        public DeviceLinkComponent setRelatedDevice(CodeableReference value) { 
2338          this.relatedDevice = value;
2339          return this;
2340        }
2341
2342        protected void listChildren(List<Property> children) {
2343          super.listChildren(children);
2344          children.add(new Property("relation", "Coding", "The type indicates the relationship of the related device to the device instance.", 0, 1, relation));
2345          children.add(new Property("relatedDevice", "CodeableReference(Device)", "A reference to the linked device.", 0, 1, relatedDevice));
2346        }
2347
2348        @Override
2349        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2350          switch (_hash) {
2351          case -554436100: /*relation*/  return new Property("relation", "Coding", "The type indicates the relationship of the related device to the device instance.", 0, 1, relation);
2352          case -296314271: /*relatedDevice*/  return new Property("relatedDevice", "CodeableReference(Device)", "A reference to the linked device.", 0, 1, relatedDevice);
2353          default: return super.getNamedProperty(_hash, _name, _checkValid);
2354          }
2355
2356        }
2357
2358      @Override
2359      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2360        switch (hash) {
2361        case -554436100: /*relation*/ return this.relation == null ? new Base[0] : new Base[] {this.relation}; // Coding
2362        case -296314271: /*relatedDevice*/ return this.relatedDevice == null ? new Base[0] : new Base[] {this.relatedDevice}; // CodeableReference
2363        default: return super.getProperty(hash, name, checkValid);
2364        }
2365
2366      }
2367
2368      @Override
2369      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2370        switch (hash) {
2371        case -554436100: // relation
2372          this.relation = TypeConvertor.castToCoding(value); // Coding
2373          return value;
2374        case -296314271: // relatedDevice
2375          this.relatedDevice = TypeConvertor.castToCodeableReference(value); // CodeableReference
2376          return value;
2377        default: return super.setProperty(hash, name, value);
2378        }
2379
2380      }
2381
2382      @Override
2383      public Base setProperty(String name, Base value) throws FHIRException {
2384        if (name.equals("relation")) {
2385          this.relation = TypeConvertor.castToCoding(value); // Coding
2386        } else if (name.equals("relatedDevice")) {
2387          this.relatedDevice = TypeConvertor.castToCodeableReference(value); // CodeableReference
2388        } else
2389          return super.setProperty(name, value);
2390        return value;
2391      }
2392
2393      @Override
2394      public Base makeProperty(int hash, String name) throws FHIRException {
2395        switch (hash) {
2396        case -554436100:  return getRelation();
2397        case -296314271:  return getRelatedDevice();
2398        default: return super.makeProperty(hash, name);
2399        }
2400
2401      }
2402
2403      @Override
2404      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2405        switch (hash) {
2406        case -554436100: /*relation*/ return new String[] {"Coding"};
2407        case -296314271: /*relatedDevice*/ return new String[] {"CodeableReference"};
2408        default: return super.getTypesForProperty(hash, name);
2409        }
2410
2411      }
2412
2413      @Override
2414      public Base addChild(String name) throws FHIRException {
2415        if (name.equals("relation")) {
2416          this.relation = new Coding();
2417          return this.relation;
2418        }
2419        else if (name.equals("relatedDevice")) {
2420          this.relatedDevice = new CodeableReference();
2421          return this.relatedDevice;
2422        }
2423        else
2424          return super.addChild(name);
2425      }
2426
2427      public DeviceLinkComponent copy() {
2428        DeviceLinkComponent dst = new DeviceLinkComponent();
2429        copyValues(dst);
2430        return dst;
2431      }
2432
2433      public void copyValues(DeviceLinkComponent dst) {
2434        super.copyValues(dst);
2435        dst.relation = relation == null ? null : relation.copy();
2436        dst.relatedDevice = relatedDevice == null ? null : relatedDevice.copy();
2437      }
2438
2439      @Override
2440      public boolean equalsDeep(Base other_) {
2441        if (!super.equalsDeep(other_))
2442          return false;
2443        if (!(other_ instanceof DeviceLinkComponent))
2444          return false;
2445        DeviceLinkComponent o = (DeviceLinkComponent) other_;
2446        return compareDeep(relation, o.relation, true) && compareDeep(relatedDevice, o.relatedDevice, true)
2447          ;
2448      }
2449
2450      @Override
2451      public boolean equalsShallow(Base other_) {
2452        if (!super.equalsShallow(other_))
2453          return false;
2454        if (!(other_ instanceof DeviceLinkComponent))
2455          return false;
2456        DeviceLinkComponent o = (DeviceLinkComponent) other_;
2457        return true;
2458      }
2459
2460      public boolean isEmpty() {
2461        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(relation, relatedDevice);
2462      }
2463
2464  public String fhirType() {
2465    return "Device.link";
2466
2467  }
2468
2469  }
2470
2471    /**
2472     * Unique instance identifiers assigned to a device by manufacturers other organizations or owners.
2473     */
2474    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2475    @Description(shortDefinition="Instance identifier", formalDefinition="Unique instance identifiers assigned to a device by manufacturers other organizations or owners." )
2476    protected List<Identifier> identifier;
2477
2478    /**
2479     * The name used to display by default when the device is referenced. Based on intent of use by the resource creator, this may reflect one of the names in Device.deviceName, or may be another simple name.
2480     */
2481    @Child(name = "displayName", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
2482    @Description(shortDefinition="The name used to display by default when the device is referenced", formalDefinition="The name used to display by default when the device is referenced. Based on intent of use by the resource creator, this may reflect one of the names in Device.deviceName, or may be another simple name." )
2483    protected StringType displayName;
2484
2485    /**
2486     * The reference to the definition for the device.
2487     */
2488    @Child(name = "definition", type = {CodeableReference.class}, order=2, min=0, max=1, modifier=false, summary=false)
2489    @Description(shortDefinition="The reference to the definition for the device", formalDefinition="The reference to the definition for the device." )
2490    protected CodeableReference definition;
2491
2492    /**
2493     * 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.
2494     */
2495    @Child(name = "udiCarrier", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2496    @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." )
2497    protected List<DeviceUdiCarrierComponent> udiCarrier;
2498
2499    /**
2500     * Status of the Device record. This is not the status of the device like availability.
2501     */
2502    @Child(name = "status", type = {CodeType.class}, order=4, min=0, max=1, modifier=true, summary=true)
2503    @Description(shortDefinition="active | inactive | entered-in-error | unknown", formalDefinition="Status of the Device record. This is not the status of the device like availability." )
2504    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-status")
2505    protected Enumeration<FHIRDeviceStatus> status;
2506
2507    /**
2508     * Reason for the status of the Device record. For example, why is the record not active.
2509     */
2510    @Child(name = "statusReason", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2511    @Description(shortDefinition="discarded | obsolete | removed", formalDefinition="Reason for the status of the Device record. For example, why is the record not active." )
2512    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-status-reason")
2513    protected List<CodeableConcept> statusReason;
2514
2515    /**
2516     * An identifier that supports traceability to the biological entity that is the source of biological material in the product.
2517     */
2518    @Child(name = "biologicalSource", type = {Identifier.class}, order=6, min=0, max=1, modifier=false, summary=false)
2519    @Description(shortDefinition="An identifier that supports traceability to the biological entity that is the source of biological material in the product", formalDefinition="An identifier that supports traceability to the biological entity that is the source of biological material in the product." )
2520    protected Identifier biologicalSource;
2521
2522    /**
2523     * A name of the manufacturer or entity legally responsible for the device.
2524     */
2525    @Child(name = "manufacturer", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
2526    @Description(shortDefinition="Name of device manufacturer", formalDefinition="A name of the manufacturer or entity legally responsible for the device." )
2527    protected StringType manufacturer;
2528
2529    /**
2530     * The date and time when the device was manufactured.
2531     */
2532    @Child(name = "manufactureDate", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=false)
2533    @Description(shortDefinition="Date when the device was made", formalDefinition="The date and time when the device was manufactured." )
2534    protected DateTimeType manufactureDate;
2535
2536    /**
2537     * The date and time beyond which this device is no longer valid or should not be used (if applicable).
2538     */
2539    @Child(name = "expirationDate", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=false)
2540    @Description(shortDefinition="Date and time of expiry of this device (if applicable)", formalDefinition="The date and time beyond which this device is no longer valid or should not be used (if applicable)." )
2541    protected DateTimeType expirationDate;
2542
2543    /**
2544     * Lot number assigned by the manufacturer.
2545     */
2546    @Child(name = "lotNumber", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
2547    @Description(shortDefinition="Lot number of manufacture", formalDefinition="Lot number assigned by the manufacturer." )
2548    protected StringType lotNumber;
2549
2550    /**
2551     * The serial number assigned by the organization when the device was manufactured.
2552     */
2553    @Child(name = "serialNumber", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false)
2554    @Description(shortDefinition="Serial number assigned by the manufacturer", formalDefinition="The serial number assigned by the organization when the device was manufactured." )
2555    protected StringType serialNumber;
2556
2557    /**
2558     * This represents the manufacturer's name of the device as provided by the device, from a UDI label, or by a person describing the Device.  This typically would be used when a person provides the name(s) or when the device represents one of the names available from DeviceDefinition.
2559     */
2560    @Child(name = "deviceName", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2561    @Description(shortDefinition="The name or names of the device as known to the manufacturer and/or patient", formalDefinition="This represents the manufacturer's name of the device as provided by the device, from a UDI label, or by a person describing the Device.  This typically would be used when a person provides the name(s) or when the device represents one of the names available from DeviceDefinition." )
2562    protected List<DeviceDeviceNameComponent> deviceName;
2563
2564    /**
2565     * The manufacturer's model number for the device.
2566     */
2567    @Child(name = "modelNumber", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false)
2568    @Description(shortDefinition="The manufacturer's model number for the device", formalDefinition="The manufacturer's model number for the device." )
2569    protected StringType modelNumber;
2570
2571    /**
2572     * The part number or catalog number of the device.
2573     */
2574    @Child(name = "partNumber", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false)
2575    @Description(shortDefinition="The part number or catalog number of the device", formalDefinition="The part number or catalog number of the device." )
2576    protected StringType partNumber;
2577
2578    /**
2579     * The kind or type of device. A device instance may have more than one type - in which case those are the types that apply to the specific instance of the device.
2580     */
2581    @Child(name = "type", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2582    @Description(shortDefinition="The kind or type of device", formalDefinition="The kind or type of device. A device instance may have more than one type - in which case those are the types that apply to the specific instance of the device." )
2583    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-type")
2584    protected List<CodeableConcept> type;
2585
2586    /**
2587     * The actual design of the device or software version running on the device.
2588     */
2589    @Child(name = "version", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2590    @Description(shortDefinition="The actual design of the device or software version running on the device", formalDefinition="The actual design of the device or software version running on the device." )
2591    protected List<DeviceVersionComponent> version;
2592
2593    /**
2594     * The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.
2595     */
2596    @Child(name = "property", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2597    @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." )
2598    protected List<DevicePropertyComponent> property;
2599
2600    /**
2601     * Patient information, if the device is affixed to, or associated to a patient for their specific use, irrespective of the procedure, use, observation, or other activity that the device is involved in.
2602     */
2603    @Child(name = "subject", type = {Patient.class, Practitioner.class, Person.class}, order=18, min=0, max=1, modifier=false, summary=false)
2604    @Description(shortDefinition="Patient to whom Device is affixed", formalDefinition="Patient information, if the device is affixed to, or associated to a patient for their specific use, irrespective of the procedure, use, observation, or other activity that the device is involved in." )
2605    protected Reference subject;
2606
2607    /**
2608     * The status of the device itself - whether it is switched on, or activated, etc.
2609     */
2610    @Child(name = "operationalStatus", type = {}, order=19, min=0, max=1, modifier=false, summary=false)
2611    @Description(shortDefinition="The status of the device itself - whether it is switched on, or activated, etc", formalDefinition="The status of the device itself - whether it is switched on, or activated, etc." )
2612    protected DeviceOperationalStatusComponent operationalStatus;
2613
2614    /**
2615     * The state of the usage or application of the device - whether the device is implanted, or explanted, or attached to the patient.
2616     */
2617    @Child(name = "associationStatus", type = {}, order=20, min=0, max=1, modifier=false, summary=false)
2618    @Description(shortDefinition="The state of the usage or application of the device", formalDefinition="The state of the usage or application of the device - whether the device is implanted, or explanted, or attached to the patient." )
2619    protected DeviceAssociationStatusComponent associationStatus;
2620
2621    /**
2622     * An organization that is responsible for the provision and ongoing maintenance of the device.
2623     */
2624    @Child(name = "owner", type = {Organization.class}, order=21, min=0, max=1, modifier=false, summary=false)
2625    @Description(shortDefinition="Organization responsible for device", formalDefinition="An organization that is responsible for the provision and ongoing maintenance of the device." )
2626    protected Reference owner;
2627
2628    /**
2629     * Contact details for an organization or a particular human that is responsible for the device.
2630     */
2631    @Child(name = "contact", type = {ContactPoint.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2632    @Description(shortDefinition="Details for human/organization for support", formalDefinition="Contact details for an organization or a particular human that is responsible for the device." )
2633    protected List<ContactPoint> contact;
2634
2635    /**
2636     * The place where the device can be found.
2637     */
2638    @Child(name = "location", type = {Location.class}, order=23, min=0, max=1, modifier=false, summary=false)
2639    @Description(shortDefinition="Where the device is found", formalDefinition="The place where the device can be found." )
2640    protected Reference location;
2641
2642    /**
2643     * A network address on which the device may be contacted directly.
2644     */
2645    @Child(name = "url", type = {UriType.class}, order=24, min=0, max=1, modifier=false, summary=false)
2646    @Description(shortDefinition="Network address to contact device", formalDefinition="A network address on which the device may be contacted directly." )
2647    protected UriType url;
2648
2649    /**
2650     * Technical endpoints providing access to services provided by the device defined at this resource.
2651     */
2652    @Child(name = "endpoint", type = {Endpoint.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2653    @Description(shortDefinition="Technical endpoints providing access to electronic services provided by the device", formalDefinition="Technical endpoints providing access to services provided by the device defined at this resource." )
2654    protected List<Reference> endpoint;
2655
2656    /**
2657     * An associated device, attached to, used with, communicating with or linking a previous or new device model to the focal device.
2658     */
2659    @Child(name = "link", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2660    @Description(shortDefinition="An associated device, attached to, used with, communicating with or linking a previous or new device model to the focal device", formalDefinition="An associated device, attached to, used with, communicating with or linking a previous or new device model to the focal device." )
2661    protected List<DeviceLinkComponent> link;
2662
2663    /**
2664     * Descriptive information, usage information or implantation information that is not captured in an existing element.
2665     */
2666    @Child(name = "note", type = {Annotation.class}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2667    @Description(shortDefinition="Device notes and comments", formalDefinition="Descriptive information, usage information or implantation information that is not captured in an existing element." )
2668    protected List<Annotation> note;
2669
2670    /**
2671     * Provides additional safety characteristics about a medical device.  For example devices containing latex.
2672     */
2673    @Child(name = "safety", type = {CodeableConcept.class}, order=28, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2674    @Description(shortDefinition="Safety Characteristics of Device", formalDefinition="Provides additional safety characteristics about a medical device.  For example devices containing latex." )
2675    protected List<CodeableConcept> safety;
2676
2677    /**
2678     * The device that this device is attached to or is part of.
2679     */
2680    @Child(name = "parent", type = {Device.class}, order=29, min=0, max=1, modifier=false, summary=false)
2681    @Description(shortDefinition="The device that this device is attached to or is part of", formalDefinition="The device that this device is attached to or is part of." )
2682    protected Reference parent;
2683
2684    private static final long serialVersionUID = 1453107483L;
2685
2686  /**
2687   * Constructor
2688   */
2689    public Device() {
2690      super();
2691    }
2692
2693    /**
2694     * @return {@link #identifier} (Unique instance identifiers assigned to a device by manufacturers other organizations or owners.)
2695     */
2696    public List<Identifier> getIdentifier() { 
2697      if (this.identifier == null)
2698        this.identifier = new ArrayList<Identifier>();
2699      return this.identifier;
2700    }
2701
2702    /**
2703     * @return Returns a reference to <code>this</code> for easy method chaining
2704     */
2705    public Device setIdentifier(List<Identifier> theIdentifier) { 
2706      this.identifier = theIdentifier;
2707      return this;
2708    }
2709
2710    public boolean hasIdentifier() { 
2711      if (this.identifier == null)
2712        return false;
2713      for (Identifier item : this.identifier)
2714        if (!item.isEmpty())
2715          return true;
2716      return false;
2717    }
2718
2719    public Identifier addIdentifier() { //3
2720      Identifier t = new Identifier();
2721      if (this.identifier == null)
2722        this.identifier = new ArrayList<Identifier>();
2723      this.identifier.add(t);
2724      return t;
2725    }
2726
2727    public Device addIdentifier(Identifier t) { //3
2728      if (t == null)
2729        return this;
2730      if (this.identifier == null)
2731        this.identifier = new ArrayList<Identifier>();
2732      this.identifier.add(t);
2733      return this;
2734    }
2735
2736    /**
2737     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2738     */
2739    public Identifier getIdentifierFirstRep() { 
2740      if (getIdentifier().isEmpty()) {
2741        addIdentifier();
2742      }
2743      return getIdentifier().get(0);
2744    }
2745
2746    /**
2747     * @return {@link #displayName} (The name used to display by default when the device is referenced. Based on intent of use by the resource creator, this may reflect one of the names in Device.deviceName, or may be another simple name.). This is the underlying object with id, value and extensions. The accessor "getDisplayName" gives direct access to the value
2748     */
2749    public StringType getDisplayNameElement() { 
2750      if (this.displayName == null)
2751        if (Configuration.errorOnAutoCreate())
2752          throw new Error("Attempt to auto-create Device.displayName");
2753        else if (Configuration.doAutoCreate())
2754          this.displayName = new StringType(); // bb
2755      return this.displayName;
2756    }
2757
2758    public boolean hasDisplayNameElement() { 
2759      return this.displayName != null && !this.displayName.isEmpty();
2760    }
2761
2762    public boolean hasDisplayName() { 
2763      return this.displayName != null && !this.displayName.isEmpty();
2764    }
2765
2766    /**
2767     * @param value {@link #displayName} (The name used to display by default when the device is referenced. Based on intent of use by the resource creator, this may reflect one of the names in Device.deviceName, or may be another simple name.). This is the underlying object with id, value and extensions. The accessor "getDisplayName" gives direct access to the value
2768     */
2769    public Device setDisplayNameElement(StringType value) { 
2770      this.displayName = value;
2771      return this;
2772    }
2773
2774    /**
2775     * @return The name used to display by default when the device is referenced. Based on intent of use by the resource creator, this may reflect one of the names in Device.deviceName, or may be another simple name.
2776     */
2777    public String getDisplayName() { 
2778      return this.displayName == null ? null : this.displayName.getValue();
2779    }
2780
2781    /**
2782     * @param value The name used to display by default when the device is referenced. Based on intent of use by the resource creator, this may reflect one of the names in Device.deviceName, or may be another simple name.
2783     */
2784    public Device setDisplayName(String value) { 
2785      if (Utilities.noString(value))
2786        this.displayName = null;
2787      else {
2788        if (this.displayName == null)
2789          this.displayName = new StringType();
2790        this.displayName.setValue(value);
2791      }
2792      return this;
2793    }
2794
2795    /**
2796     * @return {@link #definition} (The reference to the definition for the device.)
2797     */
2798    public CodeableReference getDefinition() { 
2799      if (this.definition == null)
2800        if (Configuration.errorOnAutoCreate())
2801          throw new Error("Attempt to auto-create Device.definition");
2802        else if (Configuration.doAutoCreate())
2803          this.definition = new CodeableReference(); // cc
2804      return this.definition;
2805    }
2806
2807    public boolean hasDefinition() { 
2808      return this.definition != null && !this.definition.isEmpty();
2809    }
2810
2811    /**
2812     * @param value {@link #definition} (The reference to the definition for the device.)
2813     */
2814    public Device setDefinition(CodeableReference value) { 
2815      this.definition = value;
2816      return this;
2817    }
2818
2819    /**
2820     * @return {@link #udiCarrier} (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.)
2821     */
2822    public List<DeviceUdiCarrierComponent> getUdiCarrier() { 
2823      if (this.udiCarrier == null)
2824        this.udiCarrier = new ArrayList<DeviceUdiCarrierComponent>();
2825      return this.udiCarrier;
2826    }
2827
2828    /**
2829     * @return Returns a reference to <code>this</code> for easy method chaining
2830     */
2831    public Device setUdiCarrier(List<DeviceUdiCarrierComponent> theUdiCarrier) { 
2832      this.udiCarrier = theUdiCarrier;
2833      return this;
2834    }
2835
2836    public boolean hasUdiCarrier() { 
2837      if (this.udiCarrier == null)
2838        return false;
2839      for (DeviceUdiCarrierComponent item : this.udiCarrier)
2840        if (!item.isEmpty())
2841          return true;
2842      return false;
2843    }
2844
2845    public DeviceUdiCarrierComponent addUdiCarrier() { //3
2846      DeviceUdiCarrierComponent t = new DeviceUdiCarrierComponent();
2847      if (this.udiCarrier == null)
2848        this.udiCarrier = new ArrayList<DeviceUdiCarrierComponent>();
2849      this.udiCarrier.add(t);
2850      return t;
2851    }
2852
2853    public Device addUdiCarrier(DeviceUdiCarrierComponent t) { //3
2854      if (t == null)
2855        return this;
2856      if (this.udiCarrier == null)
2857        this.udiCarrier = new ArrayList<DeviceUdiCarrierComponent>();
2858      this.udiCarrier.add(t);
2859      return this;
2860    }
2861
2862    /**
2863     * @return The first repetition of repeating field {@link #udiCarrier}, creating it if it does not already exist {3}
2864     */
2865    public DeviceUdiCarrierComponent getUdiCarrierFirstRep() { 
2866      if (getUdiCarrier().isEmpty()) {
2867        addUdiCarrier();
2868      }
2869      return getUdiCarrier().get(0);
2870    }
2871
2872    /**
2873     * @return {@link #status} (Status of the Device record. This is not the status of the device like availability.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2874     */
2875    public Enumeration<FHIRDeviceStatus> getStatusElement() { 
2876      if (this.status == null)
2877        if (Configuration.errorOnAutoCreate())
2878          throw new Error("Attempt to auto-create Device.status");
2879        else if (Configuration.doAutoCreate())
2880          this.status = new Enumeration<FHIRDeviceStatus>(new FHIRDeviceStatusEnumFactory()); // bb
2881      return this.status;
2882    }
2883
2884    public boolean hasStatusElement() { 
2885      return this.status != null && !this.status.isEmpty();
2886    }
2887
2888    public boolean hasStatus() { 
2889      return this.status != null && !this.status.isEmpty();
2890    }
2891
2892    /**
2893     * @param value {@link #status} (Status of the Device record. This is not the status of the device like availability.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2894     */
2895    public Device setStatusElement(Enumeration<FHIRDeviceStatus> value) { 
2896      this.status = value;
2897      return this;
2898    }
2899
2900    /**
2901     * @return Status of the Device record. This is not the status of the device like availability.
2902     */
2903    public FHIRDeviceStatus getStatus() { 
2904      return this.status == null ? null : this.status.getValue();
2905    }
2906
2907    /**
2908     * @param value Status of the Device record. This is not the status of the device like availability.
2909     */
2910    public Device setStatus(FHIRDeviceStatus value) { 
2911      if (value == null)
2912        this.status = null;
2913      else {
2914        if (this.status == null)
2915          this.status = new Enumeration<FHIRDeviceStatus>(new FHIRDeviceStatusEnumFactory());
2916        this.status.setValue(value);
2917      }
2918      return this;
2919    }
2920
2921    /**
2922     * @return {@link #statusReason} (Reason for the status of the Device record. For example, why is the record not active.)
2923     */
2924    public List<CodeableConcept> getStatusReason() { 
2925      if (this.statusReason == null)
2926        this.statusReason = new ArrayList<CodeableConcept>();
2927      return this.statusReason;
2928    }
2929
2930    /**
2931     * @return Returns a reference to <code>this</code> for easy method chaining
2932     */
2933    public Device setStatusReason(List<CodeableConcept> theStatusReason) { 
2934      this.statusReason = theStatusReason;
2935      return this;
2936    }
2937
2938    public boolean hasStatusReason() { 
2939      if (this.statusReason == null)
2940        return false;
2941      for (CodeableConcept item : this.statusReason)
2942        if (!item.isEmpty())
2943          return true;
2944      return false;
2945    }
2946
2947    public CodeableConcept addStatusReason() { //3
2948      CodeableConcept t = new CodeableConcept();
2949      if (this.statusReason == null)
2950        this.statusReason = new ArrayList<CodeableConcept>();
2951      this.statusReason.add(t);
2952      return t;
2953    }
2954
2955    public Device addStatusReason(CodeableConcept t) { //3
2956      if (t == null)
2957        return this;
2958      if (this.statusReason == null)
2959        this.statusReason = new ArrayList<CodeableConcept>();
2960      this.statusReason.add(t);
2961      return this;
2962    }
2963
2964    /**
2965     * @return The first repetition of repeating field {@link #statusReason}, creating it if it does not already exist {3}
2966     */
2967    public CodeableConcept getStatusReasonFirstRep() { 
2968      if (getStatusReason().isEmpty()) {
2969        addStatusReason();
2970      }
2971      return getStatusReason().get(0);
2972    }
2973
2974    /**
2975     * @return {@link #biologicalSource} (An identifier that supports traceability to the biological entity that is the source of biological material in the product.)
2976     */
2977    public Identifier getBiologicalSource() { 
2978      if (this.biologicalSource == null)
2979        if (Configuration.errorOnAutoCreate())
2980          throw new Error("Attempt to auto-create Device.biologicalSource");
2981        else if (Configuration.doAutoCreate())
2982          this.biologicalSource = new Identifier(); // cc
2983      return this.biologicalSource;
2984    }
2985
2986    public boolean hasBiologicalSource() { 
2987      return this.biologicalSource != null && !this.biologicalSource.isEmpty();
2988    }
2989
2990    /**
2991     * @param value {@link #biologicalSource} (An identifier that supports traceability to the biological entity that is the source of biological material in the product.)
2992     */
2993    public Device setBiologicalSource(Identifier value) { 
2994      this.biologicalSource = value;
2995      return this;
2996    }
2997
2998    /**
2999     * @return {@link #manufacturer} (A name of the manufacturer or entity legally responsible for the device.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value
3000     */
3001    public StringType getManufacturerElement() { 
3002      if (this.manufacturer == null)
3003        if (Configuration.errorOnAutoCreate())
3004          throw new Error("Attempt to auto-create Device.manufacturer");
3005        else if (Configuration.doAutoCreate())
3006          this.manufacturer = new StringType(); // bb
3007      return this.manufacturer;
3008    }
3009
3010    public boolean hasManufacturerElement() { 
3011      return this.manufacturer != null && !this.manufacturer.isEmpty();
3012    }
3013
3014    public boolean hasManufacturer() { 
3015      return this.manufacturer != null && !this.manufacturer.isEmpty();
3016    }
3017
3018    /**
3019     * @param value {@link #manufacturer} (A name of the manufacturer or entity legally responsible for the device.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value
3020     */
3021    public Device setManufacturerElement(StringType value) { 
3022      this.manufacturer = value;
3023      return this;
3024    }
3025
3026    /**
3027     * @return A name of the manufacturer or entity legally responsible for the device.
3028     */
3029    public String getManufacturer() { 
3030      return this.manufacturer == null ? null : this.manufacturer.getValue();
3031    }
3032
3033    /**
3034     * @param value A name of the manufacturer or entity legally responsible for the device.
3035     */
3036    public Device setManufacturer(String value) { 
3037      if (Utilities.noString(value))
3038        this.manufacturer = null;
3039      else {
3040        if (this.manufacturer == null)
3041          this.manufacturer = new StringType();
3042        this.manufacturer.setValue(value);
3043      }
3044      return this;
3045    }
3046
3047    /**
3048     * @return {@link #manufactureDate} (The date and time when the device was manufactured.). This is the underlying object with id, value and extensions. The accessor "getManufactureDate" gives direct access to the value
3049     */
3050    public DateTimeType getManufactureDateElement() { 
3051      if (this.manufactureDate == null)
3052        if (Configuration.errorOnAutoCreate())
3053          throw new Error("Attempt to auto-create Device.manufactureDate");
3054        else if (Configuration.doAutoCreate())
3055          this.manufactureDate = new DateTimeType(); // bb
3056      return this.manufactureDate;
3057    }
3058
3059    public boolean hasManufactureDateElement() { 
3060      return this.manufactureDate != null && !this.manufactureDate.isEmpty();
3061    }
3062
3063    public boolean hasManufactureDate() { 
3064      return this.manufactureDate != null && !this.manufactureDate.isEmpty();
3065    }
3066
3067    /**
3068     * @param value {@link #manufactureDate} (The date and time when the device was manufactured.). This is the underlying object with id, value and extensions. The accessor "getManufactureDate" gives direct access to the value
3069     */
3070    public Device setManufactureDateElement(DateTimeType value) { 
3071      this.manufactureDate = value;
3072      return this;
3073    }
3074
3075    /**
3076     * @return The date and time when the device was manufactured.
3077     */
3078    public Date getManufactureDate() { 
3079      return this.manufactureDate == null ? null : this.manufactureDate.getValue();
3080    }
3081
3082    /**
3083     * @param value The date and time when the device was manufactured.
3084     */
3085    public Device setManufactureDate(Date value) { 
3086      if (value == null)
3087        this.manufactureDate = null;
3088      else {
3089        if (this.manufactureDate == null)
3090          this.manufactureDate = new DateTimeType();
3091        this.manufactureDate.setValue(value);
3092      }
3093      return this;
3094    }
3095
3096    /**
3097     * @return {@link #expirationDate} (The date and time beyond which this device is no longer valid or should not be used (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value
3098     */
3099    public DateTimeType getExpirationDateElement() { 
3100      if (this.expirationDate == null)
3101        if (Configuration.errorOnAutoCreate())
3102          throw new Error("Attempt to auto-create Device.expirationDate");
3103        else if (Configuration.doAutoCreate())
3104          this.expirationDate = new DateTimeType(); // bb
3105      return this.expirationDate;
3106    }
3107
3108    public boolean hasExpirationDateElement() { 
3109      return this.expirationDate != null && !this.expirationDate.isEmpty();
3110    }
3111
3112    public boolean hasExpirationDate() { 
3113      return this.expirationDate != null && !this.expirationDate.isEmpty();
3114    }
3115
3116    /**
3117     * @param value {@link #expirationDate} (The date and time beyond which this device is no longer valid or should not be used (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value
3118     */
3119    public Device setExpirationDateElement(DateTimeType value) { 
3120      this.expirationDate = value;
3121      return this;
3122    }
3123
3124    /**
3125     * @return The date and time beyond which this device is no longer valid or should not be used (if applicable).
3126     */
3127    public Date getExpirationDate() { 
3128      return this.expirationDate == null ? null : this.expirationDate.getValue();
3129    }
3130
3131    /**
3132     * @param value The date and time beyond which this device is no longer valid or should not be used (if applicable).
3133     */
3134    public Device setExpirationDate(Date value) { 
3135      if (value == null)
3136        this.expirationDate = null;
3137      else {
3138        if (this.expirationDate == null)
3139          this.expirationDate = new DateTimeType();
3140        this.expirationDate.setValue(value);
3141      }
3142      return this;
3143    }
3144
3145    /**
3146     * @return {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value
3147     */
3148    public StringType getLotNumberElement() { 
3149      if (this.lotNumber == null)
3150        if (Configuration.errorOnAutoCreate())
3151          throw new Error("Attempt to auto-create Device.lotNumber");
3152        else if (Configuration.doAutoCreate())
3153          this.lotNumber = new StringType(); // bb
3154      return this.lotNumber;
3155    }
3156
3157    public boolean hasLotNumberElement() { 
3158      return this.lotNumber != null && !this.lotNumber.isEmpty();
3159    }
3160
3161    public boolean hasLotNumber() { 
3162      return this.lotNumber != null && !this.lotNumber.isEmpty();
3163    }
3164
3165    /**
3166     * @param value {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value
3167     */
3168    public Device setLotNumberElement(StringType value) { 
3169      this.lotNumber = value;
3170      return this;
3171    }
3172
3173    /**
3174     * @return Lot number assigned by the manufacturer.
3175     */
3176    public String getLotNumber() { 
3177      return this.lotNumber == null ? null : this.lotNumber.getValue();
3178    }
3179
3180    /**
3181     * @param value Lot number assigned by the manufacturer.
3182     */
3183    public Device setLotNumber(String value) { 
3184      if (Utilities.noString(value))
3185        this.lotNumber = null;
3186      else {
3187        if (this.lotNumber == null)
3188          this.lotNumber = new StringType();
3189        this.lotNumber.setValue(value);
3190      }
3191      return this;
3192    }
3193
3194    /**
3195     * @return {@link #serialNumber} (The serial number assigned by the organization when the device was manufactured.). This is the underlying object with id, value and extensions. The accessor "getSerialNumber" gives direct access to the value
3196     */
3197    public StringType getSerialNumberElement() { 
3198      if (this.serialNumber == null)
3199        if (Configuration.errorOnAutoCreate())
3200          throw new Error("Attempt to auto-create Device.serialNumber");
3201        else if (Configuration.doAutoCreate())
3202          this.serialNumber = new StringType(); // bb
3203      return this.serialNumber;
3204    }
3205
3206    public boolean hasSerialNumberElement() { 
3207      return this.serialNumber != null && !this.serialNumber.isEmpty();
3208    }
3209
3210    public boolean hasSerialNumber() { 
3211      return this.serialNumber != null && !this.serialNumber.isEmpty();
3212    }
3213
3214    /**
3215     * @param value {@link #serialNumber} (The serial number assigned by the organization when the device was manufactured.). This is the underlying object with id, value and extensions. The accessor "getSerialNumber" gives direct access to the value
3216     */
3217    public Device setSerialNumberElement(StringType value) { 
3218      this.serialNumber = value;
3219      return this;
3220    }
3221
3222    /**
3223     * @return The serial number assigned by the organization when the device was manufactured.
3224     */
3225    public String getSerialNumber() { 
3226      return this.serialNumber == null ? null : this.serialNumber.getValue();
3227    }
3228
3229    /**
3230     * @param value The serial number assigned by the organization when the device was manufactured.
3231     */
3232    public Device setSerialNumber(String value) { 
3233      if (Utilities.noString(value))
3234        this.serialNumber = null;
3235      else {
3236        if (this.serialNumber == null)
3237          this.serialNumber = new StringType();
3238        this.serialNumber.setValue(value);
3239      }
3240      return this;
3241    }
3242
3243    /**
3244     * @return {@link #deviceName} (This represents the manufacturer's name of the device as provided by the device, from a UDI label, or by a person describing the Device.  This typically would be used when a person provides the name(s) or when the device represents one of the names available from DeviceDefinition.)
3245     */
3246    public List<DeviceDeviceNameComponent> getDeviceName() { 
3247      if (this.deviceName == null)
3248        this.deviceName = new ArrayList<DeviceDeviceNameComponent>();
3249      return this.deviceName;
3250    }
3251
3252    /**
3253     * @return Returns a reference to <code>this</code> for easy method chaining
3254     */
3255    public Device setDeviceName(List<DeviceDeviceNameComponent> theDeviceName) { 
3256      this.deviceName = theDeviceName;
3257      return this;
3258    }
3259
3260    public boolean hasDeviceName() { 
3261      if (this.deviceName == null)
3262        return false;
3263      for (DeviceDeviceNameComponent item : this.deviceName)
3264        if (!item.isEmpty())
3265          return true;
3266      return false;
3267    }
3268
3269    public DeviceDeviceNameComponent addDeviceName() { //3
3270      DeviceDeviceNameComponent t = new DeviceDeviceNameComponent();
3271      if (this.deviceName == null)
3272        this.deviceName = new ArrayList<DeviceDeviceNameComponent>();
3273      this.deviceName.add(t);
3274      return t;
3275    }
3276
3277    public Device addDeviceName(DeviceDeviceNameComponent t) { //3
3278      if (t == null)
3279        return this;
3280      if (this.deviceName == null)
3281        this.deviceName = new ArrayList<DeviceDeviceNameComponent>();
3282      this.deviceName.add(t);
3283      return this;
3284    }
3285
3286    /**
3287     * @return The first repetition of repeating field {@link #deviceName}, creating it if it does not already exist {3}
3288     */
3289    public DeviceDeviceNameComponent getDeviceNameFirstRep() { 
3290      if (getDeviceName().isEmpty()) {
3291        addDeviceName();
3292      }
3293      return getDeviceName().get(0);
3294    }
3295
3296    /**
3297     * @return {@link #modelNumber} (The manufacturer's model number for the device.). This is the underlying object with id, value and extensions. The accessor "getModelNumber" gives direct access to the value
3298     */
3299    public StringType getModelNumberElement() { 
3300      if (this.modelNumber == null)
3301        if (Configuration.errorOnAutoCreate())
3302          throw new Error("Attempt to auto-create Device.modelNumber");
3303        else if (Configuration.doAutoCreate())
3304          this.modelNumber = new StringType(); // bb
3305      return this.modelNumber;
3306    }
3307
3308    public boolean hasModelNumberElement() { 
3309      return this.modelNumber != null && !this.modelNumber.isEmpty();
3310    }
3311
3312    public boolean hasModelNumber() { 
3313      return this.modelNumber != null && !this.modelNumber.isEmpty();
3314    }
3315
3316    /**
3317     * @param value {@link #modelNumber} (The manufacturer's model number for the device.). This is the underlying object with id, value and extensions. The accessor "getModelNumber" gives direct access to the value
3318     */
3319    public Device setModelNumberElement(StringType value) { 
3320      this.modelNumber = value;
3321      return this;
3322    }
3323
3324    /**
3325     * @return The manufacturer's model number for the device.
3326     */
3327    public String getModelNumber() { 
3328      return this.modelNumber == null ? null : this.modelNumber.getValue();
3329    }
3330
3331    /**
3332     * @param value The manufacturer's model number for the device.
3333     */
3334    public Device setModelNumber(String value) { 
3335      if (Utilities.noString(value))
3336        this.modelNumber = null;
3337      else {
3338        if (this.modelNumber == null)
3339          this.modelNumber = new StringType();
3340        this.modelNumber.setValue(value);
3341      }
3342      return this;
3343    }
3344
3345    /**
3346     * @return {@link #partNumber} (The part number or catalog number of the device.). This is the underlying object with id, value and extensions. The accessor "getPartNumber" gives direct access to the value
3347     */
3348    public StringType getPartNumberElement() { 
3349      if (this.partNumber == null)
3350        if (Configuration.errorOnAutoCreate())
3351          throw new Error("Attempt to auto-create Device.partNumber");
3352        else if (Configuration.doAutoCreate())
3353          this.partNumber = new StringType(); // bb
3354      return this.partNumber;
3355    }
3356
3357    public boolean hasPartNumberElement() { 
3358      return this.partNumber != null && !this.partNumber.isEmpty();
3359    }
3360
3361    public boolean hasPartNumber() { 
3362      return this.partNumber != null && !this.partNumber.isEmpty();
3363    }
3364
3365    /**
3366     * @param value {@link #partNumber} (The part number or catalog number of the device.). This is the underlying object with id, value and extensions. The accessor "getPartNumber" gives direct access to the value
3367     */
3368    public Device setPartNumberElement(StringType value) { 
3369      this.partNumber = value;
3370      return this;
3371    }
3372
3373    /**
3374     * @return The part number or catalog number of the device.
3375     */
3376    public String getPartNumber() { 
3377      return this.partNumber == null ? null : this.partNumber.getValue();
3378    }
3379
3380    /**
3381     * @param value The part number or catalog number of the device.
3382     */
3383    public Device setPartNumber(String value) { 
3384      if (Utilities.noString(value))
3385        this.partNumber = null;
3386      else {
3387        if (this.partNumber == null)
3388          this.partNumber = new StringType();
3389        this.partNumber.setValue(value);
3390      }
3391      return this;
3392    }
3393
3394    /**
3395     * @return {@link #type} (The kind or type of device. A device instance may have more than one type - in which case those are the types that apply to the specific instance of the device.)
3396     */
3397    public List<CodeableConcept> getType() { 
3398      if (this.type == null)
3399        this.type = new ArrayList<CodeableConcept>();
3400      return this.type;
3401    }
3402
3403    /**
3404     * @return Returns a reference to <code>this</code> for easy method chaining
3405     */
3406    public Device setType(List<CodeableConcept> theType) { 
3407      this.type = theType;
3408      return this;
3409    }
3410
3411    public boolean hasType() { 
3412      if (this.type == null)
3413        return false;
3414      for (CodeableConcept item : this.type)
3415        if (!item.isEmpty())
3416          return true;
3417      return false;
3418    }
3419
3420    public CodeableConcept addType() { //3
3421      CodeableConcept t = new CodeableConcept();
3422      if (this.type == null)
3423        this.type = new ArrayList<CodeableConcept>();
3424      this.type.add(t);
3425      return t;
3426    }
3427
3428    public Device addType(CodeableConcept t) { //3
3429      if (t == null)
3430        return this;
3431      if (this.type == null)
3432        this.type = new ArrayList<CodeableConcept>();
3433      this.type.add(t);
3434      return this;
3435    }
3436
3437    /**
3438     * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
3439     */
3440    public CodeableConcept getTypeFirstRep() { 
3441      if (getType().isEmpty()) {
3442        addType();
3443      }
3444      return getType().get(0);
3445    }
3446
3447    /**
3448     * @return {@link #version} (The actual design of the device or software version running on the device.)
3449     */
3450    public List<DeviceVersionComponent> getVersion() { 
3451      if (this.version == null)
3452        this.version = new ArrayList<DeviceVersionComponent>();
3453      return this.version;
3454    }
3455
3456    /**
3457     * @return Returns a reference to <code>this</code> for easy method chaining
3458     */
3459    public Device setVersion(List<DeviceVersionComponent> theVersion) { 
3460      this.version = theVersion;
3461      return this;
3462    }
3463
3464    public boolean hasVersion() { 
3465      if (this.version == null)
3466        return false;
3467      for (DeviceVersionComponent item : this.version)
3468        if (!item.isEmpty())
3469          return true;
3470      return false;
3471    }
3472
3473    public DeviceVersionComponent addVersion() { //3
3474      DeviceVersionComponent t = new DeviceVersionComponent();
3475      if (this.version == null)
3476        this.version = new ArrayList<DeviceVersionComponent>();
3477      this.version.add(t);
3478      return t;
3479    }
3480
3481    public Device addVersion(DeviceVersionComponent t) { //3
3482      if (t == null)
3483        return this;
3484      if (this.version == null)
3485        this.version = new ArrayList<DeviceVersionComponent>();
3486      this.version.add(t);
3487      return this;
3488    }
3489
3490    /**
3491     * @return The first repetition of repeating field {@link #version}, creating it if it does not already exist {3}
3492     */
3493    public DeviceVersionComponent getVersionFirstRep() { 
3494      if (getVersion().isEmpty()) {
3495        addVersion();
3496      }
3497      return getVersion().get(0);
3498    }
3499
3500    /**
3501     * @return {@link #property} (The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.)
3502     */
3503    public List<DevicePropertyComponent> getProperty() { 
3504      if (this.property == null)
3505        this.property = new ArrayList<DevicePropertyComponent>();
3506      return this.property;
3507    }
3508
3509    /**
3510     * @return Returns a reference to <code>this</code> for easy method chaining
3511     */
3512    public Device setProperty(List<DevicePropertyComponent> theProperty) { 
3513      this.property = theProperty;
3514      return this;
3515    }
3516
3517    public boolean hasProperty() { 
3518      if (this.property == null)
3519        return false;
3520      for (DevicePropertyComponent item : this.property)
3521        if (!item.isEmpty())
3522          return true;
3523      return false;
3524    }
3525
3526    public DevicePropertyComponent addProperty() { //3
3527      DevicePropertyComponent t = new DevicePropertyComponent();
3528      if (this.property == null)
3529        this.property = new ArrayList<DevicePropertyComponent>();
3530      this.property.add(t);
3531      return t;
3532    }
3533
3534    public Device addProperty(DevicePropertyComponent t) { //3
3535      if (t == null)
3536        return this;
3537      if (this.property == null)
3538        this.property = new ArrayList<DevicePropertyComponent>();
3539      this.property.add(t);
3540      return this;
3541    }
3542
3543    /**
3544     * @return The first repetition of repeating field {@link #property}, creating it if it does not already exist {3}
3545     */
3546    public DevicePropertyComponent getPropertyFirstRep() { 
3547      if (getProperty().isEmpty()) {
3548        addProperty();
3549      }
3550      return getProperty().get(0);
3551    }
3552
3553    /**
3554     * @return {@link #subject} (Patient information, if the device is affixed to, or associated to a patient for their specific use, irrespective of the procedure, use, observation, or other activity that the device is involved in.)
3555     */
3556    public Reference getSubject() { 
3557      if (this.subject == null)
3558        if (Configuration.errorOnAutoCreate())
3559          throw new Error("Attempt to auto-create Device.subject");
3560        else if (Configuration.doAutoCreate())
3561          this.subject = new Reference(); // cc
3562      return this.subject;
3563    }
3564
3565    public boolean hasSubject() { 
3566      return this.subject != null && !this.subject.isEmpty();
3567    }
3568
3569    /**
3570     * @param value {@link #subject} (Patient information, if the device is affixed to, or associated to a patient for their specific use, irrespective of the procedure, use, observation, or other activity that the device is involved in.)
3571     */
3572    public Device setSubject(Reference value) { 
3573      this.subject = value;
3574      return this;
3575    }
3576
3577    /**
3578     * @return {@link #operationalStatus} (The status of the device itself - whether it is switched on, or activated, etc.)
3579     */
3580    public DeviceOperationalStatusComponent getOperationalStatus() { 
3581      if (this.operationalStatus == null)
3582        if (Configuration.errorOnAutoCreate())
3583          throw new Error("Attempt to auto-create Device.operationalStatus");
3584        else if (Configuration.doAutoCreate())
3585          this.operationalStatus = new DeviceOperationalStatusComponent(); // cc
3586      return this.operationalStatus;
3587    }
3588
3589    public boolean hasOperationalStatus() { 
3590      return this.operationalStatus != null && !this.operationalStatus.isEmpty();
3591    }
3592
3593    /**
3594     * @param value {@link #operationalStatus} (The status of the device itself - whether it is switched on, or activated, etc.)
3595     */
3596    public Device setOperationalStatus(DeviceOperationalStatusComponent value) { 
3597      this.operationalStatus = value;
3598      return this;
3599    }
3600
3601    /**
3602     * @return {@link #associationStatus} (The state of the usage or application of the device - whether the device is implanted, or explanted, or attached to the patient.)
3603     */
3604    public DeviceAssociationStatusComponent getAssociationStatus() { 
3605      if (this.associationStatus == null)
3606        if (Configuration.errorOnAutoCreate())
3607          throw new Error("Attempt to auto-create Device.associationStatus");
3608        else if (Configuration.doAutoCreate())
3609          this.associationStatus = new DeviceAssociationStatusComponent(); // cc
3610      return this.associationStatus;
3611    }
3612
3613    public boolean hasAssociationStatus() { 
3614      return this.associationStatus != null && !this.associationStatus.isEmpty();
3615    }
3616
3617    /**
3618     * @param value {@link #associationStatus} (The state of the usage or application of the device - whether the device is implanted, or explanted, or attached to the patient.)
3619     */
3620    public Device setAssociationStatus(DeviceAssociationStatusComponent value) { 
3621      this.associationStatus = value;
3622      return this;
3623    }
3624
3625    /**
3626     * @return {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.)
3627     */
3628    public Reference getOwner() { 
3629      if (this.owner == null)
3630        if (Configuration.errorOnAutoCreate())
3631          throw new Error("Attempt to auto-create Device.owner");
3632        else if (Configuration.doAutoCreate())
3633          this.owner = new Reference(); // cc
3634      return this.owner;
3635    }
3636
3637    public boolean hasOwner() { 
3638      return this.owner != null && !this.owner.isEmpty();
3639    }
3640
3641    /**
3642     * @param value {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.)
3643     */
3644    public Device setOwner(Reference value) { 
3645      this.owner = value;
3646      return this;
3647    }
3648
3649    /**
3650     * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.)
3651     */
3652    public List<ContactPoint> getContact() { 
3653      if (this.contact == null)
3654        this.contact = new ArrayList<ContactPoint>();
3655      return this.contact;
3656    }
3657
3658    /**
3659     * @return Returns a reference to <code>this</code> for easy method chaining
3660     */
3661    public Device setContact(List<ContactPoint> theContact) { 
3662      this.contact = theContact;
3663      return this;
3664    }
3665
3666    public boolean hasContact() { 
3667      if (this.contact == null)
3668        return false;
3669      for (ContactPoint item : this.contact)
3670        if (!item.isEmpty())
3671          return true;
3672      return false;
3673    }
3674
3675    public ContactPoint addContact() { //3
3676      ContactPoint t = new ContactPoint();
3677      if (this.contact == null)
3678        this.contact = new ArrayList<ContactPoint>();
3679      this.contact.add(t);
3680      return t;
3681    }
3682
3683    public Device addContact(ContactPoint t) { //3
3684      if (t == null)
3685        return this;
3686      if (this.contact == null)
3687        this.contact = new ArrayList<ContactPoint>();
3688      this.contact.add(t);
3689      return this;
3690    }
3691
3692    /**
3693     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist {3}
3694     */
3695    public ContactPoint getContactFirstRep() { 
3696      if (getContact().isEmpty()) {
3697        addContact();
3698      }
3699      return getContact().get(0);
3700    }
3701
3702    /**
3703     * @return {@link #location} (The place where the device can be found.)
3704     */
3705    public Reference getLocation() { 
3706      if (this.location == null)
3707        if (Configuration.errorOnAutoCreate())
3708          throw new Error("Attempt to auto-create Device.location");
3709        else if (Configuration.doAutoCreate())
3710          this.location = new Reference(); // cc
3711      return this.location;
3712    }
3713
3714    public boolean hasLocation() { 
3715      return this.location != null && !this.location.isEmpty();
3716    }
3717
3718    /**
3719     * @param value {@link #location} (The place where the device can be found.)
3720     */
3721    public Device setLocation(Reference value) { 
3722      this.location = value;
3723      return this;
3724    }
3725
3726    /**
3727     * @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
3728     */
3729    public UriType getUrlElement() { 
3730      if (this.url == null)
3731        if (Configuration.errorOnAutoCreate())
3732          throw new Error("Attempt to auto-create Device.url");
3733        else if (Configuration.doAutoCreate())
3734          this.url = new UriType(); // bb
3735      return this.url;
3736    }
3737
3738    public boolean hasUrlElement() { 
3739      return this.url != null && !this.url.isEmpty();
3740    }
3741
3742    public boolean hasUrl() { 
3743      return this.url != null && !this.url.isEmpty();
3744    }
3745
3746    /**
3747     * @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
3748     */
3749    public Device setUrlElement(UriType value) { 
3750      this.url = value;
3751      return this;
3752    }
3753
3754    /**
3755     * @return A network address on which the device may be contacted directly.
3756     */
3757    public String getUrl() { 
3758      return this.url == null ? null : this.url.getValue();
3759    }
3760
3761    /**
3762     * @param value A network address on which the device may be contacted directly.
3763     */
3764    public Device setUrl(String value) { 
3765      if (Utilities.noString(value))
3766        this.url = null;
3767      else {
3768        if (this.url == null)
3769          this.url = new UriType();
3770        this.url.setValue(value);
3771      }
3772      return this;
3773    }
3774
3775    /**
3776     * @return {@link #endpoint} (Technical endpoints providing access to services provided by the device defined at this resource.)
3777     */
3778    public List<Reference> getEndpoint() { 
3779      if (this.endpoint == null)
3780        this.endpoint = new ArrayList<Reference>();
3781      return this.endpoint;
3782    }
3783
3784    /**
3785     * @return Returns a reference to <code>this</code> for easy method chaining
3786     */
3787    public Device setEndpoint(List<Reference> theEndpoint) { 
3788      this.endpoint = theEndpoint;
3789      return this;
3790    }
3791
3792    public boolean hasEndpoint() { 
3793      if (this.endpoint == null)
3794        return false;
3795      for (Reference item : this.endpoint)
3796        if (!item.isEmpty())
3797          return true;
3798      return false;
3799    }
3800
3801    public Reference addEndpoint() { //3
3802      Reference t = new Reference();
3803      if (this.endpoint == null)
3804        this.endpoint = new ArrayList<Reference>();
3805      this.endpoint.add(t);
3806      return t;
3807    }
3808
3809    public Device addEndpoint(Reference t) { //3
3810      if (t == null)
3811        return this;
3812      if (this.endpoint == null)
3813        this.endpoint = new ArrayList<Reference>();
3814      this.endpoint.add(t);
3815      return this;
3816    }
3817
3818    /**
3819     * @return The first repetition of repeating field {@link #endpoint}, creating it if it does not already exist {3}
3820     */
3821    public Reference getEndpointFirstRep() { 
3822      if (getEndpoint().isEmpty()) {
3823        addEndpoint();
3824      }
3825      return getEndpoint().get(0);
3826    }
3827
3828    /**
3829     * @return {@link #link} (An associated device, attached to, used with, communicating with or linking a previous or new device model to the focal device.)
3830     */
3831    public List<DeviceLinkComponent> getLink() { 
3832      if (this.link == null)
3833        this.link = new ArrayList<DeviceLinkComponent>();
3834      return this.link;
3835    }
3836
3837    /**
3838     * @return Returns a reference to <code>this</code> for easy method chaining
3839     */
3840    public Device setLink(List<DeviceLinkComponent> theLink) { 
3841      this.link = theLink;
3842      return this;
3843    }
3844
3845    public boolean hasLink() { 
3846      if (this.link == null)
3847        return false;
3848      for (DeviceLinkComponent item : this.link)
3849        if (!item.isEmpty())
3850          return true;
3851      return false;
3852    }
3853
3854    public DeviceLinkComponent addLink() { //3
3855      DeviceLinkComponent t = new DeviceLinkComponent();
3856      if (this.link == null)
3857        this.link = new ArrayList<DeviceLinkComponent>();
3858      this.link.add(t);
3859      return t;
3860    }
3861
3862    public Device addLink(DeviceLinkComponent t) { //3
3863      if (t == null)
3864        return this;
3865      if (this.link == null)
3866        this.link = new ArrayList<DeviceLinkComponent>();
3867      this.link.add(t);
3868      return this;
3869    }
3870
3871    /**
3872     * @return The first repetition of repeating field {@link #link}, creating it if it does not already exist {3}
3873     */
3874    public DeviceLinkComponent getLinkFirstRep() { 
3875      if (getLink().isEmpty()) {
3876        addLink();
3877      }
3878      return getLink().get(0);
3879    }
3880
3881    /**
3882     * @return {@link #note} (Descriptive information, usage information or implantation information that is not captured in an existing element.)
3883     */
3884    public List<Annotation> getNote() { 
3885      if (this.note == null)
3886        this.note = new ArrayList<Annotation>();
3887      return this.note;
3888    }
3889
3890    /**
3891     * @return Returns a reference to <code>this</code> for easy method chaining
3892     */
3893    public Device setNote(List<Annotation> theNote) { 
3894      this.note = theNote;
3895      return this;
3896    }
3897
3898    public boolean hasNote() { 
3899      if (this.note == null)
3900        return false;
3901      for (Annotation item : this.note)
3902        if (!item.isEmpty())
3903          return true;
3904      return false;
3905    }
3906
3907    public Annotation addNote() { //3
3908      Annotation t = new Annotation();
3909      if (this.note == null)
3910        this.note = new ArrayList<Annotation>();
3911      this.note.add(t);
3912      return t;
3913    }
3914
3915    public Device addNote(Annotation t) { //3
3916      if (t == null)
3917        return this;
3918      if (this.note == null)
3919        this.note = new ArrayList<Annotation>();
3920      this.note.add(t);
3921      return this;
3922    }
3923
3924    /**
3925     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
3926     */
3927    public Annotation getNoteFirstRep() { 
3928      if (getNote().isEmpty()) {
3929        addNote();
3930      }
3931      return getNote().get(0);
3932    }
3933
3934    /**
3935     * @return {@link #safety} (Provides additional safety characteristics about a medical device.  For example devices containing latex.)
3936     */
3937    public List<CodeableConcept> getSafety() { 
3938      if (this.safety == null)
3939        this.safety = new ArrayList<CodeableConcept>();
3940      return this.safety;
3941    }
3942
3943    /**
3944     * @return Returns a reference to <code>this</code> for easy method chaining
3945     */
3946    public Device setSafety(List<CodeableConcept> theSafety) { 
3947      this.safety = theSafety;
3948      return this;
3949    }
3950
3951    public boolean hasSafety() { 
3952      if (this.safety == null)
3953        return false;
3954      for (CodeableConcept item : this.safety)
3955        if (!item.isEmpty())
3956          return true;
3957      return false;
3958    }
3959
3960    public CodeableConcept addSafety() { //3
3961      CodeableConcept t = new CodeableConcept();
3962      if (this.safety == null)
3963        this.safety = new ArrayList<CodeableConcept>();
3964      this.safety.add(t);
3965      return t;
3966    }
3967
3968    public Device addSafety(CodeableConcept t) { //3
3969      if (t == null)
3970        return this;
3971      if (this.safety == null)
3972        this.safety = new ArrayList<CodeableConcept>();
3973      this.safety.add(t);
3974      return this;
3975    }
3976
3977    /**
3978     * @return The first repetition of repeating field {@link #safety}, creating it if it does not already exist {3}
3979     */
3980    public CodeableConcept getSafetyFirstRep() { 
3981      if (getSafety().isEmpty()) {
3982        addSafety();
3983      }
3984      return getSafety().get(0);
3985    }
3986
3987    /**
3988     * @return {@link #parent} (The device that this device is attached to or is part of.)
3989     */
3990    public Reference getParent() { 
3991      if (this.parent == null)
3992        if (Configuration.errorOnAutoCreate())
3993          throw new Error("Attempt to auto-create Device.parent");
3994        else if (Configuration.doAutoCreate())
3995          this.parent = new Reference(); // cc
3996      return this.parent;
3997    }
3998
3999    public boolean hasParent() { 
4000      return this.parent != null && !this.parent.isEmpty();
4001    }
4002
4003    /**
4004     * @param value {@link #parent} (The device that this device is attached to or is part of.)
4005     */
4006    public Device setParent(Reference value) { 
4007      this.parent = value;
4008      return this;
4009    }
4010
4011      protected void listChildren(List<Property> children) {
4012        super.listChildren(children);
4013        children.add(new Property("identifier", "Identifier", "Unique instance identifiers assigned to a device by manufacturers other organizations or owners.", 0, java.lang.Integer.MAX_VALUE, identifier));
4014        children.add(new Property("displayName", "string", "The name used to display by default when the device is referenced. Based on intent of use by the resource creator, this may reflect one of the names in Device.deviceName, or may be another simple name.", 0, 1, displayName));
4015        children.add(new Property("definition", "CodeableReference(DeviceDefinition)", "The reference to the definition for the device.", 0, 1, definition));
4016        children.add(new Property("udiCarrier", "", "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, udiCarrier));
4017        children.add(new Property("status", "code", "Status of the Device record. This is not the status of the device like availability.", 0, 1, status));
4018        children.add(new Property("statusReason", "CodeableConcept", "Reason for the status of the Device record. For example, why is the record not active.", 0, java.lang.Integer.MAX_VALUE, statusReason));
4019        children.add(new Property("biologicalSource", "Identifier", "An identifier that supports traceability to the biological entity that is the source of biological material in the product.", 0, 1, biologicalSource));
4020        children.add(new Property("manufacturer", "string", "A name of the manufacturer or entity legally responsible for the device.", 0, 1, manufacturer));
4021        children.add(new Property("manufactureDate", "dateTime", "The date and time when the device was manufactured.", 0, 1, manufactureDate));
4022        children.add(new Property("expirationDate", "dateTime", "The date and time beyond which this device is no longer valid or should not be used (if applicable).", 0, 1, expirationDate));
4023        children.add(new Property("lotNumber", "string", "Lot number assigned by the manufacturer.", 0, 1, lotNumber));
4024        children.add(new Property("serialNumber", "string", "The serial number assigned by the organization when the device was manufactured.", 0, 1, serialNumber));
4025        children.add(new Property("deviceName", "", "This represents the manufacturer's name of the device as provided by the device, from a UDI label, or by a person describing the Device.  This typically would be used when a person provides the name(s) or when the device represents one of the names available from DeviceDefinition.", 0, java.lang.Integer.MAX_VALUE, deviceName));
4026        children.add(new Property("modelNumber", "string", "The manufacturer's model number for the device.", 0, 1, modelNumber));
4027        children.add(new Property("partNumber", "string", "The part number or catalog number of the device.", 0, 1, partNumber));
4028        children.add(new Property("type", "CodeableConcept", "The kind or type of device. A device instance may have more than one type - in which case those are the types that apply to the specific instance of the device.", 0, java.lang.Integer.MAX_VALUE, type));
4029        children.add(new Property("version", "", "The actual design of the device or software version running on the device.", 0, java.lang.Integer.MAX_VALUE, version));
4030        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));
4031        children.add(new Property("subject", "Reference(Patient|Practitioner|Person)", "Patient information, if the device is affixed to, or associated to a patient for their specific use, irrespective of the procedure, use, observation, or other activity that the device is involved in.", 0, 1, subject));
4032        children.add(new Property("operationalStatus", "", "The status of the device itself - whether it is switched on, or activated, etc.", 0, 1, operationalStatus));
4033        children.add(new Property("associationStatus", "", "The state of the usage or application of the device - whether the device is implanted, or explanted, or attached to the patient.", 0, 1, associationStatus));
4034        children.add(new Property("owner", "Reference(Organization)", "An organization that is responsible for the provision and ongoing maintenance of the device.", 0, 1, owner));
4035        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));
4036        children.add(new Property("location", "Reference(Location)", "The place where the device can be found.", 0, 1, location));
4037        children.add(new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, 1, url));
4038        children.add(new Property("endpoint", "Reference(Endpoint)", "Technical endpoints providing access to services provided by the device defined at this resource.", 0, java.lang.Integer.MAX_VALUE, endpoint));
4039        children.add(new Property("link", "", "An associated device, attached to, used with, communicating with or linking a previous or new device model to the focal device.", 0, java.lang.Integer.MAX_VALUE, link));
4040        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));
4041        children.add(new Property("safety", "CodeableConcept", "Provides additional safety characteristics about a medical device.  For example devices containing latex.", 0, java.lang.Integer.MAX_VALUE, safety));
4042        children.add(new Property("parent", "Reference(Device)", "The device that this device is attached to or is part of.", 0, 1, parent));
4043      }
4044
4045      @Override
4046      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4047        switch (_hash) {
4048        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique instance identifiers assigned to a device by manufacturers other organizations or owners.", 0, java.lang.Integer.MAX_VALUE, identifier);
4049        case 1714148973: /*displayName*/  return new Property("displayName", "string", "The name used to display by default when the device is referenced. Based on intent of use by the resource creator, this may reflect one of the names in Device.deviceName, or may be another simple name.", 0, 1, displayName);
4050        case -1014418093: /*definition*/  return new Property("definition", "CodeableReference(DeviceDefinition)", "The reference to the definition for the device.", 0, 1, definition);
4051        case -1343558178: /*udiCarrier*/  return new Property("udiCarrier", "", "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, udiCarrier);
4052        case -892481550: /*status*/  return new Property("status", "code", "Status of the Device record. This is not the status of the device like availability.", 0, 1, status);
4053        case 2051346646: /*statusReason*/  return new Property("statusReason", "CodeableConcept", "Reason for the status of the Device record. For example, why is the record not active.", 0, java.lang.Integer.MAX_VALUE, statusReason);
4054        case -883952260: /*biologicalSource*/  return new Property("biologicalSource", "Identifier", "An identifier that supports traceability to the biological entity that is the source of biological material in the product.", 0, 1, biologicalSource);
4055        case -1969347631: /*manufacturer*/  return new Property("manufacturer", "string", "A name of the manufacturer or entity legally responsible for the device.", 0, 1, manufacturer);
4056        case 416714767: /*manufactureDate*/  return new Property("manufactureDate", "dateTime", "The date and time when the device was manufactured.", 0, 1, manufactureDate);
4057        case -668811523: /*expirationDate*/  return new Property("expirationDate", "dateTime", "The date and time beyond which this device is no longer valid or should not be used (if applicable).", 0, 1, expirationDate);
4058        case 462547450: /*lotNumber*/  return new Property("lotNumber", "string", "Lot number assigned by the manufacturer.", 0, 1, lotNumber);
4059        case 83787357: /*serialNumber*/  return new Property("serialNumber", "string", "The serial number assigned by the organization when the device was manufactured.", 0, 1, serialNumber);
4060        case 780988929: /*deviceName*/  return new Property("deviceName", "", "This represents the manufacturer's name of the device as provided by the device, from a UDI label, or by a person describing the Device.  This typically would be used when a person provides the name(s) or when the device represents one of the names available from DeviceDefinition.", 0, java.lang.Integer.MAX_VALUE, deviceName);
4061        case 346619858: /*modelNumber*/  return new Property("modelNumber", "string", "The manufacturer's model number for the device.", 0, 1, modelNumber);
4062        case -731502308: /*partNumber*/  return new Property("partNumber", "string", "The part number or catalog number of the device.", 0, 1, partNumber);
4063        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind or type of device. A device instance may have more than one type - in which case those are the types that apply to the specific instance of the device.", 0, java.lang.Integer.MAX_VALUE, type);
4064        case 351608024: /*version*/  return new Property("version", "", "The actual design of the device or software version running on the device.", 0, java.lang.Integer.MAX_VALUE, version);
4065        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);
4066        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Practitioner|Person)", "Patient information, if the device is affixed to, or associated to a patient for their specific use, irrespective of the procedure, use, observation, or other activity that the device is involved in.", 0, 1, subject);
4067        case -2103166364: /*operationalStatus*/  return new Property("operationalStatus", "", "The status of the device itself - whether it is switched on, or activated, etc.", 0, 1, operationalStatus);
4068        case -605391917: /*associationStatus*/  return new Property("associationStatus", "", "The state of the usage or application of the device - whether the device is implanted, or explanted, or attached to the patient.", 0, 1, associationStatus);
4069        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);
4070        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);
4071        case 1901043637: /*location*/  return new Property("location", "Reference(Location)", "The place where the device can be found.", 0, 1, location);
4072        case 116079: /*url*/  return new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, 1, url);
4073        case 1741102485: /*endpoint*/  return new Property("endpoint", "Reference(Endpoint)", "Technical endpoints providing access to services provided by the device defined at this resource.", 0, java.lang.Integer.MAX_VALUE, endpoint);
4074        case 3321850: /*link*/  return new Property("link", "", "An associated device, attached to, used with, communicating with or linking a previous or new device model to the focal device.", 0, java.lang.Integer.MAX_VALUE, link);
4075        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);
4076        case -909893934: /*safety*/  return new Property("safety", "CodeableConcept", "Provides additional safety characteristics about a medical device.  For example devices containing latex.", 0, java.lang.Integer.MAX_VALUE, safety);
4077        case -995424086: /*parent*/  return new Property("parent", "Reference(Device)", "The device that this device is attached to or is part of.", 0, 1, parent);
4078        default: return super.getNamedProperty(_hash, _name, _checkValid);
4079        }
4080
4081      }
4082
4083      @Override
4084      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4085        switch (hash) {
4086        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
4087        case 1714148973: /*displayName*/ return this.displayName == null ? new Base[0] : new Base[] {this.displayName}; // StringType
4088        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // CodeableReference
4089        case -1343558178: /*udiCarrier*/ return this.udiCarrier == null ? new Base[0] : this.udiCarrier.toArray(new Base[this.udiCarrier.size()]); // DeviceUdiCarrierComponent
4090        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FHIRDeviceStatus>
4091        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : this.statusReason.toArray(new Base[this.statusReason.size()]); // CodeableConcept
4092        case -883952260: /*biologicalSource*/ return this.biologicalSource == null ? new Base[0] : new Base[] {this.biologicalSource}; // Identifier
4093        case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : new Base[] {this.manufacturer}; // StringType
4094        case 416714767: /*manufactureDate*/ return this.manufactureDate == null ? new Base[0] : new Base[] {this.manufactureDate}; // DateTimeType
4095        case -668811523: /*expirationDate*/ return this.expirationDate == null ? new Base[0] : new Base[] {this.expirationDate}; // DateTimeType
4096        case 462547450: /*lotNumber*/ return this.lotNumber == null ? new Base[0] : new Base[] {this.lotNumber}; // StringType
4097        case 83787357: /*serialNumber*/ return this.serialNumber == null ? new Base[0] : new Base[] {this.serialNumber}; // StringType
4098        case 780988929: /*deviceName*/ return this.deviceName == null ? new Base[0] : this.deviceName.toArray(new Base[this.deviceName.size()]); // DeviceDeviceNameComponent
4099        case 346619858: /*modelNumber*/ return this.modelNumber == null ? new Base[0] : new Base[] {this.modelNumber}; // StringType
4100        case -731502308: /*partNumber*/ return this.partNumber == null ? new Base[0] : new Base[] {this.partNumber}; // StringType
4101        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
4102        case 351608024: /*version*/ return this.version == null ? new Base[0] : this.version.toArray(new Base[this.version.size()]); // DeviceVersionComponent
4103        case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // DevicePropertyComponent
4104        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
4105        case -2103166364: /*operationalStatus*/ return this.operationalStatus == null ? new Base[0] : new Base[] {this.operationalStatus}; // DeviceOperationalStatusComponent
4106        case -605391917: /*associationStatus*/ return this.associationStatus == null ? new Base[0] : new Base[] {this.associationStatus}; // DeviceAssociationStatusComponent
4107        case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference
4108        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactPoint
4109        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
4110        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
4111        case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // Reference
4112        case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // DeviceLinkComponent
4113        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
4114        case -909893934: /*safety*/ return this.safety == null ? new Base[0] : this.safety.toArray(new Base[this.safety.size()]); // CodeableConcept
4115        case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Reference
4116        default: return super.getProperty(hash, name, checkValid);
4117        }
4118
4119      }
4120
4121      @Override
4122      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4123        switch (hash) {
4124        case -1618432855: // identifier
4125          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
4126          return value;
4127        case 1714148973: // displayName
4128          this.displayName = TypeConvertor.castToString(value); // StringType
4129          return value;
4130        case -1014418093: // definition
4131          this.definition = TypeConvertor.castToCodeableReference(value); // CodeableReference
4132          return value;
4133        case -1343558178: // udiCarrier
4134          this.getUdiCarrier().add((DeviceUdiCarrierComponent) value); // DeviceUdiCarrierComponent
4135          return value;
4136        case -892481550: // status
4137          value = new FHIRDeviceStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
4138          this.status = (Enumeration) value; // Enumeration<FHIRDeviceStatus>
4139          return value;
4140        case 2051346646: // statusReason
4141          this.getStatusReason().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4142          return value;
4143        case -883952260: // biologicalSource
4144          this.biologicalSource = TypeConvertor.castToIdentifier(value); // Identifier
4145          return value;
4146        case -1969347631: // manufacturer
4147          this.manufacturer = TypeConvertor.castToString(value); // StringType
4148          return value;
4149        case 416714767: // manufactureDate
4150          this.manufactureDate = TypeConvertor.castToDateTime(value); // DateTimeType
4151          return value;
4152        case -668811523: // expirationDate
4153          this.expirationDate = TypeConvertor.castToDateTime(value); // DateTimeType
4154          return value;
4155        case 462547450: // lotNumber
4156          this.lotNumber = TypeConvertor.castToString(value); // StringType
4157          return value;
4158        case 83787357: // serialNumber
4159          this.serialNumber = TypeConvertor.castToString(value); // StringType
4160          return value;
4161        case 780988929: // deviceName
4162          this.getDeviceName().add((DeviceDeviceNameComponent) value); // DeviceDeviceNameComponent
4163          return value;
4164        case 346619858: // modelNumber
4165          this.modelNumber = TypeConvertor.castToString(value); // StringType
4166          return value;
4167        case -731502308: // partNumber
4168          this.partNumber = TypeConvertor.castToString(value); // StringType
4169          return value;
4170        case 3575610: // type
4171          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4172          return value;
4173        case 351608024: // version
4174          this.getVersion().add((DeviceVersionComponent) value); // DeviceVersionComponent
4175          return value;
4176        case -993141291: // property
4177          this.getProperty().add((DevicePropertyComponent) value); // DevicePropertyComponent
4178          return value;
4179        case -1867885268: // subject
4180          this.subject = TypeConvertor.castToReference(value); // Reference
4181          return value;
4182        case -2103166364: // operationalStatus
4183          this.operationalStatus = (DeviceOperationalStatusComponent) value; // DeviceOperationalStatusComponent
4184          return value;
4185        case -605391917: // associationStatus
4186          this.associationStatus = (DeviceAssociationStatusComponent) value; // DeviceAssociationStatusComponent
4187          return value;
4188        case 106164915: // owner
4189          this.owner = TypeConvertor.castToReference(value); // Reference
4190          return value;
4191        case 951526432: // contact
4192          this.getContact().add(TypeConvertor.castToContactPoint(value)); // ContactPoint
4193          return value;
4194        case 1901043637: // location
4195          this.location = TypeConvertor.castToReference(value); // Reference
4196          return value;
4197        case 116079: // url
4198          this.url = TypeConvertor.castToUri(value); // UriType
4199          return value;
4200        case 1741102485: // endpoint
4201          this.getEndpoint().add(TypeConvertor.castToReference(value)); // Reference
4202          return value;
4203        case 3321850: // link
4204          this.getLink().add((DeviceLinkComponent) value); // DeviceLinkComponent
4205          return value;
4206        case 3387378: // note
4207          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
4208          return value;
4209        case -909893934: // safety
4210          this.getSafety().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4211          return value;
4212        case -995424086: // parent
4213          this.parent = TypeConvertor.castToReference(value); // Reference
4214          return value;
4215        default: return super.setProperty(hash, name, value);
4216        }
4217
4218      }
4219
4220      @Override
4221      public Base setProperty(String name, Base value) throws FHIRException {
4222        if (name.equals("identifier")) {
4223          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
4224        } else if (name.equals("displayName")) {
4225          this.displayName = TypeConvertor.castToString(value); // StringType
4226        } else if (name.equals("definition")) {
4227          this.definition = TypeConvertor.castToCodeableReference(value); // CodeableReference
4228        } else if (name.equals("udiCarrier")) {
4229          this.getUdiCarrier().add((DeviceUdiCarrierComponent) value);
4230        } else if (name.equals("status")) {
4231          value = new FHIRDeviceStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
4232          this.status = (Enumeration) value; // Enumeration<FHIRDeviceStatus>
4233        } else if (name.equals("statusReason")) {
4234          this.getStatusReason().add(TypeConvertor.castToCodeableConcept(value));
4235        } else if (name.equals("biologicalSource")) {
4236          this.biologicalSource = TypeConvertor.castToIdentifier(value); // Identifier
4237        } else if (name.equals("manufacturer")) {
4238          this.manufacturer = TypeConvertor.castToString(value); // StringType
4239        } else if (name.equals("manufactureDate")) {
4240          this.manufactureDate = TypeConvertor.castToDateTime(value); // DateTimeType
4241        } else if (name.equals("expirationDate")) {
4242          this.expirationDate = TypeConvertor.castToDateTime(value); // DateTimeType
4243        } else if (name.equals("lotNumber")) {
4244          this.lotNumber = TypeConvertor.castToString(value); // StringType
4245        } else if (name.equals("serialNumber")) {
4246          this.serialNumber = TypeConvertor.castToString(value); // StringType
4247        } else if (name.equals("deviceName")) {
4248          this.getDeviceName().add((DeviceDeviceNameComponent) value);
4249        } else if (name.equals("modelNumber")) {
4250          this.modelNumber = TypeConvertor.castToString(value); // StringType
4251        } else if (name.equals("partNumber")) {
4252          this.partNumber = TypeConvertor.castToString(value); // StringType
4253        } else if (name.equals("type")) {
4254          this.getType().add(TypeConvertor.castToCodeableConcept(value));
4255        } else if (name.equals("version")) {
4256          this.getVersion().add((DeviceVersionComponent) value);
4257        } else if (name.equals("property")) {
4258          this.getProperty().add((DevicePropertyComponent) value);
4259        } else if (name.equals("subject")) {
4260          this.subject = TypeConvertor.castToReference(value); // Reference
4261        } else if (name.equals("operationalStatus")) {
4262          this.operationalStatus = (DeviceOperationalStatusComponent) value; // DeviceOperationalStatusComponent
4263        } else if (name.equals("associationStatus")) {
4264          this.associationStatus = (DeviceAssociationStatusComponent) value; // DeviceAssociationStatusComponent
4265        } else if (name.equals("owner")) {
4266          this.owner = TypeConvertor.castToReference(value); // Reference
4267        } else if (name.equals("contact")) {
4268          this.getContact().add(TypeConvertor.castToContactPoint(value));
4269        } else if (name.equals("location")) {
4270          this.location = TypeConvertor.castToReference(value); // Reference
4271        } else if (name.equals("url")) {
4272          this.url = TypeConvertor.castToUri(value); // UriType
4273        } else if (name.equals("endpoint")) {
4274          this.getEndpoint().add(TypeConvertor.castToReference(value));
4275        } else if (name.equals("link")) {
4276          this.getLink().add((DeviceLinkComponent) value);
4277        } else if (name.equals("note")) {
4278          this.getNote().add(TypeConvertor.castToAnnotation(value));
4279        } else if (name.equals("safety")) {
4280          this.getSafety().add(TypeConvertor.castToCodeableConcept(value));
4281        } else if (name.equals("parent")) {
4282          this.parent = TypeConvertor.castToReference(value); // Reference
4283        } else
4284          return super.setProperty(name, value);
4285        return value;
4286      }
4287
4288      @Override
4289      public Base makeProperty(int hash, String name) throws FHIRException {
4290        switch (hash) {
4291        case -1618432855:  return addIdentifier(); 
4292        case 1714148973:  return getDisplayNameElement();
4293        case -1014418093:  return getDefinition();
4294        case -1343558178:  return addUdiCarrier(); 
4295        case -892481550:  return getStatusElement();
4296        case 2051346646:  return addStatusReason(); 
4297        case -883952260:  return getBiologicalSource();
4298        case -1969347631:  return getManufacturerElement();
4299        case 416714767:  return getManufactureDateElement();
4300        case -668811523:  return getExpirationDateElement();
4301        case 462547450:  return getLotNumberElement();
4302        case 83787357:  return getSerialNumberElement();
4303        case 780988929:  return addDeviceName(); 
4304        case 346619858:  return getModelNumberElement();
4305        case -731502308:  return getPartNumberElement();
4306        case 3575610:  return addType(); 
4307        case 351608024:  return addVersion(); 
4308        case -993141291:  return addProperty(); 
4309        case -1867885268:  return getSubject();
4310        case -2103166364:  return getOperationalStatus();
4311        case -605391917:  return getAssociationStatus();
4312        case 106164915:  return getOwner();
4313        case 951526432:  return addContact(); 
4314        case 1901043637:  return getLocation();
4315        case 116079:  return getUrlElement();
4316        case 1741102485:  return addEndpoint(); 
4317        case 3321850:  return addLink(); 
4318        case 3387378:  return addNote(); 
4319        case -909893934:  return addSafety(); 
4320        case -995424086:  return getParent();
4321        default: return super.makeProperty(hash, name);
4322        }
4323
4324      }
4325
4326      @Override
4327      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4328        switch (hash) {
4329        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
4330        case 1714148973: /*displayName*/ return new String[] {"string"};
4331        case -1014418093: /*definition*/ return new String[] {"CodeableReference"};
4332        case -1343558178: /*udiCarrier*/ return new String[] {};
4333        case -892481550: /*status*/ return new String[] {"code"};
4334        case 2051346646: /*statusReason*/ return new String[] {"CodeableConcept"};
4335        case -883952260: /*biologicalSource*/ return new String[] {"Identifier"};
4336        case -1969347631: /*manufacturer*/ return new String[] {"string"};
4337        case 416714767: /*manufactureDate*/ return new String[] {"dateTime"};
4338        case -668811523: /*expirationDate*/ return new String[] {"dateTime"};
4339        case 462547450: /*lotNumber*/ return new String[] {"string"};
4340        case 83787357: /*serialNumber*/ return new String[] {"string"};
4341        case 780988929: /*deviceName*/ return new String[] {};
4342        case 346619858: /*modelNumber*/ return new String[] {"string"};
4343        case -731502308: /*partNumber*/ return new String[] {"string"};
4344        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
4345        case 351608024: /*version*/ return new String[] {};
4346        case -993141291: /*property*/ return new String[] {};
4347        case -1867885268: /*subject*/ return new String[] {"Reference"};
4348        case -2103166364: /*operationalStatus*/ return new String[] {};
4349        case -605391917: /*associationStatus*/ return new String[] {};
4350        case 106164915: /*owner*/ return new String[] {"Reference"};
4351        case 951526432: /*contact*/ return new String[] {"ContactPoint"};
4352        case 1901043637: /*location*/ return new String[] {"Reference"};
4353        case 116079: /*url*/ return new String[] {"uri"};
4354        case 1741102485: /*endpoint*/ return new String[] {"Reference"};
4355        case 3321850: /*link*/ return new String[] {};
4356        case 3387378: /*note*/ return new String[] {"Annotation"};
4357        case -909893934: /*safety*/ return new String[] {"CodeableConcept"};
4358        case -995424086: /*parent*/ return new String[] {"Reference"};
4359        default: return super.getTypesForProperty(hash, name);
4360        }
4361
4362      }
4363
4364      @Override
4365      public Base addChild(String name) throws FHIRException {
4366        if (name.equals("identifier")) {
4367          return addIdentifier();
4368        }
4369        else if (name.equals("displayName")) {
4370          throw new FHIRException("Cannot call addChild on a primitive type Device.displayName");
4371        }
4372        else if (name.equals("definition")) {
4373          this.definition = new CodeableReference();
4374          return this.definition;
4375        }
4376        else if (name.equals("udiCarrier")) {
4377          return addUdiCarrier();
4378        }
4379        else if (name.equals("status")) {
4380          throw new FHIRException("Cannot call addChild on a primitive type Device.status");
4381        }
4382        else if (name.equals("statusReason")) {
4383          return addStatusReason();
4384        }
4385        else if (name.equals("biologicalSource")) {
4386          this.biologicalSource = new Identifier();
4387          return this.biologicalSource;
4388        }
4389        else if (name.equals("manufacturer")) {
4390          throw new FHIRException("Cannot call addChild on a primitive type Device.manufacturer");
4391        }
4392        else if (name.equals("manufactureDate")) {
4393          throw new FHIRException("Cannot call addChild on a primitive type Device.manufactureDate");
4394        }
4395        else if (name.equals("expirationDate")) {
4396          throw new FHIRException("Cannot call addChild on a primitive type Device.expirationDate");
4397        }
4398        else if (name.equals("lotNumber")) {
4399          throw new FHIRException("Cannot call addChild on a primitive type Device.lotNumber");
4400        }
4401        else if (name.equals("serialNumber")) {
4402          throw new FHIRException("Cannot call addChild on a primitive type Device.serialNumber");
4403        }
4404        else if (name.equals("deviceName")) {
4405          return addDeviceName();
4406        }
4407        else if (name.equals("modelNumber")) {
4408          throw new FHIRException("Cannot call addChild on a primitive type Device.modelNumber");
4409        }
4410        else if (name.equals("partNumber")) {
4411          throw new FHIRException("Cannot call addChild on a primitive type Device.partNumber");
4412        }
4413        else if (name.equals("type")) {
4414          return addType();
4415        }
4416        else if (name.equals("version")) {
4417          return addVersion();
4418        }
4419        else if (name.equals("property")) {
4420          return addProperty();
4421        }
4422        else if (name.equals("subject")) {
4423          this.subject = new Reference();
4424          return this.subject;
4425        }
4426        else if (name.equals("operationalStatus")) {
4427          this.operationalStatus = new DeviceOperationalStatusComponent();
4428          return this.operationalStatus;
4429        }
4430        else if (name.equals("associationStatus")) {
4431          this.associationStatus = new DeviceAssociationStatusComponent();
4432          return this.associationStatus;
4433        }
4434        else if (name.equals("owner")) {
4435          this.owner = new Reference();
4436          return this.owner;
4437        }
4438        else if (name.equals("contact")) {
4439          return addContact();
4440        }
4441        else if (name.equals("location")) {
4442          this.location = new Reference();
4443          return this.location;
4444        }
4445        else if (name.equals("url")) {
4446          throw new FHIRException("Cannot call addChild on a primitive type Device.url");
4447        }
4448        else if (name.equals("endpoint")) {
4449          return addEndpoint();
4450        }
4451        else if (name.equals("link")) {
4452          return addLink();
4453        }
4454        else if (name.equals("note")) {
4455          return addNote();
4456        }
4457        else if (name.equals("safety")) {
4458          return addSafety();
4459        }
4460        else if (name.equals("parent")) {
4461          this.parent = new Reference();
4462          return this.parent;
4463        }
4464        else
4465          return super.addChild(name);
4466      }
4467
4468  public String fhirType() {
4469    return "Device";
4470
4471  }
4472
4473      public Device copy() {
4474        Device dst = new Device();
4475        copyValues(dst);
4476        return dst;
4477      }
4478
4479      public void copyValues(Device dst) {
4480        super.copyValues(dst);
4481        if (identifier != null) {
4482          dst.identifier = new ArrayList<Identifier>();
4483          for (Identifier i : identifier)
4484            dst.identifier.add(i.copy());
4485        };
4486        dst.displayName = displayName == null ? null : displayName.copy();
4487        dst.definition = definition == null ? null : definition.copy();
4488        if (udiCarrier != null) {
4489          dst.udiCarrier = new ArrayList<DeviceUdiCarrierComponent>();
4490          for (DeviceUdiCarrierComponent i : udiCarrier)
4491            dst.udiCarrier.add(i.copy());
4492        };
4493        dst.status = status == null ? null : status.copy();
4494        if (statusReason != null) {
4495          dst.statusReason = new ArrayList<CodeableConcept>();
4496          for (CodeableConcept i : statusReason)
4497            dst.statusReason.add(i.copy());
4498        };
4499        dst.biologicalSource = biologicalSource == null ? null : biologicalSource.copy();
4500        dst.manufacturer = manufacturer == null ? null : manufacturer.copy();
4501        dst.manufactureDate = manufactureDate == null ? null : manufactureDate.copy();
4502        dst.expirationDate = expirationDate == null ? null : expirationDate.copy();
4503        dst.lotNumber = lotNumber == null ? null : lotNumber.copy();
4504        dst.serialNumber = serialNumber == null ? null : serialNumber.copy();
4505        if (deviceName != null) {
4506          dst.deviceName = new ArrayList<DeviceDeviceNameComponent>();
4507          for (DeviceDeviceNameComponent i : deviceName)
4508            dst.deviceName.add(i.copy());
4509        };
4510        dst.modelNumber = modelNumber == null ? null : modelNumber.copy();
4511        dst.partNumber = partNumber == null ? null : partNumber.copy();
4512        if (type != null) {
4513          dst.type = new ArrayList<CodeableConcept>();
4514          for (CodeableConcept i : type)
4515            dst.type.add(i.copy());
4516        };
4517        if (version != null) {
4518          dst.version = new ArrayList<DeviceVersionComponent>();
4519          for (DeviceVersionComponent i : version)
4520            dst.version.add(i.copy());
4521        };
4522        if (property != null) {
4523          dst.property = new ArrayList<DevicePropertyComponent>();
4524          for (DevicePropertyComponent i : property)
4525            dst.property.add(i.copy());
4526        };
4527        dst.subject = subject == null ? null : subject.copy();
4528        dst.operationalStatus = operationalStatus == null ? null : operationalStatus.copy();
4529        dst.associationStatus = associationStatus == null ? null : associationStatus.copy();
4530        dst.owner = owner == null ? null : owner.copy();
4531        if (contact != null) {
4532          dst.contact = new ArrayList<ContactPoint>();
4533          for (ContactPoint i : contact)
4534            dst.contact.add(i.copy());
4535        };
4536        dst.location = location == null ? null : location.copy();
4537        dst.url = url == null ? null : url.copy();
4538        if (endpoint != null) {
4539          dst.endpoint = new ArrayList<Reference>();
4540          for (Reference i : endpoint)
4541            dst.endpoint.add(i.copy());
4542        };
4543        if (link != null) {
4544          dst.link = new ArrayList<DeviceLinkComponent>();
4545          for (DeviceLinkComponent i : link)
4546            dst.link.add(i.copy());
4547        };
4548        if (note != null) {
4549          dst.note = new ArrayList<Annotation>();
4550          for (Annotation i : note)
4551            dst.note.add(i.copy());
4552        };
4553        if (safety != null) {
4554          dst.safety = new ArrayList<CodeableConcept>();
4555          for (CodeableConcept i : safety)
4556            dst.safety.add(i.copy());
4557        };
4558        dst.parent = parent == null ? null : parent.copy();
4559      }
4560
4561      protected Device typedCopy() {
4562        return copy();
4563      }
4564
4565      @Override
4566      public boolean equalsDeep(Base other_) {
4567        if (!super.equalsDeep(other_))
4568          return false;
4569        if (!(other_ instanceof Device))
4570          return false;
4571        Device o = (Device) other_;
4572        return compareDeep(identifier, o.identifier, true) && compareDeep(displayName, o.displayName, true)
4573           && compareDeep(definition, o.definition, true) && compareDeep(udiCarrier, o.udiCarrier, true) && compareDeep(status, o.status, true)
4574           && compareDeep(statusReason, o.statusReason, true) && compareDeep(biologicalSource, o.biologicalSource, true)
4575           && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(manufactureDate, o.manufactureDate, true)
4576           && compareDeep(expirationDate, o.expirationDate, true) && compareDeep(lotNumber, o.lotNumber, true)
4577           && compareDeep(serialNumber, o.serialNumber, true) && compareDeep(deviceName, o.deviceName, true)
4578           && compareDeep(modelNumber, o.modelNumber, true) && compareDeep(partNumber, o.partNumber, true)
4579           && compareDeep(type, o.type, true) && compareDeep(version, o.version, true) && compareDeep(property, o.property, true)
4580           && compareDeep(subject, o.subject, true) && compareDeep(operationalStatus, o.operationalStatus, true)
4581           && compareDeep(associationStatus, o.associationStatus, true) && compareDeep(owner, o.owner, true)
4582           && compareDeep(contact, o.contact, true) && compareDeep(location, o.location, true) && compareDeep(url, o.url, true)
4583           && compareDeep(endpoint, o.endpoint, true) && compareDeep(link, o.link, true) && compareDeep(note, o.note, true)
4584           && compareDeep(safety, o.safety, true) && compareDeep(parent, o.parent, true);
4585      }
4586
4587      @Override
4588      public boolean equalsShallow(Base other_) {
4589        if (!super.equalsShallow(other_))
4590          return false;
4591        if (!(other_ instanceof Device))
4592          return false;
4593        Device o = (Device) other_;
4594        return compareValues(displayName, o.displayName, true) && compareValues(status, o.status, true) && compareValues(manufacturer, o.manufacturer, true)
4595           && compareValues(manufactureDate, o.manufactureDate, true) && compareValues(expirationDate, o.expirationDate, true)
4596           && compareValues(lotNumber, o.lotNumber, true) && compareValues(serialNumber, o.serialNumber, true)
4597           && compareValues(modelNumber, o.modelNumber, true) && compareValues(partNumber, o.partNumber, true)
4598           && compareValues(url, o.url, true);
4599      }
4600
4601      public boolean isEmpty() {
4602        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, displayName, definition
4603          , udiCarrier, status, statusReason, biologicalSource, manufacturer, manufactureDate
4604          , expirationDate, lotNumber, serialNumber, deviceName, modelNumber, partNumber, type
4605          , version, property, subject, operationalStatus, associationStatus, owner, contact
4606          , location, url, endpoint, link, note, safety, parent);
4607      }
4608
4609  @Override
4610  public ResourceType getResourceType() {
4611    return ResourceType.Device;
4612   }
4613
4614 /**
4615   * Search parameter: <b>biological-source</b>
4616   * <p>
4617   * Description: <b>The biological source for the device</b><br>
4618   * Type: <b>token</b><br>
4619   * Path: <b>Device.biologicalSource</b><br>
4620   * </p>
4621   */
4622  @SearchParamDefinition(name="biological-source", path="Device.biologicalSource", description="The biological source for the device", type="token" )
4623  public static final String SP_BIOLOGICAL_SOURCE = "biological-source";
4624 /**
4625   * <b>Fluent Client</b> search parameter constant for <b>biological-source</b>
4626   * <p>
4627   * Description: <b>The biological source for the device</b><br>
4628   * Type: <b>token</b><br>
4629   * Path: <b>Device.biologicalSource</b><br>
4630   * </p>
4631   */
4632  public static final ca.uhn.fhir.rest.gclient.TokenClientParam BIOLOGICAL_SOURCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BIOLOGICAL_SOURCE);
4633
4634 /**
4635   * Search parameter: <b>definition</b>
4636   * <p>
4637   * Description: <b>The definition / type of the device</b><br>
4638   * Type: <b>reference</b><br>
4639   * Path: <b>Device.definition.reference</b><br>
4640   * </p>
4641   */
4642  @SearchParamDefinition(name="definition", path="Device.definition.reference", description="The definition / type of the device", type="reference" )
4643  public static final String SP_DEFINITION = "definition";
4644 /**
4645   * <b>Fluent Client</b> search parameter constant for <b>definition</b>
4646   * <p>
4647   * Description: <b>The definition / type of the device</b><br>
4648   * Type: <b>reference</b><br>
4649   * Path: <b>Device.definition.reference</b><br>
4650   * </p>
4651   */
4652  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEFINITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEFINITION);
4653
4654/**
4655   * Constant for fluent queries to be used to add include statements. Specifies
4656   * the path value of "<b>Device:definition</b>".
4657   */
4658  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEFINITION = new ca.uhn.fhir.model.api.Include("Device:definition").toLocked();
4659
4660 /**
4661   * Search parameter: <b>device-name</b>
4662   * <p>
4663   * Description: <b>A server defined search that may match any of the string fields in Device.deviceName or Device.type.</b><br>
4664   * Type: <b>string</b><br>
4665   * Path: <b>Device.deviceName.name | Device.type.coding.display | Device.type.text</b><br>
4666   * </p>
4667   */
4668  @SearchParamDefinition(name="device-name", path="Device.deviceName.name | Device.type.coding.display | Device.type.text", description="A server defined search that may match any of the string fields in Device.deviceName or Device.type.", type="string" )
4669  public static final String SP_DEVICE_NAME = "device-name";
4670 /**
4671   * <b>Fluent Client</b> search parameter constant for <b>device-name</b>
4672   * <p>
4673   * Description: <b>A server defined search that may match any of the string fields in Device.deviceName or Device.type.</b><br>
4674   * Type: <b>string</b><br>
4675   * Path: <b>Device.deviceName.name | Device.type.coding.display | Device.type.text</b><br>
4676   * </p>
4677   */
4678  public static final ca.uhn.fhir.rest.gclient.StringClientParam DEVICE_NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DEVICE_NAME);
4679
4680 /**
4681   * Search parameter: <b>expiration-date</b>
4682   * <p>
4683   * Description: <b>The expiration date of the device</b><br>
4684   * Type: <b>date</b><br>
4685   * Path: <b>Device.expirationDate</b><br>
4686   * </p>
4687   */
4688  @SearchParamDefinition(name="expiration-date", path="Device.expirationDate", description="The expiration date of the device", type="date" )
4689  public static final String SP_EXPIRATION_DATE = "expiration-date";
4690 /**
4691   * <b>Fluent Client</b> search parameter constant for <b>expiration-date</b>
4692   * <p>
4693   * Description: <b>The expiration date of the device</b><br>
4694   * Type: <b>date</b><br>
4695   * Path: <b>Device.expirationDate</b><br>
4696   * </p>
4697   */
4698  public static final ca.uhn.fhir.rest.gclient.DateClientParam EXPIRATION_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EXPIRATION_DATE);
4699
4700 /**
4701   * Search parameter: <b>identifier</b>
4702   * <p>
4703   * Description: <b>Instance id from manufacturer, owner, and others</b><br>
4704   * Type: <b>token</b><br>
4705   * Path: <b>Device.identifier</b><br>
4706   * </p>
4707   */
4708  @SearchParamDefinition(name="identifier", path="Device.identifier", description="Instance id from manufacturer, owner, and others", type="token" )
4709  public static final String SP_IDENTIFIER = "identifier";
4710 /**
4711   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4712   * <p>
4713   * Description: <b>Instance id from manufacturer, owner, and others</b><br>
4714   * Type: <b>token</b><br>
4715   * Path: <b>Device.identifier</b><br>
4716   * </p>
4717   */
4718  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4719
4720 /**
4721   * Search parameter: <b>location</b>
4722   * <p>
4723   * Description: <b>A location, where the resource is found</b><br>
4724   * Type: <b>reference</b><br>
4725   * Path: <b>Device.location</b><br>
4726   * </p>
4727   */
4728  @SearchParamDefinition(name="location", path="Device.location", description="A location, where the resource is found", type="reference", target={Location.class } )
4729  public static final String SP_LOCATION = "location";
4730 /**
4731   * <b>Fluent Client</b> search parameter constant for <b>location</b>
4732   * <p>
4733   * Description: <b>A location, where the resource is found</b><br>
4734   * Type: <b>reference</b><br>
4735   * Path: <b>Device.location</b><br>
4736   * </p>
4737   */
4738  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION);
4739
4740/**
4741   * Constant for fluent queries to be used to add include statements. Specifies
4742   * the path value of "<b>Device:location</b>".
4743   */
4744  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Device:location").toLocked();
4745
4746 /**
4747   * Search parameter: <b>lot-number</b>
4748   * <p>
4749   * Description: <b>The lot number of the device</b><br>
4750   * Type: <b>string</b><br>
4751   * Path: <b>Device.lotNumber</b><br>
4752   * </p>
4753   */
4754  @SearchParamDefinition(name="lot-number", path="Device.lotNumber", description="The lot number of the device", type="string" )
4755  public static final String SP_LOT_NUMBER = "lot-number";
4756 /**
4757   * <b>Fluent Client</b> search parameter constant for <b>lot-number</b>
4758   * <p>
4759   * Description: <b>The lot number of the device</b><br>
4760   * Type: <b>string</b><br>
4761   * Path: <b>Device.lotNumber</b><br>
4762   * </p>
4763   */
4764  public static final ca.uhn.fhir.rest.gclient.StringClientParam LOT_NUMBER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_LOT_NUMBER);
4765
4766 /**
4767   * Search parameter: <b>manufacture-date</b>
4768   * <p>
4769   * Description: <b>The manufacture date of the device</b><br>
4770   * Type: <b>date</b><br>
4771   * Path: <b>Device.manufactureDate</b><br>
4772   * </p>
4773   */
4774  @SearchParamDefinition(name="manufacture-date", path="Device.manufactureDate", description="The manufacture date of the device", type="date" )
4775  public static final String SP_MANUFACTURE_DATE = "manufacture-date";
4776 /**
4777   * <b>Fluent Client</b> search parameter constant for <b>manufacture-date</b>
4778   * <p>
4779   * Description: <b>The manufacture date of the device</b><br>
4780   * Type: <b>date</b><br>
4781   * Path: <b>Device.manufactureDate</b><br>
4782   * </p>
4783   */
4784  public static final ca.uhn.fhir.rest.gclient.DateClientParam MANUFACTURE_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_MANUFACTURE_DATE);
4785
4786 /**
4787   * Search parameter: <b>manufacturer</b>
4788   * <p>
4789   * Description: <b>The manufacturer of the device</b><br>
4790   * Type: <b>string</b><br>
4791   * Path: <b>Device.manufacturer</b><br>
4792   * </p>
4793   */
4794  @SearchParamDefinition(name="manufacturer", path="Device.manufacturer", description="The manufacturer of the device", type="string" )
4795  public static final String SP_MANUFACTURER = "manufacturer";
4796 /**
4797   * <b>Fluent Client</b> search parameter constant for <b>manufacturer</b>
4798   * <p>
4799   * Description: <b>The manufacturer of the device</b><br>
4800   * Type: <b>string</b><br>
4801   * Path: <b>Device.manufacturer</b><br>
4802   * </p>
4803   */
4804  public static final ca.uhn.fhir.rest.gclient.StringClientParam MANUFACTURER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_MANUFACTURER);
4805
4806 /**
4807   * Search parameter: <b>model</b>
4808   * <p>
4809   * Description: <b>The model of the device</b><br>
4810   * Type: <b>string</b><br>
4811   * Path: <b>Device.modelNumber</b><br>
4812   * </p>
4813   */
4814  @SearchParamDefinition(name="model", path="Device.modelNumber", description="The model of the device", type="string" )
4815  public static final String SP_MODEL = "model";
4816 /**
4817   * <b>Fluent Client</b> search parameter constant for <b>model</b>
4818   * <p>
4819   * Description: <b>The model of the device</b><br>
4820   * Type: <b>string</b><br>
4821   * Path: <b>Device.modelNumber</b><br>
4822   * </p>
4823   */
4824  public static final ca.uhn.fhir.rest.gclient.StringClientParam MODEL = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_MODEL);
4825
4826 /**
4827   * Search parameter: <b>organization</b>
4828   * <p>
4829   * Description: <b>The organization responsible for the device</b><br>
4830   * Type: <b>reference</b><br>
4831   * Path: <b>Device.owner</b><br>
4832   * </p>
4833   */
4834  @SearchParamDefinition(name="organization", path="Device.owner", description="The organization responsible for the device", type="reference", target={Organization.class } )
4835  public static final String SP_ORGANIZATION = "organization";
4836 /**
4837   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
4838   * <p>
4839   * Description: <b>The organization responsible for the device</b><br>
4840   * Type: <b>reference</b><br>
4841   * Path: <b>Device.owner</b><br>
4842   * </p>
4843   */
4844  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
4845
4846/**
4847   * Constant for fluent queries to be used to add include statements. Specifies
4848   * the path value of "<b>Device:organization</b>".
4849   */
4850  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Device:organization").toLocked();
4851
4852 /**
4853   * Search parameter: <b>parent</b>
4854   * <p>
4855   * Description: <b>The parent device</b><br>
4856   * Type: <b>reference</b><br>
4857   * Path: <b>Device.parent</b><br>
4858   * </p>
4859   */
4860  @SearchParamDefinition(name="parent", path="Device.parent", description="The parent device", type="reference", target={Device.class } )
4861  public static final String SP_PARENT = "parent";
4862 /**
4863   * <b>Fluent Client</b> search parameter constant for <b>parent</b>
4864   * <p>
4865   * Description: <b>The parent device</b><br>
4866   * Type: <b>reference</b><br>
4867   * Path: <b>Device.parent</b><br>
4868   * </p>
4869   */
4870  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT);
4871
4872/**
4873   * Constant for fluent queries to be used to add include statements. Specifies
4874   * the path value of "<b>Device:parent</b>".
4875   */
4876  public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("Device:parent").toLocked();
4877
4878 /**
4879   * Search parameter: <b>patient</b>
4880   * <p>
4881   * Description: <b>Patient information, if the resource is affixed to a person</b><br>
4882   * Type: <b>reference</b><br>
4883   * Path: <b>Device.subject.where(resolve() is Patient)</b><br>
4884   * </p>
4885   */
4886  @SearchParamDefinition(name="patient", path="Device.subject.where(resolve() is Patient)", description="Patient information, if the resource is affixed to a person", type="reference", target={Patient.class, Person.class, Practitioner.class } )
4887  public static final String SP_PATIENT = "patient";
4888 /**
4889   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
4890   * <p>
4891   * Description: <b>Patient information, if the resource is affixed to a person</b><br>
4892   * Type: <b>reference</b><br>
4893   * Path: <b>Device.subject.where(resolve() is Patient)</b><br>
4894   * </p>
4895   */
4896  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
4897
4898/**
4899   * Constant for fluent queries to be used to add include statements. Specifies
4900   * the path value of "<b>Device:patient</b>".
4901   */
4902  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Device:patient").toLocked();
4903
4904 /**
4905   * Search parameter: <b>serial-number</b>
4906   * <p>
4907   * Description: <b>The serial number of the device</b><br>
4908   * Type: <b>string</b><br>
4909   * Path: <b>Device.serialNumber</b><br>
4910   * </p>
4911   */
4912  @SearchParamDefinition(name="serial-number", path="Device.serialNumber", description="The serial number of the device", type="string" )
4913  public static final String SP_SERIAL_NUMBER = "serial-number";
4914 /**
4915   * <b>Fluent Client</b> search parameter constant for <b>serial-number</b>
4916   * <p>
4917   * Description: <b>The serial number of the device</b><br>
4918   * Type: <b>string</b><br>
4919   * Path: <b>Device.serialNumber</b><br>
4920   * </p>
4921   */
4922  public static final ca.uhn.fhir.rest.gclient.StringClientParam SERIAL_NUMBER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_SERIAL_NUMBER);
4923
4924 /**
4925   * Search parameter: <b>status</b>
4926   * <p>
4927   * Description: <b>active | inactive | entered-in-error | unknown</b><br>
4928   * Type: <b>token</b><br>
4929   * Path: <b>Device.status</b><br>
4930   * </p>
4931   */
4932  @SearchParamDefinition(name="status", path="Device.status", description="active | inactive | entered-in-error | unknown", type="token" )
4933  public static final String SP_STATUS = "status";
4934 /**
4935   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4936   * <p>
4937   * Description: <b>active | inactive | entered-in-error | unknown</b><br>
4938   * Type: <b>token</b><br>
4939   * Path: <b>Device.status</b><br>
4940   * </p>
4941   */
4942  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4943
4944 /**
4945   * Search parameter: <b>subject</b>
4946   * <p>
4947   * Description: <b>Subject information, to which the device is associated of affixed</b><br>
4948   * Type: <b>reference</b><br>
4949   * Path: <b>Device.subject</b><br>
4950   * </p>
4951   */
4952  @SearchParamDefinition(name="subject", path="Device.subject", description="Subject information, to which the device is associated of affixed", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Patient.class, Person.class, Practitioner.class } )
4953  public static final String SP_SUBJECT = "subject";
4954 /**
4955   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
4956   * <p>
4957   * Description: <b>Subject information, to which the device is associated of affixed</b><br>
4958   * Type: <b>reference</b><br>
4959   * Path: <b>Device.subject</b><br>
4960   * </p>
4961   */
4962  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
4963
4964/**
4965   * Constant for fluent queries to be used to add include statements. Specifies
4966   * the path value of "<b>Device:subject</b>".
4967   */
4968  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Device:subject").toLocked();
4969
4970 /**
4971   * Search parameter: <b>type</b>
4972   * <p>
4973   * Description: <b>The type of the device</b><br>
4974   * Type: <b>token</b><br>
4975   * Path: <b>Device.type</b><br>
4976   * </p>
4977   */
4978  @SearchParamDefinition(name="type", path="Device.type", description="The type of the device", type="token" )
4979  public static final String SP_TYPE = "type";
4980 /**
4981   * <b>Fluent Client</b> search parameter constant for <b>type</b>
4982   * <p>
4983   * Description: <b>The type of the device</b><br>
4984   * Type: <b>token</b><br>
4985   * Path: <b>Device.type</b><br>
4986   * </p>
4987   */
4988  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
4989
4990 /**
4991   * Search parameter: <b>udi-carrier</b>
4992   * <p>
4993   * Description: <b>UDI Barcode (RFID or other technology) string in *HRF* format.</b><br>
4994   * Type: <b>string</b><br>
4995   * Path: <b>Device.udiCarrier.carrierHRF</b><br>
4996   * </p>
4997   */
4998  @SearchParamDefinition(name="udi-carrier", path="Device.udiCarrier.carrierHRF", description="UDI Barcode (RFID or other technology) string in *HRF* format.", type="string" )
4999  public static final String SP_UDI_CARRIER = "udi-carrier";
5000 /**
5001   * <b>Fluent Client</b> search parameter constant for <b>udi-carrier</b>
5002   * <p>
5003   * Description: <b>UDI Barcode (RFID or other technology) string in *HRF* format.</b><br>
5004   * Type: <b>string</b><br>
5005   * Path: <b>Device.udiCarrier.carrierHRF</b><br>
5006   * </p>
5007   */
5008  public static final ca.uhn.fhir.rest.gclient.StringClientParam UDI_CARRIER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_UDI_CARRIER);
5009
5010 /**
5011   * Search parameter: <b>udi-di</b>
5012   * <p>
5013   * Description: <b>The udi Device Identifier (DI)</b><br>
5014   * Type: <b>string</b><br>
5015   * Path: <b>Device.udiCarrier.deviceIdentifier</b><br>
5016   * </p>
5017   */
5018  @SearchParamDefinition(name="udi-di", path="Device.udiCarrier.deviceIdentifier", description="The udi Device Identifier (DI)", type="string" )
5019  public static final String SP_UDI_DI = "udi-di";
5020 /**
5021   * <b>Fluent Client</b> search parameter constant for <b>udi-di</b>
5022   * <p>
5023   * Description: <b>The udi Device Identifier (DI)</b><br>
5024   * Type: <b>string</b><br>
5025   * Path: <b>Device.udiCarrier.deviceIdentifier</b><br>
5026   * </p>
5027   */
5028  public static final ca.uhn.fhir.rest.gclient.StringClientParam UDI_DI = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_UDI_DI);
5029
5030 /**
5031   * Search parameter: <b>url</b>
5032   * <p>
5033   * Description: <b>Network address to contact device</b><br>
5034   * Type: <b>uri</b><br>
5035   * Path: <b>Device.url</b><br>
5036   * </p>
5037   */
5038  @SearchParamDefinition(name="url", path="Device.url", description="Network address to contact device", type="uri" )
5039  public static final String SP_URL = "url";
5040 /**
5041   * <b>Fluent Client</b> search parameter constant for <b>url</b>
5042   * <p>
5043   * Description: <b>Network address to contact device</b><br>
5044   * Type: <b>uri</b><br>
5045   * Path: <b>Device.url</b><br>
5046   * </p>
5047   */
5048  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
5049
5050 /**
5051   * Search parameter: <b>version</b>
5052   * <p>
5053   * Description: <b>The specific version of the device</b><br>
5054   * Type: <b>string</b><br>
5055   * Path: <b>Device.version.value</b><br>
5056   * </p>
5057   */
5058  @SearchParamDefinition(name="version", path="Device.version.value", description="The specific version of the device", type="string" )
5059  public static final String SP_VERSION = "version";
5060 /**
5061   * <b>Fluent Client</b> search parameter constant for <b>version</b>
5062   * <p>
5063   * Description: <b>The specific version of the device</b><br>
5064   * Type: <b>string</b><br>
5065   * Path: <b>Device.version.value</b><br>
5066   * </p>
5067   */
5068  public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION);
5069
5070 /**
5071   * Search parameter: <b>din</b>
5072   * <p>
5073   * Description: <b>The donation identification number (DIN)</b><br>
5074   * Type: <b>token</b><br>
5075   * Path: <b>Device.extension('http://hl7.org/fhir/SearchParameter/device-extensions-Device-din')</b><br>
5076   * </p>
5077   */
5078  @SearchParamDefinition(name="din", path="Device.extension('http://hl7.org/fhir/SearchParameter/device-extensions-Device-din')", description="The donation identification number (DIN)", type="token" )
5079  public static final String SP_DIN = "din";
5080 /**
5081   * <b>Fluent Client</b> search parameter constant for <b>din</b>
5082   * <p>
5083   * Description: <b>The donation identification number (DIN)</b><br>
5084   * Type: <b>token</b><br>
5085   * Path: <b>Device.extension('http://hl7.org/fhir/SearchParameter/device-extensions-Device-din')</b><br>
5086   * </p>
5087   */
5088  public static final ca.uhn.fhir.rest.gclient.TokenClientParam DIN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DIN);
5089
5090
5091}
5092