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