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