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