001package org.hl7.fhir.dstu2.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.dstu2
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023
024/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, 
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this 
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, 
034     this list of conditions and the following disclaimer in the documentation 
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
049  POSSIBILITY OF SUCH DAMAGE.
050  
051*/
052
053// Generated on Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
054import java.util.ArrayList;
055import java.util.Date;
056import java.util.List;
057
058import ca.uhn.fhir.model.api.annotation.Child;
059import ca.uhn.fhir.model.api.annotation.Description;
060import ca.uhn.fhir.model.api.annotation.ResourceDef;
061import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
062import org.hl7.fhir.exceptions.FHIRException;
063import org.hl7.fhir.utilities.Utilities;
064/**
065 * This resource identifies an instance 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 includes 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.
066 */
067@ResourceDef(name="Device", profile="http://hl7.org/fhir/Profile/Device")
068public class Device extends DomainResource {
069
070    public enum DeviceStatus {
071        /**
072         * The Device is available for use.
073         */
074        AVAILABLE, 
075        /**
076         * The Device is no longer available for use (e.g. lost, expired, damaged).
077         */
078        NOTAVAILABLE, 
079        /**
080         * The Device was entered in error and voided.
081         */
082        ENTEREDINERROR, 
083        /**
084         * added to help the parsers
085         */
086        NULL;
087        public static DeviceStatus fromCode(String codeString) throws FHIRException {
088            if (codeString == null || "".equals(codeString))
089                return null;
090        if ("available".equals(codeString))
091          return AVAILABLE;
092        if ("not-available".equals(codeString))
093          return NOTAVAILABLE;
094        if ("entered-in-error".equals(codeString))
095          return ENTEREDINERROR;
096        throw new FHIRException("Unknown DeviceStatus code '"+codeString+"'");
097        }
098        public String toCode() {
099          switch (this) {
100            case AVAILABLE: return "available";
101            case NOTAVAILABLE: return "not-available";
102            case ENTEREDINERROR: return "entered-in-error";
103            default: return "?";
104          }
105        }
106        public String getSystem() {
107          switch (this) {
108            case AVAILABLE: return "http://hl7.org/fhir/devicestatus";
109            case NOTAVAILABLE: return "http://hl7.org/fhir/devicestatus";
110            case ENTEREDINERROR: return "http://hl7.org/fhir/devicestatus";
111            default: return "?";
112          }
113        }
114        public String getDefinition() {
115          switch (this) {
116            case AVAILABLE: return "The Device is available for use.";
117            case NOTAVAILABLE: return "The Device is no longer available for use (e.g. lost, expired, damaged).";
118            case ENTEREDINERROR: return "The Device was entered in error and voided.";
119            default: return "?";
120          }
121        }
122        public String getDisplay() {
123          switch (this) {
124            case AVAILABLE: return "Available";
125            case NOTAVAILABLE: return "Not Available";
126            case ENTEREDINERROR: return "Entered in Error";
127            default: return "?";
128          }
129        }
130    }
131
132  public static class DeviceStatusEnumFactory implements EnumFactory<DeviceStatus> {
133    public DeviceStatus fromCode(String codeString) throws IllegalArgumentException {
134      if (codeString == null || "".equals(codeString))
135            if (codeString == null || "".equals(codeString))
136                return null;
137        if ("available".equals(codeString))
138          return DeviceStatus.AVAILABLE;
139        if ("not-available".equals(codeString))
140          return DeviceStatus.NOTAVAILABLE;
141        if ("entered-in-error".equals(codeString))
142          return DeviceStatus.ENTEREDINERROR;
143        throw new IllegalArgumentException("Unknown DeviceStatus code '"+codeString+"'");
144        }
145        public Enumeration<DeviceStatus> fromType(Base code) throws FHIRException {
146          if (code == null || code.isEmpty())
147            return null;
148          String codeString = ((PrimitiveType) code).asStringValue();
149          if (codeString == null || "".equals(codeString))
150            return null;
151        if ("available".equals(codeString))
152          return new Enumeration<DeviceStatus>(this, DeviceStatus.AVAILABLE);
153        if ("not-available".equals(codeString))
154          return new Enumeration<DeviceStatus>(this, DeviceStatus.NOTAVAILABLE);
155        if ("entered-in-error".equals(codeString))
156          return new Enumeration<DeviceStatus>(this, DeviceStatus.ENTEREDINERROR);
157        throw new FHIRException("Unknown DeviceStatus code '"+codeString+"'");
158        }
159    public String toCode(DeviceStatus code) {
160      if (code == DeviceStatus.AVAILABLE)
161        return "available";
162      if (code == DeviceStatus.NOTAVAILABLE)
163        return "not-available";
164      if (code == DeviceStatus.ENTEREDINERROR)
165        return "entered-in-error";
166      return "?";
167      }
168    }
169
170    /**
171     * Unique instance identifiers assigned to a device by organizations like manufacturers or owners. If the identifier identifies the type of device, Device.type should be used.
172     */
173    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
174    @Description(shortDefinition="Instance id from manufacturer, owner, and others", formalDefinition="Unique instance identifiers assigned to a device by organizations like manufacturers or owners. If the identifier identifies the type of device, Device.type should be used." )
175    protected List<Identifier> identifier;
176
177    /**
178     * Code or identifier to identify a kind of device.
179     */
180    @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
181    @Description(shortDefinition="What kind of device this is", formalDefinition="Code or identifier to identify a kind of device." )
182    protected CodeableConcept type;
183
184    /**
185     * Descriptive information, usage information or implantation information that is not captured in an existing element.
186     */
187    @Child(name = "note", type = {Annotation.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
188    @Description(shortDefinition="Device notes and comments", formalDefinition="Descriptive information, usage information or implantation information that is not captured in an existing element." )
189    protected List<Annotation> note;
190
191    /**
192     * Status of the Device availability.
193     */
194    @Child(name = "status", type = {CodeType.class}, order=3, min=0, max=1, modifier=true, summary=true)
195    @Description(shortDefinition="available | not-available | entered-in-error", formalDefinition="Status of the Device availability." )
196    protected Enumeration<DeviceStatus> status;
197
198    /**
199     * A name of the manufacturer.
200     */
201    @Child(name = "manufacturer", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
202    @Description(shortDefinition="Name of device manufacturer", formalDefinition="A name of the manufacturer." )
203    protected StringType manufacturer;
204
205    /**
206     * 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.
207     */
208    @Child(name = "model", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
209    @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." )
210    protected StringType model;
211
212    /**
213     * The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.
214     */
215    @Child(name = "version", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
216    @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." )
217    protected StringType version;
218
219    /**
220     * The date and time when the device was manufactured.
221     */
222    @Child(name = "manufactureDate", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=false)
223    @Description(shortDefinition="Manufacture date", formalDefinition="The date and time when the device was manufactured." )
224    protected DateTimeType manufactureDate;
225
226    /**
227     * The date and time beyond which this device is no longer valid or should not be used (if applicable).
228     */
229    @Child(name = "expiry", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=false)
230    @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)." )
231    protected DateTimeType expiry;
232
233    /**
234     * United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode)  - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.
235     */
236    @Child(name = "udi", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
237    @Description(shortDefinition="FDA mandated Unique Device Identifier", formalDefinition="United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode)  - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm." )
238    protected StringType udi;
239
240    /**
241     * Lot number assigned by the manufacturer.
242     */
243    @Child(name = "lotNumber", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
244    @Description(shortDefinition="Lot number of manufacture", formalDefinition="Lot number assigned by the manufacturer." )
245    protected StringType lotNumber;
246
247    /**
248     * An organization that is responsible for the provision and ongoing maintenance of the device.
249     */
250    @Child(name = "owner", type = {Organization.class}, order=11, min=0, max=1, modifier=false, summary=false)
251    @Description(shortDefinition="Organization responsible for device", formalDefinition="An organization that is responsible for the provision and ongoing maintenance of the device." )
252    protected Reference owner;
253
254    /**
255     * The actual object that is the target of the reference (An organization that is responsible for the provision and ongoing maintenance of the device.)
256     */
257    protected Organization ownerTarget;
258
259    /**
260     * The place where the device can be found.
261     */
262    @Child(name = "location", type = {Location.class}, order=12, min=0, max=1, modifier=false, summary=false)
263    @Description(shortDefinition="Where the resource is found", formalDefinition="The place where the device can be found." )
264    protected Reference location;
265
266    /**
267     * The actual object that is the target of the reference (The place where the device can be found.)
268     */
269    protected Location locationTarget;
270
271    /**
272     * Patient information, if the resource is affixed to a person.
273     */
274    @Child(name = "patient", type = {Patient.class}, order=13, min=0, max=1, modifier=false, summary=false)
275    @Description(shortDefinition="If the resource is affixed to a person", formalDefinition="Patient information, if the resource is affixed to a person." )
276    protected Reference patient;
277
278    /**
279     * The actual object that is the target of the reference (Patient information, if the resource is affixed to a person.)
280     */
281    protected Patient patientTarget;
282
283    /**
284     * Contact details for an organization or a particular human that is responsible for the device.
285     */
286    @Child(name = "contact", type = {ContactPoint.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
287    @Description(shortDefinition="Details for human/organization for support", formalDefinition="Contact details for an organization or a particular human that is responsible for the device." )
288    protected List<ContactPoint> contact;
289
290    /**
291     * A network address on which the device may be contacted directly.
292     */
293    @Child(name = "url", type = {UriType.class}, order=15, min=0, max=1, modifier=false, summary=false)
294    @Description(shortDefinition="Network address to contact device", formalDefinition="A network address on which the device may be contacted directly." )
295    protected UriType url;
296
297    private static final long serialVersionUID = 366690094L;
298
299  /*
300   * Constructor
301   */
302    public Device() {
303      super();
304    }
305
306  /*
307   * Constructor
308   */
309    public Device(CodeableConcept type) {
310      super();
311      this.type = type;
312    }
313
314    /**
315     * @return {@link #identifier} (Unique instance identifiers assigned to a device by organizations like manufacturers or owners. If the identifier identifies the type of device, Device.type should be used.)
316     */
317    public List<Identifier> getIdentifier() { 
318      if (this.identifier == null)
319        this.identifier = new ArrayList<Identifier>();
320      return this.identifier;
321    }
322
323    public boolean hasIdentifier() { 
324      if (this.identifier == null)
325        return false;
326      for (Identifier item : this.identifier)
327        if (!item.isEmpty())
328          return true;
329      return false;
330    }
331
332    /**
333     * @return {@link #identifier} (Unique instance identifiers assigned to a device by organizations like manufacturers or owners. If the identifier identifies the type of device, Device.type should be used.)
334     */
335    // syntactic sugar
336    public Identifier addIdentifier() { //3
337      Identifier t = new Identifier();
338      if (this.identifier == null)
339        this.identifier = new ArrayList<Identifier>();
340      this.identifier.add(t);
341      return t;
342    }
343
344    // syntactic sugar
345    public Device addIdentifier(Identifier t) { //3
346      if (t == null)
347        return this;
348      if (this.identifier == null)
349        this.identifier = new ArrayList<Identifier>();
350      this.identifier.add(t);
351      return this;
352    }
353
354    /**
355     * @return {@link #type} (Code or identifier to identify a kind of device.)
356     */
357    public CodeableConcept getType() { 
358      if (this.type == null)
359        if (Configuration.errorOnAutoCreate())
360          throw new Error("Attempt to auto-create Device.type");
361        else if (Configuration.doAutoCreate())
362          this.type = new CodeableConcept(); // cc
363      return this.type;
364    }
365
366    public boolean hasType() { 
367      return this.type != null && !this.type.isEmpty();
368    }
369
370    /**
371     * @param value {@link #type} (Code or identifier to identify a kind of device.)
372     */
373    public Device setType(CodeableConcept value) { 
374      this.type = value;
375      return this;
376    }
377
378    /**
379     * @return {@link #note} (Descriptive information, usage information or implantation information that is not captured in an existing element.)
380     */
381    public List<Annotation> getNote() { 
382      if (this.note == null)
383        this.note = new ArrayList<Annotation>();
384      return this.note;
385    }
386
387    public boolean hasNote() { 
388      if (this.note == null)
389        return false;
390      for (Annotation item : this.note)
391        if (!item.isEmpty())
392          return true;
393      return false;
394    }
395
396    /**
397     * @return {@link #note} (Descriptive information, usage information or implantation information that is not captured in an existing element.)
398     */
399    // syntactic sugar
400    public Annotation addNote() { //3
401      Annotation t = new Annotation();
402      if (this.note == null)
403        this.note = new ArrayList<Annotation>();
404      this.note.add(t);
405      return t;
406    }
407
408    // syntactic sugar
409    public Device addNote(Annotation t) { //3
410      if (t == null)
411        return this;
412      if (this.note == null)
413        this.note = new ArrayList<Annotation>();
414      this.note.add(t);
415      return this;
416    }
417
418    /**
419     * @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
420     */
421    public Enumeration<DeviceStatus> getStatusElement() { 
422      if (this.status == null)
423        if (Configuration.errorOnAutoCreate())
424          throw new Error("Attempt to auto-create Device.status");
425        else if (Configuration.doAutoCreate())
426          this.status = new Enumeration<DeviceStatus>(new DeviceStatusEnumFactory()); // bb
427      return this.status;
428    }
429
430    public boolean hasStatusElement() { 
431      return this.status != null && !this.status.isEmpty();
432    }
433
434    public boolean hasStatus() { 
435      return this.status != null && !this.status.isEmpty();
436    }
437
438    /**
439     * @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
440     */
441    public Device setStatusElement(Enumeration<DeviceStatus> value) { 
442      this.status = value;
443      return this;
444    }
445
446    /**
447     * @return Status of the Device availability.
448     */
449    public DeviceStatus getStatus() { 
450      return this.status == null ? null : this.status.getValue();
451    }
452
453    /**
454     * @param value Status of the Device availability.
455     */
456    public Device setStatus(DeviceStatus value) { 
457      if (value == null)
458        this.status = null;
459      else {
460        if (this.status == null)
461          this.status = new Enumeration<DeviceStatus>(new DeviceStatusEnumFactory());
462        this.status.setValue(value);
463      }
464      return this;
465    }
466
467    /**
468     * @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
469     */
470    public StringType getManufacturerElement() { 
471      if (this.manufacturer == null)
472        if (Configuration.errorOnAutoCreate())
473          throw new Error("Attempt to auto-create Device.manufacturer");
474        else if (Configuration.doAutoCreate())
475          this.manufacturer = new StringType(); // bb
476      return this.manufacturer;
477    }
478
479    public boolean hasManufacturerElement() { 
480      return this.manufacturer != null && !this.manufacturer.isEmpty();
481    }
482
483    public boolean hasManufacturer() { 
484      return this.manufacturer != null && !this.manufacturer.isEmpty();
485    }
486
487    /**
488     * @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
489     */
490    public Device setManufacturerElement(StringType value) { 
491      this.manufacturer = value;
492      return this;
493    }
494
495    /**
496     * @return A name of the manufacturer.
497     */
498    public String getManufacturer() { 
499      return this.manufacturer == null ? null : this.manufacturer.getValue();
500    }
501
502    /**
503     * @param value A name of the manufacturer.
504     */
505    public Device setManufacturer(String value) { 
506      if (Utilities.noString(value))
507        this.manufacturer = null;
508      else {
509        if (this.manufacturer == null)
510          this.manufacturer = new StringType();
511        this.manufacturer.setValue(value);
512      }
513      return this;
514    }
515
516    /**
517     * @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
518     */
519    public StringType getModelElement() { 
520      if (this.model == null)
521        if (Configuration.errorOnAutoCreate())
522          throw new Error("Attempt to auto-create Device.model");
523        else if (Configuration.doAutoCreate())
524          this.model = new StringType(); // bb
525      return this.model;
526    }
527
528    public boolean hasModelElement() { 
529      return this.model != null && !this.model.isEmpty();
530    }
531
532    public boolean hasModel() { 
533      return this.model != null && !this.model.isEmpty();
534    }
535
536    /**
537     * @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
538     */
539    public Device setModelElement(StringType value) { 
540      this.model = value;
541      return this;
542    }
543
544    /**
545     * @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.
546     */
547    public String getModel() { 
548      return this.model == null ? null : this.model.getValue();
549    }
550
551    /**
552     * @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.
553     */
554    public Device setModel(String value) { 
555      if (Utilities.noString(value))
556        this.model = null;
557      else {
558        if (this.model == null)
559          this.model = new StringType();
560        this.model.setValue(value);
561      }
562      return this;
563    }
564
565    /**
566     * @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
567     */
568    public StringType getVersionElement() { 
569      if (this.version == null)
570        if (Configuration.errorOnAutoCreate())
571          throw new Error("Attempt to auto-create Device.version");
572        else if (Configuration.doAutoCreate())
573          this.version = new StringType(); // bb
574      return this.version;
575    }
576
577    public boolean hasVersionElement() { 
578      return this.version != null && !this.version.isEmpty();
579    }
580
581    public boolean hasVersion() { 
582      return this.version != null && !this.version.isEmpty();
583    }
584
585    /**
586     * @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
587     */
588    public Device setVersionElement(StringType value) { 
589      this.version = value;
590      return this;
591    }
592
593    /**
594     * @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.
595     */
596    public String getVersion() { 
597      return this.version == null ? null : this.version.getValue();
598    }
599
600    /**
601     * @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.
602     */
603    public Device setVersion(String value) { 
604      if (Utilities.noString(value))
605        this.version = null;
606      else {
607        if (this.version == null)
608          this.version = new StringType();
609        this.version.setValue(value);
610      }
611      return this;
612    }
613
614    /**
615     * @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
616     */
617    public DateTimeType getManufactureDateElement() { 
618      if (this.manufactureDate == null)
619        if (Configuration.errorOnAutoCreate())
620          throw new Error("Attempt to auto-create Device.manufactureDate");
621        else if (Configuration.doAutoCreate())
622          this.manufactureDate = new DateTimeType(); // bb
623      return this.manufactureDate;
624    }
625
626    public boolean hasManufactureDateElement() { 
627      return this.manufactureDate != null && !this.manufactureDate.isEmpty();
628    }
629
630    public boolean hasManufactureDate() { 
631      return this.manufactureDate != null && !this.manufactureDate.isEmpty();
632    }
633
634    /**
635     * @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
636     */
637    public Device setManufactureDateElement(DateTimeType value) { 
638      this.manufactureDate = value;
639      return this;
640    }
641
642    /**
643     * @return The date and time when the device was manufactured.
644     */
645    public Date getManufactureDate() { 
646      return this.manufactureDate == null ? null : this.manufactureDate.getValue();
647    }
648
649    /**
650     * @param value The date and time when the device was manufactured.
651     */
652    public Device setManufactureDate(Date value) { 
653      if (value == null)
654        this.manufactureDate = null;
655      else {
656        if (this.manufactureDate == null)
657          this.manufactureDate = new DateTimeType();
658        this.manufactureDate.setValue(value);
659      }
660      return this;
661    }
662
663    /**
664     * @return {@link #expiry} (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 "getExpiry" gives direct access to the value
665     */
666    public DateTimeType getExpiryElement() { 
667      if (this.expiry == null)
668        if (Configuration.errorOnAutoCreate())
669          throw new Error("Attempt to auto-create Device.expiry");
670        else if (Configuration.doAutoCreate())
671          this.expiry = new DateTimeType(); // bb
672      return this.expiry;
673    }
674
675    public boolean hasExpiryElement() { 
676      return this.expiry != null && !this.expiry.isEmpty();
677    }
678
679    public boolean hasExpiry() { 
680      return this.expiry != null && !this.expiry.isEmpty();
681    }
682
683    /**
684     * @param value {@link #expiry} (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 "getExpiry" gives direct access to the value
685     */
686    public Device setExpiryElement(DateTimeType value) { 
687      this.expiry = value;
688      return this;
689    }
690
691    /**
692     * @return The date and time beyond which this device is no longer valid or should not be used (if applicable).
693     */
694    public Date getExpiry() { 
695      return this.expiry == null ? null : this.expiry.getValue();
696    }
697
698    /**
699     * @param value The date and time beyond which this device is no longer valid or should not be used (if applicable).
700     */
701    public Device setExpiry(Date value) { 
702      if (value == null)
703        this.expiry = null;
704      else {
705        if (this.expiry == null)
706          this.expiry = new DateTimeType();
707        this.expiry.setValue(value);
708      }
709      return this;
710    }
711
712    /**
713     * @return {@link #udi} (United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode)  - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.). This is the underlying object with id, value and extensions. The accessor "getUdi" gives direct access to the value
714     */
715    public StringType getUdiElement() { 
716      if (this.udi == null)
717        if (Configuration.errorOnAutoCreate())
718          throw new Error("Attempt to auto-create Device.udi");
719        else if (Configuration.doAutoCreate())
720          this.udi = new StringType(); // bb
721      return this.udi;
722    }
723
724    public boolean hasUdiElement() { 
725      return this.udi != null && !this.udi.isEmpty();
726    }
727
728    public boolean hasUdi() { 
729      return this.udi != null && !this.udi.isEmpty();
730    }
731
732    /**
733     * @param value {@link #udi} (United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode)  - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.). This is the underlying object with id, value and extensions. The accessor "getUdi" gives direct access to the value
734     */
735    public Device setUdiElement(StringType value) { 
736      this.udi = value;
737      return this;
738    }
739
740    /**
741     * @return United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode)  - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.
742     */
743    public String getUdi() { 
744      return this.udi == null ? null : this.udi.getValue();
745    }
746
747    /**
748     * @param value United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode)  - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.
749     */
750    public Device setUdi(String value) { 
751      if (Utilities.noString(value))
752        this.udi = null;
753      else {
754        if (this.udi == null)
755          this.udi = new StringType();
756        this.udi.setValue(value);
757      }
758      return this;
759    }
760
761    /**
762     * @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
763     */
764    public StringType getLotNumberElement() { 
765      if (this.lotNumber == null)
766        if (Configuration.errorOnAutoCreate())
767          throw new Error("Attempt to auto-create Device.lotNumber");
768        else if (Configuration.doAutoCreate())
769          this.lotNumber = new StringType(); // bb
770      return this.lotNumber;
771    }
772
773    public boolean hasLotNumberElement() { 
774      return this.lotNumber != null && !this.lotNumber.isEmpty();
775    }
776
777    public boolean hasLotNumber() { 
778      return this.lotNumber != null && !this.lotNumber.isEmpty();
779    }
780
781    /**
782     * @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
783     */
784    public Device setLotNumberElement(StringType value) { 
785      this.lotNumber = value;
786      return this;
787    }
788
789    /**
790     * @return Lot number assigned by the manufacturer.
791     */
792    public String getLotNumber() { 
793      return this.lotNumber == null ? null : this.lotNumber.getValue();
794    }
795
796    /**
797     * @param value Lot number assigned by the manufacturer.
798     */
799    public Device setLotNumber(String value) { 
800      if (Utilities.noString(value))
801        this.lotNumber = null;
802      else {
803        if (this.lotNumber == null)
804          this.lotNumber = new StringType();
805        this.lotNumber.setValue(value);
806      }
807      return this;
808    }
809
810    /**
811     * @return {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.)
812     */
813    public Reference getOwner() { 
814      if (this.owner == null)
815        if (Configuration.errorOnAutoCreate())
816          throw new Error("Attempt to auto-create Device.owner");
817        else if (Configuration.doAutoCreate())
818          this.owner = new Reference(); // cc
819      return this.owner;
820    }
821
822    public boolean hasOwner() { 
823      return this.owner != null && !this.owner.isEmpty();
824    }
825
826    /**
827     * @param value {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.)
828     */
829    public Device setOwner(Reference value) { 
830      this.owner = value;
831      return this;
832    }
833
834    /**
835     * @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.)
836     */
837    public Organization getOwnerTarget() { 
838      if (this.ownerTarget == null)
839        if (Configuration.errorOnAutoCreate())
840          throw new Error("Attempt to auto-create Device.owner");
841        else if (Configuration.doAutoCreate())
842          this.ownerTarget = new Organization(); // aa
843      return this.ownerTarget;
844    }
845
846    /**
847     * @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.)
848     */
849    public Device setOwnerTarget(Organization value) { 
850      this.ownerTarget = value;
851      return this;
852    }
853
854    /**
855     * @return {@link #location} (The place where the device can be found.)
856     */
857    public Reference getLocation() { 
858      if (this.location == null)
859        if (Configuration.errorOnAutoCreate())
860          throw new Error("Attempt to auto-create Device.location");
861        else if (Configuration.doAutoCreate())
862          this.location = new Reference(); // cc
863      return this.location;
864    }
865
866    public boolean hasLocation() { 
867      return this.location != null && !this.location.isEmpty();
868    }
869
870    /**
871     * @param value {@link #location} (The place where the device can be found.)
872     */
873    public Device setLocation(Reference value) { 
874      this.location = value;
875      return this;
876    }
877
878    /**
879     * @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.)
880     */
881    public Location getLocationTarget() { 
882      if (this.locationTarget == null)
883        if (Configuration.errorOnAutoCreate())
884          throw new Error("Attempt to auto-create Device.location");
885        else if (Configuration.doAutoCreate())
886          this.locationTarget = new Location(); // aa
887      return this.locationTarget;
888    }
889
890    /**
891     * @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.)
892     */
893    public Device setLocationTarget(Location value) { 
894      this.locationTarget = value;
895      return this;
896    }
897
898    /**
899     * @return {@link #patient} (Patient information, if the resource is affixed to a person.)
900     */
901    public Reference getPatient() { 
902      if (this.patient == null)
903        if (Configuration.errorOnAutoCreate())
904          throw new Error("Attempt to auto-create Device.patient");
905        else if (Configuration.doAutoCreate())
906          this.patient = new Reference(); // cc
907      return this.patient;
908    }
909
910    public boolean hasPatient() { 
911      return this.patient != null && !this.patient.isEmpty();
912    }
913
914    /**
915     * @param value {@link #patient} (Patient information, if the resource is affixed to a person.)
916     */
917    public Device setPatient(Reference value) { 
918      this.patient = value;
919      return this;
920    }
921
922    /**
923     * @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 resource is affixed to a person.)
924     */
925    public Patient getPatientTarget() { 
926      if (this.patientTarget == null)
927        if (Configuration.errorOnAutoCreate())
928          throw new Error("Attempt to auto-create Device.patient");
929        else if (Configuration.doAutoCreate())
930          this.patientTarget = new Patient(); // aa
931      return this.patientTarget;
932    }
933
934    /**
935     * @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 resource is affixed to a person.)
936     */
937    public Device setPatientTarget(Patient value) { 
938      this.patientTarget = value;
939      return this;
940    }
941
942    /**
943     * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.)
944     */
945    public List<ContactPoint> getContact() { 
946      if (this.contact == null)
947        this.contact = new ArrayList<ContactPoint>();
948      return this.contact;
949    }
950
951    public boolean hasContact() { 
952      if (this.contact == null)
953        return false;
954      for (ContactPoint item : this.contact)
955        if (!item.isEmpty())
956          return true;
957      return false;
958    }
959
960    /**
961     * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.)
962     */
963    // syntactic sugar
964    public ContactPoint addContact() { //3
965      ContactPoint t = new ContactPoint();
966      if (this.contact == null)
967        this.contact = new ArrayList<ContactPoint>();
968      this.contact.add(t);
969      return t;
970    }
971
972    // syntactic sugar
973    public Device addContact(ContactPoint t) { //3
974      if (t == null)
975        return this;
976      if (this.contact == null)
977        this.contact = new ArrayList<ContactPoint>();
978      this.contact.add(t);
979      return this;
980    }
981
982    /**
983     * @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
984     */
985    public UriType getUrlElement() { 
986      if (this.url == null)
987        if (Configuration.errorOnAutoCreate())
988          throw new Error("Attempt to auto-create Device.url");
989        else if (Configuration.doAutoCreate())
990          this.url = new UriType(); // bb
991      return this.url;
992    }
993
994    public boolean hasUrlElement() { 
995      return this.url != null && !this.url.isEmpty();
996    }
997
998    public boolean hasUrl() { 
999      return this.url != null && !this.url.isEmpty();
1000    }
1001
1002    /**
1003     * @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
1004     */
1005    public Device setUrlElement(UriType value) { 
1006      this.url = value;
1007      return this;
1008    }
1009
1010    /**
1011     * @return A network address on which the device may be contacted directly.
1012     */
1013    public String getUrl() { 
1014      return this.url == null ? null : this.url.getValue();
1015    }
1016
1017    /**
1018     * @param value A network address on which the device may be contacted directly.
1019     */
1020    public Device setUrl(String value) { 
1021      if (Utilities.noString(value))
1022        this.url = null;
1023      else {
1024        if (this.url == null)
1025          this.url = new UriType();
1026        this.url.setValue(value);
1027      }
1028      return this;
1029    }
1030
1031      protected void listChildren(List<Property> childrenList) {
1032        super.listChildren(childrenList);
1033        childrenList.add(new Property("identifier", "Identifier", "Unique instance identifiers assigned to a device by organizations like manufacturers or owners. If the identifier identifies the type of device, Device.type should be used.", 0, java.lang.Integer.MAX_VALUE, identifier));
1034        childrenList.add(new Property("type", "CodeableConcept", "Code or identifier to identify a kind of device.", 0, java.lang.Integer.MAX_VALUE, type));
1035        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));
1036        childrenList.add(new Property("status", "code", "Status of the Device availability.", 0, java.lang.Integer.MAX_VALUE, status));
1037        childrenList.add(new Property("manufacturer", "string", "A name of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer));
1038        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));
1039        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));
1040        childrenList.add(new Property("manufactureDate", "dateTime", "The date and time when the device was manufactured.", 0, java.lang.Integer.MAX_VALUE, manufactureDate));
1041        childrenList.add(new Property("expiry", "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, expiry));
1042        childrenList.add(new Property("udi", "string", "United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode)  - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm.", 0, java.lang.Integer.MAX_VALUE, udi));
1043        childrenList.add(new Property("lotNumber", "string", "Lot number assigned by the manufacturer.", 0, java.lang.Integer.MAX_VALUE, lotNumber));
1044        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));
1045        childrenList.add(new Property("location", "Reference(Location)", "The place where the device can be found.", 0, java.lang.Integer.MAX_VALUE, location));
1046        childrenList.add(new Property("patient", "Reference(Patient)", "Patient information, if the resource is affixed to a person.", 0, java.lang.Integer.MAX_VALUE, patient));
1047        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));
1048        childrenList.add(new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, java.lang.Integer.MAX_VALUE, url));
1049      }
1050
1051      @Override
1052      public void setProperty(String name, Base value) throws FHIRException {
1053        if (name.equals("identifier"))
1054          this.getIdentifier().add(castToIdentifier(value));
1055        else if (name.equals("type"))
1056          this.type = castToCodeableConcept(value); // CodeableConcept
1057        else if (name.equals("note"))
1058          this.getNote().add(castToAnnotation(value));
1059        else if (name.equals("status"))
1060          this.status = new DeviceStatusEnumFactory().fromType(value); // Enumeration<DeviceStatus>
1061        else if (name.equals("manufacturer"))
1062          this.manufacturer = castToString(value); // StringType
1063        else if (name.equals("model"))
1064          this.model = castToString(value); // StringType
1065        else if (name.equals("version"))
1066          this.version = castToString(value); // StringType
1067        else if (name.equals("manufactureDate"))
1068          this.manufactureDate = castToDateTime(value); // DateTimeType
1069        else if (name.equals("expiry"))
1070          this.expiry = castToDateTime(value); // DateTimeType
1071        else if (name.equals("udi"))
1072          this.udi = castToString(value); // StringType
1073        else if (name.equals("lotNumber"))
1074          this.lotNumber = castToString(value); // StringType
1075        else if (name.equals("owner"))
1076          this.owner = castToReference(value); // Reference
1077        else if (name.equals("location"))
1078          this.location = castToReference(value); // Reference
1079        else if (name.equals("patient"))
1080          this.patient = castToReference(value); // Reference
1081        else if (name.equals("contact"))
1082          this.getContact().add(castToContactPoint(value));
1083        else if (name.equals("url"))
1084          this.url = castToUri(value); // UriType
1085        else
1086          super.setProperty(name, value);
1087      }
1088
1089      @Override
1090      public Base addChild(String name) throws FHIRException {
1091        if (name.equals("identifier")) {
1092          return addIdentifier();
1093        }
1094        else if (name.equals("type")) {
1095          this.type = new CodeableConcept();
1096          return this.type;
1097        }
1098        else if (name.equals("note")) {
1099          return addNote();
1100        }
1101        else if (name.equals("status")) {
1102          throw new FHIRException("Cannot call addChild on a primitive type Device.status");
1103        }
1104        else if (name.equals("manufacturer")) {
1105          throw new FHIRException("Cannot call addChild on a primitive type Device.manufacturer");
1106        }
1107        else if (name.equals("model")) {
1108          throw new FHIRException("Cannot call addChild on a primitive type Device.model");
1109        }
1110        else if (name.equals("version")) {
1111          throw new FHIRException("Cannot call addChild on a primitive type Device.version");
1112        }
1113        else if (name.equals("manufactureDate")) {
1114          throw new FHIRException("Cannot call addChild on a primitive type Device.manufactureDate");
1115        }
1116        else if (name.equals("expiry")) {
1117          throw new FHIRException("Cannot call addChild on a primitive type Device.expiry");
1118        }
1119        else if (name.equals("udi")) {
1120          throw new FHIRException("Cannot call addChild on a primitive type Device.udi");
1121        }
1122        else if (name.equals("lotNumber")) {
1123          throw new FHIRException("Cannot call addChild on a primitive type Device.lotNumber");
1124        }
1125        else if (name.equals("owner")) {
1126          this.owner = new Reference();
1127          return this.owner;
1128        }
1129        else if (name.equals("location")) {
1130          this.location = new Reference();
1131          return this.location;
1132        }
1133        else if (name.equals("patient")) {
1134          this.patient = new Reference();
1135          return this.patient;
1136        }
1137        else if (name.equals("contact")) {
1138          return addContact();
1139        }
1140        else if (name.equals("url")) {
1141          throw new FHIRException("Cannot call addChild on a primitive type Device.url");
1142        }
1143        else
1144          return super.addChild(name);
1145      }
1146
1147  public String fhirType() {
1148    return "Device";
1149
1150  }
1151
1152      public Device copy() {
1153        Device dst = new Device();
1154        copyValues(dst);
1155        if (identifier != null) {
1156          dst.identifier = new ArrayList<Identifier>();
1157          for (Identifier i : identifier)
1158            dst.identifier.add(i.copy());
1159        };
1160        dst.type = type == null ? null : type.copy();
1161        if (note != null) {
1162          dst.note = new ArrayList<Annotation>();
1163          for (Annotation i : note)
1164            dst.note.add(i.copy());
1165        };
1166        dst.status = status == null ? null : status.copy();
1167        dst.manufacturer = manufacturer == null ? null : manufacturer.copy();
1168        dst.model = model == null ? null : model.copy();
1169        dst.version = version == null ? null : version.copy();
1170        dst.manufactureDate = manufactureDate == null ? null : manufactureDate.copy();
1171        dst.expiry = expiry == null ? null : expiry.copy();
1172        dst.udi = udi == null ? null : udi.copy();
1173        dst.lotNumber = lotNumber == null ? null : lotNumber.copy();
1174        dst.owner = owner == null ? null : owner.copy();
1175        dst.location = location == null ? null : location.copy();
1176        dst.patient = patient == null ? null : patient.copy();
1177        if (contact != null) {
1178          dst.contact = new ArrayList<ContactPoint>();
1179          for (ContactPoint i : contact)
1180            dst.contact.add(i.copy());
1181        };
1182        dst.url = url == null ? null : url.copy();
1183        return dst;
1184      }
1185
1186      protected Device typedCopy() {
1187        return copy();
1188      }
1189
1190      @Override
1191      public boolean equalsDeep(Base other) {
1192        if (!super.equalsDeep(other))
1193          return false;
1194        if (!(other instanceof Device))
1195          return false;
1196        Device o = (Device) other;
1197        return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(note, o.note, true)
1198           && compareDeep(status, o.status, true) && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(model, o.model, true)
1199           && compareDeep(version, o.version, true) && compareDeep(manufactureDate, o.manufactureDate, true)
1200           && compareDeep(expiry, o.expiry, true) && compareDeep(udi, o.udi, true) && compareDeep(lotNumber, o.lotNumber, true)
1201           && compareDeep(owner, o.owner, true) && compareDeep(location, o.location, true) && compareDeep(patient, o.patient, true)
1202           && compareDeep(contact, o.contact, true) && compareDeep(url, o.url, true);
1203      }
1204
1205      @Override
1206      public boolean equalsShallow(Base other) {
1207        if (!super.equalsShallow(other))
1208          return false;
1209        if (!(other instanceof Device))
1210          return false;
1211        Device o = (Device) other;
1212        return compareValues(status, o.status, true) && compareValues(manufacturer, o.manufacturer, true) && compareValues(model, o.model, true)
1213           && compareValues(version, o.version, true) && compareValues(manufactureDate, o.manufactureDate, true)
1214           && compareValues(expiry, o.expiry, true) && compareValues(udi, o.udi, true) && compareValues(lotNumber, o.lotNumber, true)
1215           && compareValues(url, o.url, true);
1216      }
1217
1218      public boolean isEmpty() {
1219        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty())
1220           && (note == null || note.isEmpty()) && (status == null || status.isEmpty()) && (manufacturer == null || manufacturer.isEmpty())
1221           && (model == null || model.isEmpty()) && (version == null || version.isEmpty()) && (manufactureDate == null || manufactureDate.isEmpty())
1222           && (expiry == null || expiry.isEmpty()) && (udi == null || udi.isEmpty()) && (lotNumber == null || lotNumber.isEmpty())
1223           && (owner == null || owner.isEmpty()) && (location == null || location.isEmpty()) && (patient == null || patient.isEmpty())
1224           && (contact == null || contact.isEmpty()) && (url == null || url.isEmpty());
1225      }
1226
1227  @Override
1228  public ResourceType getResourceType() {
1229    return ResourceType.Device;
1230   }
1231
1232  @SearchParamDefinition(name="identifier", path="Device.identifier", description="Instance id from manufacturer, owner, and others", type="token" )
1233  public static final String SP_IDENTIFIER = "identifier";
1234  @SearchParamDefinition(name="patient", path="Device.patient", description="Patient information, if the resource is affixed to a person", type="reference" )
1235  public static final String SP_PATIENT = "patient";
1236  @SearchParamDefinition(name="organization", path="Device.owner", description="The organization responsible for the device", type="reference" )
1237  public static final String SP_ORGANIZATION = "organization";
1238  @SearchParamDefinition(name="model", path="Device.model", description="The model of the device", type="string" )
1239  public static final String SP_MODEL = "model";
1240  @SearchParamDefinition(name="location", path="Device.location", description="A location, where the resource is found", type="reference" )
1241  public static final String SP_LOCATION = "location";
1242  @SearchParamDefinition(name="udi", path="Device.udi", description="FDA mandated Unique Device Identifier", type="string" )
1243  public static final String SP_UDI = "udi";
1244  @SearchParamDefinition(name="type", path="Device.type", description="The type of the device", type="token" )
1245  public static final String SP_TYPE = "type";
1246  @SearchParamDefinition(name="url", path="Device.url", description="Network address to contact device", type="uri" )
1247  public static final String SP_URL = "url";
1248  @SearchParamDefinition(name="manufacturer", path="Device.manufacturer", description="The manufacturer of the device", type="string" )
1249  public static final String SP_MANUFACTURER = "manufacturer";
1250
1251}
1252