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