001package org.hl7.fhir.r5.model;
002
003
004/*
005 * #%L
006 * org.hl7.fhir.r5
007 * %%
008 * Copyright (C) 2014 - 2019 Health Level 7
009 * %%
010 * Licensed under the Apache License, Version 2.0 (the \"License\");
011 * you may not use this file except in compliance with the License.
012 * You may obtain a copy of the License at
013 * 
014 *      http://www.apache.org/licenses/LICENSE-2.0
015 * 
016 * Unless required by applicable law or agreed to in writing, software
017 * distributed under the License is distributed on an \"AS IS\" BASIS,
018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
019 * See the License for the specific language governing permissions and
020 * limitations under the License.
021 * #L%
022 */
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, \
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this \
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, \
034     this list of conditions and the following disclaimer in the documentation \
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
049  POSSIBILITY OF SUCH DAMAGE.
050  */
051
052// Generated on Tue, Dec 31, 2019 12:12+1100 for FHIR vcurrent
053
054import java.util.ArrayList;
055import java.util.Date;
056import java.util.List;
057import org.hl7.fhir.utilities.Utilities;
058import org.hl7.fhir.r5.model.Enumerations.*;
059import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
060import org.hl7.fhir.exceptions.FHIRException;
061import org.hl7.fhir.instance.model.api.ICompositeType;
062import ca.uhn.fhir.model.api.annotation.ResourceDef;
063import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
064import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
065import ca.uhn.fhir.model.api.annotation.Child;
066import ca.uhn.fhir.model.api.annotation.ChildOrder;
067import ca.uhn.fhir.model.api.annotation.Description;
068import ca.uhn.fhir.model.api.annotation.Block;
069
070/**
071 * A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.
072 */
073@ResourceDef(name="Device", profile="http://hl7.org/fhir/StructureDefinition/Device")
074public class Device extends DomainResource {
075
076    public enum FHIRDeviceStatus {
077        /**
078         * The device is available for use.  Note: For *implanted devices*  this means that the device is implanted in the patient.
079         */
080        ACTIVE, 
081        /**
082         * The device is no longer available for use (e.g. lost, expired, damaged).  Note: For *implanted devices*  this means that the device has been removed from the patient.
083         */
084        INACTIVE, 
085        /**
086         * The device was entered in error and voided.
087         */
088        ENTEREDINERROR, 
089        /**
090         * The status of the device has not been determined.
091         */
092        UNKNOWN, 
093        /**
094         * added to help the parsers with the generic types
095         */
096        NULL;
097        public static FHIRDeviceStatus fromCode(String codeString) throws FHIRException {
098            if (codeString == null || "".equals(codeString))
099                return null;
100        if ("active".equals(codeString))
101          return ACTIVE;
102        if ("inactive".equals(codeString))
103          return INACTIVE;
104        if ("entered-in-error".equals(codeString))
105          return ENTEREDINERROR;
106        if ("unknown".equals(codeString))
107          return UNKNOWN;
108        if (Configuration.isAcceptInvalidEnums())
109          return null;
110        else
111          throw new FHIRException("Unknown FHIRDeviceStatus code '"+codeString+"'");
112        }
113        public String toCode() {
114          switch (this) {
115            case ACTIVE: return "active";
116            case INACTIVE: return "inactive";
117            case ENTEREDINERROR: return "entered-in-error";
118            case UNKNOWN: return "unknown";
119            default: return "?";
120          }
121        }
122        public String getSystem() {
123          switch (this) {
124            case ACTIVE: return "http://hl7.org/fhir/device-status";
125            case INACTIVE: return "http://hl7.org/fhir/device-status";
126            case ENTEREDINERROR: return "http://hl7.org/fhir/device-status";
127            case UNKNOWN: return "http://hl7.org/fhir/device-status";
128            default: return "?";
129          }
130        }
131        public String getDefinition() {
132          switch (this) {
133            case ACTIVE: return "The device is available for use.  Note: For *implanted devices*  this means that the device is implanted in the patient.";
134            case INACTIVE: return "The device is no longer available for use (e.g. lost, expired, damaged).  Note: For *implanted devices*  this means that the device has been removed from the patient.";
135            case ENTEREDINERROR: return "The device was entered in error and voided.";
136            case UNKNOWN: return "The status of the device has not been determined.";
137            default: return "?";
138          }
139        }
140        public String getDisplay() {
141          switch (this) {
142            case ACTIVE: return "Active";
143            case INACTIVE: return "Inactive";
144            case ENTEREDINERROR: return "Entered in Error";
145            case UNKNOWN: return "Unknown";
146            default: return "?";
147          }
148        }
149    }
150
151  public static class FHIRDeviceStatusEnumFactory implements EnumFactory<FHIRDeviceStatus> {
152    public FHIRDeviceStatus fromCode(String codeString) throws IllegalArgumentException {
153      if (codeString == null || "".equals(codeString))
154            if (codeString == null || "".equals(codeString))
155                return null;
156        if ("active".equals(codeString))
157          return FHIRDeviceStatus.ACTIVE;
158        if ("inactive".equals(codeString))
159          return FHIRDeviceStatus.INACTIVE;
160        if ("entered-in-error".equals(codeString))
161          return FHIRDeviceStatus.ENTEREDINERROR;
162        if ("unknown".equals(codeString))
163          return FHIRDeviceStatus.UNKNOWN;
164        throw new IllegalArgumentException("Unknown FHIRDeviceStatus code '"+codeString+"'");
165        }
166        public Enumeration<FHIRDeviceStatus> fromType(Base code) throws FHIRException {
167          if (code == null)
168            return null;
169          if (code.isEmpty())
170            return new Enumeration<FHIRDeviceStatus>(this);
171          String codeString = ((PrimitiveType) code).asStringValue();
172          if (codeString == null || "".equals(codeString))
173            return null;
174        if ("active".equals(codeString))
175          return new Enumeration<FHIRDeviceStatus>(this, FHIRDeviceStatus.ACTIVE);
176        if ("inactive".equals(codeString))
177          return new Enumeration<FHIRDeviceStatus>(this, FHIRDeviceStatus.INACTIVE);
178        if ("entered-in-error".equals(codeString))
179          return new Enumeration<FHIRDeviceStatus>(this, FHIRDeviceStatus.ENTEREDINERROR);
180        if ("unknown".equals(codeString))
181          return new Enumeration<FHIRDeviceStatus>(this, FHIRDeviceStatus.UNKNOWN);
182        throw new FHIRException("Unknown FHIRDeviceStatus code '"+codeString+"'");
183        }
184    public String toCode(FHIRDeviceStatus code) {
185      if (code == FHIRDeviceStatus.ACTIVE)
186        return "active";
187      if (code == FHIRDeviceStatus.INACTIVE)
188        return "inactive";
189      if (code == FHIRDeviceStatus.ENTEREDINERROR)
190        return "entered-in-error";
191      if (code == FHIRDeviceStatus.UNKNOWN)
192        return "unknown";
193      return "?";
194      }
195    public String toSystem(FHIRDeviceStatus code) {
196      return code.getSystem();
197      }
198    }
199
200    public enum UDIEntryType {
201        /**
202         * a barcodescanner captured the data from the device label.
203         */
204        BARCODE, 
205        /**
206         * An RFID chip reader captured the data from the device label.
207         */
208        RFID, 
209        /**
210         * The data was read from the label by a person and manually entered. (e.g.  via a keyboard).
211         */
212        MANUAL, 
213        /**
214         * The data originated from a patient's implant card and was read by an operator.
215         */
216        CARD, 
217        /**
218         * The data originated from a patient source and was not directly scanned or read from a label or card.
219         */
220        SELFREPORTED, 
221        /**
222         * The method of data capture has not been determined.
223         */
224        UNKNOWN, 
225        /**
226         * added to help the parsers with the generic types
227         */
228        NULL;
229        public static UDIEntryType fromCode(String codeString) throws FHIRException {
230            if (codeString == null || "".equals(codeString))
231                return null;
232        if ("barcode".equals(codeString))
233          return BARCODE;
234        if ("rfid".equals(codeString))
235          return RFID;
236        if ("manual".equals(codeString))
237          return MANUAL;
238        if ("card".equals(codeString))
239          return CARD;
240        if ("self-reported".equals(codeString))
241          return SELFREPORTED;
242        if ("unknown".equals(codeString))
243          return UNKNOWN;
244        if (Configuration.isAcceptInvalidEnums())
245          return null;
246        else
247          throw new FHIRException("Unknown UDIEntryType code '"+codeString+"'");
248        }
249        public String toCode() {
250          switch (this) {
251            case BARCODE: return "barcode";
252            case RFID: return "rfid";
253            case MANUAL: return "manual";
254            case CARD: return "card";
255            case SELFREPORTED: return "self-reported";
256            case UNKNOWN: return "unknown";
257            default: return "?";
258          }
259        }
260        public String getSystem() {
261          switch (this) {
262            case BARCODE: return "http://hl7.org/fhir/udi-entry-type";
263            case RFID: return "http://hl7.org/fhir/udi-entry-type";
264            case MANUAL: return "http://hl7.org/fhir/udi-entry-type";
265            case CARD: return "http://hl7.org/fhir/udi-entry-type";
266            case SELFREPORTED: return "http://hl7.org/fhir/udi-entry-type";
267            case UNKNOWN: return "http://hl7.org/fhir/udi-entry-type";
268            default: return "?";
269          }
270        }
271        public String getDefinition() {
272          switch (this) {
273            case BARCODE: return "a barcodescanner captured the data from the device label.";
274            case RFID: return "An RFID chip reader captured the data from the device label.";
275            case MANUAL: return "The data was read from the label by a person and manually entered. (e.g.  via a keyboard).";
276            case CARD: return "The data originated from a patient's implant card and was read by an operator.";
277            case SELFREPORTED: return "The data originated from a patient source and was not directly scanned or read from a label or card.";
278            case UNKNOWN: return "The method of data capture has not been determined.";
279            default: return "?";
280          }
281        }
282        public String getDisplay() {
283          switch (this) {
284            case BARCODE: return "Barcode";
285            case RFID: return "RFID";
286            case MANUAL: return "Manual";
287            case CARD: return "Card";
288            case SELFREPORTED: return "Self Reported";
289            case UNKNOWN: return "Unknown";
290            default: return "?";
291          }
292        }
293    }
294
295  public static class UDIEntryTypeEnumFactory implements EnumFactory<UDIEntryType> {
296    public UDIEntryType fromCode(String codeString) throws IllegalArgumentException {
297      if (codeString == null || "".equals(codeString))
298            if (codeString == null || "".equals(codeString))
299                return null;
300        if ("barcode".equals(codeString))
301          return UDIEntryType.BARCODE;
302        if ("rfid".equals(codeString))
303          return UDIEntryType.RFID;
304        if ("manual".equals(codeString))
305          return UDIEntryType.MANUAL;
306        if ("card".equals(codeString))
307          return UDIEntryType.CARD;
308        if ("self-reported".equals(codeString))
309          return UDIEntryType.SELFREPORTED;
310        if ("unknown".equals(codeString))
311          return UDIEntryType.UNKNOWN;
312        throw new IllegalArgumentException("Unknown UDIEntryType code '"+codeString+"'");
313        }
314        public Enumeration<UDIEntryType> fromType(Base code) throws FHIRException {
315          if (code == null)
316            return null;
317          if (code.isEmpty())
318            return new Enumeration<UDIEntryType>(this);
319          String codeString = ((PrimitiveType) code).asStringValue();
320          if (codeString == null || "".equals(codeString))
321            return null;
322        if ("barcode".equals(codeString))
323          return new Enumeration<UDIEntryType>(this, UDIEntryType.BARCODE);
324        if ("rfid".equals(codeString))
325          return new Enumeration<UDIEntryType>(this, UDIEntryType.RFID);
326        if ("manual".equals(codeString))
327          return new Enumeration<UDIEntryType>(this, UDIEntryType.MANUAL);
328        if ("card".equals(codeString))
329          return new Enumeration<UDIEntryType>(this, UDIEntryType.CARD);
330        if ("self-reported".equals(codeString))
331          return new Enumeration<UDIEntryType>(this, UDIEntryType.SELFREPORTED);
332        if ("unknown".equals(codeString))
333          return new Enumeration<UDIEntryType>(this, UDIEntryType.UNKNOWN);
334        throw new FHIRException("Unknown UDIEntryType code '"+codeString+"'");
335        }
336    public String toCode(UDIEntryType code) {
337      if (code == UDIEntryType.BARCODE)
338        return "barcode";
339      if (code == UDIEntryType.RFID)
340        return "rfid";
341      if (code == UDIEntryType.MANUAL)
342        return "manual";
343      if (code == UDIEntryType.CARD)
344        return "card";
345      if (code == UDIEntryType.SELFREPORTED)
346        return "self-reported";
347      if (code == UDIEntryType.UNKNOWN)
348        return "unknown";
349      return "?";
350      }
351    public String toSystem(UDIEntryType code) {
352      return code.getSystem();
353      }
354    }
355
356    @Block()
357    public static class DeviceUdiCarrierComponent extends BackboneElement implements IBaseBackboneElement {
358        /**
359         * 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.
360         */
361        @Child(name = "deviceIdentifier", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
362        @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." )
363        protected StringType deviceIdentifier;
364
365        /**
366         * Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :
3671) GS1: 
368http://hl7.org/fhir/NamingSystem/gs1-di, 
3692) HIBCC:
370http://hl7.org/fhir/NamingSystem/hibcc-dI, 
3713) ICCBBA for blood containers:
372http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
3734) ICCBA for other devices:
374http://hl7.org/fhir/NamingSystem/iccbba-other-di.
375         */
376        @Child(name = "issuer", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false)
377        @Description(shortDefinition="UDI Issuing Organization", formalDefinition="Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :\n1) GS1: \nhttp://hl7.org/fhir/NamingSystem/gs1-di, \n2) HIBCC:\nhttp://hl7.org/fhir/NamingSystem/hibcc-dI, \n3) ICCBBA for blood containers:\nhttp://hl7.org/fhir/NamingSystem/iccbba-blood-di, \n4) ICCBA for other devices:\nhttp://hl7.org/fhir/NamingSystem/iccbba-other-di." )
378        protected UriType issuer;
379
380        /**
381         * 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/fda-udi.
382         */
383        @Child(name = "jurisdiction", type = {UriType.class}, order=3, min=0, max=1, modifier=false, summary=false)
384        @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/fda-udi." )
385        protected UriType jurisdiction;
386
387        /**
388         * 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.
389         */
390        @Child(name = "carrierAIDC", type = {Base64BinaryType.class}, order=4, min=0, max=1, modifier=false, summary=true)
391        @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." )
392        protected Base64BinaryType carrierAIDC;
393
394        /**
395         * The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.
396         */
397        @Child(name = "carrierHRF", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
398        @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." )
399        protected StringType carrierHRF;
400
401        /**
402         * A coded entry to indicate how the data was entered.
403         */
404        @Child(name = "entryType", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false)
405        @Description(shortDefinition="barcode | rfid | manual +", formalDefinition="A coded entry to indicate how the data was entered." )
406        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/udi-entry-type")
407        protected Enumeration<UDIEntryType> entryType;
408
409        private static final long serialVersionUID = -191630425L;
410
411    /**
412     * Constructor
413     */
414      public DeviceUdiCarrierComponent() {
415        super();
416      }
417
418        /**
419         * @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
420         */
421        public StringType getDeviceIdentifierElement() { 
422          if (this.deviceIdentifier == null)
423            if (Configuration.errorOnAutoCreate())
424              throw new Error("Attempt to auto-create DeviceUdiCarrierComponent.deviceIdentifier");
425            else if (Configuration.doAutoCreate())
426              this.deviceIdentifier = new StringType(); // bb
427          return this.deviceIdentifier;
428        }
429
430        public boolean hasDeviceIdentifierElement() { 
431          return this.deviceIdentifier != null && !this.deviceIdentifier.isEmpty();
432        }
433
434        public boolean hasDeviceIdentifier() { 
435          return this.deviceIdentifier != null && !this.deviceIdentifier.isEmpty();
436        }
437
438        /**
439         * @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
440         */
441        public DeviceUdiCarrierComponent setDeviceIdentifierElement(StringType value) { 
442          this.deviceIdentifier = value;
443          return this;
444        }
445
446        /**
447         * @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.
448         */
449        public String getDeviceIdentifier() { 
450          return this.deviceIdentifier == null ? null : this.deviceIdentifier.getValue();
451        }
452
453        /**
454         * @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.
455         */
456        public DeviceUdiCarrierComponent setDeviceIdentifier(String value) { 
457          if (Utilities.noString(value))
458            this.deviceIdentifier = null;
459          else {
460            if (this.deviceIdentifier == null)
461              this.deviceIdentifier = new StringType();
462            this.deviceIdentifier.setValue(value);
463          }
464          return this;
465        }
466
467        /**
468         * @return {@link #issuer} (Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :
4691) GS1: 
470http://hl7.org/fhir/NamingSystem/gs1-di, 
4712) HIBCC:
472http://hl7.org/fhir/NamingSystem/hibcc-dI, 
4733) ICCBBA for blood containers:
474http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
4754) ICCBA for other devices:
476http://hl7.org/fhir/NamingSystem/iccbba-other-di.). This is the underlying object with id, value and extensions. The accessor "getIssuer" gives direct access to the value
477         */
478        public UriType getIssuerElement() { 
479          if (this.issuer == null)
480            if (Configuration.errorOnAutoCreate())
481              throw new Error("Attempt to auto-create DeviceUdiCarrierComponent.issuer");
482            else if (Configuration.doAutoCreate())
483              this.issuer = new UriType(); // bb
484          return this.issuer;
485        }
486
487        public boolean hasIssuerElement() { 
488          return this.issuer != null && !this.issuer.isEmpty();
489        }
490
491        public boolean hasIssuer() { 
492          return this.issuer != null && !this.issuer.isEmpty();
493        }
494
495        /**
496         * @param value {@link #issuer} (Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :
4971) GS1: 
498http://hl7.org/fhir/NamingSystem/gs1-di, 
4992) HIBCC:
500http://hl7.org/fhir/NamingSystem/hibcc-dI, 
5013) ICCBBA for blood containers:
502http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
5034) ICCBA for other devices:
504http://hl7.org/fhir/NamingSystem/iccbba-other-di.). This is the underlying object with id, value and extensions. The accessor "getIssuer" gives direct access to the value
505         */
506        public DeviceUdiCarrierComponent setIssuerElement(UriType value) { 
507          this.issuer = value;
508          return this;
509        }
510
511        /**
512         * @return Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :
5131) GS1: 
514http://hl7.org/fhir/NamingSystem/gs1-di, 
5152) HIBCC:
516http://hl7.org/fhir/NamingSystem/hibcc-dI, 
5173) ICCBBA for blood containers:
518http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
5194) ICCBA for other devices:
520http://hl7.org/fhir/NamingSystem/iccbba-other-di.
521         */
522        public String getIssuer() { 
523          return this.issuer == null ? null : this.issuer.getValue();
524        }
525
526        /**
527         * @param value Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :
5281) GS1: 
529http://hl7.org/fhir/NamingSystem/gs1-di, 
5302) HIBCC:
531http://hl7.org/fhir/NamingSystem/hibcc-dI, 
5323) ICCBBA for blood containers:
533http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
5344) ICCBA for other devices:
535http://hl7.org/fhir/NamingSystem/iccbba-other-di.
536         */
537        public DeviceUdiCarrierComponent setIssuer(String value) { 
538          if (Utilities.noString(value))
539            this.issuer = null;
540          else {
541            if (this.issuer == null)
542              this.issuer = new UriType();
543            this.issuer.setValue(value);
544          }
545          return this;
546        }
547
548        /**
549         * @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/fda-udi.). This is the underlying object with id, value and extensions. The accessor "getJurisdiction" gives direct access to the value
550         */
551        public UriType getJurisdictionElement() { 
552          if (this.jurisdiction == null)
553            if (Configuration.errorOnAutoCreate())
554              throw new Error("Attempt to auto-create DeviceUdiCarrierComponent.jurisdiction");
555            else if (Configuration.doAutoCreate())
556              this.jurisdiction = new UriType(); // bb
557          return this.jurisdiction;
558        }
559
560        public boolean hasJurisdictionElement() { 
561          return this.jurisdiction != null && !this.jurisdiction.isEmpty();
562        }
563
564        public boolean hasJurisdiction() { 
565          return this.jurisdiction != null && !this.jurisdiction.isEmpty();
566        }
567
568        /**
569         * @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/fda-udi.). This is the underlying object with id, value and extensions. The accessor "getJurisdiction" gives direct access to the value
570         */
571        public DeviceUdiCarrierComponent setJurisdictionElement(UriType value) { 
572          this.jurisdiction = value;
573          return this;
574        }
575
576        /**
577         * @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/fda-udi.
578         */
579        public String getJurisdiction() { 
580          return this.jurisdiction == null ? null : this.jurisdiction.getValue();
581        }
582
583        /**
584         * @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/fda-udi.
585         */
586        public DeviceUdiCarrierComponent setJurisdiction(String value) { 
587          if (Utilities.noString(value))
588            this.jurisdiction = null;
589          else {
590            if (this.jurisdiction == null)
591              this.jurisdiction = new UriType();
592            this.jurisdiction.setValue(value);
593          }
594          return this;
595        }
596
597        /**
598         * @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
599         */
600        public Base64BinaryType getCarrierAIDCElement() { 
601          if (this.carrierAIDC == null)
602            if (Configuration.errorOnAutoCreate())
603              throw new Error("Attempt to auto-create DeviceUdiCarrierComponent.carrierAIDC");
604            else if (Configuration.doAutoCreate())
605              this.carrierAIDC = new Base64BinaryType(); // bb
606          return this.carrierAIDC;
607        }
608
609        public boolean hasCarrierAIDCElement() { 
610          return this.carrierAIDC != null && !this.carrierAIDC.isEmpty();
611        }
612
613        public boolean hasCarrierAIDC() { 
614          return this.carrierAIDC != null && !this.carrierAIDC.isEmpty();
615        }
616
617        /**
618         * @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
619         */
620        public DeviceUdiCarrierComponent setCarrierAIDCElement(Base64BinaryType value) { 
621          this.carrierAIDC = value;
622          return this;
623        }
624
625        /**
626         * @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.
627         */
628        public byte[] getCarrierAIDC() { 
629          return this.carrierAIDC == null ? null : this.carrierAIDC.getValue();
630        }
631
632        /**
633         * @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.
634         */
635        public DeviceUdiCarrierComponent setCarrierAIDC(byte[] value) { 
636          if (value == null)
637            this.carrierAIDC = null;
638          else {
639            if (this.carrierAIDC == null)
640              this.carrierAIDC = new Base64BinaryType();
641            this.carrierAIDC.setValue(value);
642          }
643          return this;
644        }
645
646        /**
647         * @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
648         */
649        public StringType getCarrierHRFElement() { 
650          if (this.carrierHRF == null)
651            if (Configuration.errorOnAutoCreate())
652              throw new Error("Attempt to auto-create DeviceUdiCarrierComponent.carrierHRF");
653            else if (Configuration.doAutoCreate())
654              this.carrierHRF = new StringType(); // bb
655          return this.carrierHRF;
656        }
657
658        public boolean hasCarrierHRFElement() { 
659          return this.carrierHRF != null && !this.carrierHRF.isEmpty();
660        }
661
662        public boolean hasCarrierHRF() { 
663          return this.carrierHRF != null && !this.carrierHRF.isEmpty();
664        }
665
666        /**
667         * @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
668         */
669        public DeviceUdiCarrierComponent setCarrierHRFElement(StringType value) { 
670          this.carrierHRF = value;
671          return this;
672        }
673
674        /**
675         * @return The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.
676         */
677        public String getCarrierHRF() { 
678          return this.carrierHRF == null ? null : this.carrierHRF.getValue();
679        }
680
681        /**
682         * @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.
683         */
684        public DeviceUdiCarrierComponent setCarrierHRF(String value) { 
685          if (Utilities.noString(value))
686            this.carrierHRF = null;
687          else {
688            if (this.carrierHRF == null)
689              this.carrierHRF = new StringType();
690            this.carrierHRF.setValue(value);
691          }
692          return this;
693        }
694
695        /**
696         * @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
697         */
698        public Enumeration<UDIEntryType> getEntryTypeElement() { 
699          if (this.entryType == null)
700            if (Configuration.errorOnAutoCreate())
701              throw new Error("Attempt to auto-create DeviceUdiCarrierComponent.entryType");
702            else if (Configuration.doAutoCreate())
703              this.entryType = new Enumeration<UDIEntryType>(new UDIEntryTypeEnumFactory()); // bb
704          return this.entryType;
705        }
706
707        public boolean hasEntryTypeElement() { 
708          return this.entryType != null && !this.entryType.isEmpty();
709        }
710
711        public boolean hasEntryType() { 
712          return this.entryType != null && !this.entryType.isEmpty();
713        }
714
715        /**
716         * @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
717         */
718        public DeviceUdiCarrierComponent setEntryTypeElement(Enumeration<UDIEntryType> value) { 
719          this.entryType = value;
720          return this;
721        }
722
723        /**
724         * @return A coded entry to indicate how the data was entered.
725         */
726        public UDIEntryType getEntryType() { 
727          return this.entryType == null ? null : this.entryType.getValue();
728        }
729
730        /**
731         * @param value A coded entry to indicate how the data was entered.
732         */
733        public DeviceUdiCarrierComponent setEntryType(UDIEntryType value) { 
734          if (value == null)
735            this.entryType = null;
736          else {
737            if (this.entryType == null)
738              this.entryType = new Enumeration<UDIEntryType>(new UDIEntryTypeEnumFactory());
739            this.entryType.setValue(value);
740          }
741          return this;
742        }
743
744        protected void listChildren(List<Property> children) {
745          super.listChildren(children);
746          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));
747          children.add(new Property("issuer", "uri", "Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :\n1) GS1: \nhttp://hl7.org/fhir/NamingSystem/gs1-di, \n2) HIBCC:\nhttp://hl7.org/fhir/NamingSystem/hibcc-dI, \n3) ICCBBA for blood containers:\nhttp://hl7.org/fhir/NamingSystem/iccbba-blood-di, \n4) ICCBA for other devices:\nhttp://hl7.org/fhir/NamingSystem/iccbba-other-di.", 0, 1, issuer));
748          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/fda-udi.", 0, 1, jurisdiction));
749          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));
750          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));
751          children.add(new Property("entryType", "code", "A coded entry to indicate how the data was entered.", 0, 1, entryType));
752        }
753
754        @Override
755        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
756          switch (_hash) {
757          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);
758          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: \nhttp://hl7.org/fhir/NamingSystem/gs1-di, \n2) HIBCC:\nhttp://hl7.org/fhir/NamingSystem/hibcc-dI, \n3) ICCBBA for blood containers:\nhttp://hl7.org/fhir/NamingSystem/iccbba-blood-di, \n4) ICCBA for other devices:\nhttp://hl7.org/fhir/NamingSystem/iccbba-other-di.", 0, 1, issuer);
759          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/fda-udi.", 0, 1, jurisdiction);
760          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);
761          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);
762          case -479362356: /*entryType*/  return new Property("entryType", "code", "A coded entry to indicate how the data was entered.", 0, 1, entryType);
763          default: return super.getNamedProperty(_hash, _name, _checkValid);
764          }
765
766        }
767
768      @Override
769      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
770        switch (hash) {
771        case 1322005407: /*deviceIdentifier*/ return this.deviceIdentifier == null ? new Base[0] : new Base[] {this.deviceIdentifier}; // StringType
772        case -1179159879: /*issuer*/ return this.issuer == null ? new Base[0] : new Base[] {this.issuer}; // UriType
773        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : new Base[] {this.jurisdiction}; // UriType
774        case -768521825: /*carrierAIDC*/ return this.carrierAIDC == null ? new Base[0] : new Base[] {this.carrierAIDC}; // Base64BinaryType
775        case 806499972: /*carrierHRF*/ return this.carrierHRF == null ? new Base[0] : new Base[] {this.carrierHRF}; // StringType
776        case -479362356: /*entryType*/ return this.entryType == null ? new Base[0] : new Base[] {this.entryType}; // Enumeration<UDIEntryType>
777        default: return super.getProperty(hash, name, checkValid);
778        }
779
780      }
781
782      @Override
783      public Base setProperty(int hash, String name, Base value) throws FHIRException {
784        switch (hash) {
785        case 1322005407: // deviceIdentifier
786          this.deviceIdentifier = TypeConvertor.castToString(value); // StringType
787          return value;
788        case -1179159879: // issuer
789          this.issuer = TypeConvertor.castToUri(value); // UriType
790          return value;
791        case -507075711: // jurisdiction
792          this.jurisdiction = TypeConvertor.castToUri(value); // UriType
793          return value;
794        case -768521825: // carrierAIDC
795          this.carrierAIDC = TypeConvertor.castToBase64Binary(value); // Base64BinaryType
796          return value;
797        case 806499972: // carrierHRF
798          this.carrierHRF = TypeConvertor.castToString(value); // StringType
799          return value;
800        case -479362356: // entryType
801          value = new UDIEntryTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
802          this.entryType = (Enumeration) value; // Enumeration<UDIEntryType>
803          return value;
804        default: return super.setProperty(hash, name, value);
805        }
806
807      }
808
809      @Override
810      public Base setProperty(String name, Base value) throws FHIRException {
811        if (name.equals("deviceIdentifier")) {
812          this.deviceIdentifier = TypeConvertor.castToString(value); // StringType
813        } else if (name.equals("issuer")) {
814          this.issuer = TypeConvertor.castToUri(value); // UriType
815        } else if (name.equals("jurisdiction")) {
816          this.jurisdiction = TypeConvertor.castToUri(value); // UriType
817        } else if (name.equals("carrierAIDC")) {
818          this.carrierAIDC = TypeConvertor.castToBase64Binary(value); // Base64BinaryType
819        } else if (name.equals("carrierHRF")) {
820          this.carrierHRF = TypeConvertor.castToString(value); // StringType
821        } else if (name.equals("entryType")) {
822          value = new UDIEntryTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
823          this.entryType = (Enumeration) value; // Enumeration<UDIEntryType>
824        } else
825          return super.setProperty(name, value);
826        return value;
827      }
828
829      @Override
830      public Base makeProperty(int hash, String name) throws FHIRException {
831        switch (hash) {
832        case 1322005407:  return getDeviceIdentifierElement();
833        case -1179159879:  return getIssuerElement();
834        case -507075711:  return getJurisdictionElement();
835        case -768521825:  return getCarrierAIDCElement();
836        case 806499972:  return getCarrierHRFElement();
837        case -479362356:  return getEntryTypeElement();
838        default: return super.makeProperty(hash, name);
839        }
840
841      }
842
843      @Override
844      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
845        switch (hash) {
846        case 1322005407: /*deviceIdentifier*/ return new String[] {"string"};
847        case -1179159879: /*issuer*/ return new String[] {"uri"};
848        case -507075711: /*jurisdiction*/ return new String[] {"uri"};
849        case -768521825: /*carrierAIDC*/ return new String[] {"base64Binary"};
850        case 806499972: /*carrierHRF*/ return new String[] {"string"};
851        case -479362356: /*entryType*/ return new String[] {"code"};
852        default: return super.getTypesForProperty(hash, name);
853        }
854
855      }
856
857      @Override
858      public Base addChild(String name) throws FHIRException {
859        if (name.equals("deviceIdentifier")) {
860          throw new FHIRException("Cannot call addChild on a primitive type Device.udiCarrier.deviceIdentifier");
861        }
862        else if (name.equals("issuer")) {
863          throw new FHIRException("Cannot call addChild on a primitive type Device.udiCarrier.issuer");
864        }
865        else if (name.equals("jurisdiction")) {
866          throw new FHIRException("Cannot call addChild on a primitive type Device.udiCarrier.jurisdiction");
867        }
868        else if (name.equals("carrierAIDC")) {
869          throw new FHIRException("Cannot call addChild on a primitive type Device.udiCarrier.carrierAIDC");
870        }
871        else if (name.equals("carrierHRF")) {
872          throw new FHIRException("Cannot call addChild on a primitive type Device.udiCarrier.carrierHRF");
873        }
874        else if (name.equals("entryType")) {
875          throw new FHIRException("Cannot call addChild on a primitive type Device.udiCarrier.entryType");
876        }
877        else
878          return super.addChild(name);
879      }
880
881      public DeviceUdiCarrierComponent copy() {
882        DeviceUdiCarrierComponent dst = new DeviceUdiCarrierComponent();
883        copyValues(dst);
884        return dst;
885      }
886
887      public void copyValues(DeviceUdiCarrierComponent dst) {
888        super.copyValues(dst);
889        dst.deviceIdentifier = deviceIdentifier == null ? null : deviceIdentifier.copy();
890        dst.issuer = issuer == null ? null : issuer.copy();
891        dst.jurisdiction = jurisdiction == null ? null : jurisdiction.copy();
892        dst.carrierAIDC = carrierAIDC == null ? null : carrierAIDC.copy();
893        dst.carrierHRF = carrierHRF == null ? null : carrierHRF.copy();
894        dst.entryType = entryType == null ? null : entryType.copy();
895      }
896
897      @Override
898      public boolean equalsDeep(Base other_) {
899        if (!super.equalsDeep(other_))
900          return false;
901        if (!(other_ instanceof DeviceUdiCarrierComponent))
902          return false;
903        DeviceUdiCarrierComponent o = (DeviceUdiCarrierComponent) other_;
904        return compareDeep(deviceIdentifier, o.deviceIdentifier, true) && compareDeep(issuer, o.issuer, true)
905           && compareDeep(jurisdiction, o.jurisdiction, true) && compareDeep(carrierAIDC, o.carrierAIDC, true)
906           && compareDeep(carrierHRF, o.carrierHRF, true) && compareDeep(entryType, o.entryType, true);
907      }
908
909      @Override
910      public boolean equalsShallow(Base other_) {
911        if (!super.equalsShallow(other_))
912          return false;
913        if (!(other_ instanceof DeviceUdiCarrierComponent))
914          return false;
915        DeviceUdiCarrierComponent o = (DeviceUdiCarrierComponent) other_;
916        return compareValues(deviceIdentifier, o.deviceIdentifier, true) && compareValues(issuer, o.issuer, true)
917           && compareValues(jurisdiction, o.jurisdiction, true) && compareValues(carrierAIDC, o.carrierAIDC, true)
918           && compareValues(carrierHRF, o.carrierHRF, true) && compareValues(entryType, o.entryType, true);
919      }
920
921      public boolean isEmpty() {
922        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(deviceIdentifier, issuer, jurisdiction
923          , carrierAIDC, carrierHRF, entryType);
924      }
925
926  public String fhirType() {
927    return "Device.udiCarrier";
928
929  }
930
931  }
932
933    @Block()
934    public static class DeviceDeviceNameComponent extends BackboneElement implements IBaseBackboneElement {
935        /**
936         * The name that identifies the device.
937         */
938        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
939        @Description(shortDefinition="The name that identifies the device", formalDefinition="The name that identifies the device." )
940        protected StringType name;
941
942        /**
943         * The type of deviceName.
944UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.
945         */
946        @Child(name = "type", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false)
947        @Description(shortDefinition="udi-label-name | user-friendly-name | patient-reported-name | manufacturer-name | model-name | other", formalDefinition="The type of deviceName.\nUDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName." )
948        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-nametype")
949        protected Enumeration<DeviceNameType> type;
950
951        private static final long serialVersionUID = 918983440L;
952
953    /**
954     * Constructor
955     */
956      public DeviceDeviceNameComponent() {
957        super();
958      }
959
960    /**
961     * Constructor
962     */
963      public DeviceDeviceNameComponent(String name, DeviceNameType type) {
964        super();
965        this.setName(name);
966        this.setType(type);
967      }
968
969        /**
970         * @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
971         */
972        public StringType getNameElement() { 
973          if (this.name == null)
974            if (Configuration.errorOnAutoCreate())
975              throw new Error("Attempt to auto-create DeviceDeviceNameComponent.name");
976            else if (Configuration.doAutoCreate())
977              this.name = new StringType(); // bb
978          return this.name;
979        }
980
981        public boolean hasNameElement() { 
982          return this.name != null && !this.name.isEmpty();
983        }
984
985        public boolean hasName() { 
986          return this.name != null && !this.name.isEmpty();
987        }
988
989        /**
990         * @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
991         */
992        public DeviceDeviceNameComponent setNameElement(StringType value) { 
993          this.name = value;
994          return this;
995        }
996
997        /**
998         * @return The name that identifies the device.
999         */
1000        public String getName() { 
1001          return this.name == null ? null : this.name.getValue();
1002        }
1003
1004        /**
1005         * @param value The name that identifies the device.
1006         */
1007        public DeviceDeviceNameComponent setName(String value) { 
1008            if (this.name == null)
1009              this.name = new StringType();
1010            this.name.setValue(value);
1011          return this;
1012        }
1013
1014        /**
1015         * @return {@link #type} (The type of deviceName.
1016UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1017         */
1018        public Enumeration<DeviceNameType> getTypeElement() { 
1019          if (this.type == null)
1020            if (Configuration.errorOnAutoCreate())
1021              throw new Error("Attempt to auto-create DeviceDeviceNameComponent.type");
1022            else if (Configuration.doAutoCreate())
1023              this.type = new Enumeration<DeviceNameType>(new DeviceNameTypeEnumFactory()); // bb
1024          return this.type;
1025        }
1026
1027        public boolean hasTypeElement() { 
1028          return this.type != null && !this.type.isEmpty();
1029        }
1030
1031        public boolean hasType() { 
1032          return this.type != null && !this.type.isEmpty();
1033        }
1034
1035        /**
1036         * @param value {@link #type} (The type of deviceName.
1037UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1038         */
1039        public DeviceDeviceNameComponent setTypeElement(Enumeration<DeviceNameType> value) { 
1040          this.type = value;
1041          return this;
1042        }
1043
1044        /**
1045         * @return The type of deviceName.
1046UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.
1047         */
1048        public DeviceNameType getType() { 
1049          return this.type == null ? null : this.type.getValue();
1050        }
1051
1052        /**
1053         * @param value The type of deviceName.
1054UDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.
1055         */
1056        public DeviceDeviceNameComponent setType(DeviceNameType value) { 
1057            if (this.type == null)
1058              this.type = new Enumeration<DeviceNameType>(new DeviceNameTypeEnumFactory());
1059            this.type.setValue(value);
1060          return this;
1061        }
1062
1063        protected void listChildren(List<Property> children) {
1064          super.listChildren(children);
1065          children.add(new Property("name", "string", "The name that identifies the device.", 0, 1, name));
1066          children.add(new Property("type", "code", "The type of deviceName.\nUDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.", 0, 1, type));
1067        }
1068
1069        @Override
1070        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1071          switch (_hash) {
1072          case 3373707: /*name*/  return new Property("name", "string", "The name that identifies the device.", 0, 1, name);
1073          case 3575610: /*type*/  return new Property("type", "code", "The type of deviceName.\nUDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.", 0, 1, type);
1074          default: return super.getNamedProperty(_hash, _name, _checkValid);
1075          }
1076
1077        }
1078
1079      @Override
1080      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1081        switch (hash) {
1082        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1083        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<DeviceNameType>
1084        default: return super.getProperty(hash, name, checkValid);
1085        }
1086
1087      }
1088
1089      @Override
1090      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1091        switch (hash) {
1092        case 3373707: // name
1093          this.name = TypeConvertor.castToString(value); // StringType
1094          return value;
1095        case 3575610: // type
1096          value = new DeviceNameTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1097          this.type = (Enumeration) value; // Enumeration<DeviceNameType>
1098          return value;
1099        default: return super.setProperty(hash, name, value);
1100        }
1101
1102      }
1103
1104      @Override
1105      public Base setProperty(String name, Base value) throws FHIRException {
1106        if (name.equals("name")) {
1107          this.name = TypeConvertor.castToString(value); // StringType
1108        } else if (name.equals("type")) {
1109          value = new DeviceNameTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1110          this.type = (Enumeration) value; // Enumeration<DeviceNameType>
1111        } else
1112          return super.setProperty(name, value);
1113        return value;
1114      }
1115
1116      @Override
1117      public Base makeProperty(int hash, String name) throws FHIRException {
1118        switch (hash) {
1119        case 3373707:  return getNameElement();
1120        case 3575610:  return getTypeElement();
1121        default: return super.makeProperty(hash, name);
1122        }
1123
1124      }
1125
1126      @Override
1127      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1128        switch (hash) {
1129        case 3373707: /*name*/ return new String[] {"string"};
1130        case 3575610: /*type*/ return new String[] {"code"};
1131        default: return super.getTypesForProperty(hash, name);
1132        }
1133
1134      }
1135
1136      @Override
1137      public Base addChild(String name) throws FHIRException {
1138        if (name.equals("name")) {
1139          throw new FHIRException("Cannot call addChild on a primitive type Device.deviceName.name");
1140        }
1141        else if (name.equals("type")) {
1142          throw new FHIRException("Cannot call addChild on a primitive type Device.deviceName.type");
1143        }
1144        else
1145          return super.addChild(name);
1146      }
1147
1148      public DeviceDeviceNameComponent copy() {
1149        DeviceDeviceNameComponent dst = new DeviceDeviceNameComponent();
1150        copyValues(dst);
1151        return dst;
1152      }
1153
1154      public void copyValues(DeviceDeviceNameComponent dst) {
1155        super.copyValues(dst);
1156        dst.name = name == null ? null : name.copy();
1157        dst.type = type == null ? null : type.copy();
1158      }
1159
1160      @Override
1161      public boolean equalsDeep(Base other_) {
1162        if (!super.equalsDeep(other_))
1163          return false;
1164        if (!(other_ instanceof DeviceDeviceNameComponent))
1165          return false;
1166        DeviceDeviceNameComponent o = (DeviceDeviceNameComponent) other_;
1167        return compareDeep(name, o.name, true) && compareDeep(type, o.type, true);
1168      }
1169
1170      @Override
1171      public boolean equalsShallow(Base other_) {
1172        if (!super.equalsShallow(other_))
1173          return false;
1174        if (!(other_ instanceof DeviceDeviceNameComponent))
1175          return false;
1176        DeviceDeviceNameComponent o = (DeviceDeviceNameComponent) other_;
1177        return compareValues(name, o.name, true) && compareValues(type, o.type, true);
1178      }
1179
1180      public boolean isEmpty() {
1181        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, type);
1182      }
1183
1184  public String fhirType() {
1185    return "Device.deviceName";
1186
1187  }
1188
1189  }
1190
1191    @Block()
1192    public static class DeviceSpecializationComponent extends BackboneElement implements IBaseBackboneElement {
1193        /**
1194         * The standard that is used to operate and communicate.
1195         */
1196        @Child(name = "systemType", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1197        @Description(shortDefinition="The standard that is used to operate and communicate", formalDefinition="The standard that is used to operate and communicate." )
1198        protected CodeableConcept systemType;
1199
1200        /**
1201         * The version of the standard that is used to operate and communicate.
1202         */
1203        @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1204        @Description(shortDefinition="The version of the standard that is used to operate and communicate", formalDefinition="The version of the standard that is used to operate and communicate." )
1205        protected StringType version;
1206
1207        private static final long serialVersionUID = 1557342629L;
1208
1209    /**
1210     * Constructor
1211     */
1212      public DeviceSpecializationComponent() {
1213        super();
1214      }
1215
1216    /**
1217     * Constructor
1218     */
1219      public DeviceSpecializationComponent(CodeableConcept systemType) {
1220        super();
1221        this.setSystemType(systemType);
1222      }
1223
1224        /**
1225         * @return {@link #systemType} (The standard that is used to operate and communicate.)
1226         */
1227        public CodeableConcept getSystemType() { 
1228          if (this.systemType == null)
1229            if (Configuration.errorOnAutoCreate())
1230              throw new Error("Attempt to auto-create DeviceSpecializationComponent.systemType");
1231            else if (Configuration.doAutoCreate())
1232              this.systemType = new CodeableConcept(); // cc
1233          return this.systemType;
1234        }
1235
1236        public boolean hasSystemType() { 
1237          return this.systemType != null && !this.systemType.isEmpty();
1238        }
1239
1240        /**
1241         * @param value {@link #systemType} (The standard that is used to operate and communicate.)
1242         */
1243        public DeviceSpecializationComponent setSystemType(CodeableConcept value) { 
1244          this.systemType = value;
1245          return this;
1246        }
1247
1248        /**
1249         * @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
1250         */
1251        public StringType getVersionElement() { 
1252          if (this.version == null)
1253            if (Configuration.errorOnAutoCreate())
1254              throw new Error("Attempt to auto-create DeviceSpecializationComponent.version");
1255            else if (Configuration.doAutoCreate())
1256              this.version = new StringType(); // bb
1257          return this.version;
1258        }
1259
1260        public boolean hasVersionElement() { 
1261          return this.version != null && !this.version.isEmpty();
1262        }
1263
1264        public boolean hasVersion() { 
1265          return this.version != null && !this.version.isEmpty();
1266        }
1267
1268        /**
1269         * @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
1270         */
1271        public DeviceSpecializationComponent setVersionElement(StringType value) { 
1272          this.version = value;
1273          return this;
1274        }
1275
1276        /**
1277         * @return The version of the standard that is used to operate and communicate.
1278         */
1279        public String getVersion() { 
1280          return this.version == null ? null : this.version.getValue();
1281        }
1282
1283        /**
1284         * @param value The version of the standard that is used to operate and communicate.
1285         */
1286        public DeviceSpecializationComponent setVersion(String value) { 
1287          if (Utilities.noString(value))
1288            this.version = null;
1289          else {
1290            if (this.version == null)
1291              this.version = new StringType();
1292            this.version.setValue(value);
1293          }
1294          return this;
1295        }
1296
1297        protected void listChildren(List<Property> children) {
1298          super.listChildren(children);
1299          children.add(new Property("systemType", "CodeableConcept", "The standard that is used to operate and communicate.", 0, 1, systemType));
1300          children.add(new Property("version", "string", "The version of the standard that is used to operate and communicate.", 0, 1, version));
1301        }
1302
1303        @Override
1304        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1305          switch (_hash) {
1306          case 642893321: /*systemType*/  return new Property("systemType", "CodeableConcept", "The standard that is used to operate and communicate.", 0, 1, systemType);
1307          case 351608024: /*version*/  return new Property("version", "string", "The version of the standard that is used to operate and communicate.", 0, 1, version);
1308          default: return super.getNamedProperty(_hash, _name, _checkValid);
1309          }
1310
1311        }
1312
1313      @Override
1314      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1315        switch (hash) {
1316        case 642893321: /*systemType*/ return this.systemType == null ? new Base[0] : new Base[] {this.systemType}; // CodeableConcept
1317        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
1318        default: return super.getProperty(hash, name, checkValid);
1319        }
1320
1321      }
1322
1323      @Override
1324      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1325        switch (hash) {
1326        case 642893321: // systemType
1327          this.systemType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1328          return value;
1329        case 351608024: // version
1330          this.version = TypeConvertor.castToString(value); // StringType
1331          return value;
1332        default: return super.setProperty(hash, name, value);
1333        }
1334
1335      }
1336
1337      @Override
1338      public Base setProperty(String name, Base value) throws FHIRException {
1339        if (name.equals("systemType")) {
1340          this.systemType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1341        } else if (name.equals("version")) {
1342          this.version = TypeConvertor.castToString(value); // StringType
1343        } else
1344          return super.setProperty(name, value);
1345        return value;
1346      }
1347
1348      @Override
1349      public Base makeProperty(int hash, String name) throws FHIRException {
1350        switch (hash) {
1351        case 642893321:  return getSystemType();
1352        case 351608024:  return getVersionElement();
1353        default: return super.makeProperty(hash, name);
1354        }
1355
1356      }
1357
1358      @Override
1359      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1360        switch (hash) {
1361        case 642893321: /*systemType*/ return new String[] {"CodeableConcept"};
1362        case 351608024: /*version*/ return new String[] {"string"};
1363        default: return super.getTypesForProperty(hash, name);
1364        }
1365
1366      }
1367
1368      @Override
1369      public Base addChild(String name) throws FHIRException {
1370        if (name.equals("systemType")) {
1371          this.systemType = new CodeableConcept();
1372          return this.systemType;
1373        }
1374        else if (name.equals("version")) {
1375          throw new FHIRException("Cannot call addChild on a primitive type Device.specialization.version");
1376        }
1377        else
1378          return super.addChild(name);
1379      }
1380
1381      public DeviceSpecializationComponent copy() {
1382        DeviceSpecializationComponent dst = new DeviceSpecializationComponent();
1383        copyValues(dst);
1384        return dst;
1385      }
1386
1387      public void copyValues(DeviceSpecializationComponent dst) {
1388        super.copyValues(dst);
1389        dst.systemType = systemType == null ? null : systemType.copy();
1390        dst.version = version == null ? null : version.copy();
1391      }
1392
1393      @Override
1394      public boolean equalsDeep(Base other_) {
1395        if (!super.equalsDeep(other_))
1396          return false;
1397        if (!(other_ instanceof DeviceSpecializationComponent))
1398          return false;
1399        DeviceSpecializationComponent o = (DeviceSpecializationComponent) other_;
1400        return compareDeep(systemType, o.systemType, true) && compareDeep(version, o.version, true);
1401      }
1402
1403      @Override
1404      public boolean equalsShallow(Base other_) {
1405        if (!super.equalsShallow(other_))
1406          return false;
1407        if (!(other_ instanceof DeviceSpecializationComponent))
1408          return false;
1409        DeviceSpecializationComponent o = (DeviceSpecializationComponent) other_;
1410        return compareValues(version, o.version, true);
1411      }
1412
1413      public boolean isEmpty() {
1414        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(systemType, version);
1415      }
1416
1417  public String fhirType() {
1418    return "Device.specialization";
1419
1420  }
1421
1422  }
1423
1424    @Block()
1425    public static class DeviceVersionComponent extends BackboneElement implements IBaseBackboneElement {
1426        /**
1427         * The type of the device version, e.g. manufacturer, approved, internal.
1428         */
1429        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
1430        @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." )
1431        protected CodeableConcept type;
1432
1433        /**
1434         * A single component of the device version.
1435         */
1436        @Child(name = "component", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=false)
1437        @Description(shortDefinition="A single component of the device version", formalDefinition="A single component of the device version." )
1438        protected Identifier component;
1439
1440        /**
1441         * The version text.
1442         */
1443        @Child(name = "value", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=false)
1444        @Description(shortDefinition="The version text", formalDefinition="The version text." )
1445        protected StringType value;
1446
1447        private static final long serialVersionUID = 645214295L;
1448
1449    /**
1450     * Constructor
1451     */
1452      public DeviceVersionComponent() {
1453        super();
1454      }
1455
1456    /**
1457     * Constructor
1458     */
1459      public DeviceVersionComponent(String value) {
1460        super();
1461        this.setValue(value);
1462      }
1463
1464        /**
1465         * @return {@link #type} (The type of the device version, e.g. manufacturer, approved, internal.)
1466         */
1467        public CodeableConcept getType() { 
1468          if (this.type == null)
1469            if (Configuration.errorOnAutoCreate())
1470              throw new Error("Attempt to auto-create DeviceVersionComponent.type");
1471            else if (Configuration.doAutoCreate())
1472              this.type = new CodeableConcept(); // cc
1473          return this.type;
1474        }
1475
1476        public boolean hasType() { 
1477          return this.type != null && !this.type.isEmpty();
1478        }
1479
1480        /**
1481         * @param value {@link #type} (The type of the device version, e.g. manufacturer, approved, internal.)
1482         */
1483        public DeviceVersionComponent setType(CodeableConcept value) { 
1484          this.type = value;
1485          return this;
1486        }
1487
1488        /**
1489         * @return {@link #component} (A single component of the device version.)
1490         */
1491        public Identifier getComponent() { 
1492          if (this.component == null)
1493            if (Configuration.errorOnAutoCreate())
1494              throw new Error("Attempt to auto-create DeviceVersionComponent.component");
1495            else if (Configuration.doAutoCreate())
1496              this.component = new Identifier(); // cc
1497          return this.component;
1498        }
1499
1500        public boolean hasComponent() { 
1501          return this.component != null && !this.component.isEmpty();
1502        }
1503
1504        /**
1505         * @param value {@link #component} (A single component of the device version.)
1506         */
1507        public DeviceVersionComponent setComponent(Identifier value) { 
1508          this.component = value;
1509          return this;
1510        }
1511
1512        /**
1513         * @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
1514         */
1515        public StringType getValueElement() { 
1516          if (this.value == null)
1517            if (Configuration.errorOnAutoCreate())
1518              throw new Error("Attempt to auto-create DeviceVersionComponent.value");
1519            else if (Configuration.doAutoCreate())
1520              this.value = new StringType(); // bb
1521          return this.value;
1522        }
1523
1524        public boolean hasValueElement() { 
1525          return this.value != null && !this.value.isEmpty();
1526        }
1527
1528        public boolean hasValue() { 
1529          return this.value != null && !this.value.isEmpty();
1530        }
1531
1532        /**
1533         * @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
1534         */
1535        public DeviceVersionComponent setValueElement(StringType value) { 
1536          this.value = value;
1537          return this;
1538        }
1539
1540        /**
1541         * @return The version text.
1542         */
1543        public String getValue() { 
1544          return this.value == null ? null : this.value.getValue();
1545        }
1546
1547        /**
1548         * @param value The version text.
1549         */
1550        public DeviceVersionComponent setValue(String value) { 
1551            if (this.value == null)
1552              this.value = new StringType();
1553            this.value.setValue(value);
1554          return this;
1555        }
1556
1557        protected void listChildren(List<Property> children) {
1558          super.listChildren(children);
1559          children.add(new Property("type", "CodeableConcept", "The type of the device version, e.g. manufacturer, approved, internal.", 0, 1, type));
1560          children.add(new Property("component", "Identifier", "A single component of the device version.", 0, 1, component));
1561          children.add(new Property("value", "string", "The version text.", 0, 1, value));
1562        }
1563
1564        @Override
1565        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1566          switch (_hash) {
1567          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The type of the device version, e.g. manufacturer, approved, internal.", 0, 1, type);
1568          case -1399907075: /*component*/  return new Property("component", "Identifier", "A single component of the device version.", 0, 1, component);
1569          case 111972721: /*value*/  return new Property("value", "string", "The version text.", 0, 1, value);
1570          default: return super.getNamedProperty(_hash, _name, _checkValid);
1571          }
1572
1573        }
1574
1575      @Override
1576      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1577        switch (hash) {
1578        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1579        case -1399907075: /*component*/ return this.component == null ? new Base[0] : new Base[] {this.component}; // Identifier
1580        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
1581        default: return super.getProperty(hash, name, checkValid);
1582        }
1583
1584      }
1585
1586      @Override
1587      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1588        switch (hash) {
1589        case 3575610: // type
1590          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1591          return value;
1592        case -1399907075: // component
1593          this.component = TypeConvertor.castToIdentifier(value); // Identifier
1594          return value;
1595        case 111972721: // value
1596          this.value = TypeConvertor.castToString(value); // StringType
1597          return value;
1598        default: return super.setProperty(hash, name, value);
1599        }
1600
1601      }
1602
1603      @Override
1604      public Base setProperty(String name, Base value) throws FHIRException {
1605        if (name.equals("type")) {
1606          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1607        } else if (name.equals("component")) {
1608          this.component = TypeConvertor.castToIdentifier(value); // Identifier
1609        } else if (name.equals("value")) {
1610          this.value = TypeConvertor.castToString(value); // StringType
1611        } else
1612          return super.setProperty(name, value);
1613        return value;
1614      }
1615
1616      @Override
1617      public Base makeProperty(int hash, String name) throws FHIRException {
1618        switch (hash) {
1619        case 3575610:  return getType();
1620        case -1399907075:  return getComponent();
1621        case 111972721:  return getValueElement();
1622        default: return super.makeProperty(hash, name);
1623        }
1624
1625      }
1626
1627      @Override
1628      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1629        switch (hash) {
1630        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1631        case -1399907075: /*component*/ return new String[] {"Identifier"};
1632        case 111972721: /*value*/ return new String[] {"string"};
1633        default: return super.getTypesForProperty(hash, name);
1634        }
1635
1636      }
1637
1638      @Override
1639      public Base addChild(String name) throws FHIRException {
1640        if (name.equals("type")) {
1641          this.type = new CodeableConcept();
1642          return this.type;
1643        }
1644        else if (name.equals("component")) {
1645          this.component = new Identifier();
1646          return this.component;
1647        }
1648        else if (name.equals("value")) {
1649          throw new FHIRException("Cannot call addChild on a primitive type Device.version.value");
1650        }
1651        else
1652          return super.addChild(name);
1653      }
1654
1655      public DeviceVersionComponent copy() {
1656        DeviceVersionComponent dst = new DeviceVersionComponent();
1657        copyValues(dst);
1658        return dst;
1659      }
1660
1661      public void copyValues(DeviceVersionComponent dst) {
1662        super.copyValues(dst);
1663        dst.type = type == null ? null : type.copy();
1664        dst.component = component == null ? null : component.copy();
1665        dst.value = value == null ? null : value.copy();
1666      }
1667
1668      @Override
1669      public boolean equalsDeep(Base other_) {
1670        if (!super.equalsDeep(other_))
1671          return false;
1672        if (!(other_ instanceof DeviceVersionComponent))
1673          return false;
1674        DeviceVersionComponent o = (DeviceVersionComponent) other_;
1675        return compareDeep(type, o.type, true) && compareDeep(component, o.component, true) && compareDeep(value, o.value, true)
1676          ;
1677      }
1678
1679      @Override
1680      public boolean equalsShallow(Base other_) {
1681        if (!super.equalsShallow(other_))
1682          return false;
1683        if (!(other_ instanceof DeviceVersionComponent))
1684          return false;
1685        DeviceVersionComponent o = (DeviceVersionComponent) other_;
1686        return compareValues(value, o.value, true);
1687      }
1688
1689      public boolean isEmpty() {
1690        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, component, value);
1691      }
1692
1693  public String fhirType() {
1694    return "Device.version";
1695
1696  }
1697
1698  }
1699
1700    @Block()
1701    public static class DevicePropertyComponent extends BackboneElement implements IBaseBackboneElement {
1702        /**
1703         * Code that specifies the property DeviceDefinitionPropetyCode (Extensible).
1704         */
1705        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1706        @Description(shortDefinition="Code that specifies the property DeviceDefinitionPropetyCode (Extensible)", formalDefinition="Code that specifies the property DeviceDefinitionPropetyCode (Extensible)." )
1707        protected CodeableConcept type;
1708
1709        /**
1710         * Property value as a quantity.
1711         */
1712        @Child(name = "valueQuantity", type = {Quantity.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1713        @Description(shortDefinition="Property value as a quantity", formalDefinition="Property value as a quantity." )
1714        protected List<Quantity> valueQuantity;
1715
1716        /**
1717         * Property value as a code, e.g., NTP4 (synced to NTP).
1718         */
1719        @Child(name = "valueCode", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1720        @Description(shortDefinition="Property value as a code, e.g., NTP4 (synced to NTP)", formalDefinition="Property value as a code, e.g., NTP4 (synced to NTP)." )
1721        protected List<CodeableConcept> valueCode;
1722
1723        private static final long serialVersionUID = 1512172633L;
1724
1725    /**
1726     * Constructor
1727     */
1728      public DevicePropertyComponent() {
1729        super();
1730      }
1731
1732    /**
1733     * Constructor
1734     */
1735      public DevicePropertyComponent(CodeableConcept type) {
1736        super();
1737        this.setType(type);
1738      }
1739
1740        /**
1741         * @return {@link #type} (Code that specifies the property DeviceDefinitionPropetyCode (Extensible).)
1742         */
1743        public CodeableConcept getType() { 
1744          if (this.type == null)
1745            if (Configuration.errorOnAutoCreate())
1746              throw new Error("Attempt to auto-create DevicePropertyComponent.type");
1747            else if (Configuration.doAutoCreate())
1748              this.type = new CodeableConcept(); // cc
1749          return this.type;
1750        }
1751
1752        public boolean hasType() { 
1753          return this.type != null && !this.type.isEmpty();
1754        }
1755
1756        /**
1757         * @param value {@link #type} (Code that specifies the property DeviceDefinitionPropetyCode (Extensible).)
1758         */
1759        public DevicePropertyComponent setType(CodeableConcept value) { 
1760          this.type = value;
1761          return this;
1762        }
1763
1764        /**
1765         * @return {@link #valueQuantity} (Property value as a quantity.)
1766         */
1767        public List<Quantity> getValueQuantity() { 
1768          if (this.valueQuantity == null)
1769            this.valueQuantity = new ArrayList<Quantity>();
1770          return this.valueQuantity;
1771        }
1772
1773        /**
1774         * @return Returns a reference to <code>this</code> for easy method chaining
1775         */
1776        public DevicePropertyComponent setValueQuantity(List<Quantity> theValueQuantity) { 
1777          this.valueQuantity = theValueQuantity;
1778          return this;
1779        }
1780
1781        public boolean hasValueQuantity() { 
1782          if (this.valueQuantity == null)
1783            return false;
1784          for (Quantity item : this.valueQuantity)
1785            if (!item.isEmpty())
1786              return true;
1787          return false;
1788        }
1789
1790        public Quantity addValueQuantity() { //3
1791          Quantity t = new Quantity();
1792          if (this.valueQuantity == null)
1793            this.valueQuantity = new ArrayList<Quantity>();
1794          this.valueQuantity.add(t);
1795          return t;
1796        }
1797
1798        public DevicePropertyComponent addValueQuantity(Quantity t) { //3
1799          if (t == null)
1800            return this;
1801          if (this.valueQuantity == null)
1802            this.valueQuantity = new ArrayList<Quantity>();
1803          this.valueQuantity.add(t);
1804          return this;
1805        }
1806
1807        /**
1808         * @return The first repetition of repeating field {@link #valueQuantity}, creating it if it does not already exist {3}
1809         */
1810        public Quantity getValueQuantityFirstRep() { 
1811          if (getValueQuantity().isEmpty()) {
1812            addValueQuantity();
1813          }
1814          return getValueQuantity().get(0);
1815        }
1816
1817        /**
1818         * @return {@link #valueCode} (Property value as a code, e.g., NTP4 (synced to NTP).)
1819         */
1820        public List<CodeableConcept> getValueCode() { 
1821          if (this.valueCode == null)
1822            this.valueCode = new ArrayList<CodeableConcept>();
1823          return this.valueCode;
1824        }
1825
1826        /**
1827         * @return Returns a reference to <code>this</code> for easy method chaining
1828         */
1829        public DevicePropertyComponent setValueCode(List<CodeableConcept> theValueCode) { 
1830          this.valueCode = theValueCode;
1831          return this;
1832        }
1833
1834        public boolean hasValueCode() { 
1835          if (this.valueCode == null)
1836            return false;
1837          for (CodeableConcept item : this.valueCode)
1838            if (!item.isEmpty())
1839              return true;
1840          return false;
1841        }
1842
1843        public CodeableConcept addValueCode() { //3
1844          CodeableConcept t = new CodeableConcept();
1845          if (this.valueCode == null)
1846            this.valueCode = new ArrayList<CodeableConcept>();
1847          this.valueCode.add(t);
1848          return t;
1849        }
1850
1851        public DevicePropertyComponent addValueCode(CodeableConcept t) { //3
1852          if (t == null)
1853            return this;
1854          if (this.valueCode == null)
1855            this.valueCode = new ArrayList<CodeableConcept>();
1856          this.valueCode.add(t);
1857          return this;
1858        }
1859
1860        /**
1861         * @return The first repetition of repeating field {@link #valueCode}, creating it if it does not already exist {3}
1862         */
1863        public CodeableConcept getValueCodeFirstRep() { 
1864          if (getValueCode().isEmpty()) {
1865            addValueCode();
1866          }
1867          return getValueCode().get(0);
1868        }
1869
1870        protected void listChildren(List<Property> children) {
1871          super.listChildren(children);
1872          children.add(new Property("type", "CodeableConcept", "Code that specifies the property DeviceDefinitionPropetyCode (Extensible).", 0, 1, type));
1873          children.add(new Property("valueQuantity", "Quantity", "Property value as a quantity.", 0, java.lang.Integer.MAX_VALUE, valueQuantity));
1874          children.add(new Property("valueCode", "CodeableConcept", "Property value as a code, e.g., NTP4 (synced to NTP).", 0, java.lang.Integer.MAX_VALUE, valueCode));
1875        }
1876
1877        @Override
1878        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1879          switch (_hash) {
1880          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Code that specifies the property DeviceDefinitionPropetyCode (Extensible).", 0, 1, type);
1881          case -2029823716: /*valueQuantity*/  return new Property("valueQuantity", "Quantity", "Property value as a quantity.", 0, java.lang.Integer.MAX_VALUE, valueQuantity);
1882          case -766209282: /*valueCode*/  return new Property("valueCode", "CodeableConcept", "Property value as a code, e.g., NTP4 (synced to NTP).", 0, java.lang.Integer.MAX_VALUE, valueCode);
1883          default: return super.getNamedProperty(_hash, _name, _checkValid);
1884          }
1885
1886        }
1887
1888      @Override
1889      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1890        switch (hash) {
1891        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1892        case -2029823716: /*valueQuantity*/ return this.valueQuantity == null ? new Base[0] : this.valueQuantity.toArray(new Base[this.valueQuantity.size()]); // Quantity
1893        case -766209282: /*valueCode*/ return this.valueCode == null ? new Base[0] : this.valueCode.toArray(new Base[this.valueCode.size()]); // CodeableConcept
1894        default: return super.getProperty(hash, name, checkValid);
1895        }
1896
1897      }
1898
1899      @Override
1900      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1901        switch (hash) {
1902        case 3575610: // type
1903          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1904          return value;
1905        case -2029823716: // valueQuantity
1906          this.getValueQuantity().add(TypeConvertor.castToQuantity(value)); // Quantity
1907          return value;
1908        case -766209282: // valueCode
1909          this.getValueCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1910          return value;
1911        default: return super.setProperty(hash, name, value);
1912        }
1913
1914      }
1915
1916      @Override
1917      public Base setProperty(String name, Base value) throws FHIRException {
1918        if (name.equals("type")) {
1919          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1920        } else if (name.equals("valueQuantity")) {
1921          this.getValueQuantity().add(TypeConvertor.castToQuantity(value));
1922        } else if (name.equals("valueCode")) {
1923          this.getValueCode().add(TypeConvertor.castToCodeableConcept(value));
1924        } else
1925          return super.setProperty(name, value);
1926        return value;
1927      }
1928
1929      @Override
1930      public Base makeProperty(int hash, String name) throws FHIRException {
1931        switch (hash) {
1932        case 3575610:  return getType();
1933        case -2029823716:  return addValueQuantity(); 
1934        case -766209282:  return addValueCode(); 
1935        default: return super.makeProperty(hash, name);
1936        }
1937
1938      }
1939
1940      @Override
1941      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1942        switch (hash) {
1943        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1944        case -2029823716: /*valueQuantity*/ return new String[] {"Quantity"};
1945        case -766209282: /*valueCode*/ return new String[] {"CodeableConcept"};
1946        default: return super.getTypesForProperty(hash, name);
1947        }
1948
1949      }
1950
1951      @Override
1952      public Base addChild(String name) throws FHIRException {
1953        if (name.equals("type")) {
1954          this.type = new CodeableConcept();
1955          return this.type;
1956        }
1957        else if (name.equals("valueQuantity")) {
1958          return addValueQuantity();
1959        }
1960        else if (name.equals("valueCode")) {
1961          return addValueCode();
1962        }
1963        else
1964          return super.addChild(name);
1965      }
1966
1967      public DevicePropertyComponent copy() {
1968        DevicePropertyComponent dst = new DevicePropertyComponent();
1969        copyValues(dst);
1970        return dst;
1971      }
1972
1973      public void copyValues(DevicePropertyComponent dst) {
1974        super.copyValues(dst);
1975        dst.type = type == null ? null : type.copy();
1976        if (valueQuantity != null) {
1977          dst.valueQuantity = new ArrayList<Quantity>();
1978          for (Quantity i : valueQuantity)
1979            dst.valueQuantity.add(i.copy());
1980        };
1981        if (valueCode != null) {
1982          dst.valueCode = new ArrayList<CodeableConcept>();
1983          for (CodeableConcept i : valueCode)
1984            dst.valueCode.add(i.copy());
1985        };
1986      }
1987
1988      @Override
1989      public boolean equalsDeep(Base other_) {
1990        if (!super.equalsDeep(other_))
1991          return false;
1992        if (!(other_ instanceof DevicePropertyComponent))
1993          return false;
1994        DevicePropertyComponent o = (DevicePropertyComponent) other_;
1995        return compareDeep(type, o.type, true) && compareDeep(valueQuantity, o.valueQuantity, true) && compareDeep(valueCode, o.valueCode, true)
1996          ;
1997      }
1998
1999      @Override
2000      public boolean equalsShallow(Base other_) {
2001        if (!super.equalsShallow(other_))
2002          return false;
2003        if (!(other_ instanceof DevicePropertyComponent))
2004          return false;
2005        DevicePropertyComponent o = (DevicePropertyComponent) other_;
2006        return true;
2007      }
2008
2009      public boolean isEmpty() {
2010        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, valueQuantity, valueCode
2011          );
2012      }
2013
2014  public String fhirType() {
2015    return "Device.property";
2016
2017  }
2018
2019  }
2020
2021    /**
2022     * Unique instance identifiers assigned to a device by manufacturers other organizations or owners.
2023     */
2024    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2025    @Description(shortDefinition="Instance identifier", formalDefinition="Unique instance identifiers assigned to a device by manufacturers other organizations or owners." )
2026    protected List<Identifier> identifier;
2027
2028    /**
2029     * The reference to the definition for the device.
2030     */
2031    @Child(name = "definition", type = {DeviceDefinition.class}, order=1, min=0, max=1, modifier=false, summary=false)
2032    @Description(shortDefinition="The reference to the definition for the device", formalDefinition="The reference to the definition for the device." )
2033    protected Reference definition;
2034
2035    /**
2036     * 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.
2037     */
2038    @Child(name = "udiCarrier", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2039    @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." )
2040    protected List<DeviceUdiCarrierComponent> udiCarrier;
2041
2042    /**
2043     * Status of the Device availability.
2044     */
2045    @Child(name = "status", type = {CodeType.class}, order=3, min=0, max=1, modifier=true, summary=true)
2046    @Description(shortDefinition="active | inactive | entered-in-error | unknown", formalDefinition="Status of the Device availability." )
2047    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-status")
2048    protected Enumeration<FHIRDeviceStatus> status;
2049
2050    /**
2051     * Reason for the dtatus of the Device availability.
2052     */
2053    @Child(name = "statusReason", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2054    @Description(shortDefinition="online | paused | standby | offline | not-ready | transduc-discon | hw-discon | off", formalDefinition="Reason for the dtatus of the Device availability." )
2055    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-status-reason")
2056    protected List<CodeableConcept> statusReason;
2057
2058    /**
2059     * The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product.
2060     */
2061    @Child(name = "distinctIdentifier", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
2062    @Description(shortDefinition="The distinct identification string", formalDefinition="The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product." )
2063    protected StringType distinctIdentifier;
2064
2065    /**
2066     * A name of the manufacturer.
2067     */
2068    @Child(name = "manufacturer", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
2069    @Description(shortDefinition="Name of device manufacturer", formalDefinition="A name of the manufacturer." )
2070    protected StringType manufacturer;
2071
2072    /**
2073     * The date and time when the device was manufactured.
2074     */
2075    @Child(name = "manufactureDate", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=false)
2076    @Description(shortDefinition="Date when the device was made", formalDefinition="The date and time when the device was manufactured." )
2077    protected DateTimeType manufactureDate;
2078
2079    /**
2080     * The date and time beyond which this device is no longer valid or should not be used (if applicable).
2081     */
2082    @Child(name = "expirationDate", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=false)
2083    @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)." )
2084    protected DateTimeType expirationDate;
2085
2086    /**
2087     * Lot number assigned by the manufacturer.
2088     */
2089    @Child(name = "lotNumber", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
2090    @Description(shortDefinition="Lot number of manufacture", formalDefinition="Lot number assigned by the manufacturer." )
2091    protected StringType lotNumber;
2092
2093    /**
2094     * The serial number assigned by the organization when the device was manufactured.
2095     */
2096    @Child(name = "serialNumber", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
2097    @Description(shortDefinition="Serial number assigned by the manufacturer", formalDefinition="The serial number assigned by the organization when the device was manufactured." )
2098    protected StringType serialNumber;
2099
2100    /**
2101     * 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.
2102     */
2103    @Child(name = "deviceName", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2104    @Description(shortDefinition="The name of the device as given by the manufacturer", 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." )
2105    protected List<DeviceDeviceNameComponent> deviceName;
2106
2107    /**
2108     * The manufacturer's model number for the device.
2109     */
2110    @Child(name = "modelNumber", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false)
2111    @Description(shortDefinition="The manufacturer's model number for the device", formalDefinition="The manufacturer's model number for the device." )
2112    protected StringType modelNumber;
2113
2114    /**
2115     * The part number or catalog number of the device.
2116     */
2117    @Child(name = "partNumber", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false)
2118    @Description(shortDefinition="The part number or catalog number of the device", formalDefinition="The part number or catalog number of the device." )
2119    protected StringType partNumber;
2120
2121    /**
2122     * The kind or type of device.
2123     */
2124    @Child(name = "type", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=false)
2125    @Description(shortDefinition="The kind or type of device", formalDefinition="The kind or type of device." )
2126    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-type")
2127    protected CodeableConcept type;
2128
2129    /**
2130     * The capabilities supported on a  device, the standards to which the device conforms for a particular purpose, and used for the communication.
2131     */
2132    @Child(name = "specialization", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2133    @Description(shortDefinition="The capabilities supported on a  device, the standards to which the device conforms for a particular purpose, and used for the communication", formalDefinition="The capabilities supported on a  device, the standards to which the device conforms for a particular purpose, and used for the communication." )
2134    protected List<DeviceSpecializationComponent> specialization;
2135
2136    /**
2137     * The actual design of the device or software version running on the device.
2138     */
2139    @Child(name = "version", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2140    @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." )
2141    protected List<DeviceVersionComponent> version;
2142
2143    /**
2144     * The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.
2145     */
2146    @Child(name = "property", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2147    @Description(shortDefinition="The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties", formalDefinition="The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties." )
2148    protected List<DevicePropertyComponent> property;
2149
2150    /**
2151     * Patient information, If the device is affixed to a person.
2152     */
2153    @Child(name = "patient", type = {Patient.class}, order=18, min=0, max=1, modifier=false, summary=false)
2154    @Description(shortDefinition="Patient to whom Device is affixed", formalDefinition="Patient information, If the device is affixed to a person." )
2155    protected Reference patient;
2156
2157    /**
2158     * An organization that is responsible for the provision and ongoing maintenance of the device.
2159     */
2160    @Child(name = "owner", type = {Organization.class}, order=19, min=0, max=1, modifier=false, summary=false)
2161    @Description(shortDefinition="Organization responsible for device", formalDefinition="An organization that is responsible for the provision and ongoing maintenance of the device." )
2162    protected Reference owner;
2163
2164    /**
2165     * Contact details for an organization or a particular human that is responsible for the device.
2166     */
2167    @Child(name = "contact", type = {ContactPoint.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2168    @Description(shortDefinition="Details for human/organization for support", formalDefinition="Contact details for an organization or a particular human that is responsible for the device." )
2169    protected List<ContactPoint> contact;
2170
2171    /**
2172     * The place where the device can be found.
2173     */
2174    @Child(name = "location", type = {Location.class}, order=21, min=0, max=1, modifier=false, summary=false)
2175    @Description(shortDefinition="Where the device is found", formalDefinition="The place where the device can be found." )
2176    protected Reference location;
2177
2178    /**
2179     * A network address on which the device may be contacted directly.
2180     */
2181    @Child(name = "url", type = {UriType.class}, order=22, min=0, max=1, modifier=false, summary=false)
2182    @Description(shortDefinition="Network address to contact device", formalDefinition="A network address on which the device may be contacted directly." )
2183    protected UriType url;
2184
2185    /**
2186     * Descriptive information, usage information or implantation information that is not captured in an existing element.
2187     */
2188    @Child(name = "note", type = {Annotation.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2189    @Description(shortDefinition="Device notes and comments", formalDefinition="Descriptive information, usage information or implantation information that is not captured in an existing element." )
2190    protected List<Annotation> note;
2191
2192    /**
2193     * Provides additional safety characteristics about a medical device.  For example devices containing latex.
2194     */
2195    @Child(name = "safety", type = {CodeableConcept.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2196    @Description(shortDefinition="Safety Characteristics of Device", formalDefinition="Provides additional safety characteristics about a medical device.  For example devices containing latex." )
2197    protected List<CodeableConcept> safety;
2198
2199    /**
2200     * The device that this device is attached to or is part of.
2201     */
2202    @Child(name = "parent", type = {Device.class}, order=25, min=0, max=1, modifier=false, summary=false)
2203    @Description(shortDefinition="The device that this device is attached to or is part of", formalDefinition="The device that this device is attached to or is part of." )
2204    protected Reference parent;
2205
2206    private static final long serialVersionUID = 634832360L;
2207
2208  /**
2209   * Constructor
2210   */
2211    public Device() {
2212      super();
2213    }
2214
2215    /**
2216     * @return {@link #identifier} (Unique instance identifiers assigned to a device by manufacturers other organizations or owners.)
2217     */
2218    public List<Identifier> getIdentifier() { 
2219      if (this.identifier == null)
2220        this.identifier = new ArrayList<Identifier>();
2221      return this.identifier;
2222    }
2223
2224    /**
2225     * @return Returns a reference to <code>this</code> for easy method chaining
2226     */
2227    public Device setIdentifier(List<Identifier> theIdentifier) { 
2228      this.identifier = theIdentifier;
2229      return this;
2230    }
2231
2232    public boolean hasIdentifier() { 
2233      if (this.identifier == null)
2234        return false;
2235      for (Identifier item : this.identifier)
2236        if (!item.isEmpty())
2237          return true;
2238      return false;
2239    }
2240
2241    public Identifier addIdentifier() { //3
2242      Identifier t = new Identifier();
2243      if (this.identifier == null)
2244        this.identifier = new ArrayList<Identifier>();
2245      this.identifier.add(t);
2246      return t;
2247    }
2248
2249    public Device addIdentifier(Identifier t) { //3
2250      if (t == null)
2251        return this;
2252      if (this.identifier == null)
2253        this.identifier = new ArrayList<Identifier>();
2254      this.identifier.add(t);
2255      return this;
2256    }
2257
2258    /**
2259     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2260     */
2261    public Identifier getIdentifierFirstRep() { 
2262      if (getIdentifier().isEmpty()) {
2263        addIdentifier();
2264      }
2265      return getIdentifier().get(0);
2266    }
2267
2268    /**
2269     * @return {@link #definition} (The reference to the definition for the device.)
2270     */
2271    public Reference getDefinition() { 
2272      if (this.definition == null)
2273        if (Configuration.errorOnAutoCreate())
2274          throw new Error("Attempt to auto-create Device.definition");
2275        else if (Configuration.doAutoCreate())
2276          this.definition = new Reference(); // cc
2277      return this.definition;
2278    }
2279
2280    public boolean hasDefinition() { 
2281      return this.definition != null && !this.definition.isEmpty();
2282    }
2283
2284    /**
2285     * @param value {@link #definition} (The reference to the definition for the device.)
2286     */
2287    public Device setDefinition(Reference value) { 
2288      this.definition = value;
2289      return this;
2290    }
2291
2292    /**
2293     * @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.)
2294     */
2295    public List<DeviceUdiCarrierComponent> getUdiCarrier() { 
2296      if (this.udiCarrier == null)
2297        this.udiCarrier = new ArrayList<DeviceUdiCarrierComponent>();
2298      return this.udiCarrier;
2299    }
2300
2301    /**
2302     * @return Returns a reference to <code>this</code> for easy method chaining
2303     */
2304    public Device setUdiCarrier(List<DeviceUdiCarrierComponent> theUdiCarrier) { 
2305      this.udiCarrier = theUdiCarrier;
2306      return this;
2307    }
2308
2309    public boolean hasUdiCarrier() { 
2310      if (this.udiCarrier == null)
2311        return false;
2312      for (DeviceUdiCarrierComponent item : this.udiCarrier)
2313        if (!item.isEmpty())
2314          return true;
2315      return false;
2316    }
2317
2318    public DeviceUdiCarrierComponent addUdiCarrier() { //3
2319      DeviceUdiCarrierComponent t = new DeviceUdiCarrierComponent();
2320      if (this.udiCarrier == null)
2321        this.udiCarrier = new ArrayList<DeviceUdiCarrierComponent>();
2322      this.udiCarrier.add(t);
2323      return t;
2324    }
2325
2326    public Device addUdiCarrier(DeviceUdiCarrierComponent t) { //3
2327      if (t == null)
2328        return this;
2329      if (this.udiCarrier == null)
2330        this.udiCarrier = new ArrayList<DeviceUdiCarrierComponent>();
2331      this.udiCarrier.add(t);
2332      return this;
2333    }
2334
2335    /**
2336     * @return The first repetition of repeating field {@link #udiCarrier}, creating it if it does not already exist {3}
2337     */
2338    public DeviceUdiCarrierComponent getUdiCarrierFirstRep() { 
2339      if (getUdiCarrier().isEmpty()) {
2340        addUdiCarrier();
2341      }
2342      return getUdiCarrier().get(0);
2343    }
2344
2345    /**
2346     * @return {@link #status} (Status of the Device availability.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2347     */
2348    public Enumeration<FHIRDeviceStatus> getStatusElement() { 
2349      if (this.status == null)
2350        if (Configuration.errorOnAutoCreate())
2351          throw new Error("Attempt to auto-create Device.status");
2352        else if (Configuration.doAutoCreate())
2353          this.status = new Enumeration<FHIRDeviceStatus>(new FHIRDeviceStatusEnumFactory()); // bb
2354      return this.status;
2355    }
2356
2357    public boolean hasStatusElement() { 
2358      return this.status != null && !this.status.isEmpty();
2359    }
2360
2361    public boolean hasStatus() { 
2362      return this.status != null && !this.status.isEmpty();
2363    }
2364
2365    /**
2366     * @param value {@link #status} (Status of the Device availability.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2367     */
2368    public Device setStatusElement(Enumeration<FHIRDeviceStatus> value) { 
2369      this.status = value;
2370      return this;
2371    }
2372
2373    /**
2374     * @return Status of the Device availability.
2375     */
2376    public FHIRDeviceStatus getStatus() { 
2377      return this.status == null ? null : this.status.getValue();
2378    }
2379
2380    /**
2381     * @param value Status of the Device availability.
2382     */
2383    public Device setStatus(FHIRDeviceStatus value) { 
2384      if (value == null)
2385        this.status = null;
2386      else {
2387        if (this.status == null)
2388          this.status = new Enumeration<FHIRDeviceStatus>(new FHIRDeviceStatusEnumFactory());
2389        this.status.setValue(value);
2390      }
2391      return this;
2392    }
2393
2394    /**
2395     * @return {@link #statusReason} (Reason for the dtatus of the Device availability.)
2396     */
2397    public List<CodeableConcept> getStatusReason() { 
2398      if (this.statusReason == null)
2399        this.statusReason = new ArrayList<CodeableConcept>();
2400      return this.statusReason;
2401    }
2402
2403    /**
2404     * @return Returns a reference to <code>this</code> for easy method chaining
2405     */
2406    public Device setStatusReason(List<CodeableConcept> theStatusReason) { 
2407      this.statusReason = theStatusReason;
2408      return this;
2409    }
2410
2411    public boolean hasStatusReason() { 
2412      if (this.statusReason == null)
2413        return false;
2414      for (CodeableConcept item : this.statusReason)
2415        if (!item.isEmpty())
2416          return true;
2417      return false;
2418    }
2419
2420    public CodeableConcept addStatusReason() { //3
2421      CodeableConcept t = new CodeableConcept();
2422      if (this.statusReason == null)
2423        this.statusReason = new ArrayList<CodeableConcept>();
2424      this.statusReason.add(t);
2425      return t;
2426    }
2427
2428    public Device addStatusReason(CodeableConcept t) { //3
2429      if (t == null)
2430        return this;
2431      if (this.statusReason == null)
2432        this.statusReason = new ArrayList<CodeableConcept>();
2433      this.statusReason.add(t);
2434      return this;
2435    }
2436
2437    /**
2438     * @return The first repetition of repeating field {@link #statusReason}, creating it if it does not already exist {3}
2439     */
2440    public CodeableConcept getStatusReasonFirstRep() { 
2441      if (getStatusReason().isEmpty()) {
2442        addStatusReason();
2443      }
2444      return getStatusReason().get(0);
2445    }
2446
2447    /**
2448     * @return {@link #distinctIdentifier} (The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product.). This is the underlying object with id, value and extensions. The accessor "getDistinctIdentifier" gives direct access to the value
2449     */
2450    public StringType getDistinctIdentifierElement() { 
2451      if (this.distinctIdentifier == null)
2452        if (Configuration.errorOnAutoCreate())
2453          throw new Error("Attempt to auto-create Device.distinctIdentifier");
2454        else if (Configuration.doAutoCreate())
2455          this.distinctIdentifier = new StringType(); // bb
2456      return this.distinctIdentifier;
2457    }
2458
2459    public boolean hasDistinctIdentifierElement() { 
2460      return this.distinctIdentifier != null && !this.distinctIdentifier.isEmpty();
2461    }
2462
2463    public boolean hasDistinctIdentifier() { 
2464      return this.distinctIdentifier != null && !this.distinctIdentifier.isEmpty();
2465    }
2466
2467    /**
2468     * @param value {@link #distinctIdentifier} (The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product.). This is the underlying object with id, value and extensions. The accessor "getDistinctIdentifier" gives direct access to the value
2469     */
2470    public Device setDistinctIdentifierElement(StringType value) { 
2471      this.distinctIdentifier = value;
2472      return this;
2473    }
2474
2475    /**
2476     * @return The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product.
2477     */
2478    public String getDistinctIdentifier() { 
2479      return this.distinctIdentifier == null ? null : this.distinctIdentifier.getValue();
2480    }
2481
2482    /**
2483     * @param value The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product.
2484     */
2485    public Device setDistinctIdentifier(String value) { 
2486      if (Utilities.noString(value))
2487        this.distinctIdentifier = null;
2488      else {
2489        if (this.distinctIdentifier == null)
2490          this.distinctIdentifier = new StringType();
2491        this.distinctIdentifier.setValue(value);
2492      }
2493      return this;
2494    }
2495
2496    /**
2497     * @return {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value
2498     */
2499    public StringType getManufacturerElement() { 
2500      if (this.manufacturer == null)
2501        if (Configuration.errorOnAutoCreate())
2502          throw new Error("Attempt to auto-create Device.manufacturer");
2503        else if (Configuration.doAutoCreate())
2504          this.manufacturer = new StringType(); // bb
2505      return this.manufacturer;
2506    }
2507
2508    public boolean hasManufacturerElement() { 
2509      return this.manufacturer != null && !this.manufacturer.isEmpty();
2510    }
2511
2512    public boolean hasManufacturer() { 
2513      return this.manufacturer != null && !this.manufacturer.isEmpty();
2514    }
2515
2516    /**
2517     * @param value {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value
2518     */
2519    public Device setManufacturerElement(StringType value) { 
2520      this.manufacturer = value;
2521      return this;
2522    }
2523
2524    /**
2525     * @return A name of the manufacturer.
2526     */
2527    public String getManufacturer() { 
2528      return this.manufacturer == null ? null : this.manufacturer.getValue();
2529    }
2530
2531    /**
2532     * @param value A name of the manufacturer.
2533     */
2534    public Device setManufacturer(String value) { 
2535      if (Utilities.noString(value))
2536        this.manufacturer = null;
2537      else {
2538        if (this.manufacturer == null)
2539          this.manufacturer = new StringType();
2540        this.manufacturer.setValue(value);
2541      }
2542      return this;
2543    }
2544
2545    /**
2546     * @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
2547     */
2548    public DateTimeType getManufactureDateElement() { 
2549      if (this.manufactureDate == null)
2550        if (Configuration.errorOnAutoCreate())
2551          throw new Error("Attempt to auto-create Device.manufactureDate");
2552        else if (Configuration.doAutoCreate())
2553          this.manufactureDate = new DateTimeType(); // bb
2554      return this.manufactureDate;
2555    }
2556
2557    public boolean hasManufactureDateElement() { 
2558      return this.manufactureDate != null && !this.manufactureDate.isEmpty();
2559    }
2560
2561    public boolean hasManufactureDate() { 
2562      return this.manufactureDate != null && !this.manufactureDate.isEmpty();
2563    }
2564
2565    /**
2566     * @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
2567     */
2568    public Device setManufactureDateElement(DateTimeType value) { 
2569      this.manufactureDate = value;
2570      return this;
2571    }
2572
2573    /**
2574     * @return The date and time when the device was manufactured.
2575     */
2576    public Date getManufactureDate() { 
2577      return this.manufactureDate == null ? null : this.manufactureDate.getValue();
2578    }
2579
2580    /**
2581     * @param value The date and time when the device was manufactured.
2582     */
2583    public Device setManufactureDate(Date value) { 
2584      if (value == null)
2585        this.manufactureDate = null;
2586      else {
2587        if (this.manufactureDate == null)
2588          this.manufactureDate = new DateTimeType();
2589        this.manufactureDate.setValue(value);
2590      }
2591      return this;
2592    }
2593
2594    /**
2595     * @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
2596     */
2597    public DateTimeType getExpirationDateElement() { 
2598      if (this.expirationDate == null)
2599        if (Configuration.errorOnAutoCreate())
2600          throw new Error("Attempt to auto-create Device.expirationDate");
2601        else if (Configuration.doAutoCreate())
2602          this.expirationDate = new DateTimeType(); // bb
2603      return this.expirationDate;
2604    }
2605
2606    public boolean hasExpirationDateElement() { 
2607      return this.expirationDate != null && !this.expirationDate.isEmpty();
2608    }
2609
2610    public boolean hasExpirationDate() { 
2611      return this.expirationDate != null && !this.expirationDate.isEmpty();
2612    }
2613
2614    /**
2615     * @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
2616     */
2617    public Device setExpirationDateElement(DateTimeType value) { 
2618      this.expirationDate = value;
2619      return this;
2620    }
2621
2622    /**
2623     * @return The date and time beyond which this device is no longer valid or should not be used (if applicable).
2624     */
2625    public Date getExpirationDate() { 
2626      return this.expirationDate == null ? null : this.expirationDate.getValue();
2627    }
2628
2629    /**
2630     * @param value The date and time beyond which this device is no longer valid or should not be used (if applicable).
2631     */
2632    public Device setExpirationDate(Date value) { 
2633      if (value == null)
2634        this.expirationDate = null;
2635      else {
2636        if (this.expirationDate == null)
2637          this.expirationDate = new DateTimeType();
2638        this.expirationDate.setValue(value);
2639      }
2640      return this;
2641    }
2642
2643    /**
2644     * @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
2645     */
2646    public StringType getLotNumberElement() { 
2647      if (this.lotNumber == null)
2648        if (Configuration.errorOnAutoCreate())
2649          throw new Error("Attempt to auto-create Device.lotNumber");
2650        else if (Configuration.doAutoCreate())
2651          this.lotNumber = new StringType(); // bb
2652      return this.lotNumber;
2653    }
2654
2655    public boolean hasLotNumberElement() { 
2656      return this.lotNumber != null && !this.lotNumber.isEmpty();
2657    }
2658
2659    public boolean hasLotNumber() { 
2660      return this.lotNumber != null && !this.lotNumber.isEmpty();
2661    }
2662
2663    /**
2664     * @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
2665     */
2666    public Device setLotNumberElement(StringType value) { 
2667      this.lotNumber = value;
2668      return this;
2669    }
2670
2671    /**
2672     * @return Lot number assigned by the manufacturer.
2673     */
2674    public String getLotNumber() { 
2675      return this.lotNumber == null ? null : this.lotNumber.getValue();
2676    }
2677
2678    /**
2679     * @param value Lot number assigned by the manufacturer.
2680     */
2681    public Device setLotNumber(String value) { 
2682      if (Utilities.noString(value))
2683        this.lotNumber = null;
2684      else {
2685        if (this.lotNumber == null)
2686          this.lotNumber = new StringType();
2687        this.lotNumber.setValue(value);
2688      }
2689      return this;
2690    }
2691
2692    /**
2693     * @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
2694     */
2695    public StringType getSerialNumberElement() { 
2696      if (this.serialNumber == null)
2697        if (Configuration.errorOnAutoCreate())
2698          throw new Error("Attempt to auto-create Device.serialNumber");
2699        else if (Configuration.doAutoCreate())
2700          this.serialNumber = new StringType(); // bb
2701      return this.serialNumber;
2702    }
2703
2704    public boolean hasSerialNumberElement() { 
2705      return this.serialNumber != null && !this.serialNumber.isEmpty();
2706    }
2707
2708    public boolean hasSerialNumber() { 
2709      return this.serialNumber != null && !this.serialNumber.isEmpty();
2710    }
2711
2712    /**
2713     * @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
2714     */
2715    public Device setSerialNumberElement(StringType value) { 
2716      this.serialNumber = value;
2717      return this;
2718    }
2719
2720    /**
2721     * @return The serial number assigned by the organization when the device was manufactured.
2722     */
2723    public String getSerialNumber() { 
2724      return this.serialNumber == null ? null : this.serialNumber.getValue();
2725    }
2726
2727    /**
2728     * @param value The serial number assigned by the organization when the device was manufactured.
2729     */
2730    public Device setSerialNumber(String value) { 
2731      if (Utilities.noString(value))
2732        this.serialNumber = null;
2733      else {
2734        if (this.serialNumber == null)
2735          this.serialNumber = new StringType();
2736        this.serialNumber.setValue(value);
2737      }
2738      return this;
2739    }
2740
2741    /**
2742     * @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.)
2743     */
2744    public List<DeviceDeviceNameComponent> getDeviceName() { 
2745      if (this.deviceName == null)
2746        this.deviceName = new ArrayList<DeviceDeviceNameComponent>();
2747      return this.deviceName;
2748    }
2749
2750    /**
2751     * @return Returns a reference to <code>this</code> for easy method chaining
2752     */
2753    public Device setDeviceName(List<DeviceDeviceNameComponent> theDeviceName) { 
2754      this.deviceName = theDeviceName;
2755      return this;
2756    }
2757
2758    public boolean hasDeviceName() { 
2759      if (this.deviceName == null)
2760        return false;
2761      for (DeviceDeviceNameComponent item : this.deviceName)
2762        if (!item.isEmpty())
2763          return true;
2764      return false;
2765    }
2766
2767    public DeviceDeviceNameComponent addDeviceName() { //3
2768      DeviceDeviceNameComponent t = new DeviceDeviceNameComponent();
2769      if (this.deviceName == null)
2770        this.deviceName = new ArrayList<DeviceDeviceNameComponent>();
2771      this.deviceName.add(t);
2772      return t;
2773    }
2774
2775    public Device addDeviceName(DeviceDeviceNameComponent t) { //3
2776      if (t == null)
2777        return this;
2778      if (this.deviceName == null)
2779        this.deviceName = new ArrayList<DeviceDeviceNameComponent>();
2780      this.deviceName.add(t);
2781      return this;
2782    }
2783
2784    /**
2785     * @return The first repetition of repeating field {@link #deviceName}, creating it if it does not already exist {3}
2786     */
2787    public DeviceDeviceNameComponent getDeviceNameFirstRep() { 
2788      if (getDeviceName().isEmpty()) {
2789        addDeviceName();
2790      }
2791      return getDeviceName().get(0);
2792    }
2793
2794    /**
2795     * @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
2796     */
2797    public StringType getModelNumberElement() { 
2798      if (this.modelNumber == null)
2799        if (Configuration.errorOnAutoCreate())
2800          throw new Error("Attempt to auto-create Device.modelNumber");
2801        else if (Configuration.doAutoCreate())
2802          this.modelNumber = new StringType(); // bb
2803      return this.modelNumber;
2804    }
2805
2806    public boolean hasModelNumberElement() { 
2807      return this.modelNumber != null && !this.modelNumber.isEmpty();
2808    }
2809
2810    public boolean hasModelNumber() { 
2811      return this.modelNumber != null && !this.modelNumber.isEmpty();
2812    }
2813
2814    /**
2815     * @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
2816     */
2817    public Device setModelNumberElement(StringType value) { 
2818      this.modelNumber = value;
2819      return this;
2820    }
2821
2822    /**
2823     * @return The manufacturer's model number for the device.
2824     */
2825    public String getModelNumber() { 
2826      return this.modelNumber == null ? null : this.modelNumber.getValue();
2827    }
2828
2829    /**
2830     * @param value The manufacturer's model number for the device.
2831     */
2832    public Device setModelNumber(String value) { 
2833      if (Utilities.noString(value))
2834        this.modelNumber = null;
2835      else {
2836        if (this.modelNumber == null)
2837          this.modelNumber = new StringType();
2838        this.modelNumber.setValue(value);
2839      }
2840      return this;
2841    }
2842
2843    /**
2844     * @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
2845     */
2846    public StringType getPartNumberElement() { 
2847      if (this.partNumber == null)
2848        if (Configuration.errorOnAutoCreate())
2849          throw new Error("Attempt to auto-create Device.partNumber");
2850        else if (Configuration.doAutoCreate())
2851          this.partNumber = new StringType(); // bb
2852      return this.partNumber;
2853    }
2854
2855    public boolean hasPartNumberElement() { 
2856      return this.partNumber != null && !this.partNumber.isEmpty();
2857    }
2858
2859    public boolean hasPartNumber() { 
2860      return this.partNumber != null && !this.partNumber.isEmpty();
2861    }
2862
2863    /**
2864     * @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
2865     */
2866    public Device setPartNumberElement(StringType value) { 
2867      this.partNumber = value;
2868      return this;
2869    }
2870
2871    /**
2872     * @return The part number or catalog number of the device.
2873     */
2874    public String getPartNumber() { 
2875      return this.partNumber == null ? null : this.partNumber.getValue();
2876    }
2877
2878    /**
2879     * @param value The part number or catalog number of the device.
2880     */
2881    public Device setPartNumber(String value) { 
2882      if (Utilities.noString(value))
2883        this.partNumber = null;
2884      else {
2885        if (this.partNumber == null)
2886          this.partNumber = new StringType();
2887        this.partNumber.setValue(value);
2888      }
2889      return this;
2890    }
2891
2892    /**
2893     * @return {@link #type} (The kind or type of device.)
2894     */
2895    public CodeableConcept getType() { 
2896      if (this.type == null)
2897        if (Configuration.errorOnAutoCreate())
2898          throw new Error("Attempt to auto-create Device.type");
2899        else if (Configuration.doAutoCreate())
2900          this.type = new CodeableConcept(); // cc
2901      return this.type;
2902    }
2903
2904    public boolean hasType() { 
2905      return this.type != null && !this.type.isEmpty();
2906    }
2907
2908    /**
2909     * @param value {@link #type} (The kind or type of device.)
2910     */
2911    public Device setType(CodeableConcept value) { 
2912      this.type = value;
2913      return this;
2914    }
2915
2916    /**
2917     * @return {@link #specialization} (The capabilities supported on a  device, the standards to which the device conforms for a particular purpose, and used for the communication.)
2918     */
2919    public List<DeviceSpecializationComponent> getSpecialization() { 
2920      if (this.specialization == null)
2921        this.specialization = new ArrayList<DeviceSpecializationComponent>();
2922      return this.specialization;
2923    }
2924
2925    /**
2926     * @return Returns a reference to <code>this</code> for easy method chaining
2927     */
2928    public Device setSpecialization(List<DeviceSpecializationComponent> theSpecialization) { 
2929      this.specialization = theSpecialization;
2930      return this;
2931    }
2932
2933    public boolean hasSpecialization() { 
2934      if (this.specialization == null)
2935        return false;
2936      for (DeviceSpecializationComponent item : this.specialization)
2937        if (!item.isEmpty())
2938          return true;
2939      return false;
2940    }
2941
2942    public DeviceSpecializationComponent addSpecialization() { //3
2943      DeviceSpecializationComponent t = new DeviceSpecializationComponent();
2944      if (this.specialization == null)
2945        this.specialization = new ArrayList<DeviceSpecializationComponent>();
2946      this.specialization.add(t);
2947      return t;
2948    }
2949
2950    public Device addSpecialization(DeviceSpecializationComponent t) { //3
2951      if (t == null)
2952        return this;
2953      if (this.specialization == null)
2954        this.specialization = new ArrayList<DeviceSpecializationComponent>();
2955      this.specialization.add(t);
2956      return this;
2957    }
2958
2959    /**
2960     * @return The first repetition of repeating field {@link #specialization}, creating it if it does not already exist {3}
2961     */
2962    public DeviceSpecializationComponent getSpecializationFirstRep() { 
2963      if (getSpecialization().isEmpty()) {
2964        addSpecialization();
2965      }
2966      return getSpecialization().get(0);
2967    }
2968
2969    /**
2970     * @return {@link #version} (The actual design of the device or software version running on the device.)
2971     */
2972    public List<DeviceVersionComponent> getVersion() { 
2973      if (this.version == null)
2974        this.version = new ArrayList<DeviceVersionComponent>();
2975      return this.version;
2976    }
2977
2978    /**
2979     * @return Returns a reference to <code>this</code> for easy method chaining
2980     */
2981    public Device setVersion(List<DeviceVersionComponent> theVersion) { 
2982      this.version = theVersion;
2983      return this;
2984    }
2985
2986    public boolean hasVersion() { 
2987      if (this.version == null)
2988        return false;
2989      for (DeviceVersionComponent item : this.version)
2990        if (!item.isEmpty())
2991          return true;
2992      return false;
2993    }
2994
2995    public DeviceVersionComponent addVersion() { //3
2996      DeviceVersionComponent t = new DeviceVersionComponent();
2997      if (this.version == null)
2998        this.version = new ArrayList<DeviceVersionComponent>();
2999      this.version.add(t);
3000      return t;
3001    }
3002
3003    public Device addVersion(DeviceVersionComponent t) { //3
3004      if (t == null)
3005        return this;
3006      if (this.version == null)
3007        this.version = new ArrayList<DeviceVersionComponent>();
3008      this.version.add(t);
3009      return this;
3010    }
3011
3012    /**
3013     * @return The first repetition of repeating field {@link #version}, creating it if it does not already exist {3}
3014     */
3015    public DeviceVersionComponent getVersionFirstRep() { 
3016      if (getVersion().isEmpty()) {
3017        addVersion();
3018      }
3019      return getVersion().get(0);
3020    }
3021
3022    /**
3023     * @return {@link #property} (The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.)
3024     */
3025    public List<DevicePropertyComponent> getProperty() { 
3026      if (this.property == null)
3027        this.property = new ArrayList<DevicePropertyComponent>();
3028      return this.property;
3029    }
3030
3031    /**
3032     * @return Returns a reference to <code>this</code> for easy method chaining
3033     */
3034    public Device setProperty(List<DevicePropertyComponent> theProperty) { 
3035      this.property = theProperty;
3036      return this;
3037    }
3038
3039    public boolean hasProperty() { 
3040      if (this.property == null)
3041        return false;
3042      for (DevicePropertyComponent item : this.property)
3043        if (!item.isEmpty())
3044          return true;
3045      return false;
3046    }
3047
3048    public DevicePropertyComponent addProperty() { //3
3049      DevicePropertyComponent t = new DevicePropertyComponent();
3050      if (this.property == null)
3051        this.property = new ArrayList<DevicePropertyComponent>();
3052      this.property.add(t);
3053      return t;
3054    }
3055
3056    public Device addProperty(DevicePropertyComponent t) { //3
3057      if (t == null)
3058        return this;
3059      if (this.property == null)
3060        this.property = new ArrayList<DevicePropertyComponent>();
3061      this.property.add(t);
3062      return this;
3063    }
3064
3065    /**
3066     * @return The first repetition of repeating field {@link #property}, creating it if it does not already exist {3}
3067     */
3068    public DevicePropertyComponent getPropertyFirstRep() { 
3069      if (getProperty().isEmpty()) {
3070        addProperty();
3071      }
3072      return getProperty().get(0);
3073    }
3074
3075    /**
3076     * @return {@link #patient} (Patient information, If the device is affixed to a person.)
3077     */
3078    public Reference getPatient() { 
3079      if (this.patient == null)
3080        if (Configuration.errorOnAutoCreate())
3081          throw new Error("Attempt to auto-create Device.patient");
3082        else if (Configuration.doAutoCreate())
3083          this.patient = new Reference(); // cc
3084      return this.patient;
3085    }
3086
3087    public boolean hasPatient() { 
3088      return this.patient != null && !this.patient.isEmpty();
3089    }
3090
3091    /**
3092     * @param value {@link #patient} (Patient information, If the device is affixed to a person.)
3093     */
3094    public Device setPatient(Reference value) { 
3095      this.patient = value;
3096      return this;
3097    }
3098
3099    /**
3100     * @return {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.)
3101     */
3102    public Reference getOwner() { 
3103      if (this.owner == null)
3104        if (Configuration.errorOnAutoCreate())
3105          throw new Error("Attempt to auto-create Device.owner");
3106        else if (Configuration.doAutoCreate())
3107          this.owner = new Reference(); // cc
3108      return this.owner;
3109    }
3110
3111    public boolean hasOwner() { 
3112      return this.owner != null && !this.owner.isEmpty();
3113    }
3114
3115    /**
3116     * @param value {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.)
3117     */
3118    public Device setOwner(Reference value) { 
3119      this.owner = value;
3120      return this;
3121    }
3122
3123    /**
3124     * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.)
3125     */
3126    public List<ContactPoint> getContact() { 
3127      if (this.contact == null)
3128        this.contact = new ArrayList<ContactPoint>();
3129      return this.contact;
3130    }
3131
3132    /**
3133     * @return Returns a reference to <code>this</code> for easy method chaining
3134     */
3135    public Device setContact(List<ContactPoint> theContact) { 
3136      this.contact = theContact;
3137      return this;
3138    }
3139
3140    public boolean hasContact() { 
3141      if (this.contact == null)
3142        return false;
3143      for (ContactPoint item : this.contact)
3144        if (!item.isEmpty())
3145          return true;
3146      return false;
3147    }
3148
3149    public ContactPoint addContact() { //3
3150      ContactPoint t = new ContactPoint();
3151      if (this.contact == null)
3152        this.contact = new ArrayList<ContactPoint>();
3153      this.contact.add(t);
3154      return t;
3155    }
3156
3157    public Device addContact(ContactPoint t) { //3
3158      if (t == null)
3159        return this;
3160      if (this.contact == null)
3161        this.contact = new ArrayList<ContactPoint>();
3162      this.contact.add(t);
3163      return this;
3164    }
3165
3166    /**
3167     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist {3}
3168     */
3169    public ContactPoint getContactFirstRep() { 
3170      if (getContact().isEmpty()) {
3171        addContact();
3172      }
3173      return getContact().get(0);
3174    }
3175
3176    /**
3177     * @return {@link #location} (The place where the device can be found.)
3178     */
3179    public Reference getLocation() { 
3180      if (this.location == null)
3181        if (Configuration.errorOnAutoCreate())
3182          throw new Error("Attempt to auto-create Device.location");
3183        else if (Configuration.doAutoCreate())
3184          this.location = new Reference(); // cc
3185      return this.location;
3186    }
3187
3188    public boolean hasLocation() { 
3189      return this.location != null && !this.location.isEmpty();
3190    }
3191
3192    /**
3193     * @param value {@link #location} (The place where the device can be found.)
3194     */
3195    public Device setLocation(Reference value) { 
3196      this.location = value;
3197      return this;
3198    }
3199
3200    /**
3201     * @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
3202     */
3203    public UriType getUrlElement() { 
3204      if (this.url == null)
3205        if (Configuration.errorOnAutoCreate())
3206          throw new Error("Attempt to auto-create Device.url");
3207        else if (Configuration.doAutoCreate())
3208          this.url = new UriType(); // bb
3209      return this.url;
3210    }
3211
3212    public boolean hasUrlElement() { 
3213      return this.url != null && !this.url.isEmpty();
3214    }
3215
3216    public boolean hasUrl() { 
3217      return this.url != null && !this.url.isEmpty();
3218    }
3219
3220    /**
3221     * @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
3222     */
3223    public Device setUrlElement(UriType value) { 
3224      this.url = value;
3225      return this;
3226    }
3227
3228    /**
3229     * @return A network address on which the device may be contacted directly.
3230     */
3231    public String getUrl() { 
3232      return this.url == null ? null : this.url.getValue();
3233    }
3234
3235    /**
3236     * @param value A network address on which the device may be contacted directly.
3237     */
3238    public Device setUrl(String value) { 
3239      if (Utilities.noString(value))
3240        this.url = null;
3241      else {
3242        if (this.url == null)
3243          this.url = new UriType();
3244        this.url.setValue(value);
3245      }
3246      return this;
3247    }
3248
3249    /**
3250     * @return {@link #note} (Descriptive information, usage information or implantation information that is not captured in an existing element.)
3251     */
3252    public List<Annotation> getNote() { 
3253      if (this.note == null)
3254        this.note = new ArrayList<Annotation>();
3255      return this.note;
3256    }
3257
3258    /**
3259     * @return Returns a reference to <code>this</code> for easy method chaining
3260     */
3261    public Device setNote(List<Annotation> theNote) { 
3262      this.note = theNote;
3263      return this;
3264    }
3265
3266    public boolean hasNote() { 
3267      if (this.note == null)
3268        return false;
3269      for (Annotation item : this.note)
3270        if (!item.isEmpty())
3271          return true;
3272      return false;
3273    }
3274
3275    public Annotation addNote() { //3
3276      Annotation t = new Annotation();
3277      if (this.note == null)
3278        this.note = new ArrayList<Annotation>();
3279      this.note.add(t);
3280      return t;
3281    }
3282
3283    public Device addNote(Annotation t) { //3
3284      if (t == null)
3285        return this;
3286      if (this.note == null)
3287        this.note = new ArrayList<Annotation>();
3288      this.note.add(t);
3289      return this;
3290    }
3291
3292    /**
3293     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
3294     */
3295    public Annotation getNoteFirstRep() { 
3296      if (getNote().isEmpty()) {
3297        addNote();
3298      }
3299      return getNote().get(0);
3300    }
3301
3302    /**
3303     * @return {@link #safety} (Provides additional safety characteristics about a medical device.  For example devices containing latex.)
3304     */
3305    public List<CodeableConcept> getSafety() { 
3306      if (this.safety == null)
3307        this.safety = new ArrayList<CodeableConcept>();
3308      return this.safety;
3309    }
3310
3311    /**
3312     * @return Returns a reference to <code>this</code> for easy method chaining
3313     */
3314    public Device setSafety(List<CodeableConcept> theSafety) { 
3315      this.safety = theSafety;
3316      return this;
3317    }
3318
3319    public boolean hasSafety() { 
3320      if (this.safety == null)
3321        return false;
3322      for (CodeableConcept item : this.safety)
3323        if (!item.isEmpty())
3324          return true;
3325      return false;
3326    }
3327
3328    public CodeableConcept addSafety() { //3
3329      CodeableConcept t = new CodeableConcept();
3330      if (this.safety == null)
3331        this.safety = new ArrayList<CodeableConcept>();
3332      this.safety.add(t);
3333      return t;
3334    }
3335
3336    public Device addSafety(CodeableConcept t) { //3
3337      if (t == null)
3338        return this;
3339      if (this.safety == null)
3340        this.safety = new ArrayList<CodeableConcept>();
3341      this.safety.add(t);
3342      return this;
3343    }
3344
3345    /**
3346     * @return The first repetition of repeating field {@link #safety}, creating it if it does not already exist {3}
3347     */
3348    public CodeableConcept getSafetyFirstRep() { 
3349      if (getSafety().isEmpty()) {
3350        addSafety();
3351      }
3352      return getSafety().get(0);
3353    }
3354
3355    /**
3356     * @return {@link #parent} (The device that this device is attached to or is part of.)
3357     */
3358    public Reference getParent() { 
3359      if (this.parent == null)
3360        if (Configuration.errorOnAutoCreate())
3361          throw new Error("Attempt to auto-create Device.parent");
3362        else if (Configuration.doAutoCreate())
3363          this.parent = new Reference(); // cc
3364      return this.parent;
3365    }
3366
3367    public boolean hasParent() { 
3368      return this.parent != null && !this.parent.isEmpty();
3369    }
3370
3371    /**
3372     * @param value {@link #parent} (The device that this device is attached to or is part of.)
3373     */
3374    public Device setParent(Reference value) { 
3375      this.parent = value;
3376      return this;
3377    }
3378
3379      protected void listChildren(List<Property> children) {
3380        super.listChildren(children);
3381        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));
3382        children.add(new Property("definition", "Reference(DeviceDefinition)", "The reference to the definition for the device.", 0, 1, definition));
3383        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));
3384        children.add(new Property("status", "code", "Status of the Device availability.", 0, 1, status));
3385        children.add(new Property("statusReason", "CodeableConcept", "Reason for the dtatus of the Device availability.", 0, java.lang.Integer.MAX_VALUE, statusReason));
3386        children.add(new Property("distinctIdentifier", "string", "The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product.", 0, 1, distinctIdentifier));
3387        children.add(new Property("manufacturer", "string", "A name of the manufacturer.", 0, 1, manufacturer));
3388        children.add(new Property("manufactureDate", "dateTime", "The date and time when the device was manufactured.", 0, 1, manufactureDate));
3389        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));
3390        children.add(new Property("lotNumber", "string", "Lot number assigned by the manufacturer.", 0, 1, lotNumber));
3391        children.add(new Property("serialNumber", "string", "The serial number assigned by the organization when the device was manufactured.", 0, 1, serialNumber));
3392        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));
3393        children.add(new Property("modelNumber", "string", "The manufacturer's model number for the device.", 0, 1, modelNumber));
3394        children.add(new Property("partNumber", "string", "The part number or catalog number of the device.", 0, 1, partNumber));
3395        children.add(new Property("type", "CodeableConcept", "The kind or type of device.", 0, 1, type));
3396        children.add(new Property("specialization", "", "The capabilities supported on a  device, the standards to which the device conforms for a particular purpose, and used for the communication.", 0, java.lang.Integer.MAX_VALUE, specialization));
3397        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));
3398        children.add(new Property("property", "", "The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.", 0, java.lang.Integer.MAX_VALUE, property));
3399        children.add(new Property("patient", "Reference(Patient)", "Patient information, If the device is affixed to a person.", 0, 1, patient));
3400        children.add(new Property("owner", "Reference(Organization)", "An organization that is responsible for the provision and ongoing maintenance of the device.", 0, 1, owner));
3401        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));
3402        children.add(new Property("location", "Reference(Location)", "The place where the device can be found.", 0, 1, location));
3403        children.add(new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, 1, url));
3404        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));
3405        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));
3406        children.add(new Property("parent", "Reference(Device)", "The device that this device is attached to or is part of.", 0, 1, parent));
3407      }
3408
3409      @Override
3410      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3411        switch (_hash) {
3412        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);
3413        case -1014418093: /*definition*/  return new Property("definition", "Reference(DeviceDefinition)", "The reference to the definition for the device.", 0, 1, definition);
3414        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);
3415        case -892481550: /*status*/  return new Property("status", "code", "Status of the Device availability.", 0, 1, status);
3416        case 2051346646: /*statusReason*/  return new Property("statusReason", "CodeableConcept", "Reason for the dtatus of the Device availability.", 0, java.lang.Integer.MAX_VALUE, statusReason);
3417        case -1836176187: /*distinctIdentifier*/  return new Property("distinctIdentifier", "string", "The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product.", 0, 1, distinctIdentifier);
3418        case -1969347631: /*manufacturer*/  return new Property("manufacturer", "string", "A name of the manufacturer.", 0, 1, manufacturer);
3419        case 416714767: /*manufactureDate*/  return new Property("manufactureDate", "dateTime", "The date and time when the device was manufactured.", 0, 1, manufactureDate);
3420        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);
3421        case 462547450: /*lotNumber*/  return new Property("lotNumber", "string", "Lot number assigned by the manufacturer.", 0, 1, lotNumber);
3422        case 83787357: /*serialNumber*/  return new Property("serialNumber", "string", "The serial number assigned by the organization when the device was manufactured.", 0, 1, serialNumber);
3423        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);
3424        case 346619858: /*modelNumber*/  return new Property("modelNumber", "string", "The manufacturer's model number for the device.", 0, 1, modelNumber);
3425        case -731502308: /*partNumber*/  return new Property("partNumber", "string", "The part number or catalog number of the device.", 0, 1, partNumber);
3426        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind or type of device.", 0, 1, type);
3427        case 682815883: /*specialization*/  return new Property("specialization", "", "The capabilities supported on a  device, the standards to which the device conforms for a particular purpose, and used for the communication.", 0, java.lang.Integer.MAX_VALUE, specialization);
3428        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);
3429        case -993141291: /*property*/  return new Property("property", "", "The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.", 0, java.lang.Integer.MAX_VALUE, property);
3430        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "Patient information, If the device is affixed to a person.", 0, 1, patient);
3431        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);
3432        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);
3433        case 1901043637: /*location*/  return new Property("location", "Reference(Location)", "The place where the device can be found.", 0, 1, location);
3434        case 116079: /*url*/  return new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, 1, url);
3435        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);
3436        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);
3437        case -995424086: /*parent*/  return new Property("parent", "Reference(Device)", "The device that this device is attached to or is part of.", 0, 1, parent);
3438        default: return super.getNamedProperty(_hash, _name, _checkValid);
3439        }
3440
3441      }
3442
3443      @Override
3444      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3445        switch (hash) {
3446        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3447        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // Reference
3448        case -1343558178: /*udiCarrier*/ return this.udiCarrier == null ? new Base[0] : this.udiCarrier.toArray(new Base[this.udiCarrier.size()]); // DeviceUdiCarrierComponent
3449        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FHIRDeviceStatus>
3450        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : this.statusReason.toArray(new Base[this.statusReason.size()]); // CodeableConcept
3451        case -1836176187: /*distinctIdentifier*/ return this.distinctIdentifier == null ? new Base[0] : new Base[] {this.distinctIdentifier}; // StringType
3452        case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : new Base[] {this.manufacturer}; // StringType
3453        case 416714767: /*manufactureDate*/ return this.manufactureDate == null ? new Base[0] : new Base[] {this.manufactureDate}; // DateTimeType
3454        case -668811523: /*expirationDate*/ return this.expirationDate == null ? new Base[0] : new Base[] {this.expirationDate}; // DateTimeType
3455        case 462547450: /*lotNumber*/ return this.lotNumber == null ? new Base[0] : new Base[] {this.lotNumber}; // StringType
3456        case 83787357: /*serialNumber*/ return this.serialNumber == null ? new Base[0] : new Base[] {this.serialNumber}; // StringType
3457        case 780988929: /*deviceName*/ return this.deviceName == null ? new Base[0] : this.deviceName.toArray(new Base[this.deviceName.size()]); // DeviceDeviceNameComponent
3458        case 346619858: /*modelNumber*/ return this.modelNumber == null ? new Base[0] : new Base[] {this.modelNumber}; // StringType
3459        case -731502308: /*partNumber*/ return this.partNumber == null ? new Base[0] : new Base[] {this.partNumber}; // StringType
3460        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3461        case 682815883: /*specialization*/ return this.specialization == null ? new Base[0] : this.specialization.toArray(new Base[this.specialization.size()]); // DeviceSpecializationComponent
3462        case 351608024: /*version*/ return this.version == null ? new Base[0] : this.version.toArray(new Base[this.version.size()]); // DeviceVersionComponent
3463        case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // DevicePropertyComponent
3464        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
3465        case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference
3466        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactPoint
3467        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
3468        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
3469        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
3470        case -909893934: /*safety*/ return this.safety == null ? new Base[0] : this.safety.toArray(new Base[this.safety.size()]); // CodeableConcept
3471        case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Reference
3472        default: return super.getProperty(hash, name, checkValid);
3473        }
3474
3475      }
3476
3477      @Override
3478      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3479        switch (hash) {
3480        case -1618432855: // identifier
3481          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
3482          return value;
3483        case -1014418093: // definition
3484          this.definition = TypeConvertor.castToReference(value); // Reference
3485          return value;
3486        case -1343558178: // udiCarrier
3487          this.getUdiCarrier().add((DeviceUdiCarrierComponent) value); // DeviceUdiCarrierComponent
3488          return value;
3489        case -892481550: // status
3490          value = new FHIRDeviceStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3491          this.status = (Enumeration) value; // Enumeration<FHIRDeviceStatus>
3492          return value;
3493        case 2051346646: // statusReason
3494          this.getStatusReason().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3495          return value;
3496        case -1836176187: // distinctIdentifier
3497          this.distinctIdentifier = TypeConvertor.castToString(value); // StringType
3498          return value;
3499        case -1969347631: // manufacturer
3500          this.manufacturer = TypeConvertor.castToString(value); // StringType
3501          return value;
3502        case 416714767: // manufactureDate
3503          this.manufactureDate = TypeConvertor.castToDateTime(value); // DateTimeType
3504          return value;
3505        case -668811523: // expirationDate
3506          this.expirationDate = TypeConvertor.castToDateTime(value); // DateTimeType
3507          return value;
3508        case 462547450: // lotNumber
3509          this.lotNumber = TypeConvertor.castToString(value); // StringType
3510          return value;
3511        case 83787357: // serialNumber
3512          this.serialNumber = TypeConvertor.castToString(value); // StringType
3513          return value;
3514        case 780988929: // deviceName
3515          this.getDeviceName().add((DeviceDeviceNameComponent) value); // DeviceDeviceNameComponent
3516          return value;
3517        case 346619858: // modelNumber
3518          this.modelNumber = TypeConvertor.castToString(value); // StringType
3519          return value;
3520        case -731502308: // partNumber
3521          this.partNumber = TypeConvertor.castToString(value); // StringType
3522          return value;
3523        case 3575610: // type
3524          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3525          return value;
3526        case 682815883: // specialization
3527          this.getSpecialization().add((DeviceSpecializationComponent) value); // DeviceSpecializationComponent
3528          return value;
3529        case 351608024: // version
3530          this.getVersion().add((DeviceVersionComponent) value); // DeviceVersionComponent
3531          return value;
3532        case -993141291: // property
3533          this.getProperty().add((DevicePropertyComponent) value); // DevicePropertyComponent
3534          return value;
3535        case -791418107: // patient
3536          this.patient = TypeConvertor.castToReference(value); // Reference
3537          return value;
3538        case 106164915: // owner
3539          this.owner = TypeConvertor.castToReference(value); // Reference
3540          return value;
3541        case 951526432: // contact
3542          this.getContact().add(TypeConvertor.castToContactPoint(value)); // ContactPoint
3543          return value;
3544        case 1901043637: // location
3545          this.location = TypeConvertor.castToReference(value); // Reference
3546          return value;
3547        case 116079: // url
3548          this.url = TypeConvertor.castToUri(value); // UriType
3549          return value;
3550        case 3387378: // note
3551          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
3552          return value;
3553        case -909893934: // safety
3554          this.getSafety().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3555          return value;
3556        case -995424086: // parent
3557          this.parent = TypeConvertor.castToReference(value); // Reference
3558          return value;
3559        default: return super.setProperty(hash, name, value);
3560        }
3561
3562      }
3563
3564      @Override
3565      public Base setProperty(String name, Base value) throws FHIRException {
3566        if (name.equals("identifier")) {
3567          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
3568        } else if (name.equals("definition")) {
3569          this.definition = TypeConvertor.castToReference(value); // Reference
3570        } else if (name.equals("udiCarrier")) {
3571          this.getUdiCarrier().add((DeviceUdiCarrierComponent) value);
3572        } else if (name.equals("status")) {
3573          value = new FHIRDeviceStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3574          this.status = (Enumeration) value; // Enumeration<FHIRDeviceStatus>
3575        } else if (name.equals("statusReason")) {
3576          this.getStatusReason().add(TypeConvertor.castToCodeableConcept(value));
3577        } else if (name.equals("distinctIdentifier")) {
3578          this.distinctIdentifier = TypeConvertor.castToString(value); // StringType
3579        } else if (name.equals("manufacturer")) {
3580          this.manufacturer = TypeConvertor.castToString(value); // StringType
3581        } else if (name.equals("manufactureDate")) {
3582          this.manufactureDate = TypeConvertor.castToDateTime(value); // DateTimeType
3583        } else if (name.equals("expirationDate")) {
3584          this.expirationDate = TypeConvertor.castToDateTime(value); // DateTimeType
3585        } else if (name.equals("lotNumber")) {
3586          this.lotNumber = TypeConvertor.castToString(value); // StringType
3587        } else if (name.equals("serialNumber")) {
3588          this.serialNumber = TypeConvertor.castToString(value); // StringType
3589        } else if (name.equals("deviceName")) {
3590          this.getDeviceName().add((DeviceDeviceNameComponent) value);
3591        } else if (name.equals("modelNumber")) {
3592          this.modelNumber = TypeConvertor.castToString(value); // StringType
3593        } else if (name.equals("partNumber")) {
3594          this.partNumber = TypeConvertor.castToString(value); // StringType
3595        } else if (name.equals("type")) {
3596          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3597        } else if (name.equals("specialization")) {
3598          this.getSpecialization().add((DeviceSpecializationComponent) value);
3599        } else if (name.equals("version")) {
3600          this.getVersion().add((DeviceVersionComponent) value);
3601        } else if (name.equals("property")) {
3602          this.getProperty().add((DevicePropertyComponent) value);
3603        } else if (name.equals("patient")) {
3604          this.patient = TypeConvertor.castToReference(value); // Reference
3605        } else if (name.equals("owner")) {
3606          this.owner = TypeConvertor.castToReference(value); // Reference
3607        } else if (name.equals("contact")) {
3608          this.getContact().add(TypeConvertor.castToContactPoint(value));
3609        } else if (name.equals("location")) {
3610          this.location = TypeConvertor.castToReference(value); // Reference
3611        } else if (name.equals("url")) {
3612          this.url = TypeConvertor.castToUri(value); // UriType
3613        } else if (name.equals("note")) {
3614          this.getNote().add(TypeConvertor.castToAnnotation(value));
3615        } else if (name.equals("safety")) {
3616          this.getSafety().add(TypeConvertor.castToCodeableConcept(value));
3617        } else if (name.equals("parent")) {
3618          this.parent = TypeConvertor.castToReference(value); // Reference
3619        } else
3620          return super.setProperty(name, value);
3621        return value;
3622      }
3623
3624      @Override
3625      public Base makeProperty(int hash, String name) throws FHIRException {
3626        switch (hash) {
3627        case -1618432855:  return addIdentifier(); 
3628        case -1014418093:  return getDefinition();
3629        case -1343558178:  return addUdiCarrier(); 
3630        case -892481550:  return getStatusElement();
3631        case 2051346646:  return addStatusReason(); 
3632        case -1836176187:  return getDistinctIdentifierElement();
3633        case -1969347631:  return getManufacturerElement();
3634        case 416714767:  return getManufactureDateElement();
3635        case -668811523:  return getExpirationDateElement();
3636        case 462547450:  return getLotNumberElement();
3637        case 83787357:  return getSerialNumberElement();
3638        case 780988929:  return addDeviceName(); 
3639        case 346619858:  return getModelNumberElement();
3640        case -731502308:  return getPartNumberElement();
3641        case 3575610:  return getType();
3642        case 682815883:  return addSpecialization(); 
3643        case 351608024:  return addVersion(); 
3644        case -993141291:  return addProperty(); 
3645        case -791418107:  return getPatient();
3646        case 106164915:  return getOwner();
3647        case 951526432:  return addContact(); 
3648        case 1901043637:  return getLocation();
3649        case 116079:  return getUrlElement();
3650        case 3387378:  return addNote(); 
3651        case -909893934:  return addSafety(); 
3652        case -995424086:  return getParent();
3653        default: return super.makeProperty(hash, name);
3654        }
3655
3656      }
3657
3658      @Override
3659      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3660        switch (hash) {
3661        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3662        case -1014418093: /*definition*/ return new String[] {"Reference"};
3663        case -1343558178: /*udiCarrier*/ return new String[] {};
3664        case -892481550: /*status*/ return new String[] {"code"};
3665        case 2051346646: /*statusReason*/ return new String[] {"CodeableConcept"};
3666        case -1836176187: /*distinctIdentifier*/ return new String[] {"string"};
3667        case -1969347631: /*manufacturer*/ return new String[] {"string"};
3668        case 416714767: /*manufactureDate*/ return new String[] {"dateTime"};
3669        case -668811523: /*expirationDate*/ return new String[] {"dateTime"};
3670        case 462547450: /*lotNumber*/ return new String[] {"string"};
3671        case 83787357: /*serialNumber*/ return new String[] {"string"};
3672        case 780988929: /*deviceName*/ return new String[] {};
3673        case 346619858: /*modelNumber*/ return new String[] {"string"};
3674        case -731502308: /*partNumber*/ return new String[] {"string"};
3675        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3676        case 682815883: /*specialization*/ return new String[] {};
3677        case 351608024: /*version*/ return new String[] {};
3678        case -993141291: /*property*/ return new String[] {};
3679        case -791418107: /*patient*/ return new String[] {"Reference"};
3680        case 106164915: /*owner*/ return new String[] {"Reference"};
3681        case 951526432: /*contact*/ return new String[] {"ContactPoint"};
3682        case 1901043637: /*location*/ return new String[] {"Reference"};
3683        case 116079: /*url*/ return new String[] {"uri"};
3684        case 3387378: /*note*/ return new String[] {"Annotation"};
3685        case -909893934: /*safety*/ return new String[] {"CodeableConcept"};
3686        case -995424086: /*parent*/ return new String[] {"Reference"};
3687        default: return super.getTypesForProperty(hash, name);
3688        }
3689
3690      }
3691
3692      @Override
3693      public Base addChild(String name) throws FHIRException {
3694        if (name.equals("identifier")) {
3695          return addIdentifier();
3696        }
3697        else if (name.equals("definition")) {
3698          this.definition = new Reference();
3699          return this.definition;
3700        }
3701        else if (name.equals("udiCarrier")) {
3702          return addUdiCarrier();
3703        }
3704        else if (name.equals("status")) {
3705          throw new FHIRException("Cannot call addChild on a primitive type Device.status");
3706        }
3707        else if (name.equals("statusReason")) {
3708          return addStatusReason();
3709        }
3710        else if (name.equals("distinctIdentifier")) {
3711          throw new FHIRException("Cannot call addChild on a primitive type Device.distinctIdentifier");
3712        }
3713        else if (name.equals("manufacturer")) {
3714          throw new FHIRException("Cannot call addChild on a primitive type Device.manufacturer");
3715        }
3716        else if (name.equals("manufactureDate")) {
3717          throw new FHIRException("Cannot call addChild on a primitive type Device.manufactureDate");
3718        }
3719        else if (name.equals("expirationDate")) {
3720          throw new FHIRException("Cannot call addChild on a primitive type Device.expirationDate");
3721        }
3722        else if (name.equals("lotNumber")) {
3723          throw new FHIRException("Cannot call addChild on a primitive type Device.lotNumber");
3724        }
3725        else if (name.equals("serialNumber")) {
3726          throw new FHIRException("Cannot call addChild on a primitive type Device.serialNumber");
3727        }
3728        else if (name.equals("deviceName")) {
3729          return addDeviceName();
3730        }
3731        else if (name.equals("modelNumber")) {
3732          throw new FHIRException("Cannot call addChild on a primitive type Device.modelNumber");
3733        }
3734        else if (name.equals("partNumber")) {
3735          throw new FHIRException("Cannot call addChild on a primitive type Device.partNumber");
3736        }
3737        else if (name.equals("type")) {
3738          this.type = new CodeableConcept();
3739          return this.type;
3740        }
3741        else if (name.equals("specialization")) {
3742          return addSpecialization();
3743        }
3744        else if (name.equals("version")) {
3745          return addVersion();
3746        }
3747        else if (name.equals("property")) {
3748          return addProperty();
3749        }
3750        else if (name.equals("patient")) {
3751          this.patient = new Reference();
3752          return this.patient;
3753        }
3754        else if (name.equals("owner")) {
3755          this.owner = new Reference();
3756          return this.owner;
3757        }
3758        else if (name.equals("contact")) {
3759          return addContact();
3760        }
3761        else if (name.equals("location")) {
3762          this.location = new Reference();
3763          return this.location;
3764        }
3765        else if (name.equals("url")) {
3766          throw new FHIRException("Cannot call addChild on a primitive type Device.url");
3767        }
3768        else if (name.equals("note")) {
3769          return addNote();
3770        }
3771        else if (name.equals("safety")) {
3772          return addSafety();
3773        }
3774        else if (name.equals("parent")) {
3775          this.parent = new Reference();
3776          return this.parent;
3777        }
3778        else
3779          return super.addChild(name);
3780      }
3781
3782  public String fhirType() {
3783    return "Device";
3784
3785  }
3786
3787      public Device copy() {
3788        Device dst = new Device();
3789        copyValues(dst);
3790        return dst;
3791      }
3792
3793      public void copyValues(Device dst) {
3794        super.copyValues(dst);
3795        if (identifier != null) {
3796          dst.identifier = new ArrayList<Identifier>();
3797          for (Identifier i : identifier)
3798            dst.identifier.add(i.copy());
3799        };
3800        dst.definition = definition == null ? null : definition.copy();
3801        if (udiCarrier != null) {
3802          dst.udiCarrier = new ArrayList<DeviceUdiCarrierComponent>();
3803          for (DeviceUdiCarrierComponent i : udiCarrier)
3804            dst.udiCarrier.add(i.copy());
3805        };
3806        dst.status = status == null ? null : status.copy();
3807        if (statusReason != null) {
3808          dst.statusReason = new ArrayList<CodeableConcept>();
3809          for (CodeableConcept i : statusReason)
3810            dst.statusReason.add(i.copy());
3811        };
3812        dst.distinctIdentifier = distinctIdentifier == null ? null : distinctIdentifier.copy();
3813        dst.manufacturer = manufacturer == null ? null : manufacturer.copy();
3814        dst.manufactureDate = manufactureDate == null ? null : manufactureDate.copy();
3815        dst.expirationDate = expirationDate == null ? null : expirationDate.copy();
3816        dst.lotNumber = lotNumber == null ? null : lotNumber.copy();
3817        dst.serialNumber = serialNumber == null ? null : serialNumber.copy();
3818        if (deviceName != null) {
3819          dst.deviceName = new ArrayList<DeviceDeviceNameComponent>();
3820          for (DeviceDeviceNameComponent i : deviceName)
3821            dst.deviceName.add(i.copy());
3822        };
3823        dst.modelNumber = modelNumber == null ? null : modelNumber.copy();
3824        dst.partNumber = partNumber == null ? null : partNumber.copy();
3825        dst.type = type == null ? null : type.copy();
3826        if (specialization != null) {
3827          dst.specialization = new ArrayList<DeviceSpecializationComponent>();
3828          for (DeviceSpecializationComponent i : specialization)
3829            dst.specialization.add(i.copy());
3830        };
3831        if (version != null) {
3832          dst.version = new ArrayList<DeviceVersionComponent>();
3833          for (DeviceVersionComponent i : version)
3834            dst.version.add(i.copy());
3835        };
3836        if (property != null) {
3837          dst.property = new ArrayList<DevicePropertyComponent>();
3838          for (DevicePropertyComponent i : property)
3839            dst.property.add(i.copy());
3840        };
3841        dst.patient = patient == null ? null : patient.copy();
3842        dst.owner = owner == null ? null : owner.copy();
3843        if (contact != null) {
3844          dst.contact = new ArrayList<ContactPoint>();
3845          for (ContactPoint i : contact)
3846            dst.contact.add(i.copy());
3847        };
3848        dst.location = location == null ? null : location.copy();
3849        dst.url = url == null ? null : url.copy();
3850        if (note != null) {
3851          dst.note = new ArrayList<Annotation>();
3852          for (Annotation i : note)
3853            dst.note.add(i.copy());
3854        };
3855        if (safety != null) {
3856          dst.safety = new ArrayList<CodeableConcept>();
3857          for (CodeableConcept i : safety)
3858            dst.safety.add(i.copy());
3859        };
3860        dst.parent = parent == null ? null : parent.copy();
3861      }
3862
3863      protected Device typedCopy() {
3864        return copy();
3865      }
3866
3867      @Override
3868      public boolean equalsDeep(Base other_) {
3869        if (!super.equalsDeep(other_))
3870          return false;
3871        if (!(other_ instanceof Device))
3872          return false;
3873        Device o = (Device) other_;
3874        return compareDeep(identifier, o.identifier, true) && compareDeep(definition, o.definition, true)
3875           && compareDeep(udiCarrier, o.udiCarrier, true) && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true)
3876           && compareDeep(distinctIdentifier, o.distinctIdentifier, true) && compareDeep(manufacturer, o.manufacturer, true)
3877           && compareDeep(manufactureDate, o.manufactureDate, true) && compareDeep(expirationDate, o.expirationDate, true)
3878           && compareDeep(lotNumber, o.lotNumber, true) && compareDeep(serialNumber, o.serialNumber, true)
3879           && compareDeep(deviceName, o.deviceName, true) && compareDeep(modelNumber, o.modelNumber, true)
3880           && compareDeep(partNumber, o.partNumber, true) && compareDeep(type, o.type, true) && compareDeep(specialization, o.specialization, true)
3881           && compareDeep(version, o.version, true) && compareDeep(property, o.property, true) && compareDeep(patient, o.patient, true)
3882           && compareDeep(owner, o.owner, true) && compareDeep(contact, o.contact, true) && compareDeep(location, o.location, true)
3883           && compareDeep(url, o.url, true) && compareDeep(note, o.note, true) && compareDeep(safety, o.safety, true)
3884           && compareDeep(parent, o.parent, true);
3885      }
3886
3887      @Override
3888      public boolean equalsShallow(Base other_) {
3889        if (!super.equalsShallow(other_))
3890          return false;
3891        if (!(other_ instanceof Device))
3892          return false;
3893        Device o = (Device) other_;
3894        return compareValues(status, o.status, true) && compareValues(distinctIdentifier, o.distinctIdentifier, true)
3895           && compareValues(manufacturer, o.manufacturer, true) && compareValues(manufactureDate, o.manufactureDate, true)
3896           && compareValues(expirationDate, o.expirationDate, true) && compareValues(lotNumber, o.lotNumber, true)
3897           && compareValues(serialNumber, o.serialNumber, true) && compareValues(modelNumber, o.modelNumber, true)
3898           && compareValues(partNumber, o.partNumber, true) && compareValues(url, o.url, true);
3899      }
3900
3901      public boolean isEmpty() {
3902        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, definition, udiCarrier
3903          , status, statusReason, distinctIdentifier, manufacturer, manufactureDate, expirationDate
3904          , lotNumber, serialNumber, deviceName, modelNumber, partNumber, type, specialization
3905          , version, property, patient, owner, contact, location, url, note, safety
3906          , parent);
3907      }
3908
3909  @Override
3910  public ResourceType getResourceType() {
3911    return ResourceType.Device;
3912   }
3913
3914 /**
3915   * Search parameter: <b>device-name</b>
3916   * <p>
3917   * Description: <b>A server defined search that may match any of the string fields in Device.deviceName or Device.type.</b><br>
3918   * Type: <b>string</b><br>
3919   * Path: <b>Device.deviceName.name | Device.type.coding.display | Device.type.text</b><br>
3920   * </p>
3921   */
3922  @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" )
3923  public static final String SP_DEVICE_NAME = "device-name";
3924 /**
3925   * <b>Fluent Client</b> search parameter constant for <b>device-name</b>
3926   * <p>
3927   * Description: <b>A server defined search that may match any of the string fields in Device.deviceName or Device.type.</b><br>
3928   * Type: <b>string</b><br>
3929   * Path: <b>Device.deviceName.name | Device.type.coding.display | Device.type.text</b><br>
3930   * </p>
3931   */
3932  public static final ca.uhn.fhir.rest.gclient.StringClientParam DEVICE_NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DEVICE_NAME);
3933
3934 /**
3935   * Search parameter: <b>identifier</b>
3936   * <p>
3937   * Description: <b>Instance id from manufacturer, owner, and others</b><br>
3938   * Type: <b>token</b><br>
3939   * Path: <b>Device.identifier</b><br>
3940   * </p>
3941   */
3942  @SearchParamDefinition(name="identifier", path="Device.identifier", description="Instance id from manufacturer, owner, and others", type="token" )
3943  public static final String SP_IDENTIFIER = "identifier";
3944 /**
3945   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3946   * <p>
3947   * Description: <b>Instance id from manufacturer, owner, and others</b><br>
3948   * Type: <b>token</b><br>
3949   * Path: <b>Device.identifier</b><br>
3950   * </p>
3951   */
3952  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3953
3954 /**
3955   * Search parameter: <b>location</b>
3956   * <p>
3957   * Description: <b>A location, where the resource is found</b><br>
3958   * Type: <b>reference</b><br>
3959   * Path: <b>Device.location</b><br>
3960   * </p>
3961   */
3962  @SearchParamDefinition(name="location", path="Device.location", description="A location, where the resource is found", type="reference", target={Location.class } )
3963  public static final String SP_LOCATION = "location";
3964 /**
3965   * <b>Fluent Client</b> search parameter constant for <b>location</b>
3966   * <p>
3967   * Description: <b>A location, where the resource is found</b><br>
3968   * Type: <b>reference</b><br>
3969   * Path: <b>Device.location</b><br>
3970   * </p>
3971   */
3972  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION);
3973
3974/**
3975   * Constant for fluent queries to be used to add include statements. Specifies
3976   * the path value of "<b>Device:location</b>".
3977   */
3978  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Device:location").toLocked();
3979
3980 /**
3981   * Search parameter: <b>manufacturer</b>
3982   * <p>
3983   * Description: <b>The manufacturer of the device</b><br>
3984   * Type: <b>string</b><br>
3985   * Path: <b>Device.manufacturer</b><br>
3986   * </p>
3987   */
3988  @SearchParamDefinition(name="manufacturer", path="Device.manufacturer", description="The manufacturer of the device", type="string" )
3989  public static final String SP_MANUFACTURER = "manufacturer";
3990 /**
3991   * <b>Fluent Client</b> search parameter constant for <b>manufacturer</b>
3992   * <p>
3993   * Description: <b>The manufacturer of the device</b><br>
3994   * Type: <b>string</b><br>
3995   * Path: <b>Device.manufacturer</b><br>
3996   * </p>
3997   */
3998  public static final ca.uhn.fhir.rest.gclient.StringClientParam MANUFACTURER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_MANUFACTURER);
3999
4000 /**
4001   * Search parameter: <b>model</b>
4002   * <p>
4003   * Description: <b>The model of the device</b><br>
4004   * Type: <b>string</b><br>
4005   * Path: <b>Device.modelNumber</b><br>
4006   * </p>
4007   */
4008  @SearchParamDefinition(name="model", path="Device.modelNumber", description="The model of the device", type="string" )
4009  public static final String SP_MODEL = "model";
4010 /**
4011   * <b>Fluent Client</b> search parameter constant for <b>model</b>
4012   * <p>
4013   * Description: <b>The model of the device</b><br>
4014   * Type: <b>string</b><br>
4015   * Path: <b>Device.modelNumber</b><br>
4016   * </p>
4017   */
4018  public static final ca.uhn.fhir.rest.gclient.StringClientParam MODEL = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_MODEL);
4019
4020 /**
4021   * Search parameter: <b>organization</b>
4022   * <p>
4023   * Description: <b>The organization responsible for the device</b><br>
4024   * Type: <b>reference</b><br>
4025   * Path: <b>Device.owner</b><br>
4026   * </p>
4027   */
4028  @SearchParamDefinition(name="organization", path="Device.owner", description="The organization responsible for the device", type="reference", target={Organization.class } )
4029  public static final String SP_ORGANIZATION = "organization";
4030 /**
4031   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
4032   * <p>
4033   * Description: <b>The organization responsible for the device</b><br>
4034   * Type: <b>reference</b><br>
4035   * Path: <b>Device.owner</b><br>
4036   * </p>
4037   */
4038  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
4039
4040/**
4041   * Constant for fluent queries to be used to add include statements. Specifies
4042   * the path value of "<b>Device:organization</b>".
4043   */
4044  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Device:organization").toLocked();
4045
4046 /**
4047   * Search parameter: <b>patient</b>
4048   * <p>
4049   * Description: <b>Patient information, if the resource is affixed to a person</b><br>
4050   * Type: <b>reference</b><br>
4051   * Path: <b>Device.patient</b><br>
4052   * </p>
4053   */
4054  @SearchParamDefinition(name="patient", path="Device.patient", description="Patient information, if the resource is affixed to a person", type="reference", target={Patient.class } )
4055  public static final String SP_PATIENT = "patient";
4056 /**
4057   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
4058   * <p>
4059   * Description: <b>Patient information, if the resource is affixed to a person</b><br>
4060   * Type: <b>reference</b><br>
4061   * Path: <b>Device.patient</b><br>
4062   * </p>
4063   */
4064  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
4065
4066/**
4067   * Constant for fluent queries to be used to add include statements. Specifies
4068   * the path value of "<b>Device:patient</b>".
4069   */
4070  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Device:patient").toLocked();
4071
4072 /**
4073   * Search parameter: <b>status</b>
4074   * <p>
4075   * Description: <b>active | inactive | entered-in-error | unknown</b><br>
4076   * Type: <b>token</b><br>
4077   * Path: <b>Device.status</b><br>
4078   * </p>
4079   */
4080  @SearchParamDefinition(name="status", path="Device.status", description="active | inactive | entered-in-error | unknown", type="token" )
4081  public static final String SP_STATUS = "status";
4082 /**
4083   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4084   * <p>
4085   * Description: <b>active | inactive | entered-in-error | unknown</b><br>
4086   * Type: <b>token</b><br>
4087   * Path: <b>Device.status</b><br>
4088   * </p>
4089   */
4090  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4091
4092 /**
4093   * Search parameter: <b>type</b>
4094   * <p>
4095   * Description: <b>The type of the device</b><br>
4096   * Type: <b>token</b><br>
4097   * Path: <b>Device.type</b><br>
4098   * </p>
4099   */
4100  @SearchParamDefinition(name="type", path="Device.type", description="The type of the device", type="token" )
4101  public static final String SP_TYPE = "type";
4102 /**
4103   * <b>Fluent Client</b> search parameter constant for <b>type</b>
4104   * <p>
4105   * Description: <b>The type of the device</b><br>
4106   * Type: <b>token</b><br>
4107   * Path: <b>Device.type</b><br>
4108   * </p>
4109   */
4110  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
4111
4112 /**
4113   * Search parameter: <b>udi-carrier</b>
4114   * <p>
4115   * Description: <b>UDI Barcode (RFID or other technology) string in *HRF* format.</b><br>
4116   * Type: <b>string</b><br>
4117   * Path: <b>Device.udiCarrier.carrierHRF</b><br>
4118   * </p>
4119   */
4120  @SearchParamDefinition(name="udi-carrier", path="Device.udiCarrier.carrierHRF", description="UDI Barcode (RFID or other technology) string in *HRF* format.", type="string" )
4121  public static final String SP_UDI_CARRIER = "udi-carrier";
4122 /**
4123   * <b>Fluent Client</b> search parameter constant for <b>udi-carrier</b>
4124   * <p>
4125   * Description: <b>UDI Barcode (RFID or other technology) string in *HRF* format.</b><br>
4126   * Type: <b>string</b><br>
4127   * Path: <b>Device.udiCarrier.carrierHRF</b><br>
4128   * </p>
4129   */
4130  public static final ca.uhn.fhir.rest.gclient.StringClientParam UDI_CARRIER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_UDI_CARRIER);
4131
4132 /**
4133   * Search parameter: <b>udi-di</b>
4134   * <p>
4135   * Description: <b>The udi Device Identifier (DI)</b><br>
4136   * Type: <b>string</b><br>
4137   * Path: <b>Device.udiCarrier.deviceIdentifier</b><br>
4138   * </p>
4139   */
4140  @SearchParamDefinition(name="udi-di", path="Device.udiCarrier.deviceIdentifier", description="The udi Device Identifier (DI)", type="string" )
4141  public static final String SP_UDI_DI = "udi-di";
4142 /**
4143   * <b>Fluent Client</b> search parameter constant for <b>udi-di</b>
4144   * <p>
4145   * Description: <b>The udi Device Identifier (DI)</b><br>
4146   * Type: <b>string</b><br>
4147   * Path: <b>Device.udiCarrier.deviceIdentifier</b><br>
4148   * </p>
4149   */
4150  public static final ca.uhn.fhir.rest.gclient.StringClientParam UDI_DI = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_UDI_DI);
4151
4152 /**
4153   * Search parameter: <b>url</b>
4154   * <p>
4155   * Description: <b>Network address to contact device</b><br>
4156   * Type: <b>uri</b><br>
4157   * Path: <b>Device.url</b><br>
4158   * </p>
4159   */
4160  @SearchParamDefinition(name="url", path="Device.url", description="Network address to contact device", type="uri" )
4161  public static final String SP_URL = "url";
4162 /**
4163   * <b>Fluent Client</b> search parameter constant for <b>url</b>
4164   * <p>
4165   * Description: <b>Network address to contact device</b><br>
4166   * Type: <b>uri</b><br>
4167   * Path: <b>Device.url</b><br>
4168   * </p>
4169   */
4170  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
4171
4172 /**
4173   * Search parameter: <b>din</b>
4174   * <p>
4175   * Description: <b>The donation identification number (DIN)</b><br>
4176   * Type: <b>token</b><br>
4177   * Path: <b>Device.extension('http://hl7.org/fhir/SearchParameter/device-extensions-Device-din')</b><br>
4178   * </p>
4179   */
4180  @SearchParamDefinition(name="din", path="Device.extension('http://hl7.org/fhir/SearchParameter/device-extensions-Device-din')", description="The donation identification number (DIN)", type="token" )
4181  public static final String SP_DIN = "din";
4182 /**
4183   * <b>Fluent Client</b> search parameter constant for <b>din</b>
4184   * <p>
4185   * Description: <b>The donation identification number (DIN)</b><br>
4186   * Type: <b>token</b><br>
4187   * Path: <b>Device.extension('http://hl7.org/fhir/SearchParameter/device-extensions-Device-din')</b><br>
4188   * </p>
4189   */
4190  public static final ca.uhn.fhir.rest.gclient.TokenClientParam DIN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DIN);
4191
4192
4193}
4194