001package org.hl7.fhir.dstu3.model;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
036import java.util.ArrayList;
037import java.util.List;
038
039import org.hl7.fhir.exceptions.FHIRException;
040import org.hl7.fhir.exceptions.FHIRFormatError;
041
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.Description;
044import ca.uhn.fhir.model.api.annotation.ResourceDef;
045import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
046/**
047 * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.
048 */
049@ResourceDef(name="Media", profile="http://hl7.org/fhir/Profile/Media")
050public class Media extends DomainResource {
051
052    public enum DigitalMediaType {
053        /**
054         * The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents
055         */
056        PHOTO, 
057        /**
058         * The media consists of a series of frames that capture a moving image
059         */
060        VIDEO, 
061        /**
062         * The media consists of a sound recording
063         */
064        AUDIO, 
065        /**
066         * added to help the parsers with the generic types
067         */
068        NULL;
069        public static DigitalMediaType fromCode(String codeString) throws FHIRException {
070            if (codeString == null || "".equals(codeString))
071                return null;
072        if ("photo".equals(codeString))
073          return PHOTO;
074        if ("video".equals(codeString))
075          return VIDEO;
076        if ("audio".equals(codeString))
077          return AUDIO;
078        if (Configuration.isAcceptInvalidEnums())
079          return null;
080        else
081          throw new FHIRException("Unknown DigitalMediaType code '"+codeString+"'");
082        }
083        public String toCode() {
084          switch (this) {
085            case PHOTO: return "photo";
086            case VIDEO: return "video";
087            case AUDIO: return "audio";
088            case NULL: return null;
089            default: return "?";
090          }
091        }
092        public String getSystem() {
093          switch (this) {
094            case PHOTO: return "http://hl7.org/fhir/digital-media-type";
095            case VIDEO: return "http://hl7.org/fhir/digital-media-type";
096            case AUDIO: return "http://hl7.org/fhir/digital-media-type";
097            case NULL: return null;
098            default: return "?";
099          }
100        }
101        public String getDefinition() {
102          switch (this) {
103            case PHOTO: return "The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents";
104            case VIDEO: return "The media consists of a series of frames that capture a moving image";
105            case AUDIO: return "The media consists of a sound recording";
106            case NULL: return null;
107            default: return "?";
108          }
109        }
110        public String getDisplay() {
111          switch (this) {
112            case PHOTO: return "Photo";
113            case VIDEO: return "Video";
114            case AUDIO: return "Audio";
115            case NULL: return null;
116            default: return "?";
117          }
118        }
119    }
120
121  public static class DigitalMediaTypeEnumFactory implements EnumFactory<DigitalMediaType> {
122    public DigitalMediaType fromCode(String codeString) throws IllegalArgumentException {
123      if (codeString == null || "".equals(codeString))
124            if (codeString == null || "".equals(codeString))
125                return null;
126        if ("photo".equals(codeString))
127          return DigitalMediaType.PHOTO;
128        if ("video".equals(codeString))
129          return DigitalMediaType.VIDEO;
130        if ("audio".equals(codeString))
131          return DigitalMediaType.AUDIO;
132        throw new IllegalArgumentException("Unknown DigitalMediaType code '"+codeString+"'");
133        }
134        public Enumeration<DigitalMediaType> fromType(PrimitiveType<?> code) throws FHIRException {
135          if (code == null)
136            return null;
137          if (code.isEmpty())
138            return new Enumeration<DigitalMediaType>(this);
139          String codeString = code.asStringValue();
140          if (codeString == null || "".equals(codeString))
141            return null;
142        if ("photo".equals(codeString))
143          return new Enumeration<DigitalMediaType>(this, DigitalMediaType.PHOTO);
144        if ("video".equals(codeString))
145          return new Enumeration<DigitalMediaType>(this, DigitalMediaType.VIDEO);
146        if ("audio".equals(codeString))
147          return new Enumeration<DigitalMediaType>(this, DigitalMediaType.AUDIO);
148        throw new FHIRException("Unknown DigitalMediaType code '"+codeString+"'");
149        }
150    public String toCode(DigitalMediaType code) {
151       if (code == DigitalMediaType.NULL)
152           return null;
153       if (code == DigitalMediaType.PHOTO)
154        return "photo";
155      if (code == DigitalMediaType.VIDEO)
156        return "video";
157      if (code == DigitalMediaType.AUDIO)
158        return "audio";
159      return "?";
160   }
161    public String toSystem(DigitalMediaType code) {
162      return code.getSystem();
163      }
164    }
165
166    /**
167     * Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.
168     */
169    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
170    @Description(shortDefinition="Identifier(s) for the image", formalDefinition="Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers." )
171    protected List<Identifier> identifier;
172
173    /**
174     * A procedure that is fulfilled in whole or in part by the creation of this media.
175     */
176    @Child(name = "basedOn", type = {ProcedureRequest.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
177    @Description(shortDefinition="Procedure that caused this media to be created", formalDefinition="A procedure that is fulfilled in whole or in part by the creation of this media." )
178    protected List<Reference> basedOn;
179    /**
180     * The actual objects that are the target of the reference (A procedure that is fulfilled in whole or in part by the creation of this media.)
181     */
182    protected List<ProcedureRequest> basedOnTarget;
183
184
185    /**
186     * Whether the media is a photo (still image), an audio recording, or a video recording.
187     */
188    @Child(name = "type", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
189    @Description(shortDefinition="photo | video | audio", formalDefinition="Whether the media is a photo (still image), an audio recording, or a video recording." )
190    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/digital-media-type")
191    protected Enumeration<DigitalMediaType> type;
192
193    /**
194     * Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.
195     */
196    @Child(name = "subtype", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
197    @Description(shortDefinition="The type of acquisition equipment/process", formalDefinition="Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality." )
198    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/digital-media-subtype")
199    protected CodeableConcept subtype;
200
201    /**
202     * The name of the imaging view e.g. Lateral or Antero-posterior (AP).
203     */
204    @Child(name = "view", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
205    @Description(shortDefinition="Imaging view, e.g. Lateral or Antero-posterior", formalDefinition="The name of the imaging view e.g. Lateral or Antero-posterior (AP)." )
206    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/media-view")
207    protected CodeableConcept view;
208
209    /**
210     * Who/What this Media is a record of.
211     */
212    @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class, Device.class, Specimen.class}, order=5, min=0, max=1, modifier=false, summary=true)
213    @Description(shortDefinition="Who/What this Media is a record of", formalDefinition="Who/What this Media is a record of." )
214    protected Reference subject;
215
216    /**
217     * The actual object that is the target of the reference (Who/What this Media is a record of.)
218     */
219    protected Resource subjectTarget;
220
221    /**
222     * The encounter or episode of care that establishes the context for this media.
223     */
224    @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=6, min=0, max=1, modifier=false, summary=true)
225    @Description(shortDefinition="Encounter / Episode associated with media", formalDefinition="The encounter or episode of care that establishes the context for this media." )
226    protected Reference context;
227
228    /**
229     * The actual object that is the target of the reference (The encounter or episode of care that establishes the context for this media.)
230     */
231    protected Resource contextTarget;
232
233    /**
234     * The date and time(s) at which the media was collected.
235     */
236    @Child(name = "occurrence", type = {DateTimeType.class, Period.class}, order=7, min=0, max=1, modifier=false, summary=true)
237    @Description(shortDefinition="When Media was collected", formalDefinition="The date and time(s) at which the media was collected." )
238    protected Type occurrence;
239
240    /**
241     * The person who administered the collection of the image.
242     */
243    @Child(name = "operator", type = {Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true)
244    @Description(shortDefinition="The person who generated the image", formalDefinition="The person who administered the collection of the image." )
245    protected Reference operator;
246
247    /**
248     * The actual object that is the target of the reference (The person who administered the collection of the image.)
249     */
250    protected Practitioner operatorTarget;
251
252    /**
253     * Describes why the event occurred in coded or textual form.
254     */
255    @Child(name = "reasonCode", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
256    @Description(shortDefinition="Why was event performed?", formalDefinition="Describes why the event occurred in coded or textual form." )
257    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/procedure-reason")
258    protected List<CodeableConcept> reasonCode;
259
260    /**
261     * Indicates the site on the subject's body where the media was collected (i.e. the target site).
262     */
263    @Child(name = "bodySite", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true)
264    @Description(shortDefinition="Body part in media", formalDefinition="Indicates the site on the subject's body where the media was collected (i.e. the target site)." )
265    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/body-site")
266    protected CodeableConcept bodySite;
267
268    /**
269     * The device used to collect the media.
270     */
271    @Child(name = "device", type = {Device.class, DeviceMetric.class}, order=11, min=0, max=1, modifier=false, summary=true)
272    @Description(shortDefinition="Observing Device", formalDefinition="The device used to collect the media." )
273    protected Reference device;
274
275    /**
276     * The actual object that is the target of the reference (The device used to collect the media.)
277     */
278    protected Resource deviceTarget;
279
280    /**
281     * Height of the image in pixels (photo/video).
282     */
283    @Child(name = "height", type = {PositiveIntType.class}, order=12, min=0, max=1, modifier=false, summary=true)
284    @Description(shortDefinition="Height of the image in pixels (photo/video)", formalDefinition="Height of the image in pixels (photo/video)." )
285    protected PositiveIntType height;
286
287    /**
288     * Width of the image in pixels (photo/video).
289     */
290    @Child(name = "width", type = {PositiveIntType.class}, order=13, min=0, max=1, modifier=false, summary=true)
291    @Description(shortDefinition="Width of the image in pixels (photo/video)", formalDefinition="Width of the image in pixels (photo/video)." )
292    protected PositiveIntType width;
293
294    /**
295     * The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.
296     */
297    @Child(name = "frames", type = {PositiveIntType.class}, order=14, min=0, max=1, modifier=false, summary=true)
298    @Description(shortDefinition="Number of frames if > 1 (photo)", formalDefinition="The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required." )
299    protected PositiveIntType frames;
300
301    /**
302     * The duration of the recording in seconds - for audio and video.
303     */
304    @Child(name = "duration", type = {UnsignedIntType.class}, order=15, min=0, max=1, modifier=false, summary=true)
305    @Description(shortDefinition="Length in seconds (audio / video)", formalDefinition="The duration of the recording in seconds - for audio and video." )
306    protected UnsignedIntType duration;
307
308    /**
309     * The actual content of the media - inline or by direct reference to the media source file.
310     */
311    @Child(name = "content", type = {Attachment.class}, order=16, min=1, max=1, modifier=false, summary=false)
312    @Description(shortDefinition="Actual Media - reference or data", formalDefinition="The actual content of the media - inline or by direct reference to the media source file." )
313    protected Attachment content;
314
315    /**
316     * Comments made about the media by the performer, subject or other participants.
317     */
318    @Child(name = "note", type = {Annotation.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
319    @Description(shortDefinition="Comments made about the media", formalDefinition="Comments made about the media by the performer, subject or other participants." )
320    protected List<Annotation> note;
321
322    private static final long serialVersionUID = -831317677L;
323
324  /**
325   * Constructor
326   */
327    public Media() {
328      super();
329    }
330
331  /**
332   * Constructor
333   */
334    public Media(Enumeration<DigitalMediaType> type, Attachment content) {
335      super();
336      this.type = type;
337      this.content = content;
338    }
339
340    /**
341     * @return {@link #identifier} (Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.)
342     */
343    public List<Identifier> getIdentifier() { 
344      if (this.identifier == null)
345        this.identifier = new ArrayList<Identifier>();
346      return this.identifier;
347    }
348
349    /**
350     * @return Returns a reference to <code>this</code> for easy method chaining
351     */
352    public Media setIdentifier(List<Identifier> theIdentifier) { 
353      this.identifier = theIdentifier;
354      return this;
355    }
356
357    public boolean hasIdentifier() { 
358      if (this.identifier == null)
359        return false;
360      for (Identifier item : this.identifier)
361        if (!item.isEmpty())
362          return true;
363      return false;
364    }
365
366    public Identifier addIdentifier() { //3
367      Identifier t = new Identifier();
368      if (this.identifier == null)
369        this.identifier = new ArrayList<Identifier>();
370      this.identifier.add(t);
371      return t;
372    }
373
374    public Media addIdentifier(Identifier t) { //3
375      if (t == null)
376        return this;
377      if (this.identifier == null)
378        this.identifier = new ArrayList<Identifier>();
379      this.identifier.add(t);
380      return this;
381    }
382
383    /**
384     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
385     */
386    public Identifier getIdentifierFirstRep() { 
387      if (getIdentifier().isEmpty()) {
388        addIdentifier();
389      }
390      return getIdentifier().get(0);
391    }
392
393    /**
394     * @return {@link #basedOn} (A procedure that is fulfilled in whole or in part by the creation of this media.)
395     */
396    public List<Reference> getBasedOn() { 
397      if (this.basedOn == null)
398        this.basedOn = new ArrayList<Reference>();
399      return this.basedOn;
400    }
401
402    /**
403     * @return Returns a reference to <code>this</code> for easy method chaining
404     */
405    public Media setBasedOn(List<Reference> theBasedOn) { 
406      this.basedOn = theBasedOn;
407      return this;
408    }
409
410    public boolean hasBasedOn() { 
411      if (this.basedOn == null)
412        return false;
413      for (Reference item : this.basedOn)
414        if (!item.isEmpty())
415          return true;
416      return false;
417    }
418
419    public Reference addBasedOn() { //3
420      Reference t = new Reference();
421      if (this.basedOn == null)
422        this.basedOn = new ArrayList<Reference>();
423      this.basedOn.add(t);
424      return t;
425    }
426
427    public Media addBasedOn(Reference t) { //3
428      if (t == null)
429        return this;
430      if (this.basedOn == null)
431        this.basedOn = new ArrayList<Reference>();
432      this.basedOn.add(t);
433      return this;
434    }
435
436    /**
437     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist
438     */
439    public Reference getBasedOnFirstRep() { 
440      if (getBasedOn().isEmpty()) {
441        addBasedOn();
442      }
443      return getBasedOn().get(0);
444    }
445
446    /**
447     * @return {@link #type} (Whether the media is a photo (still image), an audio recording, or a video recording.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
448     */
449    public Enumeration<DigitalMediaType> getTypeElement() { 
450      if (this.type == null)
451        if (Configuration.errorOnAutoCreate())
452          throw new Error("Attempt to auto-create Media.type");
453        else if (Configuration.doAutoCreate())
454          this.type = new Enumeration<DigitalMediaType>(new DigitalMediaTypeEnumFactory()); // bb
455      return this.type;
456    }
457
458    public boolean hasTypeElement() { 
459      return this.type != null && !this.type.isEmpty();
460    }
461
462    public boolean hasType() { 
463      return this.type != null && !this.type.isEmpty();
464    }
465
466    /**
467     * @param value {@link #type} (Whether the media is a photo (still image), an audio recording, or a video recording.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
468     */
469    public Media setTypeElement(Enumeration<DigitalMediaType> value) { 
470      this.type = value;
471      return this;
472    }
473
474    /**
475     * @return Whether the media is a photo (still image), an audio recording, or a video recording.
476     */
477    public DigitalMediaType getType() { 
478      return this.type == null ? null : this.type.getValue();
479    }
480
481    /**
482     * @param value Whether the media is a photo (still image), an audio recording, or a video recording.
483     */
484    public Media setType(DigitalMediaType value) { 
485        if (this.type == null)
486          this.type = new Enumeration<DigitalMediaType>(new DigitalMediaTypeEnumFactory());
487        this.type.setValue(value);
488      return this;
489    }
490
491    /**
492     * @return {@link #subtype} (Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.)
493     */
494    public CodeableConcept getSubtype() { 
495      if (this.subtype == null)
496        if (Configuration.errorOnAutoCreate())
497          throw new Error("Attempt to auto-create Media.subtype");
498        else if (Configuration.doAutoCreate())
499          this.subtype = new CodeableConcept(); // cc
500      return this.subtype;
501    }
502
503    public boolean hasSubtype() { 
504      return this.subtype != null && !this.subtype.isEmpty();
505    }
506
507    /**
508     * @param value {@link #subtype} (Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.)
509     */
510    public Media setSubtype(CodeableConcept value)  { 
511      this.subtype = value;
512      return this;
513    }
514
515    /**
516     * @return {@link #view} (The name of the imaging view e.g. Lateral or Antero-posterior (AP).)
517     */
518    public CodeableConcept getView() { 
519      if (this.view == null)
520        if (Configuration.errorOnAutoCreate())
521          throw new Error("Attempt to auto-create Media.view");
522        else if (Configuration.doAutoCreate())
523          this.view = new CodeableConcept(); // cc
524      return this.view;
525    }
526
527    public boolean hasView() { 
528      return this.view != null && !this.view.isEmpty();
529    }
530
531    /**
532     * @param value {@link #view} (The name of the imaging view e.g. Lateral or Antero-posterior (AP).)
533     */
534    public Media setView(CodeableConcept value)  { 
535      this.view = value;
536      return this;
537    }
538
539    /**
540     * @return {@link #subject} (Who/What this Media is a record of.)
541     */
542    public Reference getSubject() { 
543      if (this.subject == null)
544        if (Configuration.errorOnAutoCreate())
545          throw new Error("Attempt to auto-create Media.subject");
546        else if (Configuration.doAutoCreate())
547          this.subject = new Reference(); // cc
548      return this.subject;
549    }
550
551    public boolean hasSubject() { 
552      return this.subject != null && !this.subject.isEmpty();
553    }
554
555    /**
556     * @param value {@link #subject} (Who/What this Media is a record of.)
557     */
558    public Media setSubject(Reference value)  { 
559      this.subject = value;
560      return this;
561    }
562
563    /**
564     * @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. (Who/What this Media is a record of.)
565     */
566    public Resource getSubjectTarget() { 
567      return this.subjectTarget;
568    }
569
570    /**
571     * @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. (Who/What this Media is a record of.)
572     */
573    public Media setSubjectTarget(Resource value) { 
574      this.subjectTarget = value;
575      return this;
576    }
577
578    /**
579     * @return {@link #context} (The encounter or episode of care that establishes the context for this media.)
580     */
581    public Reference getContext() { 
582      if (this.context == null)
583        if (Configuration.errorOnAutoCreate())
584          throw new Error("Attempt to auto-create Media.context");
585        else if (Configuration.doAutoCreate())
586          this.context = new Reference(); // cc
587      return this.context;
588    }
589
590    public boolean hasContext() { 
591      return this.context != null && !this.context.isEmpty();
592    }
593
594    /**
595     * @param value {@link #context} (The encounter or episode of care that establishes the context for this media.)
596     */
597    public Media setContext(Reference value)  { 
598      this.context = value;
599      return this;
600    }
601
602    /**
603     * @return {@link #context} 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 encounter or episode of care that establishes the context for this media.)
604     */
605    public Resource getContextTarget() { 
606      return this.contextTarget;
607    }
608
609    /**
610     * @param value {@link #context} 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 encounter or episode of care that establishes the context for this media.)
611     */
612    public Media setContextTarget(Resource value) { 
613      this.contextTarget = value;
614      return this;
615    }
616
617    /**
618     * @return {@link #occurrence} (The date and time(s) at which the media was collected.)
619     */
620    public Type getOccurrence() { 
621      return this.occurrence;
622    }
623
624    /**
625     * @return {@link #occurrence} (The date and time(s) at which the media was collected.)
626     */
627    public DateTimeType getOccurrenceDateTimeType() throws FHIRException { 
628      if (this.occurrence == null)
629        return null;
630      if (!(this.occurrence instanceof DateTimeType))
631        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.occurrence.getClass().getName()+" was encountered");
632      return (DateTimeType) this.occurrence;
633    }
634
635    public boolean hasOccurrenceDateTimeType() {
636        return this.occurrence instanceof DateTimeType;
637    }
638
639    /**
640     * @return {@link #occurrence} (The date and time(s) at which the media was collected.)
641     */
642    public Period getOccurrencePeriod() throws FHIRException { 
643      if (this.occurrence == null)
644        return null;
645      if (!(this.occurrence instanceof Period))
646        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.occurrence.getClass().getName()+" was encountered");
647      return (Period) this.occurrence;
648    }
649
650    public boolean hasOccurrencePeriod() {
651        return this.occurrence instanceof Period;
652    }
653
654    public boolean hasOccurrence() { 
655      return this.occurrence != null && !this.occurrence.isEmpty();
656    }
657
658    /**
659     * @param value {@link #occurrence} (The date and time(s) at which the media was collected.)
660     */
661    public Media setOccurrence(Type value) throws FHIRFormatError { 
662      if (value != null && !(value instanceof DateTimeType || value instanceof Period))
663        throw new FHIRFormatError("Not the right type for Media.occurrence[x]: "+value.fhirType());
664      this.occurrence = value;
665      return this;
666    }
667
668    /**
669     * @return {@link #operator} (The person who administered the collection of the image.)
670     */
671    public Reference getOperator() { 
672      if (this.operator == null)
673        if (Configuration.errorOnAutoCreate())
674          throw new Error("Attempt to auto-create Media.operator");
675        else if (Configuration.doAutoCreate())
676          this.operator = new Reference(); // cc
677      return this.operator;
678    }
679
680    public boolean hasOperator() { 
681      return this.operator != null && !this.operator.isEmpty();
682    }
683
684    /**
685     * @param value {@link #operator} (The person who administered the collection of the image.)
686     */
687    public Media setOperator(Reference value)  { 
688      this.operator = value;
689      return this;
690    }
691
692    /**
693     * @return {@link #operator} 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 person who administered the collection of the image.)
694     */
695    public Practitioner getOperatorTarget() { 
696      if (this.operatorTarget == null)
697        if (Configuration.errorOnAutoCreate())
698          throw new Error("Attempt to auto-create Media.operator");
699        else if (Configuration.doAutoCreate())
700          this.operatorTarget = new Practitioner(); // aa
701      return this.operatorTarget;
702    }
703
704    /**
705     * @param value {@link #operator} 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 person who administered the collection of the image.)
706     */
707    public Media setOperatorTarget(Practitioner value) { 
708      this.operatorTarget = value;
709      return this;
710    }
711
712    /**
713     * @return {@link #reasonCode} (Describes why the event occurred in coded or textual form.)
714     */
715    public List<CodeableConcept> getReasonCode() { 
716      if (this.reasonCode == null)
717        this.reasonCode = new ArrayList<CodeableConcept>();
718      return this.reasonCode;
719    }
720
721    /**
722     * @return Returns a reference to <code>this</code> for easy method chaining
723     */
724    public Media setReasonCode(List<CodeableConcept> theReasonCode) { 
725      this.reasonCode = theReasonCode;
726      return this;
727    }
728
729    public boolean hasReasonCode() { 
730      if (this.reasonCode == null)
731        return false;
732      for (CodeableConcept item : this.reasonCode)
733        if (!item.isEmpty())
734          return true;
735      return false;
736    }
737
738    public CodeableConcept addReasonCode() { //3
739      CodeableConcept t = new CodeableConcept();
740      if (this.reasonCode == null)
741        this.reasonCode = new ArrayList<CodeableConcept>();
742      this.reasonCode.add(t);
743      return t;
744    }
745
746    public Media addReasonCode(CodeableConcept t) { //3
747      if (t == null)
748        return this;
749      if (this.reasonCode == null)
750        this.reasonCode = new ArrayList<CodeableConcept>();
751      this.reasonCode.add(t);
752      return this;
753    }
754
755    /**
756     * @return The first repetition of repeating field {@link #reasonCode}, creating it if it does not already exist
757     */
758    public CodeableConcept getReasonCodeFirstRep() { 
759      if (getReasonCode().isEmpty()) {
760        addReasonCode();
761      }
762      return getReasonCode().get(0);
763    }
764
765    /**
766     * @return {@link #bodySite} (Indicates the site on the subject's body where the media was collected (i.e. the target site).)
767     */
768    public CodeableConcept getBodySite() { 
769      if (this.bodySite == null)
770        if (Configuration.errorOnAutoCreate())
771          throw new Error("Attempt to auto-create Media.bodySite");
772        else if (Configuration.doAutoCreate())
773          this.bodySite = new CodeableConcept(); // cc
774      return this.bodySite;
775    }
776
777    public boolean hasBodySite() { 
778      return this.bodySite != null && !this.bodySite.isEmpty();
779    }
780
781    /**
782     * @param value {@link #bodySite} (Indicates the site on the subject's body where the media was collected (i.e. the target site).)
783     */
784    public Media setBodySite(CodeableConcept value)  { 
785      this.bodySite = value;
786      return this;
787    }
788
789    /**
790     * @return {@link #device} (The device used to collect the media.)
791     */
792    public Reference getDevice() { 
793      if (this.device == null)
794        if (Configuration.errorOnAutoCreate())
795          throw new Error("Attempt to auto-create Media.device");
796        else if (Configuration.doAutoCreate())
797          this.device = new Reference(); // cc
798      return this.device;
799    }
800
801    public boolean hasDevice() { 
802      return this.device != null && !this.device.isEmpty();
803    }
804
805    /**
806     * @param value {@link #device} (The device used to collect the media.)
807     */
808    public Media setDevice(Reference value)  { 
809      this.device = value;
810      return this;
811    }
812
813    /**
814     * @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 device used to collect the media.)
815     */
816    public Resource getDeviceTarget() { 
817      return this.deviceTarget;
818    }
819
820    /**
821     * @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 device used to collect the media.)
822     */
823    public Media setDeviceTarget(Resource value) { 
824      this.deviceTarget = value;
825      return this;
826    }
827
828    /**
829     * @return {@link #height} (Height of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value
830     */
831    public PositiveIntType getHeightElement() { 
832      if (this.height == null)
833        if (Configuration.errorOnAutoCreate())
834          throw new Error("Attempt to auto-create Media.height");
835        else if (Configuration.doAutoCreate())
836          this.height = new PositiveIntType(); // bb
837      return this.height;
838    }
839
840    public boolean hasHeightElement() { 
841      return this.height != null && !this.height.isEmpty();
842    }
843
844    public boolean hasHeight() { 
845      return this.height != null && !this.height.isEmpty();
846    }
847
848    /**
849     * @param value {@link #height} (Height of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value
850     */
851    public Media setHeightElement(PositiveIntType value) { 
852      this.height = value;
853      return this;
854    }
855
856    /**
857     * @return Height of the image in pixels (photo/video).
858     */
859    public int getHeight() { 
860      return this.height == null || this.height.isEmpty() ? 0 : this.height.getValue();
861    }
862
863    /**
864     * @param value Height of the image in pixels (photo/video).
865     */
866    public Media setHeight(int value) { 
867        if (this.height == null)
868          this.height = new PositiveIntType();
869        this.height.setValue(value);
870      return this;
871    }
872
873    /**
874     * @return {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value
875     */
876    public PositiveIntType getWidthElement() { 
877      if (this.width == null)
878        if (Configuration.errorOnAutoCreate())
879          throw new Error("Attempt to auto-create Media.width");
880        else if (Configuration.doAutoCreate())
881          this.width = new PositiveIntType(); // bb
882      return this.width;
883    }
884
885    public boolean hasWidthElement() { 
886      return this.width != null && !this.width.isEmpty();
887    }
888
889    public boolean hasWidth() { 
890      return this.width != null && !this.width.isEmpty();
891    }
892
893    /**
894     * @param value {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value
895     */
896    public Media setWidthElement(PositiveIntType value) { 
897      this.width = value;
898      return this;
899    }
900
901    /**
902     * @return Width of the image in pixels (photo/video).
903     */
904    public int getWidth() { 
905      return this.width == null || this.width.isEmpty() ? 0 : this.width.getValue();
906    }
907
908    /**
909     * @param value Width of the image in pixels (photo/video).
910     */
911    public Media setWidth(int value) { 
912        if (this.width == null)
913          this.width = new PositiveIntType();
914        this.width.setValue(value);
915      return this;
916    }
917
918    /**
919     * @return {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value
920     */
921    public PositiveIntType getFramesElement() { 
922      if (this.frames == null)
923        if (Configuration.errorOnAutoCreate())
924          throw new Error("Attempt to auto-create Media.frames");
925        else if (Configuration.doAutoCreate())
926          this.frames = new PositiveIntType(); // bb
927      return this.frames;
928    }
929
930    public boolean hasFramesElement() { 
931      return this.frames != null && !this.frames.isEmpty();
932    }
933
934    public boolean hasFrames() { 
935      return this.frames != null && !this.frames.isEmpty();
936    }
937
938    /**
939     * @param value {@link #frames} (The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value
940     */
941    public Media setFramesElement(PositiveIntType value) { 
942      this.frames = value;
943      return this;
944    }
945
946    /**
947     * @return The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.
948     */
949    public int getFrames() { 
950      return this.frames == null || this.frames.isEmpty() ? 0 : this.frames.getValue();
951    }
952
953    /**
954     * @param value The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.
955     */
956    public Media setFrames(int value) { 
957        if (this.frames == null)
958          this.frames = new PositiveIntType();
959        this.frames.setValue(value);
960      return this;
961    }
962
963    /**
964     * @return {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value
965     */
966    public UnsignedIntType getDurationElement() { 
967      if (this.duration == null)
968        if (Configuration.errorOnAutoCreate())
969          throw new Error("Attempt to auto-create Media.duration");
970        else if (Configuration.doAutoCreate())
971          this.duration = new UnsignedIntType(); // bb
972      return this.duration;
973    }
974
975    public boolean hasDurationElement() { 
976      return this.duration != null && !this.duration.isEmpty();
977    }
978
979    public boolean hasDuration() { 
980      return this.duration != null && !this.duration.isEmpty();
981    }
982
983    /**
984     * @param value {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value
985     */
986    public Media setDurationElement(UnsignedIntType value) { 
987      this.duration = value;
988      return this;
989    }
990
991    /**
992     * @return The duration of the recording in seconds - for audio and video.
993     */
994    public int getDuration() { 
995      return this.duration == null || this.duration.isEmpty() ? 0 : this.duration.getValue();
996    }
997
998    /**
999     * @param value The duration of the recording in seconds - for audio and video.
1000     */
1001    public Media setDuration(int value) { 
1002        if (this.duration == null)
1003          this.duration = new UnsignedIntType();
1004        this.duration.setValue(value);
1005      return this;
1006    }
1007
1008    /**
1009     * @return {@link #content} (The actual content of the media - inline or by direct reference to the media source file.)
1010     */
1011    public Attachment getContent() { 
1012      if (this.content == null)
1013        if (Configuration.errorOnAutoCreate())
1014          throw new Error("Attempt to auto-create Media.content");
1015        else if (Configuration.doAutoCreate())
1016          this.content = new Attachment(); // cc
1017      return this.content;
1018    }
1019
1020    public boolean hasContent() { 
1021      return this.content != null && !this.content.isEmpty();
1022    }
1023
1024    /**
1025     * @param value {@link #content} (The actual content of the media - inline or by direct reference to the media source file.)
1026     */
1027    public Media setContent(Attachment value)  { 
1028      this.content = value;
1029      return this;
1030    }
1031
1032    /**
1033     * @return {@link #note} (Comments made about the media by the performer, subject or other participants.)
1034     */
1035    public List<Annotation> getNote() { 
1036      if (this.note == null)
1037        this.note = new ArrayList<Annotation>();
1038      return this.note;
1039    }
1040
1041    /**
1042     * @return Returns a reference to <code>this</code> for easy method chaining
1043     */
1044    public Media setNote(List<Annotation> theNote) { 
1045      this.note = theNote;
1046      return this;
1047    }
1048
1049    public boolean hasNote() { 
1050      if (this.note == null)
1051        return false;
1052      for (Annotation item : this.note)
1053        if (!item.isEmpty())
1054          return true;
1055      return false;
1056    }
1057
1058    public Annotation addNote() { //3
1059      Annotation t = new Annotation();
1060      if (this.note == null)
1061        this.note = new ArrayList<Annotation>();
1062      this.note.add(t);
1063      return t;
1064    }
1065
1066    public Media addNote(Annotation t) { //3
1067      if (t == null)
1068        return this;
1069      if (this.note == null)
1070        this.note = new ArrayList<Annotation>();
1071      this.note.add(t);
1072      return this;
1073    }
1074
1075    /**
1076     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
1077     */
1078    public Annotation getNoteFirstRep() { 
1079      if (getNote().isEmpty()) {
1080        addNote();
1081      }
1082      return getNote().get(0);
1083    }
1084
1085      protected void listChildren(List<Property> children) {
1086        super.listChildren(children);
1087        children.add(new Property("identifier", "Identifier", "Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier));
1088        children.add(new Property("basedOn", "Reference(ProcedureRequest)", "A procedure that is fulfilled in whole or in part by the creation of this media.", 0, java.lang.Integer.MAX_VALUE, basedOn));
1089        children.add(new Property("type", "code", "Whether the media is a photo (still image), an audio recording, or a video recording.", 0, 1, type));
1090        children.add(new Property("subtype", "CodeableConcept", "Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.", 0, 1, subtype));
1091        children.add(new Property("view", "CodeableConcept", "The name of the imaging view e.g. Lateral or Antero-posterior (AP).", 0, 1, view));
1092        children.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device|Specimen)", "Who/What this Media is a record of.", 0, 1, subject));
1093        children.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "The encounter or episode of care that establishes the context for this media.", 0, 1, context));
1094        children.add(new Property("occurrence[x]", "dateTime|Period", "The date and time(s) at which the media was collected.", 0, 1, occurrence));
1095        children.add(new Property("operator", "Reference(Practitioner)", "The person who administered the collection of the image.", 0, 1, operator));
1096        children.add(new Property("reasonCode", "CodeableConcept", "Describes why the event occurred in coded or textual form.", 0, java.lang.Integer.MAX_VALUE, reasonCode));
1097        children.add(new Property("bodySite", "CodeableConcept", "Indicates the site on the subject's body where the media was collected (i.e. the target site).", 0, 1, bodySite));
1098        children.add(new Property("device", "Reference(Device|DeviceMetric)", "The device used to collect the media.", 0, 1, device));
1099        children.add(new Property("height", "positiveInt", "Height of the image in pixels (photo/video).", 0, 1, height));
1100        children.add(new Property("width", "positiveInt", "Width of the image in pixels (photo/video).", 0, 1, width));
1101        children.add(new Property("frames", "positiveInt", "The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.", 0, 1, frames));
1102        children.add(new Property("duration", "unsignedInt", "The duration of the recording in seconds - for audio and video.", 0, 1, duration));
1103        children.add(new Property("content", "Attachment", "The actual content of the media - inline or by direct reference to the media source file.", 0, 1, content));
1104        children.add(new Property("note", "Annotation", "Comments made about the media by the performer, subject or other participants.", 0, java.lang.Integer.MAX_VALUE, note));
1105      }
1106
1107      @Override
1108      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1109        switch (_hash) {
1110        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier);
1111        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(ProcedureRequest)", "A procedure that is fulfilled in whole or in part by the creation of this media.", 0, java.lang.Integer.MAX_VALUE, basedOn);
1112        case 3575610: /*type*/  return new Property("type", "code", "Whether the media is a photo (still image), an audio recording, or a video recording.", 0, 1, type);
1113        case -1867567750: /*subtype*/  return new Property("subtype", "CodeableConcept", "Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.", 0, 1, subtype);
1114        case 3619493: /*view*/  return new Property("view", "CodeableConcept", "The name of the imaging view e.g. Lateral or Antero-posterior (AP).", 0, 1, view);
1115        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Practitioner|Group|Device|Specimen)", "Who/What this Media is a record of.", 0, 1, subject);
1116        case 951530927: /*context*/  return new Property("context", "Reference(Encounter|EpisodeOfCare)", "The encounter or episode of care that establishes the context for this media.", 0, 1, context);
1117        case -2022646513: /*occurrence[x]*/  return new Property("occurrence[x]", "dateTime|Period", "The date and time(s) at which the media was collected.", 0, 1, occurrence);
1118        case 1687874001: /*occurrence*/  return new Property("occurrence[x]", "dateTime|Period", "The date and time(s) at which the media was collected.", 0, 1, occurrence);
1119        case -298443636: /*occurrenceDateTime*/  return new Property("occurrence[x]", "dateTime|Period", "The date and time(s) at which the media was collected.", 0, 1, occurrence);
1120        case 1397156594: /*occurrencePeriod*/  return new Property("occurrence[x]", "dateTime|Period", "The date and time(s) at which the media was collected.", 0, 1, occurrence);
1121        case -500553564: /*operator*/  return new Property("operator", "Reference(Practitioner)", "The person who administered the collection of the image.", 0, 1, operator);
1122        case 722137681: /*reasonCode*/  return new Property("reasonCode", "CodeableConcept", "Describes why the event occurred in coded or textual form.", 0, java.lang.Integer.MAX_VALUE, reasonCode);
1123        case 1702620169: /*bodySite*/  return new Property("bodySite", "CodeableConcept", "Indicates the site on the subject's body where the media was collected (i.e. the target site).", 0, 1, bodySite);
1124        case -1335157162: /*device*/  return new Property("device", "Reference(Device|DeviceMetric)", "The device used to collect the media.", 0, 1, device);
1125        case -1221029593: /*height*/  return new Property("height", "positiveInt", "Height of the image in pixels (photo/video).", 0, 1, height);
1126        case 113126854: /*width*/  return new Property("width", "positiveInt", "Width of the image in pixels (photo/video).", 0, 1, width);
1127        case -1266514778: /*frames*/  return new Property("frames", "positiveInt", "The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.", 0, 1, frames);
1128        case -1992012396: /*duration*/  return new Property("duration", "unsignedInt", "The duration of the recording in seconds - for audio and video.", 0, 1, duration);
1129        case 951530617: /*content*/  return new Property("content", "Attachment", "The actual content of the media - inline or by direct reference to the media source file.", 0, 1, content);
1130        case 3387378: /*note*/  return new Property("note", "Annotation", "Comments made about the media by the performer, subject or other participants.", 0, java.lang.Integer.MAX_VALUE, note);
1131        default: return super.getNamedProperty(_hash, _name, _checkValid);
1132        }
1133
1134      }
1135
1136      @Override
1137      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1138        switch (hash) {
1139        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1140        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
1141        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<DigitalMediaType>
1142        case -1867567750: /*subtype*/ return this.subtype == null ? new Base[0] : new Base[] {this.subtype}; // CodeableConcept
1143        case 3619493: /*view*/ return this.view == null ? new Base[0] : new Base[] {this.view}; // CodeableConcept
1144        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1145        case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference
1146        case 1687874001: /*occurrence*/ return this.occurrence == null ? new Base[0] : new Base[] {this.occurrence}; // Type
1147        case -500553564: /*operator*/ return this.operator == null ? new Base[0] : new Base[] {this.operator}; // Reference
1148        case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
1149        case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableConcept
1150        case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference
1151        case -1221029593: /*height*/ return this.height == null ? new Base[0] : new Base[] {this.height}; // PositiveIntType
1152        case 113126854: /*width*/ return this.width == null ? new Base[0] : new Base[] {this.width}; // PositiveIntType
1153        case -1266514778: /*frames*/ return this.frames == null ? new Base[0] : new Base[] {this.frames}; // PositiveIntType
1154        case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // UnsignedIntType
1155        case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Attachment
1156        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1157        default: return super.getProperty(hash, name, checkValid);
1158        }
1159
1160      }
1161
1162      @Override
1163      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1164        switch (hash) {
1165        case -1618432855: // identifier
1166          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1167          return value;
1168        case -332612366: // basedOn
1169          this.getBasedOn().add(castToReference(value)); // Reference
1170          return value;
1171        case 3575610: // type
1172          value = new DigitalMediaTypeEnumFactory().fromType(castToCode(value));
1173          this.type = (Enumeration) value; // Enumeration<DigitalMediaType>
1174          return value;
1175        case -1867567750: // subtype
1176          this.subtype = castToCodeableConcept(value); // CodeableConcept
1177          return value;
1178        case 3619493: // view
1179          this.view = castToCodeableConcept(value); // CodeableConcept
1180          return value;
1181        case -1867885268: // subject
1182          this.subject = castToReference(value); // Reference
1183          return value;
1184        case 951530927: // context
1185          this.context = castToReference(value); // Reference
1186          return value;
1187        case 1687874001: // occurrence
1188          this.occurrence = castToType(value); // Type
1189          return value;
1190        case -500553564: // operator
1191          this.operator = castToReference(value); // Reference
1192          return value;
1193        case 722137681: // reasonCode
1194          this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
1195          return value;
1196        case 1702620169: // bodySite
1197          this.bodySite = castToCodeableConcept(value); // CodeableConcept
1198          return value;
1199        case -1335157162: // device
1200          this.device = castToReference(value); // Reference
1201          return value;
1202        case -1221029593: // height
1203          this.height = castToPositiveInt(value); // PositiveIntType
1204          return value;
1205        case 113126854: // width
1206          this.width = castToPositiveInt(value); // PositiveIntType
1207          return value;
1208        case -1266514778: // frames
1209          this.frames = castToPositiveInt(value); // PositiveIntType
1210          return value;
1211        case -1992012396: // duration
1212          this.duration = castToUnsignedInt(value); // UnsignedIntType
1213          return value;
1214        case 951530617: // content
1215          this.content = castToAttachment(value); // Attachment
1216          return value;
1217        case 3387378: // note
1218          this.getNote().add(castToAnnotation(value)); // Annotation
1219          return value;
1220        default: return super.setProperty(hash, name, value);
1221        }
1222
1223      }
1224
1225      @Override
1226      public Base setProperty(String name, Base value) throws FHIRException {
1227        if (name.equals("identifier")) {
1228          this.getIdentifier().add(castToIdentifier(value));
1229        } else if (name.equals("basedOn")) {
1230          this.getBasedOn().add(castToReference(value));
1231        } else if (name.equals("type")) {
1232          value = new DigitalMediaTypeEnumFactory().fromType(castToCode(value));
1233          this.type = (Enumeration) value; // Enumeration<DigitalMediaType>
1234        } else if (name.equals("subtype")) {
1235          this.subtype = castToCodeableConcept(value); // CodeableConcept
1236        } else if (name.equals("view")) {
1237          this.view = castToCodeableConcept(value); // CodeableConcept
1238        } else if (name.equals("subject")) {
1239          this.subject = castToReference(value); // Reference
1240        } else if (name.equals("context")) {
1241          this.context = castToReference(value); // Reference
1242        } else if (name.equals("occurrence[x]")) {
1243          this.occurrence = castToType(value); // Type
1244        } else if (name.equals("operator")) {
1245          this.operator = castToReference(value); // Reference
1246        } else if (name.equals("reasonCode")) {
1247          this.getReasonCode().add(castToCodeableConcept(value));
1248        } else if (name.equals("bodySite")) {
1249          this.bodySite = castToCodeableConcept(value); // CodeableConcept
1250        } else if (name.equals("device")) {
1251          this.device = castToReference(value); // Reference
1252        } else if (name.equals("height")) {
1253          this.height = castToPositiveInt(value); // PositiveIntType
1254        } else if (name.equals("width")) {
1255          this.width = castToPositiveInt(value); // PositiveIntType
1256        } else if (name.equals("frames")) {
1257          this.frames = castToPositiveInt(value); // PositiveIntType
1258        } else if (name.equals("duration")) {
1259          this.duration = castToUnsignedInt(value); // UnsignedIntType
1260        } else if (name.equals("content")) {
1261          this.content = castToAttachment(value); // Attachment
1262        } else if (name.equals("note")) {
1263          this.getNote().add(castToAnnotation(value));
1264        } else
1265          return super.setProperty(name, value);
1266        return value;
1267      }
1268
1269      @Override
1270      public Base makeProperty(int hash, String name) throws FHIRException {
1271        switch (hash) {
1272        case -1618432855:  return addIdentifier(); 
1273        case -332612366:  return addBasedOn(); 
1274        case 3575610:  return getTypeElement();
1275        case -1867567750:  return getSubtype(); 
1276        case 3619493:  return getView(); 
1277        case -1867885268:  return getSubject(); 
1278        case 951530927:  return getContext(); 
1279        case -2022646513:  return getOccurrence(); 
1280        case 1687874001:  return getOccurrence(); 
1281        case -500553564:  return getOperator(); 
1282        case 722137681:  return addReasonCode(); 
1283        case 1702620169:  return getBodySite(); 
1284        case -1335157162:  return getDevice(); 
1285        case -1221029593:  return getHeightElement();
1286        case 113126854:  return getWidthElement();
1287        case -1266514778:  return getFramesElement();
1288        case -1992012396:  return getDurationElement();
1289        case 951530617:  return getContent(); 
1290        case 3387378:  return addNote(); 
1291        default: return super.makeProperty(hash, name);
1292        }
1293
1294      }
1295
1296      @Override
1297      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1298        switch (hash) {
1299        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1300        case -332612366: /*basedOn*/ return new String[] {"Reference"};
1301        case 3575610: /*type*/ return new String[] {"code"};
1302        case -1867567750: /*subtype*/ return new String[] {"CodeableConcept"};
1303        case 3619493: /*view*/ return new String[] {"CodeableConcept"};
1304        case -1867885268: /*subject*/ return new String[] {"Reference"};
1305        case 951530927: /*context*/ return new String[] {"Reference"};
1306        case 1687874001: /*occurrence*/ return new String[] {"dateTime", "Period"};
1307        case -500553564: /*operator*/ return new String[] {"Reference"};
1308        case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
1309        case 1702620169: /*bodySite*/ return new String[] {"CodeableConcept"};
1310        case -1335157162: /*device*/ return new String[] {"Reference"};
1311        case -1221029593: /*height*/ return new String[] {"positiveInt"};
1312        case 113126854: /*width*/ return new String[] {"positiveInt"};
1313        case -1266514778: /*frames*/ return new String[] {"positiveInt"};
1314        case -1992012396: /*duration*/ return new String[] {"unsignedInt"};
1315        case 951530617: /*content*/ return new String[] {"Attachment"};
1316        case 3387378: /*note*/ return new String[] {"Annotation"};
1317        default: return super.getTypesForProperty(hash, name);
1318        }
1319
1320      }
1321
1322      @Override
1323      public Base addChild(String name) throws FHIRException {
1324        if (name.equals("identifier")) {
1325          return addIdentifier();
1326        }
1327        else if (name.equals("basedOn")) {
1328          return addBasedOn();
1329        }
1330        else if (name.equals("type")) {
1331          throw new FHIRException("Cannot call addChild on a singleton property Media.type");
1332        }
1333        else if (name.equals("subtype")) {
1334          this.subtype = new CodeableConcept();
1335          return this.subtype;
1336        }
1337        else if (name.equals("view")) {
1338          this.view = new CodeableConcept();
1339          return this.view;
1340        }
1341        else if (name.equals("subject")) {
1342          this.subject = new Reference();
1343          return this.subject;
1344        }
1345        else if (name.equals("context")) {
1346          this.context = new Reference();
1347          return this.context;
1348        }
1349        else if (name.equals("occurrenceDateTime")) {
1350          this.occurrence = new DateTimeType();
1351          return this.occurrence;
1352        }
1353        else if (name.equals("occurrencePeriod")) {
1354          this.occurrence = new Period();
1355          return this.occurrence;
1356        }
1357        else if (name.equals("operator")) {
1358          this.operator = new Reference();
1359          return this.operator;
1360        }
1361        else if (name.equals("reasonCode")) {
1362          return addReasonCode();
1363        }
1364        else if (name.equals("bodySite")) {
1365          this.bodySite = new CodeableConcept();
1366          return this.bodySite;
1367        }
1368        else if (name.equals("device")) {
1369          this.device = new Reference();
1370          return this.device;
1371        }
1372        else if (name.equals("height")) {
1373          throw new FHIRException("Cannot call addChild on a singleton property Media.height");
1374        }
1375        else if (name.equals("width")) {
1376          throw new FHIRException("Cannot call addChild on a singleton property Media.width");
1377        }
1378        else if (name.equals("frames")) {
1379          throw new FHIRException("Cannot call addChild on a singleton property Media.frames");
1380        }
1381        else if (name.equals("duration")) {
1382          throw new FHIRException("Cannot call addChild on a singleton property Media.duration");
1383        }
1384        else if (name.equals("content")) {
1385          this.content = new Attachment();
1386          return this.content;
1387        }
1388        else if (name.equals("note")) {
1389          return addNote();
1390        }
1391        else
1392          return super.addChild(name);
1393      }
1394
1395  public String fhirType() {
1396    return "Media";
1397
1398  }
1399
1400      public Media copy() {
1401        Media dst = new Media();
1402        copyValues(dst);
1403        if (identifier != null) {
1404          dst.identifier = new ArrayList<Identifier>();
1405          for (Identifier i : identifier)
1406            dst.identifier.add(i.copy());
1407        };
1408        if (basedOn != null) {
1409          dst.basedOn = new ArrayList<Reference>();
1410          for (Reference i : basedOn)
1411            dst.basedOn.add(i.copy());
1412        };
1413        dst.type = type == null ? null : type.copy();
1414        dst.subtype = subtype == null ? null : subtype.copy();
1415        dst.view = view == null ? null : view.copy();
1416        dst.subject = subject == null ? null : subject.copy();
1417        dst.context = context == null ? null : context.copy();
1418        dst.occurrence = occurrence == null ? null : occurrence.copy();
1419        dst.operator = operator == null ? null : operator.copy();
1420        if (reasonCode != null) {
1421          dst.reasonCode = new ArrayList<CodeableConcept>();
1422          for (CodeableConcept i : reasonCode)
1423            dst.reasonCode.add(i.copy());
1424        };
1425        dst.bodySite = bodySite == null ? null : bodySite.copy();
1426        dst.device = device == null ? null : device.copy();
1427        dst.height = height == null ? null : height.copy();
1428        dst.width = width == null ? null : width.copy();
1429        dst.frames = frames == null ? null : frames.copy();
1430        dst.duration = duration == null ? null : duration.copy();
1431        dst.content = content == null ? null : content.copy();
1432        if (note != null) {
1433          dst.note = new ArrayList<Annotation>();
1434          for (Annotation i : note)
1435            dst.note.add(i.copy());
1436        };
1437        return dst;
1438      }
1439
1440      protected Media typedCopy() {
1441        return copy();
1442      }
1443
1444      @Override
1445      public boolean equalsDeep(Base other_) {
1446        if (!super.equalsDeep(other_))
1447          return false;
1448        if (!(other_ instanceof Media))
1449          return false;
1450        Media o = (Media) other_;
1451        return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(type, o.type, true)
1452           && compareDeep(subtype, o.subtype, true) && compareDeep(view, o.view, true) && compareDeep(subject, o.subject, true)
1453           && compareDeep(context, o.context, true) && compareDeep(occurrence, o.occurrence, true) && compareDeep(operator, o.operator, true)
1454           && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(bodySite, o.bodySite, true) && compareDeep(device, o.device, true)
1455           && compareDeep(height, o.height, true) && compareDeep(width, o.width, true) && compareDeep(frames, o.frames, true)
1456           && compareDeep(duration, o.duration, true) && compareDeep(content, o.content, true) && compareDeep(note, o.note, true)
1457          ;
1458      }
1459
1460      @Override
1461      public boolean equalsShallow(Base other_) {
1462        if (!super.equalsShallow(other_))
1463          return false;
1464        if (!(other_ instanceof Media))
1465          return false;
1466        Media o = (Media) other_;
1467        return compareValues(type, o.type, true) && compareValues(height, o.height, true) && compareValues(width, o.width, true)
1468           && compareValues(frames, o.frames, true) && compareValues(duration, o.duration, true);
1469      }
1470
1471      public boolean isEmpty() {
1472        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, type
1473          , subtype, view, subject, context, occurrence, operator, reasonCode, bodySite
1474          , device, height, width, frames, duration, content, note);
1475      }
1476
1477  @Override
1478  public ResourceType getResourceType() {
1479    return ResourceType.Media;
1480   }
1481
1482 /**
1483   * Search parameter: <b>date</b>
1484   * <p>
1485   * Description: <b>When Media was collected</b><br>
1486   * Type: <b>date</b><br>
1487   * Path: <b>Media.occurrence[x]</b><br>
1488   * </p>
1489   */
1490  @SearchParamDefinition(name="date", path="Media.occurrence", description="When Media was collected", type="date" )
1491  public static final String SP_DATE = "date";
1492 /**
1493   * <b>Fluent Client</b> search parameter constant for <b>date</b>
1494   * <p>
1495   * Description: <b>When Media was collected</b><br>
1496   * Type: <b>date</b><br>
1497   * Path: <b>Media.occurrence[x]</b><br>
1498   * </p>
1499   */
1500  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
1501
1502 /**
1503   * Search parameter: <b>identifier</b>
1504   * <p>
1505   * Description: <b>Identifier(s) for the image</b><br>
1506   * Type: <b>token</b><br>
1507   * Path: <b>Media.identifier</b><br>
1508   * </p>
1509   */
1510  @SearchParamDefinition(name="identifier", path="Media.identifier", description="Identifier(s) for the image", type="token" )
1511  public static final String SP_IDENTIFIER = "identifier";
1512 /**
1513   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1514   * <p>
1515   * Description: <b>Identifier(s) for the image</b><br>
1516   * Type: <b>token</b><br>
1517   * Path: <b>Media.identifier</b><br>
1518   * </p>
1519   */
1520  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1521
1522 /**
1523   * Search parameter: <b>created</b>
1524   * <p>
1525   * Description: <b>Date attachment was first created</b><br>
1526   * Type: <b>date</b><br>
1527   * Path: <b>Media.content.creation</b><br>
1528   * </p>
1529   */
1530  @SearchParamDefinition(name="created", path="Media.content.creation", description="Date attachment was first created", type="date" )
1531  public static final String SP_CREATED = "created";
1532 /**
1533   * <b>Fluent Client</b> search parameter constant for <b>created</b>
1534   * <p>
1535   * Description: <b>Date attachment was first created</b><br>
1536   * Type: <b>date</b><br>
1537   * Path: <b>Media.content.creation</b><br>
1538   * </p>
1539   */
1540  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED);
1541
1542 /**
1543   * Search parameter: <b>subject</b>
1544   * <p>
1545   * Description: <b>Who/What this Media is a record of</b><br>
1546   * Type: <b>reference</b><br>
1547   * Path: <b>Media.subject</b><br>
1548   * </p>
1549   */
1550  @SearchParamDefinition(name="subject", path="Media.subject", description="Who/What this Media is a record of", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Device.class, Group.class, Patient.class, Practitioner.class, Specimen.class } )
1551  public static final String SP_SUBJECT = "subject";
1552 /**
1553   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
1554   * <p>
1555   * Description: <b>Who/What this Media is a record of</b><br>
1556   * Type: <b>reference</b><br>
1557   * Path: <b>Media.subject</b><br>
1558   * </p>
1559   */
1560  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
1561
1562/**
1563   * Constant for fluent queries to be used to add include statements. Specifies
1564   * the path value of "<b>Media:subject</b>".
1565   */
1566  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Media:subject").toLocked();
1567
1568 /**
1569   * Search parameter: <b>type</b>
1570   * <p>
1571   * Description: <b>photo | video | audio</b><br>
1572   * Type: <b>token</b><br>
1573   * Path: <b>Media.type</b><br>
1574   * </p>
1575   */
1576  @SearchParamDefinition(name="type", path="Media.type", description="photo | video | audio", type="token" )
1577  public static final String SP_TYPE = "type";
1578 /**
1579   * <b>Fluent Client</b> search parameter constant for <b>type</b>
1580   * <p>
1581   * Description: <b>photo | video | audio</b><br>
1582   * Type: <b>token</b><br>
1583   * Path: <b>Media.type</b><br>
1584   * </p>
1585   */
1586  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
1587
1588 /**
1589   * Search parameter: <b>operator</b>
1590   * <p>
1591   * Description: <b>The person who generated the image</b><br>
1592   * Type: <b>reference</b><br>
1593   * Path: <b>Media.operator</b><br>
1594   * </p>
1595   */
1596  @SearchParamDefinition(name="operator", path="Media.operator", description="The person who generated the image", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Practitioner.class } )
1597  public static final String SP_OPERATOR = "operator";
1598 /**
1599   * <b>Fluent Client</b> search parameter constant for <b>operator</b>
1600   * <p>
1601   * Description: <b>The person who generated the image</b><br>
1602   * Type: <b>reference</b><br>
1603   * Path: <b>Media.operator</b><br>
1604   * </p>
1605   */
1606  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam OPERATOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_OPERATOR);
1607
1608/**
1609   * Constant for fluent queries to be used to add include statements. Specifies
1610   * the path value of "<b>Media:operator</b>".
1611   */
1612  public static final ca.uhn.fhir.model.api.Include INCLUDE_OPERATOR = new ca.uhn.fhir.model.api.Include("Media:operator").toLocked();
1613
1614 /**
1615   * Search parameter: <b>view</b>
1616   * <p>
1617   * Description: <b>Imaging view, e.g. Lateral or Antero-posterior</b><br>
1618   * Type: <b>token</b><br>
1619   * Path: <b>Media.view</b><br>
1620   * </p>
1621   */
1622  @SearchParamDefinition(name="view", path="Media.view", description="Imaging view, e.g. Lateral or Antero-posterior", type="token" )
1623  public static final String SP_VIEW = "view";
1624 /**
1625   * <b>Fluent Client</b> search parameter constant for <b>view</b>
1626   * <p>
1627   * Description: <b>Imaging view, e.g. Lateral or Antero-posterior</b><br>
1628   * Type: <b>token</b><br>
1629   * Path: <b>Media.view</b><br>
1630   * </p>
1631   */
1632  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VIEW = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VIEW);
1633
1634 /**
1635   * Search parameter: <b>site</b>
1636   * <p>
1637   * Description: <b>Body part in media</b><br>
1638   * Type: <b>token</b><br>
1639   * Path: <b>Media.bodySite</b><br>
1640   * </p>
1641   */
1642  @SearchParamDefinition(name="site", path="Media.bodySite", description="Body part in media", type="token" )
1643  public static final String SP_SITE = "site";
1644 /**
1645   * <b>Fluent Client</b> search parameter constant for <b>site</b>
1646   * <p>
1647   * Description: <b>Body part in media</b><br>
1648   * Type: <b>token</b><br>
1649   * Path: <b>Media.bodySite</b><br>
1650   * </p>
1651   */
1652  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SITE);
1653
1654 /**
1655   * Search parameter: <b>based-on</b>
1656   * <p>
1657   * Description: <b>Procedure that caused this media to be created</b><br>
1658   * Type: <b>reference</b><br>
1659   * Path: <b>Media.basedOn</b><br>
1660   * </p>
1661   */
1662  @SearchParamDefinition(name="based-on", path="Media.basedOn", description="Procedure that caused this media to be created", type="reference", target={ProcedureRequest.class } )
1663  public static final String SP_BASED_ON = "based-on";
1664 /**
1665   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
1666   * <p>
1667   * Description: <b>Procedure that caused this media to be created</b><br>
1668   * Type: <b>reference</b><br>
1669   * Path: <b>Media.basedOn</b><br>
1670   * </p>
1671   */
1672  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
1673
1674/**
1675   * Constant for fluent queries to be used to add include statements. Specifies
1676   * the path value of "<b>Media:based-on</b>".
1677   */
1678  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("Media:based-on").toLocked();
1679
1680 /**
1681   * Search parameter: <b>subtype</b>
1682   * <p>
1683   * Description: <b>The type of acquisition equipment/process</b><br>
1684   * Type: <b>token</b><br>
1685   * Path: <b>Media.subtype</b><br>
1686   * </p>
1687   */
1688  @SearchParamDefinition(name="subtype", path="Media.subtype", description="The type of acquisition equipment/process", type="token" )
1689  public static final String SP_SUBTYPE = "subtype";
1690 /**
1691   * <b>Fluent Client</b> search parameter constant for <b>subtype</b>
1692   * <p>
1693   * Description: <b>The type of acquisition equipment/process</b><br>
1694   * Type: <b>token</b><br>
1695   * Path: <b>Media.subtype</b><br>
1696   * </p>
1697   */
1698  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBTYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBTYPE);
1699
1700 /**
1701   * Search parameter: <b>patient</b>
1702   * <p>
1703   * Description: <b>Who/What this Media is a record of</b><br>
1704   * Type: <b>reference</b><br>
1705   * Path: <b>Media.subject</b><br>
1706   * </p>
1707   */
1708  @SearchParamDefinition(name="patient", path="Media.subject", description="Who/What this Media is a record of", type="reference", target={Patient.class } )
1709  public static final String SP_PATIENT = "patient";
1710 /**
1711   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1712   * <p>
1713   * Description: <b>Who/What this Media is a record of</b><br>
1714   * Type: <b>reference</b><br>
1715   * Path: <b>Media.subject</b><br>
1716   * </p>
1717   */
1718  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
1719
1720/**
1721   * Constant for fluent queries to be used to add include statements. Specifies
1722   * the path value of "<b>Media:patient</b>".
1723   */
1724  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Media:patient").toLocked();
1725
1726 /**
1727   * Search parameter: <b>context</b>
1728   * <p>
1729   * Description: <b>Encounter / Episode associated with media</b><br>
1730   * Type: <b>reference</b><br>
1731   * Path: <b>Media.context</b><br>
1732   * </p>
1733   */
1734  @SearchParamDefinition(name="context", path="Media.context", description="Encounter / Episode associated with media", type="reference", target={Encounter.class, EpisodeOfCare.class } )
1735  public static final String SP_CONTEXT = "context";
1736 /**
1737   * <b>Fluent Client</b> search parameter constant for <b>context</b>
1738   * <p>
1739   * Description: <b>Encounter / Episode associated with media</b><br>
1740   * Type: <b>reference</b><br>
1741   * Path: <b>Media.context</b><br>
1742   * </p>
1743   */
1744  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTEXT);
1745
1746/**
1747   * Constant for fluent queries to be used to add include statements. Specifies
1748   * the path value of "<b>Media:context</b>".
1749   */
1750  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTEXT = new ca.uhn.fhir.model.api.Include("Media:context").toLocked();
1751
1752 /**
1753   * Search parameter: <b>device</b>
1754   * <p>
1755   * Description: <b>Observing Device</b><br>
1756   * Type: <b>reference</b><br>
1757   * Path: <b>Media.device</b><br>
1758   * </p>
1759   */
1760  @SearchParamDefinition(name="device", path="Media.device", description="Observing Device", type="reference", target={Device.class, DeviceMetric.class } )
1761  public static final String SP_DEVICE = "device";
1762 /**
1763   * <b>Fluent Client</b> search parameter constant for <b>device</b>
1764   * <p>
1765   * Description: <b>Observing Device</b><br>
1766   * Type: <b>reference</b><br>
1767   * Path: <b>Media.device</b><br>
1768   * </p>
1769   */
1770  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE);
1771
1772/**
1773   * Constant for fluent queries to be used to add include statements. Specifies
1774   * the path value of "<b>Media:device</b>".
1775   */
1776  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("Media:device").toLocked();
1777
1778
1779}