001package org.hl7.fhir.dstu3.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Mon, Apr 17, 2017 17:38-0400 for FHIR v3.0.1
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import ca.uhn.fhir.model.api.annotation.ResourceDef;
038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
039import ca.uhn.fhir.model.api.annotation.Child;
040import ca.uhn.fhir.model.api.annotation.ChildOrder;
041import ca.uhn.fhir.model.api.annotation.Description;
042import ca.uhn.fhir.model.api.annotation.Block;
043import org.hl7.fhir.instance.model.api.*;
044import org.hl7.fhir.exceptions.FHIRException;
045/**
046 * This resource identifies an instance or 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.  Medical devices include durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.  Non-medical devices may include items such as a machine, cellphone, computer, application, etc.
047 */
048@ResourceDef(name="Device", profile="http://hl7.org/fhir/Profile/Device")
049public class Device extends DomainResource {
050
051    public enum UDIEntryType {
052        /**
053         * A Barcode scanner captured the data from the device label
054         */
055        BARCODE, 
056        /**
057         * An RFID chip reader captured the data from the device label
058         */
059        RFID, 
060        /**
061         * The data was read from the label by a person and manually entered. (e.g.  via a keyboard)
062         */
063        MANUAL, 
064        /**
065         * The data originated from a patient's implant card and read by an operator.
066         */
067        CARD, 
068        /**
069         * The data originated from a patient source and not directly scanned or read from a label or card.
070         */
071        SELFREPORTED, 
072        /**
073         * The method of data capture has not been determined
074         */
075        UNKNOWN, 
076        /**
077         * added to help the parsers with the generic types
078         */
079        NULL;
080        public static UDIEntryType fromCode(String codeString) throws FHIRException {
081            if (codeString == null || "".equals(codeString))
082                return null;
083        if ("barcode".equals(codeString))
084          return BARCODE;
085        if ("rfid".equals(codeString))
086          return RFID;
087        if ("manual".equals(codeString))
088          return MANUAL;
089        if ("card".equals(codeString))
090          return CARD;
091        if ("self-reported".equals(codeString))
092          return SELFREPORTED;
093        if ("unknown".equals(codeString))
094          return UNKNOWN;
095        if (Configuration.isAcceptInvalidEnums())
096          return null;
097        else
098          throw new FHIRException("Unknown UDIEntryType code '"+codeString+"'");
099        }
100        public String toCode() {
101          switch (this) {
102            case BARCODE: return "barcode";
103            case RFID: return "rfid";
104            case MANUAL: return "manual";
105            case CARD: return "card";
106            case SELFREPORTED: return "self-reported";
107            case UNKNOWN: return "unknown";
108            default: return "?";
109          }
110        }
111        public String getSystem() {
112          switch (this) {
113            case BARCODE: return "http://hl7.org/fhir/udi-entry-type";
114            case RFID: return "http://hl7.org/fhir/udi-entry-type";
115            case MANUAL: return "http://hl7.org/fhir/udi-entry-type";
116            case CARD: return "http://hl7.org/fhir/udi-entry-type";
117            case SELFREPORTED: return "http://hl7.org/fhir/udi-entry-type";
118            case UNKNOWN: return "http://hl7.org/fhir/udi-entry-type";
119            default: return "?";
120          }
121        }
122        public String getDefinition() {
123          switch (this) {
124            case BARCODE: return "A Barcode scanner captured the data from the device label";
125            case RFID: return "An RFID chip reader captured the data from the device label";
126            case MANUAL: return "The data was read from the label by a person and manually entered. (e.g.  via a keyboard)";
127            case CARD: return "The data originated from a patient's implant card and read by an operator.";
128            case SELFREPORTED: return "The data originated from a patient source and not directly scanned or read from a label or card.";
129            case UNKNOWN: return "The method of data capture has not been determined";
130            default: return "?";
131          }
132        }
133        public String getDisplay() {
134          switch (this) {
135            case BARCODE: return "BarCode";
136            case RFID: return "RFID";
137            case MANUAL: return "Manual";
138            case CARD: return "Card";
139            case SELFREPORTED: return "Self Reported";
140            case UNKNOWN: return "Unknown";
141            default: return "?";
142          }
143        }
144    }
145
146  public static class UDIEntryTypeEnumFactory implements EnumFactory<UDIEntryType> {
147    public UDIEntryType fromCode(String codeString) throws IllegalArgumentException {
148      if (codeString == null || "".equals(codeString))
149            if (codeString == null || "".equals(codeString))
150                return null;
151        if ("barcode".equals(codeString))
152          return UDIEntryType.BARCODE;
153        if ("rfid".equals(codeString))
154          return UDIEntryType.RFID;
155        if ("manual".equals(codeString))
156          return UDIEntryType.MANUAL;
157        if ("card".equals(codeString))
158          return UDIEntryType.CARD;
159        if ("self-reported".equals(codeString))
160          return UDIEntryType.SELFREPORTED;
161        if ("unknown".equals(codeString))
162          return UDIEntryType.UNKNOWN;
163        throw new IllegalArgumentException("Unknown UDIEntryType code '"+codeString+"'");
164        }
165        public Enumeration<UDIEntryType> fromType(Base code) throws FHIRException {
166          if (code == null)
167            return null;
168          if (code.isEmpty())
169            return new Enumeration<UDIEntryType>(this);
170          String codeString = ((PrimitiveType) code).asStringValue();
171          if (codeString == null || "".equals(codeString))
172            return null;
173        if ("barcode".equals(codeString))
174          return new Enumeration<UDIEntryType>(this, UDIEntryType.BARCODE);
175        if ("rfid".equals(codeString))
176          return new Enumeration<UDIEntryType>(this, UDIEntryType.RFID);
177        if ("manual".equals(codeString))
178          return new Enumeration<UDIEntryType>(this, UDIEntryType.MANUAL);
179        if ("card".equals(codeString))
180          return new Enumeration<UDIEntryType>(this, UDIEntryType.CARD);
181        if ("self-reported".equals(codeString))
182          return new Enumeration<UDIEntryType>(this, UDIEntryType.SELFREPORTED);
183        if ("unknown".equals(codeString))
184          return new Enumeration<UDIEntryType>(this, UDIEntryType.UNKNOWN);
185        throw new FHIRException("Unknown UDIEntryType code '"+codeString+"'");
186        }
187    public String toCode(UDIEntryType code) {
188      if (code == UDIEntryType.BARCODE)
189        return "barcode";
190      if (code == UDIEntryType.RFID)
191        return "rfid";
192      if (code == UDIEntryType.MANUAL)
193        return "manual";
194      if (code == UDIEntryType.CARD)
195        return "card";
196      if (code == UDIEntryType.SELFREPORTED)
197        return "self-reported";
198      if (code == UDIEntryType.UNKNOWN)
199        return "unknown";
200      return "?";
201      }
202    public String toSystem(UDIEntryType code) {
203      return code.getSystem();
204      }
205    }
206
207    public enum FHIRDeviceStatus {
208        /**
209         * The Device is available for use.  Note: This means for *implanted devices*  the device is implanted in the patient.
210         */
211        ACTIVE, 
212        /**
213         * The Device is no longer available for use (e.g. lost, expired, damaged).  Note: This means for *implanted devices*  the device has been removed from the patient.
214         */
215        INACTIVE, 
216        /**
217         * The Device was entered in error and voided.
218         */
219        ENTEREDINERROR, 
220        /**
221         * The status of the device has not been determined.
222         */
223        UNKNOWN, 
224        /**
225         * added to help the parsers with the generic types
226         */
227        NULL;
228        public static FHIRDeviceStatus fromCode(String codeString) throws FHIRException {
229            if (codeString == null || "".equals(codeString))
230                return null;
231        if ("active".equals(codeString))
232          return ACTIVE;
233        if ("inactive".equals(codeString))
234          return INACTIVE;
235        if ("entered-in-error".equals(codeString))
236          return ENTEREDINERROR;
237        if ("unknown".equals(codeString))
238          return UNKNOWN;
239        if (Configuration.isAcceptInvalidEnums())
240          return null;
241        else
242          throw new FHIRException("Unknown FHIRDeviceStatus code '"+codeString+"'");
243        }
244        public String toCode() {
245          switch (this) {
246            case ACTIVE: return "active";
247            case INACTIVE: return "inactive";
248            case ENTEREDINERROR: return "entered-in-error";
249            case UNKNOWN: return "unknown";
250            default: return "?";
251          }
252        }
253        public String getSystem() {
254          switch (this) {
255            case ACTIVE: return "http://hl7.org/fhir/device-status";
256            case INACTIVE: return "http://hl7.org/fhir/device-status";
257            case ENTEREDINERROR: return "http://hl7.org/fhir/device-status";
258            case UNKNOWN: return "http://hl7.org/fhir/device-status";
259            default: return "?";
260          }
261        }
262        public String getDefinition() {
263          switch (this) {
264            case ACTIVE: return "The Device is available for use.  Note: This means for *implanted devices*  the device is implanted in the patient.";
265            case INACTIVE: return "The Device is no longer available for use (e.g. lost, expired, damaged).  Note: This means for *implanted devices*  the device has been removed from the patient.";
266            case ENTEREDINERROR: return "The Device was entered in error and voided.";
267            case UNKNOWN: return "The status of the device has not been determined.";
268            default: return "?";
269          }
270        }
271        public String getDisplay() {
272          switch (this) {
273            case ACTIVE: return "Active";
274            case INACTIVE: return "Inactive";
275            case ENTEREDINERROR: return "Entered in Error";
276            case UNKNOWN: return "Unknown";
277            default: return "?";
278          }
279        }
280    }
281
282  public static class FHIRDeviceStatusEnumFactory implements EnumFactory<FHIRDeviceStatus> {
283    public FHIRDeviceStatus fromCode(String codeString) throws IllegalArgumentException {
284      if (codeString == null || "".equals(codeString))
285            if (codeString == null || "".equals(codeString))
286                return null;
287        if ("active".equals(codeString))
288          return FHIRDeviceStatus.ACTIVE;
289        if ("inactive".equals(codeString))
290          return FHIRDeviceStatus.INACTIVE;
291        if ("entered-in-error".equals(codeString))
292          return FHIRDeviceStatus.ENTEREDINERROR;
293        if ("unknown".equals(codeString))
294          return FHIRDeviceStatus.UNKNOWN;
295        throw new IllegalArgumentException("Unknown FHIRDeviceStatus code '"+codeString+"'");
296        }
297        public Enumeration<FHIRDeviceStatus> fromType(Base code) throws FHIRException {
298          if (code == null)
299            return null;
300          if (code.isEmpty())
301            return new Enumeration<FHIRDeviceStatus>(this);
302          String codeString = ((PrimitiveType) code).asStringValue();
303          if (codeString == null || "".equals(codeString))
304            return null;
305        if ("active".equals(codeString))
306          return new Enumeration<FHIRDeviceStatus>(this, FHIRDeviceStatus.ACTIVE);
307        if ("inactive".equals(codeString))
308          return new Enumeration<FHIRDeviceStatus>(this, FHIRDeviceStatus.INACTIVE);
309        if ("entered-in-error".equals(codeString))
310          return new Enumeration<FHIRDeviceStatus>(this, FHIRDeviceStatus.ENTEREDINERROR);
311        if ("unknown".equals(codeString))
312          return new Enumeration<FHIRDeviceStatus>(this, FHIRDeviceStatus.UNKNOWN);
313        throw new FHIRException("Unknown FHIRDeviceStatus code '"+codeString+"'");
314        }
315    public String toCode(FHIRDeviceStatus code) {
316      if (code == FHIRDeviceStatus.ACTIVE)
317        return "active";
318      if (code == FHIRDeviceStatus.INACTIVE)
319        return "inactive";
320      if (code == FHIRDeviceStatus.ENTEREDINERROR)
321        return "entered-in-error";
322      if (code == FHIRDeviceStatus.UNKNOWN)
323        return "unknown";
324      return "?";
325      }
326    public String toSystem(FHIRDeviceStatus code) {
327      return code.getSystem();
328      }
329    }
330
331    @Block()
332    public static class DeviceUdiComponent extends BackboneElement implements IBaseBackboneElement {
333        /**
334         * 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.
335         */
336        @Child(name = "deviceIdentifier", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
337        @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." )
338        protected StringType deviceIdentifier;
339
340        /**
341         * Name of device as used in labeling or catalog.
342         */
343        @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
344        @Description(shortDefinition="Device Name as appears on UDI label", formalDefinition="Name of device as used in labeling or catalog." )
345        protected StringType name;
346
347        /**
348         * 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.
349         */
350        @Child(name = "jurisdiction", type = {UriType.class}, order=3, min=0, max=1, modifier=false, summary=false)
351        @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." )
352        protected UriType jurisdiction;
353
354        /**
355         * The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.
356         */
357        @Child(name = "carrierHRF", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
358        @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." )
359        protected StringType carrierHRF;
360
361        /**
362         * 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.
363         */
364        @Child(name = "carrierAIDC", type = {Base64BinaryType.class}, order=5, min=0, max=1, modifier=false, summary=true)
365        @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." )
366        protected Base64BinaryType carrierAIDC;
367
368        /**
369         * Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :
3701) GS1: 
371http://hl7.org/fhir/NamingSystem/gs1-di, 
3722) HIBCC:
373http://hl7.org/fhir/NamingSystem/hibcc-dI, 
3743) ICCBBA for blood containers:
375http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
3764) ICCBA for other devices:
377http://hl7.org/fhir/NamingSystem/iccbba-other-di.
378         */
379        @Child(name = "issuer", type = {UriType.class}, order=6, min=0, max=1, modifier=false, summary=false)
380        @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." )
381        protected UriType issuer;
382
383        /**
384         * A coded entry to indicate how the data was entered.
385         */
386        @Child(name = "entryType", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=false)
387        @Description(shortDefinition="barcode | rfid | manual +", formalDefinition="A coded entry to indicate how the data was entered." )
388        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/udi-entry-type")
389        protected Enumeration<UDIEntryType> entryType;
390
391        private static final long serialVersionUID = -1105798343L;
392
393    /**
394     * Constructor
395     */
396      public DeviceUdiComponent() {
397        super();
398      }
399
400        /**
401         * @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
402         */
403        public StringType getDeviceIdentifierElement() { 
404          if (this.deviceIdentifier == null)
405            if (Configuration.errorOnAutoCreate())
406              throw new Error("Attempt to auto-create DeviceUdiComponent.deviceIdentifier");
407            else if (Configuration.doAutoCreate())
408              this.deviceIdentifier = new StringType(); // bb
409          return this.deviceIdentifier;
410        }
411
412        public boolean hasDeviceIdentifierElement() { 
413          return this.deviceIdentifier != null && !this.deviceIdentifier.isEmpty();
414        }
415
416        public boolean hasDeviceIdentifier() { 
417          return this.deviceIdentifier != null && !this.deviceIdentifier.isEmpty();
418        }
419
420        /**
421         * @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
422         */
423        public DeviceUdiComponent setDeviceIdentifierElement(StringType value) { 
424          this.deviceIdentifier = value;
425          return this;
426        }
427
428        /**
429         * @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.
430         */
431        public String getDeviceIdentifier() { 
432          return this.deviceIdentifier == null ? null : this.deviceIdentifier.getValue();
433        }
434
435        /**
436         * @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.
437         */
438        public DeviceUdiComponent setDeviceIdentifier(String value) { 
439          if (Utilities.noString(value))
440            this.deviceIdentifier = null;
441          else {
442            if (this.deviceIdentifier == null)
443              this.deviceIdentifier = new StringType();
444            this.deviceIdentifier.setValue(value);
445          }
446          return this;
447        }
448
449        /**
450         * @return {@link #name} (Name of device as used in labeling or catalog.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
451         */
452        public StringType getNameElement() { 
453          if (this.name == null)
454            if (Configuration.errorOnAutoCreate())
455              throw new Error("Attempt to auto-create DeviceUdiComponent.name");
456            else if (Configuration.doAutoCreate())
457              this.name = new StringType(); // bb
458          return this.name;
459        }
460
461        public boolean hasNameElement() { 
462          return this.name != null && !this.name.isEmpty();
463        }
464
465        public boolean hasName() { 
466          return this.name != null && !this.name.isEmpty();
467        }
468
469        /**
470         * @param value {@link #name} (Name of device as used in labeling or catalog.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
471         */
472        public DeviceUdiComponent setNameElement(StringType value) { 
473          this.name = value;
474          return this;
475        }
476
477        /**
478         * @return Name of device as used in labeling or catalog.
479         */
480        public String getName() { 
481          return this.name == null ? null : this.name.getValue();
482        }
483
484        /**
485         * @param value Name of device as used in labeling or catalog.
486         */
487        public DeviceUdiComponent setName(String value) { 
488          if (Utilities.noString(value))
489            this.name = null;
490          else {
491            if (this.name == null)
492              this.name = new StringType();
493            this.name.setValue(value);
494          }
495          return this;
496        }
497
498        /**
499         * @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
500         */
501        public UriType getJurisdictionElement() { 
502          if (this.jurisdiction == null)
503            if (Configuration.errorOnAutoCreate())
504              throw new Error("Attempt to auto-create DeviceUdiComponent.jurisdiction");
505            else if (Configuration.doAutoCreate())
506              this.jurisdiction = new UriType(); // bb
507          return this.jurisdiction;
508        }
509
510        public boolean hasJurisdictionElement() { 
511          return this.jurisdiction != null && !this.jurisdiction.isEmpty();
512        }
513
514        public boolean hasJurisdiction() { 
515          return this.jurisdiction != null && !this.jurisdiction.isEmpty();
516        }
517
518        /**
519         * @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
520         */
521        public DeviceUdiComponent setJurisdictionElement(UriType value) { 
522          this.jurisdiction = value;
523          return this;
524        }
525
526        /**
527         * @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.
528         */
529        public String getJurisdiction() { 
530          return this.jurisdiction == null ? null : this.jurisdiction.getValue();
531        }
532
533        /**
534         * @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.
535         */
536        public DeviceUdiComponent setJurisdiction(String value) { 
537          if (Utilities.noString(value))
538            this.jurisdiction = null;
539          else {
540            if (this.jurisdiction == null)
541              this.jurisdiction = new UriType();
542            this.jurisdiction.setValue(value);
543          }
544          return this;
545        }
546
547        /**
548         * @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
549         */
550        public StringType getCarrierHRFElement() { 
551          if (this.carrierHRF == null)
552            if (Configuration.errorOnAutoCreate())
553              throw new Error("Attempt to auto-create DeviceUdiComponent.carrierHRF");
554            else if (Configuration.doAutoCreate())
555              this.carrierHRF = new StringType(); // bb
556          return this.carrierHRF;
557        }
558
559        public boolean hasCarrierHRFElement() { 
560          return this.carrierHRF != null && !this.carrierHRF.isEmpty();
561        }
562
563        public boolean hasCarrierHRF() { 
564          return this.carrierHRF != null && !this.carrierHRF.isEmpty();
565        }
566
567        /**
568         * @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
569         */
570        public DeviceUdiComponent setCarrierHRFElement(StringType value) { 
571          this.carrierHRF = value;
572          return this;
573        }
574
575        /**
576         * @return The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.
577         */
578        public String getCarrierHRF() { 
579          return this.carrierHRF == null ? null : this.carrierHRF.getValue();
580        }
581
582        /**
583         * @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.
584         */
585        public DeviceUdiComponent setCarrierHRF(String value) { 
586          if (Utilities.noString(value))
587            this.carrierHRF = null;
588          else {
589            if (this.carrierHRF == null)
590              this.carrierHRF = new StringType();
591            this.carrierHRF.setValue(value);
592          }
593          return this;
594        }
595
596        /**
597         * @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
598         */
599        public Base64BinaryType getCarrierAIDCElement() { 
600          if (this.carrierAIDC == null)
601            if (Configuration.errorOnAutoCreate())
602              throw new Error("Attempt to auto-create DeviceUdiComponent.carrierAIDC");
603            else if (Configuration.doAutoCreate())
604              this.carrierAIDC = new Base64BinaryType(); // bb
605          return this.carrierAIDC;
606        }
607
608        public boolean hasCarrierAIDCElement() { 
609          return this.carrierAIDC != null && !this.carrierAIDC.isEmpty();
610        }
611
612        public boolean hasCarrierAIDC() { 
613          return this.carrierAIDC != null && !this.carrierAIDC.isEmpty();
614        }
615
616        /**
617         * @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
618         */
619        public DeviceUdiComponent setCarrierAIDCElement(Base64BinaryType value) { 
620          this.carrierAIDC = value;
621          return this;
622        }
623
624        /**
625         * @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.
626         */
627        public byte[] getCarrierAIDC() { 
628          return this.carrierAIDC == null ? null : this.carrierAIDC.getValue();
629        }
630
631        /**
632         * @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.
633         */
634        public DeviceUdiComponent setCarrierAIDC(byte[] value) { 
635          if (value == null)
636            this.carrierAIDC = null;
637          else {
638            if (this.carrierAIDC == null)
639              this.carrierAIDC = new Base64BinaryType();
640            this.carrierAIDC.setValue(value);
641          }
642          return this;
643        }
644
645        /**
646         * @return {@link #issuer} (Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :
6471) GS1: 
648http://hl7.org/fhir/NamingSystem/gs1-di, 
6492) HIBCC:
650http://hl7.org/fhir/NamingSystem/hibcc-dI, 
6513) ICCBBA for blood containers:
652http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
6534) ICCBA for other devices:
654http://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
655         */
656        public UriType getIssuerElement() { 
657          if (this.issuer == null)
658            if (Configuration.errorOnAutoCreate())
659              throw new Error("Attempt to auto-create DeviceUdiComponent.issuer");
660            else if (Configuration.doAutoCreate())
661              this.issuer = new UriType(); // bb
662          return this.issuer;
663        }
664
665        public boolean hasIssuerElement() { 
666          return this.issuer != null && !this.issuer.isEmpty();
667        }
668
669        public boolean hasIssuer() { 
670          return this.issuer != null && !this.issuer.isEmpty();
671        }
672
673        /**
674         * @param value {@link #issuer} (Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :
6751) GS1: 
676http://hl7.org/fhir/NamingSystem/gs1-di, 
6772) HIBCC:
678http://hl7.org/fhir/NamingSystem/hibcc-dI, 
6793) ICCBBA for blood containers:
680http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
6814) ICCBA for other devices:
682http://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
683         */
684        public DeviceUdiComponent setIssuerElement(UriType value) { 
685          this.issuer = value;
686          return this;
687        }
688
689        /**
690         * @return Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :
6911) GS1: 
692http://hl7.org/fhir/NamingSystem/gs1-di, 
6932) HIBCC:
694http://hl7.org/fhir/NamingSystem/hibcc-dI, 
6953) ICCBBA for blood containers:
696http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
6974) ICCBA for other devices:
698http://hl7.org/fhir/NamingSystem/iccbba-other-di.
699         */
700        public String getIssuer() { 
701          return this.issuer == null ? null : this.issuer.getValue();
702        }
703
704        /**
705         * @param value Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :
7061) GS1: 
707http://hl7.org/fhir/NamingSystem/gs1-di, 
7082) HIBCC:
709http://hl7.org/fhir/NamingSystem/hibcc-dI, 
7103) ICCBBA for blood containers:
711http://hl7.org/fhir/NamingSystem/iccbba-blood-di, 
7124) ICCBA for other devices:
713http://hl7.org/fhir/NamingSystem/iccbba-other-di.
714         */
715        public DeviceUdiComponent setIssuer(String value) { 
716          if (Utilities.noString(value))
717            this.issuer = null;
718          else {
719            if (this.issuer == null)
720              this.issuer = new UriType();
721            this.issuer.setValue(value);
722          }
723          return this;
724        }
725
726        /**
727         * @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
728         */
729        public Enumeration<UDIEntryType> getEntryTypeElement() { 
730          if (this.entryType == null)
731            if (Configuration.errorOnAutoCreate())
732              throw new Error("Attempt to auto-create DeviceUdiComponent.entryType");
733            else if (Configuration.doAutoCreate())
734              this.entryType = new Enumeration<UDIEntryType>(new UDIEntryTypeEnumFactory()); // bb
735          return this.entryType;
736        }
737
738        public boolean hasEntryTypeElement() { 
739          return this.entryType != null && !this.entryType.isEmpty();
740        }
741
742        public boolean hasEntryType() { 
743          return this.entryType != null && !this.entryType.isEmpty();
744        }
745
746        /**
747         * @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
748         */
749        public DeviceUdiComponent setEntryTypeElement(Enumeration<UDIEntryType> value) { 
750          this.entryType = value;
751          return this;
752        }
753
754        /**
755         * @return A coded entry to indicate how the data was entered.
756         */
757        public UDIEntryType getEntryType() { 
758          return this.entryType == null ? null : this.entryType.getValue();
759        }
760
761        /**
762         * @param value A coded entry to indicate how the data was entered.
763         */
764        public DeviceUdiComponent setEntryType(UDIEntryType value) { 
765          if (value == null)
766            this.entryType = null;
767          else {
768            if (this.entryType == null)
769              this.entryType = new Enumeration<UDIEntryType>(new UDIEntryTypeEnumFactory());
770            this.entryType.setValue(value);
771          }
772          return this;
773        }
774
775        protected void listChildren(List<Property> childrenList) {
776          super.listChildren(childrenList);
777          childrenList.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, java.lang.Integer.MAX_VALUE, deviceIdentifier));
778          childrenList.add(new Property("name", "string", "Name of device as used in labeling or catalog.", 0, java.lang.Integer.MAX_VALUE, name));
779          childrenList.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, java.lang.Integer.MAX_VALUE, jurisdiction));
780          childrenList.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, java.lang.Integer.MAX_VALUE, carrierHRF));
781          childrenList.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, java.lang.Integer.MAX_VALUE, carrierAIDC));
782          childrenList.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, java.lang.Integer.MAX_VALUE, issuer));
783          childrenList.add(new Property("entryType", "code", "A coded entry to indicate how the data was entered.", 0, java.lang.Integer.MAX_VALUE, entryType));
784        }
785
786      @Override
787      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
788        switch (hash) {
789        case 1322005407: /*deviceIdentifier*/ return this.deviceIdentifier == null ? new Base[0] : new Base[] {this.deviceIdentifier}; // StringType
790        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
791        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : new Base[] {this.jurisdiction}; // UriType
792        case 806499972: /*carrierHRF*/ return this.carrierHRF == null ? new Base[0] : new Base[] {this.carrierHRF}; // StringType
793        case -768521825: /*carrierAIDC*/ return this.carrierAIDC == null ? new Base[0] : new Base[] {this.carrierAIDC}; // Base64BinaryType
794        case -1179159879: /*issuer*/ return this.issuer == null ? new Base[0] : new Base[] {this.issuer}; // UriType
795        case -479362356: /*entryType*/ return this.entryType == null ? new Base[0] : new Base[] {this.entryType}; // Enumeration<UDIEntryType>
796        default: return super.getProperty(hash, name, checkValid);
797        }
798
799      }
800
801      @Override
802      public Base setProperty(int hash, String name, Base value) throws FHIRException {
803        switch (hash) {
804        case 1322005407: // deviceIdentifier
805          this.deviceIdentifier = castToString(value); // StringType
806          return value;
807        case 3373707: // name
808          this.name = castToString(value); // StringType
809          return value;
810        case -507075711: // jurisdiction
811          this.jurisdiction = castToUri(value); // UriType
812          return value;
813        case 806499972: // carrierHRF
814          this.carrierHRF = castToString(value); // StringType
815          return value;
816        case -768521825: // carrierAIDC
817          this.carrierAIDC = castToBase64Binary(value); // Base64BinaryType
818          return value;
819        case -1179159879: // issuer
820          this.issuer = castToUri(value); // UriType
821          return value;
822        case -479362356: // entryType
823          value = new UDIEntryTypeEnumFactory().fromType(castToCode(value));
824          this.entryType = (Enumeration) value; // Enumeration<UDIEntryType>
825          return value;
826        default: return super.setProperty(hash, name, value);
827        }
828
829      }
830
831      @Override
832      public Base setProperty(String name, Base value) throws FHIRException {
833        if (name.equals("deviceIdentifier")) {
834          this.deviceIdentifier = castToString(value); // StringType
835        } else if (name.equals("name")) {
836          this.name = castToString(value); // StringType
837        } else if (name.equals("jurisdiction")) {
838          this.jurisdiction = castToUri(value); // UriType
839        } else if (name.equals("carrierHRF")) {
840          this.carrierHRF = castToString(value); // StringType
841        } else if (name.equals("carrierAIDC")) {
842          this.carrierAIDC = castToBase64Binary(value); // Base64BinaryType
843        } else if (name.equals("issuer")) {
844          this.issuer = castToUri(value); // UriType
845        } else if (name.equals("entryType")) {
846          value = new UDIEntryTypeEnumFactory().fromType(castToCode(value));
847          this.entryType = (Enumeration) value; // Enumeration<UDIEntryType>
848        } else
849          return super.setProperty(name, value);
850        return value;
851      }
852
853      @Override
854      public Base makeProperty(int hash, String name) throws FHIRException {
855        switch (hash) {
856        case 1322005407:  return getDeviceIdentifierElement();
857        case 3373707:  return getNameElement();
858        case -507075711:  return getJurisdictionElement();
859        case 806499972:  return getCarrierHRFElement();
860        case -768521825:  return getCarrierAIDCElement();
861        case -1179159879:  return getIssuerElement();
862        case -479362356:  return getEntryTypeElement();
863        default: return super.makeProperty(hash, name);
864        }
865
866      }
867
868      @Override
869      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
870        switch (hash) {
871        case 1322005407: /*deviceIdentifier*/ return new String[] {"string"};
872        case 3373707: /*name*/ return new String[] {"string"};
873        case -507075711: /*jurisdiction*/ return new String[] {"uri"};
874        case 806499972: /*carrierHRF*/ return new String[] {"string"};
875        case -768521825: /*carrierAIDC*/ return new String[] {"base64Binary"};
876        case -1179159879: /*issuer*/ return new String[] {"uri"};
877        case -479362356: /*entryType*/ return new String[] {"code"};
878        default: return super.getTypesForProperty(hash, name);
879        }
880
881      }
882
883      @Override
884      public Base addChild(String name) throws FHIRException {
885        if (name.equals("deviceIdentifier")) {
886          throw new FHIRException("Cannot call addChild on a primitive type Device.deviceIdentifier");
887        }
888        else if (name.equals("name")) {
889          throw new FHIRException("Cannot call addChild on a primitive type Device.name");
890        }
891        else if (name.equals("jurisdiction")) {
892          throw new FHIRException("Cannot call addChild on a primitive type Device.jurisdiction");
893        }
894        else if (name.equals("carrierHRF")) {
895          throw new FHIRException("Cannot call addChild on a primitive type Device.carrierHRF");
896        }
897        else if (name.equals("carrierAIDC")) {
898          throw new FHIRException("Cannot call addChild on a primitive type Device.carrierAIDC");
899        }
900        else if (name.equals("issuer")) {
901          throw new FHIRException("Cannot call addChild on a primitive type Device.issuer");
902        }
903        else if (name.equals("entryType")) {
904          throw new FHIRException("Cannot call addChild on a primitive type Device.entryType");
905        }
906        else
907          return super.addChild(name);
908      }
909
910      public DeviceUdiComponent copy() {
911        DeviceUdiComponent dst = new DeviceUdiComponent();
912        copyValues(dst);
913        dst.deviceIdentifier = deviceIdentifier == null ? null : deviceIdentifier.copy();
914        dst.name = name == null ? null : name.copy();
915        dst.jurisdiction = jurisdiction == null ? null : jurisdiction.copy();
916        dst.carrierHRF = carrierHRF == null ? null : carrierHRF.copy();
917        dst.carrierAIDC = carrierAIDC == null ? null : carrierAIDC.copy();
918        dst.issuer = issuer == null ? null : issuer.copy();
919        dst.entryType = entryType == null ? null : entryType.copy();
920        return dst;
921      }
922
923      @Override
924      public boolean equalsDeep(Base other) {
925        if (!super.equalsDeep(other))
926          return false;
927        if (!(other instanceof DeviceUdiComponent))
928          return false;
929        DeviceUdiComponent o = (DeviceUdiComponent) other;
930        return compareDeep(deviceIdentifier, o.deviceIdentifier, true) && compareDeep(name, o.name, true)
931           && compareDeep(jurisdiction, o.jurisdiction, true) && compareDeep(carrierHRF, o.carrierHRF, true)
932           && compareDeep(carrierAIDC, o.carrierAIDC, true) && compareDeep(issuer, o.issuer, true) && compareDeep(entryType, o.entryType, true)
933          ;
934      }
935
936      @Override
937      public boolean equalsShallow(Base other) {
938        if (!super.equalsShallow(other))
939          return false;
940        if (!(other instanceof DeviceUdiComponent))
941          return false;
942        DeviceUdiComponent o = (DeviceUdiComponent) other;
943        return compareValues(deviceIdentifier, o.deviceIdentifier, true) && compareValues(name, o.name, true)
944           && compareValues(jurisdiction, o.jurisdiction, true) && compareValues(carrierHRF, o.carrierHRF, true)
945           && compareValues(carrierAIDC, o.carrierAIDC, true) && compareValues(issuer, o.issuer, true) && compareValues(entryType, o.entryType, true)
946          ;
947      }
948
949      public boolean isEmpty() {
950        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(deviceIdentifier, name, jurisdiction
951          , carrierHRF, carrierAIDC, issuer, entryType);
952      }
953
954  public String fhirType() {
955    return "Device.udi";
956
957  }
958
959  }
960
961    /**
962     * Unique instance identifiers assigned to a device by manufacturers other organizations or owners.
963     */
964    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
965    @Description(shortDefinition="Instance identifier", formalDefinition="Unique instance identifiers assigned to a device by manufacturers other organizations or owners." )
966    protected List<Identifier> identifier;
967
968    /**
969     * [Unique device identifier (UDI)](device.html#5.11.3.2.2) assigned to device label or package.
970     */
971    @Child(name = "udi", type = {}, order=1, min=0, max=1, modifier=false, summary=true)
972    @Description(shortDefinition="Unique Device Identifier (UDI) Barcode string", formalDefinition="[Unique device identifier (UDI)](device.html#5.11.3.2.2) assigned to device label or package." )
973    protected DeviceUdiComponent udi;
974
975    /**
976     * Status of the Device availability.
977     */
978    @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true)
979    @Description(shortDefinition="active | inactive | entered-in-error | unknown", formalDefinition="Status of the Device availability." )
980    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-status")
981    protected Enumeration<FHIRDeviceStatus> status;
982
983    /**
984     * Code or identifier to identify a kind of device.
985     */
986    @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
987    @Description(shortDefinition="What kind of device this is", formalDefinition="Code or identifier to identify a kind of device." )
988    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-kind")
989    protected CodeableConcept type;
990
991    /**
992     * Lot number assigned by the manufacturer.
993     */
994    @Child(name = "lotNumber", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
995    @Description(shortDefinition="Lot number of manufacture", formalDefinition="Lot number assigned by the manufacturer." )
996    protected StringType lotNumber;
997
998    /**
999     * A name of the manufacturer.
1000     */
1001    @Child(name = "manufacturer", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
1002    @Description(shortDefinition="Name of device manufacturer", formalDefinition="A name of the manufacturer." )
1003    protected StringType manufacturer;
1004
1005    /**
1006     * The date and time when the device was manufactured.
1007     */
1008    @Child(name = "manufactureDate", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=false)
1009    @Description(shortDefinition="Date when the device was made", formalDefinition="The date and time when the device was manufactured." )
1010    protected DateTimeType manufactureDate;
1011
1012    /**
1013     * The date and time beyond which this device is no longer valid or should not be used (if applicable).
1014     */
1015    @Child(name = "expirationDate", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=false)
1016    @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)." )
1017    protected DateTimeType expirationDate;
1018
1019    /**
1020     * The "model" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.
1021     */
1022    @Child(name = "model", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
1023    @Description(shortDefinition="Model id assigned by the manufacturer", formalDefinition="The \"model\" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type." )
1024    protected StringType model;
1025
1026    /**
1027     * The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.
1028     */
1029    @Child(name = "version", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
1030    @Description(shortDefinition="Version number (i.e. software)", formalDefinition="The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware." )
1031    protected StringType version;
1032
1033    /**
1034     * Patient information, If the device is affixed to a person.
1035     */
1036    @Child(name = "patient", type = {Patient.class}, order=10, min=0, max=1, modifier=false, summary=false)
1037    @Description(shortDefinition="Patient to whom Device is affixed", formalDefinition="Patient information, If the device is affixed to a person." )
1038    protected Reference patient;
1039
1040    /**
1041     * The actual object that is the target of the reference (Patient information, If the device is affixed to a person.)
1042     */
1043    protected Patient patientTarget;
1044
1045    /**
1046     * An organization that is responsible for the provision and ongoing maintenance of the device.
1047     */
1048    @Child(name = "owner", type = {Organization.class}, order=11, min=0, max=1, modifier=false, summary=false)
1049    @Description(shortDefinition="Organization responsible for device", formalDefinition="An organization that is responsible for the provision and ongoing maintenance of the device." )
1050    protected Reference owner;
1051
1052    /**
1053     * The actual object that is the target of the reference (An organization that is responsible for the provision and ongoing maintenance of the device.)
1054     */
1055    protected Organization ownerTarget;
1056
1057    /**
1058     * Contact details for an organization or a particular human that is responsible for the device.
1059     */
1060    @Child(name = "contact", type = {ContactPoint.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1061    @Description(shortDefinition="Details for human/organization for support", formalDefinition="Contact details for an organization or a particular human that is responsible for the device." )
1062    protected List<ContactPoint> contact;
1063
1064    /**
1065     * The place where the device can be found.
1066     */
1067    @Child(name = "location", type = {Location.class}, order=13, min=0, max=1, modifier=false, summary=false)
1068    @Description(shortDefinition="Where the resource is found", formalDefinition="The place where the device can be found." )
1069    protected Reference location;
1070
1071    /**
1072     * The actual object that is the target of the reference (The place where the device can be found.)
1073     */
1074    protected Location locationTarget;
1075
1076    /**
1077     * A network address on which the device may be contacted directly.
1078     */
1079    @Child(name = "url", type = {UriType.class}, order=14, min=0, max=1, modifier=false, summary=false)
1080    @Description(shortDefinition="Network address to contact device", formalDefinition="A network address on which the device may be contacted directly." )
1081    protected UriType url;
1082
1083    /**
1084     * Descriptive information, usage information or implantation information that is not captured in an existing element.
1085     */
1086    @Child(name = "note", type = {Annotation.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1087    @Description(shortDefinition="Device notes and comments", formalDefinition="Descriptive information, usage information or implantation information that is not captured in an existing element." )
1088    protected List<Annotation> note;
1089
1090    /**
1091     * Provides additional safety characteristics about a medical device.  For example devices containing latex.
1092     */
1093    @Child(name = "safety", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1094    @Description(shortDefinition="Safety Characteristics of Device", formalDefinition="Provides additional safety characteristics about a medical device.  For example devices containing latex." )
1095    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-safety")
1096    protected List<CodeableConcept> safety;
1097
1098    private static final long serialVersionUID = -1056263930L;
1099
1100  /**
1101   * Constructor
1102   */
1103    public Device() {
1104      super();
1105    }
1106
1107    /**
1108     * @return {@link #identifier} (Unique instance identifiers assigned to a device by manufacturers other organizations or owners.)
1109     */
1110    public List<Identifier> getIdentifier() { 
1111      if (this.identifier == null)
1112        this.identifier = new ArrayList<Identifier>();
1113      return this.identifier;
1114    }
1115
1116    /**
1117     * @return Returns a reference to <code>this</code> for easy method chaining
1118     */
1119    public Device setIdentifier(List<Identifier> theIdentifier) { 
1120      this.identifier = theIdentifier;
1121      return this;
1122    }
1123
1124    public boolean hasIdentifier() { 
1125      if (this.identifier == null)
1126        return false;
1127      for (Identifier item : this.identifier)
1128        if (!item.isEmpty())
1129          return true;
1130      return false;
1131    }
1132
1133    public Identifier addIdentifier() { //3
1134      Identifier t = new Identifier();
1135      if (this.identifier == null)
1136        this.identifier = new ArrayList<Identifier>();
1137      this.identifier.add(t);
1138      return t;
1139    }
1140
1141    public Device addIdentifier(Identifier t) { //3
1142      if (t == null)
1143        return this;
1144      if (this.identifier == null)
1145        this.identifier = new ArrayList<Identifier>();
1146      this.identifier.add(t);
1147      return this;
1148    }
1149
1150    /**
1151     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1152     */
1153    public Identifier getIdentifierFirstRep() { 
1154      if (getIdentifier().isEmpty()) {
1155        addIdentifier();
1156      }
1157      return getIdentifier().get(0);
1158    }
1159
1160    /**
1161     * @return {@link #udi} ([Unique device identifier (UDI)](device.html#5.11.3.2.2) assigned to device label or package.)
1162     */
1163    public DeviceUdiComponent getUdi() { 
1164      if (this.udi == null)
1165        if (Configuration.errorOnAutoCreate())
1166          throw new Error("Attempt to auto-create Device.udi");
1167        else if (Configuration.doAutoCreate())
1168          this.udi = new DeviceUdiComponent(); // cc
1169      return this.udi;
1170    }
1171
1172    public boolean hasUdi() { 
1173      return this.udi != null && !this.udi.isEmpty();
1174    }
1175
1176    /**
1177     * @param value {@link #udi} ([Unique device identifier (UDI)](device.html#5.11.3.2.2) assigned to device label or package.)
1178     */
1179    public Device setUdi(DeviceUdiComponent value) { 
1180      this.udi = value;
1181      return this;
1182    }
1183
1184    /**
1185     * @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
1186     */
1187    public Enumeration<FHIRDeviceStatus> getStatusElement() { 
1188      if (this.status == null)
1189        if (Configuration.errorOnAutoCreate())
1190          throw new Error("Attempt to auto-create Device.status");
1191        else if (Configuration.doAutoCreate())
1192          this.status = new Enumeration<FHIRDeviceStatus>(new FHIRDeviceStatusEnumFactory()); // bb
1193      return this.status;
1194    }
1195
1196    public boolean hasStatusElement() { 
1197      return this.status != null && !this.status.isEmpty();
1198    }
1199
1200    public boolean hasStatus() { 
1201      return this.status != null && !this.status.isEmpty();
1202    }
1203
1204    /**
1205     * @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
1206     */
1207    public Device setStatusElement(Enumeration<FHIRDeviceStatus> value) { 
1208      this.status = value;
1209      return this;
1210    }
1211
1212    /**
1213     * @return Status of the Device availability.
1214     */
1215    public FHIRDeviceStatus getStatus() { 
1216      return this.status == null ? null : this.status.getValue();
1217    }
1218
1219    /**
1220     * @param value Status of the Device availability.
1221     */
1222    public Device setStatus(FHIRDeviceStatus value) { 
1223      if (value == null)
1224        this.status = null;
1225      else {
1226        if (this.status == null)
1227          this.status = new Enumeration<FHIRDeviceStatus>(new FHIRDeviceStatusEnumFactory());
1228        this.status.setValue(value);
1229      }
1230      return this;
1231    }
1232
1233    /**
1234     * @return {@link #type} (Code or identifier to identify a kind of device.)
1235     */
1236    public CodeableConcept getType() { 
1237      if (this.type == null)
1238        if (Configuration.errorOnAutoCreate())
1239          throw new Error("Attempt to auto-create Device.type");
1240        else if (Configuration.doAutoCreate())
1241          this.type = new CodeableConcept(); // cc
1242      return this.type;
1243    }
1244
1245    public boolean hasType() { 
1246      return this.type != null && !this.type.isEmpty();
1247    }
1248
1249    /**
1250     * @param value {@link #type} (Code or identifier to identify a kind of device.)
1251     */
1252    public Device setType(CodeableConcept value) { 
1253      this.type = value;
1254      return this;
1255    }
1256
1257    /**
1258     * @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
1259     */
1260    public StringType getLotNumberElement() { 
1261      if (this.lotNumber == null)
1262        if (Configuration.errorOnAutoCreate())
1263          throw new Error("Attempt to auto-create Device.lotNumber");
1264        else if (Configuration.doAutoCreate())
1265          this.lotNumber = new StringType(); // bb
1266      return this.lotNumber;
1267    }
1268
1269    public boolean hasLotNumberElement() { 
1270      return this.lotNumber != null && !this.lotNumber.isEmpty();
1271    }
1272
1273    public boolean hasLotNumber() { 
1274      return this.lotNumber != null && !this.lotNumber.isEmpty();
1275    }
1276
1277    /**
1278     * @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
1279     */
1280    public Device setLotNumberElement(StringType value) { 
1281      this.lotNumber = value;
1282      return this;
1283    }
1284
1285    /**
1286     * @return Lot number assigned by the manufacturer.
1287     */
1288    public String getLotNumber() { 
1289      return this.lotNumber == null ? null : this.lotNumber.getValue();
1290    }
1291
1292    /**
1293     * @param value Lot number assigned by the manufacturer.
1294     */
1295    public Device setLotNumber(String value) { 
1296      if (Utilities.noString(value))
1297        this.lotNumber = null;
1298      else {
1299        if (this.lotNumber == null)
1300          this.lotNumber = new StringType();
1301        this.lotNumber.setValue(value);
1302      }
1303      return this;
1304    }
1305
1306    /**
1307     * @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
1308     */
1309    public StringType getManufacturerElement() { 
1310      if (this.manufacturer == null)
1311        if (Configuration.errorOnAutoCreate())
1312          throw new Error("Attempt to auto-create Device.manufacturer");
1313        else if (Configuration.doAutoCreate())
1314          this.manufacturer = new StringType(); // bb
1315      return this.manufacturer;
1316    }
1317
1318    public boolean hasManufacturerElement() { 
1319      return this.manufacturer != null && !this.manufacturer.isEmpty();
1320    }
1321
1322    public boolean hasManufacturer() { 
1323      return this.manufacturer != null && !this.manufacturer.isEmpty();
1324    }
1325
1326    /**
1327     * @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
1328     */
1329    public Device setManufacturerElement(StringType value) { 
1330      this.manufacturer = value;
1331      return this;
1332    }
1333
1334    /**
1335     * @return A name of the manufacturer.
1336     */
1337    public String getManufacturer() { 
1338      return this.manufacturer == null ? null : this.manufacturer.getValue();
1339    }
1340
1341    /**
1342     * @param value A name of the manufacturer.
1343     */
1344    public Device setManufacturer(String value) { 
1345      if (Utilities.noString(value))
1346        this.manufacturer = null;
1347      else {
1348        if (this.manufacturer == null)
1349          this.manufacturer = new StringType();
1350        this.manufacturer.setValue(value);
1351      }
1352      return this;
1353    }
1354
1355    /**
1356     * @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
1357     */
1358    public DateTimeType getManufactureDateElement() { 
1359      if (this.manufactureDate == null)
1360        if (Configuration.errorOnAutoCreate())
1361          throw new Error("Attempt to auto-create Device.manufactureDate");
1362        else if (Configuration.doAutoCreate())
1363          this.manufactureDate = new DateTimeType(); // bb
1364      return this.manufactureDate;
1365    }
1366
1367    public boolean hasManufactureDateElement() { 
1368      return this.manufactureDate != null && !this.manufactureDate.isEmpty();
1369    }
1370
1371    public boolean hasManufactureDate() { 
1372      return this.manufactureDate != null && !this.manufactureDate.isEmpty();
1373    }
1374
1375    /**
1376     * @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
1377     */
1378    public Device setManufactureDateElement(DateTimeType value) { 
1379      this.manufactureDate = value;
1380      return this;
1381    }
1382
1383    /**
1384     * @return The date and time when the device was manufactured.
1385     */
1386    public Date getManufactureDate() { 
1387      return this.manufactureDate == null ? null : this.manufactureDate.getValue();
1388    }
1389
1390    /**
1391     * @param value The date and time when the device was manufactured.
1392     */
1393    public Device setManufactureDate(Date value) { 
1394      if (value == null)
1395        this.manufactureDate = null;
1396      else {
1397        if (this.manufactureDate == null)
1398          this.manufactureDate = new DateTimeType();
1399        this.manufactureDate.setValue(value);
1400      }
1401      return this;
1402    }
1403
1404    /**
1405     * @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
1406     */
1407    public DateTimeType getExpirationDateElement() { 
1408      if (this.expirationDate == null)
1409        if (Configuration.errorOnAutoCreate())
1410          throw new Error("Attempt to auto-create Device.expirationDate");
1411        else if (Configuration.doAutoCreate())
1412          this.expirationDate = new DateTimeType(); // bb
1413      return this.expirationDate;
1414    }
1415
1416    public boolean hasExpirationDateElement() { 
1417      return this.expirationDate != null && !this.expirationDate.isEmpty();
1418    }
1419
1420    public boolean hasExpirationDate() { 
1421      return this.expirationDate != null && !this.expirationDate.isEmpty();
1422    }
1423
1424    /**
1425     * @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
1426     */
1427    public Device setExpirationDateElement(DateTimeType value) { 
1428      this.expirationDate = value;
1429      return this;
1430    }
1431
1432    /**
1433     * @return The date and time beyond which this device is no longer valid or should not be used (if applicable).
1434     */
1435    public Date getExpirationDate() { 
1436      return this.expirationDate == null ? null : this.expirationDate.getValue();
1437    }
1438
1439    /**
1440     * @param value The date and time beyond which this device is no longer valid or should not be used (if applicable).
1441     */
1442    public Device setExpirationDate(Date value) { 
1443      if (value == null)
1444        this.expirationDate = null;
1445      else {
1446        if (this.expirationDate == null)
1447          this.expirationDate = new DateTimeType();
1448        this.expirationDate.setValue(value);
1449      }
1450      return this;
1451    }
1452
1453    /**
1454     * @return {@link #model} (The "model" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value
1455     */
1456    public StringType getModelElement() { 
1457      if (this.model == null)
1458        if (Configuration.errorOnAutoCreate())
1459          throw new Error("Attempt to auto-create Device.model");
1460        else if (Configuration.doAutoCreate())
1461          this.model = new StringType(); // bb
1462      return this.model;
1463    }
1464
1465    public boolean hasModelElement() { 
1466      return this.model != null && !this.model.isEmpty();
1467    }
1468
1469    public boolean hasModel() { 
1470      return this.model != null && !this.model.isEmpty();
1471    }
1472
1473    /**
1474     * @param value {@link #model} (The "model" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value
1475     */
1476    public Device setModelElement(StringType value) { 
1477      this.model = value;
1478      return this;
1479    }
1480
1481    /**
1482     * @return The "model" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.
1483     */
1484    public String getModel() { 
1485      return this.model == null ? null : this.model.getValue();
1486    }
1487
1488    /**
1489     * @param value The "model" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.
1490     */
1491    public Device setModel(String value) { 
1492      if (Utilities.noString(value))
1493        this.model = null;
1494      else {
1495        if (this.model == null)
1496          this.model = new StringType();
1497        this.model.setValue(value);
1498      }
1499      return this;
1500    }
1501
1502    /**
1503     * @return {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1504     */
1505    public StringType getVersionElement() { 
1506      if (this.version == null)
1507        if (Configuration.errorOnAutoCreate())
1508          throw new Error("Attempt to auto-create Device.version");
1509        else if (Configuration.doAutoCreate())
1510          this.version = new StringType(); // bb
1511      return this.version;
1512    }
1513
1514    public boolean hasVersionElement() { 
1515      return this.version != null && !this.version.isEmpty();
1516    }
1517
1518    public boolean hasVersion() { 
1519      return this.version != null && !this.version.isEmpty();
1520    }
1521
1522    /**
1523     * @param value {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1524     */
1525    public Device setVersionElement(StringType value) { 
1526      this.version = value;
1527      return this;
1528    }
1529
1530    /**
1531     * @return The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.
1532     */
1533    public String getVersion() { 
1534      return this.version == null ? null : this.version.getValue();
1535    }
1536
1537    /**
1538     * @param value The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.
1539     */
1540    public Device setVersion(String value) { 
1541      if (Utilities.noString(value))
1542        this.version = null;
1543      else {
1544        if (this.version == null)
1545          this.version = new StringType();
1546        this.version.setValue(value);
1547      }
1548      return this;
1549    }
1550
1551    /**
1552     * @return {@link #patient} (Patient information, If the device is affixed to a person.)
1553     */
1554    public Reference getPatient() { 
1555      if (this.patient == null)
1556        if (Configuration.errorOnAutoCreate())
1557          throw new Error("Attempt to auto-create Device.patient");
1558        else if (Configuration.doAutoCreate())
1559          this.patient = new Reference(); // cc
1560      return this.patient;
1561    }
1562
1563    public boolean hasPatient() { 
1564      return this.patient != null && !this.patient.isEmpty();
1565    }
1566
1567    /**
1568     * @param value {@link #patient} (Patient information, If the device is affixed to a person.)
1569     */
1570    public Device setPatient(Reference value) { 
1571      this.patient = value;
1572      return this;
1573    }
1574
1575    /**
1576     * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient information, If the device is affixed to a person.)
1577     */
1578    public Patient getPatientTarget() { 
1579      if (this.patientTarget == null)
1580        if (Configuration.errorOnAutoCreate())
1581          throw new Error("Attempt to auto-create Device.patient");
1582        else if (Configuration.doAutoCreate())
1583          this.patientTarget = new Patient(); // aa
1584      return this.patientTarget;
1585    }
1586
1587    /**
1588     * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient information, If the device is affixed to a person.)
1589     */
1590    public Device setPatientTarget(Patient value) { 
1591      this.patientTarget = value;
1592      return this;
1593    }
1594
1595    /**
1596     * @return {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.)
1597     */
1598    public Reference getOwner() { 
1599      if (this.owner == null)
1600        if (Configuration.errorOnAutoCreate())
1601          throw new Error("Attempt to auto-create Device.owner");
1602        else if (Configuration.doAutoCreate())
1603          this.owner = new Reference(); // cc
1604      return this.owner;
1605    }
1606
1607    public boolean hasOwner() { 
1608      return this.owner != null && !this.owner.isEmpty();
1609    }
1610
1611    /**
1612     * @param value {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.)
1613     */
1614    public Device setOwner(Reference value) { 
1615      this.owner = value;
1616      return this;
1617    }
1618
1619    /**
1620     * @return {@link #owner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An organization that is responsible for the provision and ongoing maintenance of the device.)
1621     */
1622    public Organization getOwnerTarget() { 
1623      if (this.ownerTarget == null)
1624        if (Configuration.errorOnAutoCreate())
1625          throw new Error("Attempt to auto-create Device.owner");
1626        else if (Configuration.doAutoCreate())
1627          this.ownerTarget = new Organization(); // aa
1628      return this.ownerTarget;
1629    }
1630
1631    /**
1632     * @param value {@link #owner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An organization that is responsible for the provision and ongoing maintenance of the device.)
1633     */
1634    public Device setOwnerTarget(Organization value) { 
1635      this.ownerTarget = value;
1636      return this;
1637    }
1638
1639    /**
1640     * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.)
1641     */
1642    public List<ContactPoint> getContact() { 
1643      if (this.contact == null)
1644        this.contact = new ArrayList<ContactPoint>();
1645      return this.contact;
1646    }
1647
1648    /**
1649     * @return Returns a reference to <code>this</code> for easy method chaining
1650     */
1651    public Device setContact(List<ContactPoint> theContact) { 
1652      this.contact = theContact;
1653      return this;
1654    }
1655
1656    public boolean hasContact() { 
1657      if (this.contact == null)
1658        return false;
1659      for (ContactPoint item : this.contact)
1660        if (!item.isEmpty())
1661          return true;
1662      return false;
1663    }
1664
1665    public ContactPoint addContact() { //3
1666      ContactPoint t = new ContactPoint();
1667      if (this.contact == null)
1668        this.contact = new ArrayList<ContactPoint>();
1669      this.contact.add(t);
1670      return t;
1671    }
1672
1673    public Device addContact(ContactPoint t) { //3
1674      if (t == null)
1675        return this;
1676      if (this.contact == null)
1677        this.contact = new ArrayList<ContactPoint>();
1678      this.contact.add(t);
1679      return this;
1680    }
1681
1682    /**
1683     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
1684     */
1685    public ContactPoint getContactFirstRep() { 
1686      if (getContact().isEmpty()) {
1687        addContact();
1688      }
1689      return getContact().get(0);
1690    }
1691
1692    /**
1693     * @return {@link #location} (The place where the device can be found.)
1694     */
1695    public Reference getLocation() { 
1696      if (this.location == null)
1697        if (Configuration.errorOnAutoCreate())
1698          throw new Error("Attempt to auto-create Device.location");
1699        else if (Configuration.doAutoCreate())
1700          this.location = new Reference(); // cc
1701      return this.location;
1702    }
1703
1704    public boolean hasLocation() { 
1705      return this.location != null && !this.location.isEmpty();
1706    }
1707
1708    /**
1709     * @param value {@link #location} (The place where the device can be found.)
1710     */
1711    public Device setLocation(Reference value) { 
1712      this.location = value;
1713      return this;
1714    }
1715
1716    /**
1717     * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The place where the device can be found.)
1718     */
1719    public Location getLocationTarget() { 
1720      if (this.locationTarget == null)
1721        if (Configuration.errorOnAutoCreate())
1722          throw new Error("Attempt to auto-create Device.location");
1723        else if (Configuration.doAutoCreate())
1724          this.locationTarget = new Location(); // aa
1725      return this.locationTarget;
1726    }
1727
1728    /**
1729     * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The place where the device can be found.)
1730     */
1731    public Device setLocationTarget(Location value) { 
1732      this.locationTarget = value;
1733      return this;
1734    }
1735
1736    /**
1737     * @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
1738     */
1739    public UriType getUrlElement() { 
1740      if (this.url == null)
1741        if (Configuration.errorOnAutoCreate())
1742          throw new Error("Attempt to auto-create Device.url");
1743        else if (Configuration.doAutoCreate())
1744          this.url = new UriType(); // bb
1745      return this.url;
1746    }
1747
1748    public boolean hasUrlElement() { 
1749      return this.url != null && !this.url.isEmpty();
1750    }
1751
1752    public boolean hasUrl() { 
1753      return this.url != null && !this.url.isEmpty();
1754    }
1755
1756    /**
1757     * @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
1758     */
1759    public Device setUrlElement(UriType value) { 
1760      this.url = value;
1761      return this;
1762    }
1763
1764    /**
1765     * @return A network address on which the device may be contacted directly.
1766     */
1767    public String getUrl() { 
1768      return this.url == null ? null : this.url.getValue();
1769    }
1770
1771    /**
1772     * @param value A network address on which the device may be contacted directly.
1773     */
1774    public Device setUrl(String value) { 
1775      if (Utilities.noString(value))
1776        this.url = null;
1777      else {
1778        if (this.url == null)
1779          this.url = new UriType();
1780        this.url.setValue(value);
1781      }
1782      return this;
1783    }
1784
1785    /**
1786     * @return {@link #note} (Descriptive information, usage information or implantation information that is not captured in an existing element.)
1787     */
1788    public List<Annotation> getNote() { 
1789      if (this.note == null)
1790        this.note = new ArrayList<Annotation>();
1791      return this.note;
1792    }
1793
1794    /**
1795     * @return Returns a reference to <code>this</code> for easy method chaining
1796     */
1797    public Device setNote(List<Annotation> theNote) { 
1798      this.note = theNote;
1799      return this;
1800    }
1801
1802    public boolean hasNote() { 
1803      if (this.note == null)
1804        return false;
1805      for (Annotation item : this.note)
1806        if (!item.isEmpty())
1807          return true;
1808      return false;
1809    }
1810
1811    public Annotation addNote() { //3
1812      Annotation t = new Annotation();
1813      if (this.note == null)
1814        this.note = new ArrayList<Annotation>();
1815      this.note.add(t);
1816      return t;
1817    }
1818
1819    public Device addNote(Annotation t) { //3
1820      if (t == null)
1821        return this;
1822      if (this.note == null)
1823        this.note = new ArrayList<Annotation>();
1824      this.note.add(t);
1825      return this;
1826    }
1827
1828    /**
1829     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
1830     */
1831    public Annotation getNoteFirstRep() { 
1832      if (getNote().isEmpty()) {
1833        addNote();
1834      }
1835      return getNote().get(0);
1836    }
1837
1838    /**
1839     * @return {@link #safety} (Provides additional safety characteristics about a medical device.  For example devices containing latex.)
1840     */
1841    public List<CodeableConcept> getSafety() { 
1842      if (this.safety == null)
1843        this.safety = new ArrayList<CodeableConcept>();
1844      return this.safety;
1845    }
1846
1847    /**
1848     * @return Returns a reference to <code>this</code> for easy method chaining
1849     */
1850    public Device setSafety(List<CodeableConcept> theSafety) { 
1851      this.safety = theSafety;
1852      return this;
1853    }
1854
1855    public boolean hasSafety() { 
1856      if (this.safety == null)
1857        return false;
1858      for (CodeableConcept item : this.safety)
1859        if (!item.isEmpty())
1860          return true;
1861      return false;
1862    }
1863
1864    public CodeableConcept addSafety() { //3
1865      CodeableConcept t = new CodeableConcept();
1866      if (this.safety == null)
1867        this.safety = new ArrayList<CodeableConcept>();
1868      this.safety.add(t);
1869      return t;
1870    }
1871
1872    public Device addSafety(CodeableConcept t) { //3
1873      if (t == null)
1874        return this;
1875      if (this.safety == null)
1876        this.safety = new ArrayList<CodeableConcept>();
1877      this.safety.add(t);
1878      return this;
1879    }
1880
1881    /**
1882     * @return The first repetition of repeating field {@link #safety}, creating it if it does not already exist
1883     */
1884    public CodeableConcept getSafetyFirstRep() { 
1885      if (getSafety().isEmpty()) {
1886        addSafety();
1887      }
1888      return getSafety().get(0);
1889    }
1890
1891      protected void listChildren(List<Property> childrenList) {
1892        super.listChildren(childrenList);
1893        childrenList.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));
1894        childrenList.add(new Property("udi", "", "[Unique device identifier (UDI)](device.html#5.11.3.2.2) assigned to device label or package.", 0, java.lang.Integer.MAX_VALUE, udi));
1895        childrenList.add(new Property("status", "code", "Status of the Device availability.", 0, java.lang.Integer.MAX_VALUE, status));
1896        childrenList.add(new Property("type", "CodeableConcept", "Code or identifier to identify a kind of device.", 0, java.lang.Integer.MAX_VALUE, type));
1897        childrenList.add(new Property("lotNumber", "string", "Lot number assigned by the manufacturer.", 0, java.lang.Integer.MAX_VALUE, lotNumber));
1898        childrenList.add(new Property("manufacturer", "string", "A name of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer));
1899        childrenList.add(new Property("manufactureDate", "dateTime", "The date and time when the device was manufactured.", 0, java.lang.Integer.MAX_VALUE, manufactureDate));
1900        childrenList.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, java.lang.Integer.MAX_VALUE, expirationDate));
1901        childrenList.add(new Property("model", "string", "The \"model\" is an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type.", 0, java.lang.Integer.MAX_VALUE, model));
1902        childrenList.add(new Property("version", "string", "The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.", 0, java.lang.Integer.MAX_VALUE, version));
1903        childrenList.add(new Property("patient", "Reference(Patient)", "Patient information, If the device is affixed to a person.", 0, java.lang.Integer.MAX_VALUE, patient));
1904        childrenList.add(new Property("owner", "Reference(Organization)", "An organization that is responsible for the provision and ongoing maintenance of the device.", 0, java.lang.Integer.MAX_VALUE, owner));
1905        childrenList.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));
1906        childrenList.add(new Property("location", "Reference(Location)", "The place where the device can be found.", 0, java.lang.Integer.MAX_VALUE, location));
1907        childrenList.add(new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, java.lang.Integer.MAX_VALUE, url));
1908        childrenList.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));
1909        childrenList.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));
1910      }
1911
1912      @Override
1913      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1914        switch (hash) {
1915        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1916        case 115642: /*udi*/ return this.udi == null ? new Base[0] : new Base[] {this.udi}; // DeviceUdiComponent
1917        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FHIRDeviceStatus>
1918        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1919        case 462547450: /*lotNumber*/ return this.lotNumber == null ? new Base[0] : new Base[] {this.lotNumber}; // StringType
1920        case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : new Base[] {this.manufacturer}; // StringType
1921        case 416714767: /*manufactureDate*/ return this.manufactureDate == null ? new Base[0] : new Base[] {this.manufactureDate}; // DateTimeType
1922        case -668811523: /*expirationDate*/ return this.expirationDate == null ? new Base[0] : new Base[] {this.expirationDate}; // DateTimeType
1923        case 104069929: /*model*/ return this.model == null ? new Base[0] : new Base[] {this.model}; // StringType
1924        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
1925        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
1926        case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference
1927        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactPoint
1928        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
1929        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
1930        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1931        case -909893934: /*safety*/ return this.safety == null ? new Base[0] : this.safety.toArray(new Base[this.safety.size()]); // CodeableConcept
1932        default: return super.getProperty(hash, name, checkValid);
1933        }
1934
1935      }
1936
1937      @Override
1938      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1939        switch (hash) {
1940        case -1618432855: // identifier
1941          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1942          return value;
1943        case 115642: // udi
1944          this.udi = (DeviceUdiComponent) value; // DeviceUdiComponent
1945          return value;
1946        case -892481550: // status
1947          value = new FHIRDeviceStatusEnumFactory().fromType(castToCode(value));
1948          this.status = (Enumeration) value; // Enumeration<FHIRDeviceStatus>
1949          return value;
1950        case 3575610: // type
1951          this.type = castToCodeableConcept(value); // CodeableConcept
1952          return value;
1953        case 462547450: // lotNumber
1954          this.lotNumber = castToString(value); // StringType
1955          return value;
1956        case -1969347631: // manufacturer
1957          this.manufacturer = castToString(value); // StringType
1958          return value;
1959        case 416714767: // manufactureDate
1960          this.manufactureDate = castToDateTime(value); // DateTimeType
1961          return value;
1962        case -668811523: // expirationDate
1963          this.expirationDate = castToDateTime(value); // DateTimeType
1964          return value;
1965        case 104069929: // model
1966          this.model = castToString(value); // StringType
1967          return value;
1968        case 351608024: // version
1969          this.version = castToString(value); // StringType
1970          return value;
1971        case -791418107: // patient
1972          this.patient = castToReference(value); // Reference
1973          return value;
1974        case 106164915: // owner
1975          this.owner = castToReference(value); // Reference
1976          return value;
1977        case 951526432: // contact
1978          this.getContact().add(castToContactPoint(value)); // ContactPoint
1979          return value;
1980        case 1901043637: // location
1981          this.location = castToReference(value); // Reference
1982          return value;
1983        case 116079: // url
1984          this.url = castToUri(value); // UriType
1985          return value;
1986        case 3387378: // note
1987          this.getNote().add(castToAnnotation(value)); // Annotation
1988          return value;
1989        case -909893934: // safety
1990          this.getSafety().add(castToCodeableConcept(value)); // CodeableConcept
1991          return value;
1992        default: return super.setProperty(hash, name, value);
1993        }
1994
1995      }
1996
1997      @Override
1998      public Base setProperty(String name, Base value) throws FHIRException {
1999        if (name.equals("identifier")) {
2000          this.getIdentifier().add(castToIdentifier(value));
2001        } else if (name.equals("udi")) {
2002          this.udi = (DeviceUdiComponent) value; // DeviceUdiComponent
2003        } else if (name.equals("status")) {
2004          value = new FHIRDeviceStatusEnumFactory().fromType(castToCode(value));
2005          this.status = (Enumeration) value; // Enumeration<FHIRDeviceStatus>
2006        } else if (name.equals("type")) {
2007          this.type = castToCodeableConcept(value); // CodeableConcept
2008        } else if (name.equals("lotNumber")) {
2009          this.lotNumber = castToString(value); // StringType
2010        } else if (name.equals("manufacturer")) {
2011          this.manufacturer = castToString(value); // StringType
2012        } else if (name.equals("manufactureDate")) {
2013          this.manufactureDate = castToDateTime(value); // DateTimeType
2014        } else if (name.equals("expirationDate")) {
2015          this.expirationDate = castToDateTime(value); // DateTimeType
2016        } else if (name.equals("model")) {
2017          this.model = castToString(value); // StringType
2018        } else if (name.equals("version")) {
2019          this.version = castToString(value); // StringType
2020        } else if (name.equals("patient")) {
2021          this.patient = castToReference(value); // Reference
2022        } else if (name.equals("owner")) {
2023          this.owner = castToReference(value); // Reference
2024        } else if (name.equals("contact")) {
2025          this.getContact().add(castToContactPoint(value));
2026        } else if (name.equals("location")) {
2027          this.location = castToReference(value); // Reference
2028        } else if (name.equals("url")) {
2029          this.url = castToUri(value); // UriType
2030        } else if (name.equals("note")) {
2031          this.getNote().add(castToAnnotation(value));
2032        } else if (name.equals("safety")) {
2033          this.getSafety().add(castToCodeableConcept(value));
2034        } else
2035          return super.setProperty(name, value);
2036        return value;
2037      }
2038
2039      @Override
2040      public Base makeProperty(int hash, String name) throws FHIRException {
2041        switch (hash) {
2042        case -1618432855:  return addIdentifier(); 
2043        case 115642:  return getUdi(); 
2044        case -892481550:  return getStatusElement();
2045        case 3575610:  return getType(); 
2046        case 462547450:  return getLotNumberElement();
2047        case -1969347631:  return getManufacturerElement();
2048        case 416714767:  return getManufactureDateElement();
2049        case -668811523:  return getExpirationDateElement();
2050        case 104069929:  return getModelElement();
2051        case 351608024:  return getVersionElement();
2052        case -791418107:  return getPatient(); 
2053        case 106164915:  return getOwner(); 
2054        case 951526432:  return addContact(); 
2055        case 1901043637:  return getLocation(); 
2056        case 116079:  return getUrlElement();
2057        case 3387378:  return addNote(); 
2058        case -909893934:  return addSafety(); 
2059        default: return super.makeProperty(hash, name);
2060        }
2061
2062      }
2063
2064      @Override
2065      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2066        switch (hash) {
2067        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2068        case 115642: /*udi*/ return new String[] {};
2069        case -892481550: /*status*/ return new String[] {"code"};
2070        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2071        case 462547450: /*lotNumber*/ return new String[] {"string"};
2072        case -1969347631: /*manufacturer*/ return new String[] {"string"};
2073        case 416714767: /*manufactureDate*/ return new String[] {"dateTime"};
2074        case -668811523: /*expirationDate*/ return new String[] {"dateTime"};
2075        case 104069929: /*model*/ return new String[] {"string"};
2076        case 351608024: /*version*/ return new String[] {"string"};
2077        case -791418107: /*patient*/ return new String[] {"Reference"};
2078        case 106164915: /*owner*/ return new String[] {"Reference"};
2079        case 951526432: /*contact*/ return new String[] {"ContactPoint"};
2080        case 1901043637: /*location*/ return new String[] {"Reference"};
2081        case 116079: /*url*/ return new String[] {"uri"};
2082        case 3387378: /*note*/ return new String[] {"Annotation"};
2083        case -909893934: /*safety*/ return new String[] {"CodeableConcept"};
2084        default: return super.getTypesForProperty(hash, name);
2085        }
2086
2087      }
2088
2089      @Override
2090      public Base addChild(String name) throws FHIRException {
2091        if (name.equals("identifier")) {
2092          return addIdentifier();
2093        }
2094        else if (name.equals("udi")) {
2095          this.udi = new DeviceUdiComponent();
2096          return this.udi;
2097        }
2098        else if (name.equals("status")) {
2099          throw new FHIRException("Cannot call addChild on a primitive type Device.status");
2100        }
2101        else if (name.equals("type")) {
2102          this.type = new CodeableConcept();
2103          return this.type;
2104        }
2105        else if (name.equals("lotNumber")) {
2106          throw new FHIRException("Cannot call addChild on a primitive type Device.lotNumber");
2107        }
2108        else if (name.equals("manufacturer")) {
2109          throw new FHIRException("Cannot call addChild on a primitive type Device.manufacturer");
2110        }
2111        else if (name.equals("manufactureDate")) {
2112          throw new FHIRException("Cannot call addChild on a primitive type Device.manufactureDate");
2113        }
2114        else if (name.equals("expirationDate")) {
2115          throw new FHIRException("Cannot call addChild on a primitive type Device.expirationDate");
2116        }
2117        else if (name.equals("model")) {
2118          throw new FHIRException("Cannot call addChild on a primitive type Device.model");
2119        }
2120        else if (name.equals("version")) {
2121          throw new FHIRException("Cannot call addChild on a primitive type Device.version");
2122        }
2123        else if (name.equals("patient")) {
2124          this.patient = new Reference();
2125          return this.patient;
2126        }
2127        else if (name.equals("owner")) {
2128          this.owner = new Reference();
2129          return this.owner;
2130        }
2131        else if (name.equals("contact")) {
2132          return addContact();
2133        }
2134        else if (name.equals("location")) {
2135          this.location = new Reference();
2136          return this.location;
2137        }
2138        else if (name.equals("url")) {
2139          throw new FHIRException("Cannot call addChild on a primitive type Device.url");
2140        }
2141        else if (name.equals("note")) {
2142          return addNote();
2143        }
2144        else if (name.equals("safety")) {
2145          return addSafety();
2146        }
2147        else
2148          return super.addChild(name);
2149      }
2150
2151  public String fhirType() {
2152    return "Device";
2153
2154  }
2155
2156      public Device copy() {
2157        Device dst = new Device();
2158        copyValues(dst);
2159        if (identifier != null) {
2160          dst.identifier = new ArrayList<Identifier>();
2161          for (Identifier i : identifier)
2162            dst.identifier.add(i.copy());
2163        };
2164        dst.udi = udi == null ? null : udi.copy();
2165        dst.status = status == null ? null : status.copy();
2166        dst.type = type == null ? null : type.copy();
2167        dst.lotNumber = lotNumber == null ? null : lotNumber.copy();
2168        dst.manufacturer = manufacturer == null ? null : manufacturer.copy();
2169        dst.manufactureDate = manufactureDate == null ? null : manufactureDate.copy();
2170        dst.expirationDate = expirationDate == null ? null : expirationDate.copy();
2171        dst.model = model == null ? null : model.copy();
2172        dst.version = version == null ? null : version.copy();
2173        dst.patient = patient == null ? null : patient.copy();
2174        dst.owner = owner == null ? null : owner.copy();
2175        if (contact != null) {
2176          dst.contact = new ArrayList<ContactPoint>();
2177          for (ContactPoint i : contact)
2178            dst.contact.add(i.copy());
2179        };
2180        dst.location = location == null ? null : location.copy();
2181        dst.url = url == null ? null : url.copy();
2182        if (note != null) {
2183          dst.note = new ArrayList<Annotation>();
2184          for (Annotation i : note)
2185            dst.note.add(i.copy());
2186        };
2187        if (safety != null) {
2188          dst.safety = new ArrayList<CodeableConcept>();
2189          for (CodeableConcept i : safety)
2190            dst.safety.add(i.copy());
2191        };
2192        return dst;
2193      }
2194
2195      protected Device typedCopy() {
2196        return copy();
2197      }
2198
2199      @Override
2200      public boolean equalsDeep(Base other) {
2201        if (!super.equalsDeep(other))
2202          return false;
2203        if (!(other instanceof Device))
2204          return false;
2205        Device o = (Device) other;
2206        return compareDeep(identifier, o.identifier, true) && compareDeep(udi, o.udi, true) && compareDeep(status, o.status, true)
2207           && compareDeep(type, o.type, true) && compareDeep(lotNumber, o.lotNumber, true) && compareDeep(manufacturer, o.manufacturer, true)
2208           && compareDeep(manufactureDate, o.manufactureDate, true) && compareDeep(expirationDate, o.expirationDate, true)
2209           && compareDeep(model, o.model, true) && compareDeep(version, o.version, true) && compareDeep(patient, o.patient, true)
2210           && compareDeep(owner, o.owner, true) && compareDeep(contact, o.contact, true) && compareDeep(location, o.location, true)
2211           && compareDeep(url, o.url, true) && compareDeep(note, o.note, true) && compareDeep(safety, o.safety, true)
2212          ;
2213      }
2214
2215      @Override
2216      public boolean equalsShallow(Base other) {
2217        if (!super.equalsShallow(other))
2218          return false;
2219        if (!(other instanceof Device))
2220          return false;
2221        Device o = (Device) other;
2222        return compareValues(status, o.status, true) && compareValues(lotNumber, o.lotNumber, true) && compareValues(manufacturer, o.manufacturer, true)
2223           && compareValues(manufactureDate, o.manufactureDate, true) && compareValues(expirationDate, o.expirationDate, true)
2224           && compareValues(model, o.model, true) && compareValues(version, o.version, true) && compareValues(url, o.url, true)
2225          ;
2226      }
2227
2228      public boolean isEmpty() {
2229        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, udi, status
2230          , type, lotNumber, manufacturer, manufactureDate, expirationDate, model, version
2231          , patient, owner, contact, location, url, note, safety);
2232      }
2233
2234  @Override
2235  public ResourceType getResourceType() {
2236    return ResourceType.Device;
2237   }
2238
2239 /**
2240   * Search parameter: <b>udi-di</b>
2241   * <p>
2242   * Description: <b>The udi Device Identifier (DI)</b><br>
2243   * Type: <b>string</b><br>
2244   * Path: <b>Device.udi.deviceIdentifier</b><br>
2245   * </p>
2246   */
2247  @SearchParamDefinition(name="udi-di", path="Device.udi.deviceIdentifier", description="The udi Device Identifier (DI)", type="string" )
2248  public static final String SP_UDI_DI = "udi-di";
2249 /**
2250   * <b>Fluent Client</b> search parameter constant for <b>udi-di</b>
2251   * <p>
2252   * Description: <b>The udi Device Identifier (DI)</b><br>
2253   * Type: <b>string</b><br>
2254   * Path: <b>Device.udi.deviceIdentifier</b><br>
2255   * </p>
2256   */
2257  public static final ca.uhn.fhir.rest.gclient.StringClientParam UDI_DI = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_UDI_DI);
2258
2259 /**
2260   * Search parameter: <b>identifier</b>
2261   * <p>
2262   * Description: <b>Instance id from manufacturer, owner, and others</b><br>
2263   * Type: <b>token</b><br>
2264   * Path: <b>Device.identifier</b><br>
2265   * </p>
2266   */
2267  @SearchParamDefinition(name="identifier", path="Device.identifier", description="Instance id from manufacturer, owner, and others", type="token" )
2268  public static final String SP_IDENTIFIER = "identifier";
2269 /**
2270   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2271   * <p>
2272   * Description: <b>Instance id from manufacturer, owner, and others</b><br>
2273   * Type: <b>token</b><br>
2274   * Path: <b>Device.identifier</b><br>
2275   * </p>
2276   */
2277  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2278
2279 /**
2280   * Search parameter: <b>udi-carrier</b>
2281   * <p>
2282   * Description: <b>UDI Barcode (RFID or other technology) string either in HRF format or AIDC format converted to base64 string.</b><br>
2283   * Type: <b>string</b><br>
2284   * Path: <b>Device.udi.carrierHRF, Device.udi.carrierAIDC</b><br>
2285   * </p>
2286   */
2287  @SearchParamDefinition(name="udi-carrier", path="Device.udi.carrierHRF | Device.udi.carrierAIDC", description="UDI Barcode (RFID or other technology) string either in HRF format or AIDC format converted to base64 string.", type="string" )
2288  public static final String SP_UDI_CARRIER = "udi-carrier";
2289 /**
2290   * <b>Fluent Client</b> search parameter constant for <b>udi-carrier</b>
2291   * <p>
2292   * Description: <b>UDI Barcode (RFID or other technology) string either in HRF format or AIDC format converted to base64 string.</b><br>
2293   * Type: <b>string</b><br>
2294   * Path: <b>Device.udi.carrierHRF, Device.udi.carrierAIDC</b><br>
2295   * </p>
2296   */
2297  public static final ca.uhn.fhir.rest.gclient.StringClientParam UDI_CARRIER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_UDI_CARRIER);
2298
2299 /**
2300   * Search parameter: <b>device-name</b>
2301   * <p>
2302   * Description: <b>A server defined search that may match any of the string fields in the Device.udi.name  or Device.type.coding.display or  Device.type.text</b><br>
2303   * Type: <b>string</b><br>
2304   * Path: <b>Device.udi.name, Device.type.text, Device.type.coding.display</b><br>
2305   * </p>
2306   */
2307  @SearchParamDefinition(name="device-name", path="Device.udi.name | Device.type.text | Device.type.coding.display", description="A server defined search that may match any of the string fields in the Device.udi.name  or Device.type.coding.display or  Device.type.text", type="string" )
2308  public static final String SP_DEVICE_NAME = "device-name";
2309 /**
2310   * <b>Fluent Client</b> search parameter constant for <b>device-name</b>
2311   * <p>
2312   * Description: <b>A server defined search that may match any of the string fields in the Device.udi.name  or Device.type.coding.display or  Device.type.text</b><br>
2313   * Type: <b>string</b><br>
2314   * Path: <b>Device.udi.name, Device.type.text, Device.type.coding.display</b><br>
2315   * </p>
2316   */
2317  public static final ca.uhn.fhir.rest.gclient.StringClientParam DEVICE_NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DEVICE_NAME);
2318
2319 /**
2320   * Search parameter: <b>patient</b>
2321   * <p>
2322   * Description: <b>Patient information, if the resource is affixed to a person</b><br>
2323   * Type: <b>reference</b><br>
2324   * Path: <b>Device.patient</b><br>
2325   * </p>
2326   */
2327  @SearchParamDefinition(name="patient", path="Device.patient", description="Patient information, if the resource is affixed to a person", type="reference", target={Patient.class } )
2328  public static final String SP_PATIENT = "patient";
2329 /**
2330   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2331   * <p>
2332   * Description: <b>Patient information, if the resource is affixed to a person</b><br>
2333   * Type: <b>reference</b><br>
2334   * Path: <b>Device.patient</b><br>
2335   * </p>
2336   */
2337  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2338
2339/**
2340   * Constant for fluent queries to be used to add include statements. Specifies
2341   * the path value of "<b>Device:patient</b>".
2342   */
2343  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Device:patient").toLocked();
2344
2345 /**
2346   * Search parameter: <b>organization</b>
2347   * <p>
2348   * Description: <b>The organization responsible for the device</b><br>
2349   * Type: <b>reference</b><br>
2350   * Path: <b>Device.owner</b><br>
2351   * </p>
2352   */
2353  @SearchParamDefinition(name="organization", path="Device.owner", description="The organization responsible for the device", type="reference", target={Organization.class } )
2354  public static final String SP_ORGANIZATION = "organization";
2355 /**
2356   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
2357   * <p>
2358   * Description: <b>The organization responsible for the device</b><br>
2359   * Type: <b>reference</b><br>
2360   * Path: <b>Device.owner</b><br>
2361   * </p>
2362   */
2363  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
2364
2365/**
2366   * Constant for fluent queries to be used to add include statements. Specifies
2367   * the path value of "<b>Device:organization</b>".
2368   */
2369  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Device:organization").toLocked();
2370
2371 /**
2372   * Search parameter: <b>model</b>
2373   * <p>
2374   * Description: <b>The model of the device</b><br>
2375   * Type: <b>string</b><br>
2376   * Path: <b>Device.model</b><br>
2377   * </p>
2378   */
2379  @SearchParamDefinition(name="model", path="Device.model", description="The model of the device", type="string" )
2380  public static final String SP_MODEL = "model";
2381 /**
2382   * <b>Fluent Client</b> search parameter constant for <b>model</b>
2383   * <p>
2384   * Description: <b>The model of the device</b><br>
2385   * Type: <b>string</b><br>
2386   * Path: <b>Device.model</b><br>
2387   * </p>
2388   */
2389  public static final ca.uhn.fhir.rest.gclient.StringClientParam MODEL = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_MODEL);
2390
2391 /**
2392   * Search parameter: <b>location</b>
2393   * <p>
2394   * Description: <b>A location, where the resource is found</b><br>
2395   * Type: <b>reference</b><br>
2396   * Path: <b>Device.location</b><br>
2397   * </p>
2398   */
2399  @SearchParamDefinition(name="location", path="Device.location", description="A location, where the resource is found", type="reference", target={Location.class } )
2400  public static final String SP_LOCATION = "location";
2401 /**
2402   * <b>Fluent Client</b> search parameter constant for <b>location</b>
2403   * <p>
2404   * Description: <b>A location, where the resource is found</b><br>
2405   * Type: <b>reference</b><br>
2406   * Path: <b>Device.location</b><br>
2407   * </p>
2408   */
2409  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION);
2410
2411/**
2412   * Constant for fluent queries to be used to add include statements. Specifies
2413   * the path value of "<b>Device:location</b>".
2414   */
2415  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Device:location").toLocked();
2416
2417 /**
2418   * Search parameter: <b>type</b>
2419   * <p>
2420   * Description: <b>The type of the device</b><br>
2421   * Type: <b>token</b><br>
2422   * Path: <b>Device.type</b><br>
2423   * </p>
2424   */
2425  @SearchParamDefinition(name="type", path="Device.type", description="The type of the device", type="token" )
2426  public static final String SP_TYPE = "type";
2427 /**
2428   * <b>Fluent Client</b> search parameter constant for <b>type</b>
2429   * <p>
2430   * Description: <b>The type of the device</b><br>
2431   * Type: <b>token</b><br>
2432   * Path: <b>Device.type</b><br>
2433   * </p>
2434   */
2435  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
2436
2437 /**
2438   * Search parameter: <b>url</b>
2439   * <p>
2440   * Description: <b>Network address to contact device</b><br>
2441   * Type: <b>uri</b><br>
2442   * Path: <b>Device.url</b><br>
2443   * </p>
2444   */
2445  @SearchParamDefinition(name="url", path="Device.url", description="Network address to contact device", type="uri" )
2446  public static final String SP_URL = "url";
2447 /**
2448   * <b>Fluent Client</b> search parameter constant for <b>url</b>
2449   * <p>
2450   * Description: <b>Network address to contact device</b><br>
2451   * Type: <b>uri</b><br>
2452   * Path: <b>Device.url</b><br>
2453   * </p>
2454   */
2455  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
2456
2457 /**
2458   * Search parameter: <b>manufacturer</b>
2459   * <p>
2460   * Description: <b>The manufacturer of the device</b><br>
2461   * Type: <b>string</b><br>
2462   * Path: <b>Device.manufacturer</b><br>
2463   * </p>
2464   */
2465  @SearchParamDefinition(name="manufacturer", path="Device.manufacturer", description="The manufacturer of the device", type="string" )
2466  public static final String SP_MANUFACTURER = "manufacturer";
2467 /**
2468   * <b>Fluent Client</b> search parameter constant for <b>manufacturer</b>
2469   * <p>
2470   * Description: <b>The manufacturer of the device</b><br>
2471   * Type: <b>string</b><br>
2472   * Path: <b>Device.manufacturer</b><br>
2473   * </p>
2474   */
2475  public static final ca.uhn.fhir.rest.gclient.StringClientParam MANUFACTURER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_MANUFACTURER);
2476
2477 /**
2478   * Search parameter: <b>status</b>
2479   * <p>
2480   * Description: <b>active | inactive | entered-in-error | unknown</b><br>
2481   * Type: <b>token</b><br>
2482   * Path: <b>Device.status</b><br>
2483   * </p>
2484   */
2485  @SearchParamDefinition(name="status", path="Device.status", description="active | inactive | entered-in-error | unknown", type="token" )
2486  public static final String SP_STATUS = "status";
2487 /**
2488   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2489   * <p>
2490   * Description: <b>active | inactive | entered-in-error | unknown</b><br>
2491   * Type: <b>token</b><br>
2492   * Path: <b>Device.status</b><br>
2493   * </p>
2494   */
2495  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2496
2497
2498}
2499