001package org.hl7.fhir.dstu3.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
035import java.util.ArrayList;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.exceptions.FHIRException;
040import org.hl7.fhir.exceptions.FHIRFormatError;
041
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.Description;
044import ca.uhn.fhir.model.api.annotation.ResourceDef;
045import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
046/**
047 * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.
048 */
049@ResourceDef(name="DeviceUseStatement", profile="http://hl7.org/fhir/Profile/DeviceUseStatement")
050public class DeviceUseStatement extends DomainResource {
051
052    public enum DeviceUseStatementStatus {
053        /**
054         * The device is still being used.
055         */
056        ACTIVE, 
057        /**
058         * The device is no longer being used.
059         */
060        COMPLETED, 
061        /**
062         * The statement was recorded incorrectly.
063         */
064        ENTEREDINERROR, 
065        /**
066         * The device may be used at some time in the future.
067         */
068        INTENDED, 
069        /**
070         * Actions implied by the statement have been permanently halted, before all of them occurred.
071         */
072        STOPPED, 
073        /**
074         * Actions implied by the statement have been temporarily halted, but are expected to continue later. May also be called "suspended".
075         */
076        ONHOLD, 
077        /**
078         * added to help the parsers with the generic types
079         */
080        NULL;
081        public static DeviceUseStatementStatus fromCode(String codeString) throws FHIRException {
082            if (codeString == null || "".equals(codeString))
083                return null;
084        if ("active".equals(codeString))
085          return ACTIVE;
086        if ("completed".equals(codeString))
087          return COMPLETED;
088        if ("entered-in-error".equals(codeString))
089          return ENTEREDINERROR;
090        if ("intended".equals(codeString))
091          return INTENDED;
092        if ("stopped".equals(codeString))
093          return STOPPED;
094        if ("on-hold".equals(codeString))
095          return ONHOLD;
096        if (Configuration.isAcceptInvalidEnums())
097          return null;
098        else
099          throw new FHIRException("Unknown DeviceUseStatementStatus code '"+codeString+"'");
100        }
101        public String toCode() {
102          switch (this) {
103            case ACTIVE: return "active";
104            case COMPLETED: return "completed";
105            case ENTEREDINERROR: return "entered-in-error";
106            case INTENDED: return "intended";
107            case STOPPED: return "stopped";
108            case ONHOLD: return "on-hold";
109            case NULL: return null;
110            default: return "?";
111          }
112        }
113        public String getSystem() {
114          switch (this) {
115            case ACTIVE: return "http://hl7.org/fhir/device-statement-status";
116            case COMPLETED: return "http://hl7.org/fhir/device-statement-status";
117            case ENTEREDINERROR: return "http://hl7.org/fhir/device-statement-status";
118            case INTENDED: return "http://hl7.org/fhir/device-statement-status";
119            case STOPPED: return "http://hl7.org/fhir/device-statement-status";
120            case ONHOLD: return "http://hl7.org/fhir/device-statement-status";
121            case NULL: return null;
122            default: return "?";
123          }
124        }
125        public String getDefinition() {
126          switch (this) {
127            case ACTIVE: return "The device is still being used.";
128            case COMPLETED: return "The device is no longer being used.";
129            case ENTEREDINERROR: return "The statement was recorded incorrectly.";
130            case INTENDED: return "The device may be used at some time in the future.";
131            case STOPPED: return "Actions implied by the statement have been permanently halted, before all of them occurred.";
132            case ONHOLD: return "Actions implied by the statement have been temporarily halted, but are expected to continue later. May also be called \"suspended\".";
133            case NULL: return null;
134            default: return "?";
135          }
136        }
137        public String getDisplay() {
138          switch (this) {
139            case ACTIVE: return "Active";
140            case COMPLETED: return "Completed";
141            case ENTEREDINERROR: return "Entered in Error";
142            case INTENDED: return "Intended";
143            case STOPPED: return "Stopped";
144            case ONHOLD: return "On Hold";
145            case NULL: return null;
146            default: return "?";
147          }
148        }
149    }
150
151  public static class DeviceUseStatementStatusEnumFactory implements EnumFactory<DeviceUseStatementStatus> {
152    public DeviceUseStatementStatus fromCode(String codeString) throws IllegalArgumentException {
153      if (codeString == null || "".equals(codeString))
154            if (codeString == null || "".equals(codeString))
155                return null;
156        if ("active".equals(codeString))
157          return DeviceUseStatementStatus.ACTIVE;
158        if ("completed".equals(codeString))
159          return DeviceUseStatementStatus.COMPLETED;
160        if ("entered-in-error".equals(codeString))
161          return DeviceUseStatementStatus.ENTEREDINERROR;
162        if ("intended".equals(codeString))
163          return DeviceUseStatementStatus.INTENDED;
164        if ("stopped".equals(codeString))
165          return DeviceUseStatementStatus.STOPPED;
166        if ("on-hold".equals(codeString))
167          return DeviceUseStatementStatus.ONHOLD;
168        throw new IllegalArgumentException("Unknown DeviceUseStatementStatus code '"+codeString+"'");
169        }
170        public Enumeration<DeviceUseStatementStatus> fromType(PrimitiveType<?> code) throws FHIRException {
171          if (code == null)
172            return null;
173          if (code.isEmpty())
174            return new Enumeration<DeviceUseStatementStatus>(this);
175          String codeString = code.asStringValue();
176          if (codeString == null || "".equals(codeString))
177            return null;
178        if ("active".equals(codeString))
179          return new Enumeration<DeviceUseStatementStatus>(this, DeviceUseStatementStatus.ACTIVE);
180        if ("completed".equals(codeString))
181          return new Enumeration<DeviceUseStatementStatus>(this, DeviceUseStatementStatus.COMPLETED);
182        if ("entered-in-error".equals(codeString))
183          return new Enumeration<DeviceUseStatementStatus>(this, DeviceUseStatementStatus.ENTEREDINERROR);
184        if ("intended".equals(codeString))
185          return new Enumeration<DeviceUseStatementStatus>(this, DeviceUseStatementStatus.INTENDED);
186        if ("stopped".equals(codeString))
187          return new Enumeration<DeviceUseStatementStatus>(this, DeviceUseStatementStatus.STOPPED);
188        if ("on-hold".equals(codeString))
189          return new Enumeration<DeviceUseStatementStatus>(this, DeviceUseStatementStatus.ONHOLD);
190        throw new FHIRException("Unknown DeviceUseStatementStatus code '"+codeString+"'");
191        }
192    public String toCode(DeviceUseStatementStatus code) {
193      if (code == DeviceUseStatementStatus.ACTIVE)
194        return "active";
195      if (code == DeviceUseStatementStatus.COMPLETED)
196        return "completed";
197      if (code == DeviceUseStatementStatus.ENTEREDINERROR)
198        return "entered-in-error";
199      if (code == DeviceUseStatementStatus.INTENDED)
200        return "intended";
201      if (code == DeviceUseStatementStatus.STOPPED)
202        return "stopped";
203      if (code == DeviceUseStatementStatus.ONHOLD)
204        return "on-hold";
205      return "?";
206      }
207    public String toSystem(DeviceUseStatementStatus code) {
208      return code.getSystem();
209      }
210    }
211
212    /**
213     * An external identifier for this statement such as an IRI.
214     */
215    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
216    @Description(shortDefinition="External identifier for this record", formalDefinition="An external identifier for this statement such as an IRI." )
217    protected List<Identifier> identifier;
218
219    /**
220     * A code representing the patient or other source's judgment about the state of the device used that this statement is about.  Generally this will be active or completed.
221     */
222    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
223    @Description(shortDefinition="active | completed | entered-in-error +", formalDefinition="A code representing the patient or other source's judgment about the state of the device used that this statement is about.  Generally this will be active or completed." )
224    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-statement-status")
225    protected Enumeration<DeviceUseStatementStatus> status;
226
227    /**
228     * The patient who used the device.
229     */
230    @Child(name = "subject", type = {Patient.class, Group.class}, order=2, min=1, max=1, modifier=false, summary=false)
231    @Description(shortDefinition="Patient using device", formalDefinition="The patient who used the device." )
232    protected Reference subject;
233
234    /**
235     * The actual object that is the target of the reference (The patient who used the device.)
236     */
237    protected Resource subjectTarget;
238
239    /**
240     * The time period over which the device was used.
241     */
242    @Child(name = "whenUsed", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=false)
243    @Description(shortDefinition="Period device was used", formalDefinition="The time period over which the device was used." )
244    protected Period whenUsed;
245
246    /**
247     * How often the device was used.
248     */
249    @Child(name = "timing", type = {Timing.class, Period.class, DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false)
250    @Description(shortDefinition="How often  the device was used", formalDefinition="How often the device was used." )
251    protected Type timing;
252
253    /**
254     * The time at which the statement was made/recorded.
255     */
256    @Child(name = "recordedOn", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
257    @Description(shortDefinition="When statement was recorded", formalDefinition="The time at which the statement was made/recorded." )
258    protected DateTimeType recordedOn;
259
260    /**
261     * Who reported the device was being used by the patient.
262     */
263    @Child(name = "source", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=6, min=0, max=1, modifier=false, summary=false)
264    @Description(shortDefinition="Who made the statement", formalDefinition="Who reported the device was being used by the patient." )
265    protected Reference source;
266
267    /**
268     * The actual object that is the target of the reference (Who reported the device was being used by the patient.)
269     */
270    protected Resource sourceTarget;
271
272    /**
273     * The details of the device used.
274     */
275    @Child(name = "device", type = {Device.class}, order=7, min=1, max=1, modifier=false, summary=false)
276    @Description(shortDefinition="Reference to device used", formalDefinition="The details of the device used." )
277    protected Reference device;
278
279    /**
280     * The actual object that is the target of the reference (The details of the device used.)
281     */
282    protected Device deviceTarget;
283
284    /**
285     * Reason or justification for the use of the device.
286     */
287    @Child(name = "indication", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
288    @Description(shortDefinition="Why device was used", formalDefinition="Reason or justification for the use of the device." )
289    protected List<CodeableConcept> indication;
290
291    /**
292     * Indicates the site on the subject's body where the device was used ( i.e. the target site).
293     */
294    @Child(name = "bodySite", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false)
295    @Description(shortDefinition="Target body site", formalDefinition="Indicates the site on the subject's body where the device was used ( i.e. the target site)." )
296    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/body-site")
297    protected CodeableConcept bodySite;
298
299    /**
300     * Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.
301     */
302    @Child(name = "note", type = {Annotation.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
303    @Description(shortDefinition="Addition details (comments, instructions)", formalDefinition="Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." )
304    protected List<Annotation> note;
305
306    private static final long serialVersionUID = 2144163845L;
307
308  /**
309   * Constructor
310   */
311    public DeviceUseStatement() {
312      super();
313    }
314
315  /**
316   * Constructor
317   */
318    public DeviceUseStatement(Enumeration<DeviceUseStatementStatus> status, Reference subject, Reference device) {
319      super();
320      this.status = status;
321      this.subject = subject;
322      this.device = device;
323    }
324
325    /**
326     * @return {@link #identifier} (An external identifier for this statement such as an IRI.)
327     */
328    public List<Identifier> getIdentifier() { 
329      if (this.identifier == null)
330        this.identifier = new ArrayList<Identifier>();
331      return this.identifier;
332    }
333
334    /**
335     * @return Returns a reference to <code>this</code> for easy method chaining
336     */
337    public DeviceUseStatement setIdentifier(List<Identifier> theIdentifier) { 
338      this.identifier = theIdentifier;
339      return this;
340    }
341
342    public boolean hasIdentifier() { 
343      if (this.identifier == null)
344        return false;
345      for (Identifier item : this.identifier)
346        if (!item.isEmpty())
347          return true;
348      return false;
349    }
350
351    public Identifier addIdentifier() { //3
352      Identifier t = new Identifier();
353      if (this.identifier == null)
354        this.identifier = new ArrayList<Identifier>();
355      this.identifier.add(t);
356      return t;
357    }
358
359    public DeviceUseStatement addIdentifier(Identifier t) { //3
360      if (t == null)
361        return this;
362      if (this.identifier == null)
363        this.identifier = new ArrayList<Identifier>();
364      this.identifier.add(t);
365      return this;
366    }
367
368    /**
369     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
370     */
371    public Identifier getIdentifierFirstRep() { 
372      if (getIdentifier().isEmpty()) {
373        addIdentifier();
374      }
375      return getIdentifier().get(0);
376    }
377
378    /**
379     * @return {@link #status} (A code representing the patient or other source's judgment about the state of the device used that this statement is about.  Generally this will be active or completed.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
380     */
381    public Enumeration<DeviceUseStatementStatus> getStatusElement() { 
382      if (this.status == null)
383        if (Configuration.errorOnAutoCreate())
384          throw new Error("Attempt to auto-create DeviceUseStatement.status");
385        else if (Configuration.doAutoCreate())
386          this.status = new Enumeration<DeviceUseStatementStatus>(new DeviceUseStatementStatusEnumFactory()); // bb
387      return this.status;
388    }
389
390    public boolean hasStatusElement() { 
391      return this.status != null && !this.status.isEmpty();
392    }
393
394    public boolean hasStatus() { 
395      return this.status != null && !this.status.isEmpty();
396    }
397
398    /**
399     * @param value {@link #status} (A code representing the patient or other source's judgment about the state of the device used that this statement is about.  Generally this will be active or completed.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
400     */
401    public DeviceUseStatement setStatusElement(Enumeration<DeviceUseStatementStatus> value) { 
402      this.status = value;
403      return this;
404    }
405
406    /**
407     * @return A code representing the patient or other source's judgment about the state of the device used that this statement is about.  Generally this will be active or completed.
408     */
409    public DeviceUseStatementStatus getStatus() { 
410      return this.status == null ? null : this.status.getValue();
411    }
412
413    /**
414     * @param value A code representing the patient or other source's judgment about the state of the device used that this statement is about.  Generally this will be active or completed.
415     */
416    public DeviceUseStatement setStatus(DeviceUseStatementStatus value) { 
417        if (this.status == null)
418          this.status = new Enumeration<DeviceUseStatementStatus>(new DeviceUseStatementStatusEnumFactory());
419        this.status.setValue(value);
420      return this;
421    }
422
423    /**
424     * @return {@link #subject} (The patient who used the device.)
425     */
426    public Reference getSubject() { 
427      if (this.subject == null)
428        if (Configuration.errorOnAutoCreate())
429          throw new Error("Attempt to auto-create DeviceUseStatement.subject");
430        else if (Configuration.doAutoCreate())
431          this.subject = new Reference(); // cc
432      return this.subject;
433    }
434
435    public boolean hasSubject() { 
436      return this.subject != null && !this.subject.isEmpty();
437    }
438
439    /**
440     * @param value {@link #subject} (The patient who used the device.)
441     */
442    public DeviceUseStatement setSubject(Reference value)  { 
443      this.subject = value;
444      return this;
445    }
446
447    /**
448     * @return {@link #subject} 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 patient who used the device.)
449     */
450    public Resource getSubjectTarget() { 
451      return this.subjectTarget;
452    }
453
454    /**
455     * @param value {@link #subject} 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 patient who used the device.)
456     */
457    public DeviceUseStatement setSubjectTarget(Resource value) { 
458      this.subjectTarget = value;
459      return this;
460    }
461
462    /**
463     * @return {@link #whenUsed} (The time period over which the device was used.)
464     */
465    public Period getWhenUsed() { 
466      if (this.whenUsed == null)
467        if (Configuration.errorOnAutoCreate())
468          throw new Error("Attempt to auto-create DeviceUseStatement.whenUsed");
469        else if (Configuration.doAutoCreate())
470          this.whenUsed = new Period(); // cc
471      return this.whenUsed;
472    }
473
474    public boolean hasWhenUsed() { 
475      return this.whenUsed != null && !this.whenUsed.isEmpty();
476    }
477
478    /**
479     * @param value {@link #whenUsed} (The time period over which the device was used.)
480     */
481    public DeviceUseStatement setWhenUsed(Period value)  { 
482      this.whenUsed = value;
483      return this;
484    }
485
486    /**
487     * @return {@link #timing} (How often the device was used.)
488     */
489    public Type getTiming() { 
490      return this.timing;
491    }
492
493    /**
494     * @return {@link #timing} (How often the device was used.)
495     */
496    public Timing getTimingTiming() throws FHIRException { 
497      if (this.timing == null)
498        return null;
499      if (!(this.timing instanceof Timing))
500        throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered");
501      return (Timing) this.timing;
502    }
503
504    public boolean hasTimingTiming() { 
505      return this != null && this.timing instanceof Timing;
506    }
507
508    /**
509     * @return {@link #timing} (How often the device was used.)
510     */
511    public Period getTimingPeriod() throws FHIRException { 
512      if (this.timing == null)
513        return null;
514      if (!(this.timing instanceof Period))
515        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered");
516      return (Period) this.timing;
517    }
518
519    public boolean hasTimingPeriod() { 
520      return this != null && this.timing instanceof Period;
521    }
522
523    /**
524     * @return {@link #timing} (How often the device was used.)
525     */
526    public DateTimeType getTimingDateTimeType() throws FHIRException { 
527      if (this.timing == null)
528        return null;
529      if (!(this.timing instanceof DateTimeType))
530        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered");
531      return (DateTimeType) this.timing;
532    }
533
534    public boolean hasTimingDateTimeType() { 
535      return this != null && this.timing instanceof DateTimeType;
536    }
537
538    public boolean hasTiming() { 
539      return this.timing != null && !this.timing.isEmpty();
540    }
541
542    /**
543     * @param value {@link #timing} (How often the device was used.)
544     */
545    public DeviceUseStatement setTiming(Type value) throws FHIRFormatError { 
546      if (value != null && !(value instanceof Timing || value instanceof Period || value instanceof DateTimeType))
547        throw new FHIRFormatError("Not the right type for DeviceUseStatement.timing[x]: "+value.fhirType());
548      this.timing = value;
549      return this;
550    }
551
552    /**
553     * @return {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value
554     */
555    public DateTimeType getRecordedOnElement() { 
556      if (this.recordedOn == null)
557        if (Configuration.errorOnAutoCreate())
558          throw new Error("Attempt to auto-create DeviceUseStatement.recordedOn");
559        else if (Configuration.doAutoCreate())
560          this.recordedOn = new DateTimeType(); // bb
561      return this.recordedOn;
562    }
563
564    public boolean hasRecordedOnElement() { 
565      return this.recordedOn != null && !this.recordedOn.isEmpty();
566    }
567
568    public boolean hasRecordedOn() { 
569      return this.recordedOn != null && !this.recordedOn.isEmpty();
570    }
571
572    /**
573     * @param value {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value
574     */
575    public DeviceUseStatement setRecordedOnElement(DateTimeType value) { 
576      this.recordedOn = value;
577      return this;
578    }
579
580    /**
581     * @return The time at which the statement was made/recorded.
582     */
583    public Date getRecordedOn() { 
584      return this.recordedOn == null ? null : this.recordedOn.getValue();
585    }
586
587    /**
588     * @param value The time at which the statement was made/recorded.
589     */
590    public DeviceUseStatement setRecordedOn(Date value) { 
591      if (value == null)
592        this.recordedOn = null;
593      else {
594        if (this.recordedOn == null)
595          this.recordedOn = new DateTimeType();
596        this.recordedOn.setValue(value);
597      }
598      return this;
599    }
600
601    /**
602     * @return {@link #source} (Who reported the device was being used by the patient.)
603     */
604    public Reference getSource() { 
605      if (this.source == null)
606        if (Configuration.errorOnAutoCreate())
607          throw new Error("Attempt to auto-create DeviceUseStatement.source");
608        else if (Configuration.doAutoCreate())
609          this.source = new Reference(); // cc
610      return this.source;
611    }
612
613    public boolean hasSource() { 
614      return this.source != null && !this.source.isEmpty();
615    }
616
617    /**
618     * @param value {@link #source} (Who reported the device was being used by the patient.)
619     */
620    public DeviceUseStatement setSource(Reference value)  { 
621      this.source = value;
622      return this;
623    }
624
625    /**
626     * @return {@link #source} 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. (Who reported the device was being used by the patient.)
627     */
628    public Resource getSourceTarget() { 
629      return this.sourceTarget;
630    }
631
632    /**
633     * @param value {@link #source} 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. (Who reported the device was being used by the patient.)
634     */
635    public DeviceUseStatement setSourceTarget(Resource value) { 
636      this.sourceTarget = value;
637      return this;
638    }
639
640    /**
641     * @return {@link #device} (The details of the device used.)
642     */
643    public Reference getDevice() { 
644      if (this.device == null)
645        if (Configuration.errorOnAutoCreate())
646          throw new Error("Attempt to auto-create DeviceUseStatement.device");
647        else if (Configuration.doAutoCreate())
648          this.device = new Reference(); // cc
649      return this.device;
650    }
651
652    public boolean hasDevice() { 
653      return this.device != null && !this.device.isEmpty();
654    }
655
656    /**
657     * @param value {@link #device} (The details of the device used.)
658     */
659    public DeviceUseStatement setDevice(Reference value)  { 
660      this.device = value;
661      return this;
662    }
663
664    /**
665     * @return {@link #device} 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 details of the device used.)
666     */
667    public Device getDeviceTarget() { 
668      if (this.deviceTarget == null)
669        if (Configuration.errorOnAutoCreate())
670          throw new Error("Attempt to auto-create DeviceUseStatement.device");
671        else if (Configuration.doAutoCreate())
672          this.deviceTarget = new Device(); // aa
673      return this.deviceTarget;
674    }
675
676    /**
677     * @param value {@link #device} 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 details of the device used.)
678     */
679    public DeviceUseStatement setDeviceTarget(Device value) { 
680      this.deviceTarget = value;
681      return this;
682    }
683
684    /**
685     * @return {@link #indication} (Reason or justification for the use of the device.)
686     */
687    public List<CodeableConcept> getIndication() { 
688      if (this.indication == null)
689        this.indication = new ArrayList<CodeableConcept>();
690      return this.indication;
691    }
692
693    /**
694     * @return Returns a reference to <code>this</code> for easy method chaining
695     */
696    public DeviceUseStatement setIndication(List<CodeableConcept> theIndication) { 
697      this.indication = theIndication;
698      return this;
699    }
700
701    public boolean hasIndication() { 
702      if (this.indication == null)
703        return false;
704      for (CodeableConcept item : this.indication)
705        if (!item.isEmpty())
706          return true;
707      return false;
708    }
709
710    public CodeableConcept addIndication() { //3
711      CodeableConcept t = new CodeableConcept();
712      if (this.indication == null)
713        this.indication = new ArrayList<CodeableConcept>();
714      this.indication.add(t);
715      return t;
716    }
717
718    public DeviceUseStatement addIndication(CodeableConcept t) { //3
719      if (t == null)
720        return this;
721      if (this.indication == null)
722        this.indication = new ArrayList<CodeableConcept>();
723      this.indication.add(t);
724      return this;
725    }
726
727    /**
728     * @return The first repetition of repeating field {@link #indication}, creating it if it does not already exist
729     */
730    public CodeableConcept getIndicationFirstRep() { 
731      if (getIndication().isEmpty()) {
732        addIndication();
733      }
734      return getIndication().get(0);
735    }
736
737    /**
738     * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).)
739     */
740    public CodeableConcept getBodySite() { 
741      if (this.bodySite == null)
742        if (Configuration.errorOnAutoCreate())
743          throw new Error("Attempt to auto-create DeviceUseStatement.bodySite");
744        else if (Configuration.doAutoCreate())
745          this.bodySite = new CodeableConcept(); // cc
746      return this.bodySite;
747    }
748
749    public boolean hasBodySite() { 
750      return this.bodySite != null && !this.bodySite.isEmpty();
751    }
752
753    /**
754     * @param value {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).)
755     */
756    public DeviceUseStatement setBodySite(CodeableConcept value)  { 
757      this.bodySite = value;
758      return this;
759    }
760
761    /**
762     * @return {@link #note} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.)
763     */
764    public List<Annotation> getNote() { 
765      if (this.note == null)
766        this.note = new ArrayList<Annotation>();
767      return this.note;
768    }
769
770    /**
771     * @return Returns a reference to <code>this</code> for easy method chaining
772     */
773    public DeviceUseStatement setNote(List<Annotation> theNote) { 
774      this.note = theNote;
775      return this;
776    }
777
778    public boolean hasNote() { 
779      if (this.note == null)
780        return false;
781      for (Annotation item : this.note)
782        if (!item.isEmpty())
783          return true;
784      return false;
785    }
786
787    public Annotation addNote() { //3
788      Annotation t = new Annotation();
789      if (this.note == null)
790        this.note = new ArrayList<Annotation>();
791      this.note.add(t);
792      return t;
793    }
794
795    public DeviceUseStatement addNote(Annotation t) { //3
796      if (t == null)
797        return this;
798      if (this.note == null)
799        this.note = new ArrayList<Annotation>();
800      this.note.add(t);
801      return this;
802    }
803
804    /**
805     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
806     */
807    public Annotation getNoteFirstRep() { 
808      if (getNote().isEmpty()) {
809        addNote();
810      }
811      return getNote().get(0);
812    }
813
814      protected void listChildren(List<Property> children) {
815        super.listChildren(children);
816        children.add(new Property("identifier", "Identifier", "An external identifier for this statement such as an IRI.", 0, java.lang.Integer.MAX_VALUE, identifier));
817        children.add(new Property("status", "code", "A code representing the patient or other source's judgment about the state of the device used that this statement is about.  Generally this will be active or completed.", 0, 1, status));
818        children.add(new Property("subject", "Reference(Patient|Group)", "The patient who used the device.", 0, 1, subject));
819        children.add(new Property("whenUsed", "Period", "The time period over which the device was used.", 0, 1, whenUsed));
820        children.add(new Property("timing[x]", "Timing|Period|dateTime", "How often the device was used.", 0, 1, timing));
821        children.add(new Property("recordedOn", "dateTime", "The time at which the statement was made/recorded.", 0, 1, recordedOn));
822        children.add(new Property("source", "Reference(Patient|Practitioner|RelatedPerson)", "Who reported the device was being used by the patient.", 0, 1, source));
823        children.add(new Property("device", "Reference(Device)", "The details of the device used.", 0, 1, device));
824        children.add(new Property("indication", "CodeableConcept", "Reason or justification for the use of the device.", 0, java.lang.Integer.MAX_VALUE, indication));
825        children.add(new Property("bodySite", "CodeableConcept", "Indicates the site on the subject's body where the device was used ( i.e. the target site).", 0, 1, bodySite));
826        children.add(new Property("note", "Annotation", "Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, note));
827      }
828
829      @Override
830      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
831        switch (_hash) {
832        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "An external identifier for this statement such as an IRI.", 0, java.lang.Integer.MAX_VALUE, identifier);
833        case -892481550: /*status*/  return new Property("status", "code", "A code representing the patient or other source's judgment about the state of the device used that this statement is about.  Generally this will be active or completed.", 0, 1, status);
834        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "The patient who used the device.", 0, 1, subject);
835        case 2042879511: /*whenUsed*/  return new Property("whenUsed", "Period", "The time period over which the device was used.", 0, 1, whenUsed);
836        case 164632566: /*timing[x]*/  return new Property("timing[x]", "Timing|Period|dateTime", "How often the device was used.", 0, 1, timing);
837        case -873664438: /*timing*/  return new Property("timing[x]", "Timing|Period|dateTime", "How often the device was used.", 0, 1, timing);
838        case -497554124: /*timingTiming*/  return new Property("timing[x]", "Timing|Period|dateTime", "How often the device was used.", 0, 1, timing);
839        case -615615829: /*timingPeriod*/  return new Property("timing[x]", "Timing|Period|dateTime", "How often the device was used.", 0, 1, timing);
840        case -1837458939: /*timingDateTime*/  return new Property("timing[x]", "Timing|Period|dateTime", "How often the device was used.", 0, 1, timing);
841        case 735397551: /*recordedOn*/  return new Property("recordedOn", "dateTime", "The time at which the statement was made/recorded.", 0, 1, recordedOn);
842        case -896505829: /*source*/  return new Property("source", "Reference(Patient|Practitioner|RelatedPerson)", "Who reported the device was being used by the patient.", 0, 1, source);
843        case -1335157162: /*device*/  return new Property("device", "Reference(Device)", "The details of the device used.", 0, 1, device);
844        case -597168804: /*indication*/  return new Property("indication", "CodeableConcept", "Reason or justification for the use of the device.", 0, java.lang.Integer.MAX_VALUE, indication);
845        case 1702620169: /*bodySite*/  return new Property("bodySite", "CodeableConcept", "Indicates the site on the subject's body where the device was used ( i.e. the target site).", 0, 1, bodySite);
846        case 3387378: /*note*/  return new Property("note", "Annotation", "Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, note);
847        default: return super.getNamedProperty(_hash, _name, _checkValid);
848        }
849
850      }
851
852      @Override
853      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
854        switch (hash) {
855        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
856        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<DeviceUseStatementStatus>
857        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
858        case 2042879511: /*whenUsed*/ return this.whenUsed == null ? new Base[0] : new Base[] {this.whenUsed}; // Period
859        case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Type
860        case 735397551: /*recordedOn*/ return this.recordedOn == null ? new Base[0] : new Base[] {this.recordedOn}; // DateTimeType
861        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference
862        case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference
863        case -597168804: /*indication*/ return this.indication == null ? new Base[0] : this.indication.toArray(new Base[this.indication.size()]); // CodeableConcept
864        case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableConcept
865        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
866        default: return super.getProperty(hash, name, checkValid);
867        }
868
869      }
870
871      @Override
872      public Base setProperty(int hash, String name, Base value) throws FHIRException {
873        switch (hash) {
874        case -1618432855: // identifier
875          this.getIdentifier().add(castToIdentifier(value)); // Identifier
876          return value;
877        case -892481550: // status
878          value = new DeviceUseStatementStatusEnumFactory().fromType(castToCode(value));
879          this.status = (Enumeration) value; // Enumeration<DeviceUseStatementStatus>
880          return value;
881        case -1867885268: // subject
882          this.subject = castToReference(value); // Reference
883          return value;
884        case 2042879511: // whenUsed
885          this.whenUsed = castToPeriod(value); // Period
886          return value;
887        case -873664438: // timing
888          this.timing = castToType(value); // Type
889          return value;
890        case 735397551: // recordedOn
891          this.recordedOn = castToDateTime(value); // DateTimeType
892          return value;
893        case -896505829: // source
894          this.source = castToReference(value); // Reference
895          return value;
896        case -1335157162: // device
897          this.device = castToReference(value); // Reference
898          return value;
899        case -597168804: // indication
900          this.getIndication().add(castToCodeableConcept(value)); // CodeableConcept
901          return value;
902        case 1702620169: // bodySite
903          this.bodySite = castToCodeableConcept(value); // CodeableConcept
904          return value;
905        case 3387378: // note
906          this.getNote().add(castToAnnotation(value)); // Annotation
907          return value;
908        default: return super.setProperty(hash, name, value);
909        }
910
911      }
912
913      @Override
914      public Base setProperty(String name, Base value) throws FHIRException {
915        if (name.equals("identifier")) {
916          this.getIdentifier().add(castToIdentifier(value));
917        } else if (name.equals("status")) {
918          value = new DeviceUseStatementStatusEnumFactory().fromType(castToCode(value));
919          this.status = (Enumeration) value; // Enumeration<DeviceUseStatementStatus>
920        } else if (name.equals("subject")) {
921          this.subject = castToReference(value); // Reference
922        } else if (name.equals("whenUsed")) {
923          this.whenUsed = castToPeriod(value); // Period
924        } else if (name.equals("timing[x]")) {
925          this.timing = castToType(value); // Type
926        } else if (name.equals("recordedOn")) {
927          this.recordedOn = castToDateTime(value); // DateTimeType
928        } else if (name.equals("source")) {
929          this.source = castToReference(value); // Reference
930        } else if (name.equals("device")) {
931          this.device = castToReference(value); // Reference
932        } else if (name.equals("indication")) {
933          this.getIndication().add(castToCodeableConcept(value));
934        } else if (name.equals("bodySite")) {
935          this.bodySite = castToCodeableConcept(value); // CodeableConcept
936        } else if (name.equals("note")) {
937          this.getNote().add(castToAnnotation(value));
938        } else
939          return super.setProperty(name, value);
940        return value;
941      }
942
943      @Override
944      public Base makeProperty(int hash, String name) throws FHIRException {
945        switch (hash) {
946        case -1618432855:  return addIdentifier(); 
947        case -892481550:  return getStatusElement();
948        case -1867885268:  return getSubject(); 
949        case 2042879511:  return getWhenUsed(); 
950        case 164632566:  return getTiming(); 
951        case -873664438:  return getTiming(); 
952        case 735397551:  return getRecordedOnElement();
953        case -896505829:  return getSource(); 
954        case -1335157162:  return getDevice(); 
955        case -597168804:  return addIndication(); 
956        case 1702620169:  return getBodySite(); 
957        case 3387378:  return addNote(); 
958        default: return super.makeProperty(hash, name);
959        }
960
961      }
962
963      @Override
964      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
965        switch (hash) {
966        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
967        case -892481550: /*status*/ return new String[] {"code"};
968        case -1867885268: /*subject*/ return new String[] {"Reference"};
969        case 2042879511: /*whenUsed*/ return new String[] {"Period"};
970        case -873664438: /*timing*/ return new String[] {"Timing", "Period", "dateTime"};
971        case 735397551: /*recordedOn*/ return new String[] {"dateTime"};
972        case -896505829: /*source*/ return new String[] {"Reference"};
973        case -1335157162: /*device*/ return new String[] {"Reference"};
974        case -597168804: /*indication*/ return new String[] {"CodeableConcept"};
975        case 1702620169: /*bodySite*/ return new String[] {"CodeableConcept"};
976        case 3387378: /*note*/ return new String[] {"Annotation"};
977        default: return super.getTypesForProperty(hash, name);
978        }
979
980      }
981
982      @Override
983      public Base addChild(String name) throws FHIRException {
984        if (name.equals("identifier")) {
985          return addIdentifier();
986        }
987        else if (name.equals("status")) {
988          throw new FHIRException("Cannot call addChild on a singleton property DeviceUseStatement.status");
989        }
990        else if (name.equals("subject")) {
991          this.subject = new Reference();
992          return this.subject;
993        }
994        else if (name.equals("whenUsed")) {
995          this.whenUsed = new Period();
996          return this.whenUsed;
997        }
998        else if (name.equals("timingTiming")) {
999          this.timing = new Timing();
1000          return this.timing;
1001        }
1002        else if (name.equals("timingPeriod")) {
1003          this.timing = new Period();
1004          return this.timing;
1005        }
1006        else if (name.equals("timingDateTime")) {
1007          this.timing = new DateTimeType();
1008          return this.timing;
1009        }
1010        else if (name.equals("recordedOn")) {
1011          throw new FHIRException("Cannot call addChild on a singleton property DeviceUseStatement.recordedOn");
1012        }
1013        else if (name.equals("source")) {
1014          this.source = new Reference();
1015          return this.source;
1016        }
1017        else if (name.equals("device")) {
1018          this.device = new Reference();
1019          return this.device;
1020        }
1021        else if (name.equals("indication")) {
1022          return addIndication();
1023        }
1024        else if (name.equals("bodySite")) {
1025          this.bodySite = new CodeableConcept();
1026          return this.bodySite;
1027        }
1028        else if (name.equals("note")) {
1029          return addNote();
1030        }
1031        else
1032          return super.addChild(name);
1033      }
1034
1035  public String fhirType() {
1036    return "DeviceUseStatement";
1037
1038  }
1039
1040      public DeviceUseStatement copy() {
1041        DeviceUseStatement dst = new DeviceUseStatement();
1042        copyValues(dst);
1043        if (identifier != null) {
1044          dst.identifier = new ArrayList<Identifier>();
1045          for (Identifier i : identifier)
1046            dst.identifier.add(i.copy());
1047        };
1048        dst.status = status == null ? null : status.copy();
1049        dst.subject = subject == null ? null : subject.copy();
1050        dst.whenUsed = whenUsed == null ? null : whenUsed.copy();
1051        dst.timing = timing == null ? null : timing.copy();
1052        dst.recordedOn = recordedOn == null ? null : recordedOn.copy();
1053        dst.source = source == null ? null : source.copy();
1054        dst.device = device == null ? null : device.copy();
1055        if (indication != null) {
1056          dst.indication = new ArrayList<CodeableConcept>();
1057          for (CodeableConcept i : indication)
1058            dst.indication.add(i.copy());
1059        };
1060        dst.bodySite = bodySite == null ? null : bodySite.copy();
1061        if (note != null) {
1062          dst.note = new ArrayList<Annotation>();
1063          for (Annotation i : note)
1064            dst.note.add(i.copy());
1065        };
1066        return dst;
1067      }
1068
1069      protected DeviceUseStatement typedCopy() {
1070        return copy();
1071      }
1072
1073      @Override
1074      public boolean equalsDeep(Base other_) {
1075        if (!super.equalsDeep(other_))
1076          return false;
1077        if (!(other_ instanceof DeviceUseStatement))
1078          return false;
1079        DeviceUseStatement o = (DeviceUseStatement) other_;
1080        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(subject, o.subject, true)
1081           && compareDeep(whenUsed, o.whenUsed, true) && compareDeep(timing, o.timing, true) && compareDeep(recordedOn, o.recordedOn, true)
1082           && compareDeep(source, o.source, true) && compareDeep(device, o.device, true) && compareDeep(indication, o.indication, true)
1083           && compareDeep(bodySite, o.bodySite, true) && compareDeep(note, o.note, true);
1084      }
1085
1086      @Override
1087      public boolean equalsShallow(Base other_) {
1088        if (!super.equalsShallow(other_))
1089          return false;
1090        if (!(other_ instanceof DeviceUseStatement))
1091          return false;
1092        DeviceUseStatement o = (DeviceUseStatement) other_;
1093        return compareValues(status, o.status, true) && compareValues(recordedOn, o.recordedOn, true);
1094      }
1095
1096      public boolean isEmpty() {
1097        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, subject
1098          , whenUsed, timing, recordedOn, source, device, indication, bodySite, note);
1099      }
1100
1101  @Override
1102  public ResourceType getResourceType() {
1103    return ResourceType.DeviceUseStatement;
1104   }
1105
1106 /**
1107   * Search parameter: <b>identifier</b>
1108   * <p>
1109   * Description: <b>Search by identifier</b><br>
1110   * Type: <b>token</b><br>
1111   * Path: <b>DeviceUseStatement.identifier</b><br>
1112   * </p>
1113   */
1114  @SearchParamDefinition(name="identifier", path="DeviceUseStatement.identifier", description="Search by identifier", type="token" )
1115  public static final String SP_IDENTIFIER = "identifier";
1116 /**
1117   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1118   * <p>
1119   * Description: <b>Search by identifier</b><br>
1120   * Type: <b>token</b><br>
1121   * Path: <b>DeviceUseStatement.identifier</b><br>
1122   * </p>
1123   */
1124  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1125
1126 /**
1127   * Search parameter: <b>subject</b>
1128   * <p>
1129   * Description: <b>Search by subject</b><br>
1130   * Type: <b>reference</b><br>
1131   * Path: <b>DeviceUseStatement.subject</b><br>
1132   * </p>
1133   */
1134  @SearchParamDefinition(name="subject", path="DeviceUseStatement.subject", description="Search by subject", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Group.class, Patient.class } )
1135  public static final String SP_SUBJECT = "subject";
1136 /**
1137   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
1138   * <p>
1139   * Description: <b>Search by subject</b><br>
1140   * Type: <b>reference</b><br>
1141   * Path: <b>DeviceUseStatement.subject</b><br>
1142   * </p>
1143   */
1144  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
1145
1146/**
1147   * Constant for fluent queries to be used to add include statements. Specifies
1148   * the path value of "<b>DeviceUseStatement:subject</b>".
1149   */
1150  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DeviceUseStatement:subject").toLocked();
1151
1152 /**
1153   * Search parameter: <b>patient</b>
1154   * <p>
1155   * Description: <b>Search by subject - a patient</b><br>
1156   * Type: <b>reference</b><br>
1157   * Path: <b>DeviceUseStatement.subject</b><br>
1158   * </p>
1159   */
1160  @SearchParamDefinition(name="patient", path="DeviceUseStatement.subject", description="Search by subject - a patient", type="reference", target={Group.class, Patient.class } )
1161  public static final String SP_PATIENT = "patient";
1162 /**
1163   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1164   * <p>
1165   * Description: <b>Search by subject - a patient</b><br>
1166   * Type: <b>reference</b><br>
1167   * Path: <b>DeviceUseStatement.subject</b><br>
1168   * </p>
1169   */
1170  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
1171
1172/**
1173   * Constant for fluent queries to be used to add include statements. Specifies
1174   * the path value of "<b>DeviceUseStatement:patient</b>".
1175   */
1176  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DeviceUseStatement:patient").toLocked();
1177
1178 /**
1179   * Search parameter: <b>device</b>
1180   * <p>
1181   * Description: <b>Search by device</b><br>
1182   * Type: <b>reference</b><br>
1183   * Path: <b>DeviceUseStatement.device</b><br>
1184   * </p>
1185   */
1186  @SearchParamDefinition(name="device", path="DeviceUseStatement.device", description="Search by device", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device") }, target={Device.class } )
1187  public static final String SP_DEVICE = "device";
1188 /**
1189   * <b>Fluent Client</b> search parameter constant for <b>device</b>
1190   * <p>
1191   * Description: <b>Search by device</b><br>
1192   * Type: <b>reference</b><br>
1193   * Path: <b>DeviceUseStatement.device</b><br>
1194   * </p>
1195   */
1196  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE);
1197
1198/**
1199   * Constant for fluent queries to be used to add include statements. Specifies
1200   * the path value of "<b>DeviceUseStatement:device</b>".
1201   */
1202  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("DeviceUseStatement:device").toLocked();
1203
1204
1205}