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