001package org.hl7.fhir.r4.model;
002
003import java.math.BigDecimal;
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
035import java.util.ArrayList;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.exceptions.FHIRException;
040import org.hl7.fhir.utilities.Utilities;
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/**
048 * A photo, video, or audio recording acquired or used in healthcare. The actual
049 * content may be inline or provided by direct reference.
050 */
051@ResourceDef(name = "Media", profile = "http://hl7.org/fhir/StructureDefinition/Media")
052public class Media extends DomainResource {
053
054  public enum MediaStatus {
055    /**
056     * The core event has not started yet, but some staging activities have begun
057     * (e.g. surgical suite preparation). Preparation stages may be tracked for
058     * billing purposes.
059     */
060    PREPARATION,
061    /**
062     * The event is currently occurring.
063     */
064    INPROGRESS,
065    /**
066     * The event was terminated prior to any activity beyond preparation. I.e. The
067     * 'main' activity has not yet begun. The boundary between preparatory and the
068     * 'main' activity is context-specific.
069     */
070    NOTDONE,
071    /**
072     * The event has been temporarily stopped but is expected to resume in the
073     * future.
074     */
075    ONHOLD,
076    /**
077     * The event was terminated prior to the full completion of the intended
078     * activity but after at least some of the 'main' activity (beyond preparation)
079     * has occurred.
080     */
081    STOPPED,
082    /**
083     * The event has now concluded.
084     */
085    COMPLETED,
086    /**
087     * This electronic record should never have existed, though it is possible that
088     * real-world decisions were based on it. (If real-world activity has occurred,
089     * the status should be "stopped" rather than "entered-in-error".).
090     */
091    ENTEREDINERROR,
092    /**
093     * The authoring/source system does not know which of the status values
094     * currently applies for this event. Note: This concept is not to be used for
095     * "other" - one of the listed statuses is presumed to apply, but the
096     * authoring/source system does not know which.
097     */
098    UNKNOWN,
099    /**
100     * added to help the parsers with the generic types
101     */
102    NULL;
103
104    public static MediaStatus fromCode(String codeString) throws FHIRException {
105      if (codeString == null || "".equals(codeString))
106        return null;
107      if ("preparation".equals(codeString))
108        return PREPARATION;
109      if ("in-progress".equals(codeString))
110        return INPROGRESS;
111      if ("not-done".equals(codeString))
112        return NOTDONE;
113      if ("on-hold".equals(codeString))
114        return ONHOLD;
115      if ("stopped".equals(codeString))
116        return STOPPED;
117      if ("completed".equals(codeString))
118        return COMPLETED;
119      if ("entered-in-error".equals(codeString))
120        return ENTEREDINERROR;
121      if ("unknown".equals(codeString))
122        return UNKNOWN;
123      if (Configuration.isAcceptInvalidEnums())
124        return null;
125      else
126        throw new FHIRException("Unknown MediaStatus code '" + codeString + "'");
127    }
128
129    public String toCode() {
130      switch (this) {
131      case PREPARATION:
132        return "preparation";
133      case INPROGRESS:
134        return "in-progress";
135      case NOTDONE:
136        return "not-done";
137      case ONHOLD:
138        return "on-hold";
139      case STOPPED:
140        return "stopped";
141      case COMPLETED:
142        return "completed";
143      case ENTEREDINERROR:
144        return "entered-in-error";
145      case UNKNOWN:
146        return "unknown";
147      case NULL:
148        return null;
149      default:
150        return "?";
151      }
152    }
153
154    public String getSystem() {
155      switch (this) {
156      case PREPARATION:
157        return "http://hl7.org/fhir/event-status";
158      case INPROGRESS:
159        return "http://hl7.org/fhir/event-status";
160      case NOTDONE:
161        return "http://hl7.org/fhir/event-status";
162      case ONHOLD:
163        return "http://hl7.org/fhir/event-status";
164      case STOPPED:
165        return "http://hl7.org/fhir/event-status";
166      case COMPLETED:
167        return "http://hl7.org/fhir/event-status";
168      case ENTEREDINERROR:
169        return "http://hl7.org/fhir/event-status";
170      case UNKNOWN:
171        return "http://hl7.org/fhir/event-status";
172      case NULL:
173        return null;
174      default:
175        return "?";
176      }
177    }
178
179    public String getDefinition() {
180      switch (this) {
181      case PREPARATION:
182        return "The core event has not started yet, but some staging activities have begun (e.g. surgical suite preparation).  Preparation stages may be tracked for billing purposes.";
183      case INPROGRESS:
184        return "The event is currently occurring.";
185      case NOTDONE:
186        return "The event was terminated prior to any activity beyond preparation.  I.e. The 'main' activity has not yet begun.  The boundary between preparatory and the 'main' activity is context-specific.";
187      case ONHOLD:
188        return "The event has been temporarily stopped but is expected to resume in the future.";
189      case STOPPED:
190        return "The event was terminated prior to the full completion of the intended activity but after at least some of the 'main' activity (beyond preparation) has occurred.";
191      case COMPLETED:
192        return "The event has now concluded.";
193      case ENTEREDINERROR:
194        return "This electronic record should never have existed, though it is possible that real-world decisions were based on it.  (If real-world activity has occurred, the status should be \"stopped\" rather than \"entered-in-error\".).";
195      case UNKNOWN:
196        return "The authoring/source system does not know which of the status values currently applies for this event.  Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply,  but the authoring/source system does not know which.";
197      case NULL:
198        return null;
199      default:
200        return "?";
201      }
202    }
203
204    public String getDisplay() {
205      switch (this) {
206      case PREPARATION:
207        return "Preparation";
208      case INPROGRESS:
209        return "In Progress";
210      case NOTDONE:
211        return "Not Done";
212      case ONHOLD:
213        return "On Hold";
214      case STOPPED:
215        return "Stopped";
216      case COMPLETED:
217        return "Completed";
218      case ENTEREDINERROR:
219        return "Entered in Error";
220      case UNKNOWN:
221        return "Unknown";
222      case NULL:
223        return null;
224      default:
225        return "?";
226      }
227    }
228  }
229
230  public static class MediaStatusEnumFactory implements EnumFactory<MediaStatus> {
231    public MediaStatus fromCode(String codeString) throws IllegalArgumentException {
232      if (codeString == null || "".equals(codeString))
233        if (codeString == null || "".equals(codeString))
234          return null;
235      if ("preparation".equals(codeString))
236        return MediaStatus.PREPARATION;
237      if ("in-progress".equals(codeString))
238        return MediaStatus.INPROGRESS;
239      if ("not-done".equals(codeString))
240        return MediaStatus.NOTDONE;
241      if ("on-hold".equals(codeString))
242        return MediaStatus.ONHOLD;
243      if ("stopped".equals(codeString))
244        return MediaStatus.STOPPED;
245      if ("completed".equals(codeString))
246        return MediaStatus.COMPLETED;
247      if ("entered-in-error".equals(codeString))
248        return MediaStatus.ENTEREDINERROR;
249      if ("unknown".equals(codeString))
250        return MediaStatus.UNKNOWN;
251      throw new IllegalArgumentException("Unknown MediaStatus code '" + codeString + "'");
252    }
253
254    public Enumeration<MediaStatus> fromType(PrimitiveType<?> code) throws FHIRException {
255      if (code == null)
256        return null;
257      if (code.isEmpty())
258        return new Enumeration<MediaStatus>(this, MediaStatus.NULL, code);
259      String codeString = code.asStringValue();
260      if (codeString == null || "".equals(codeString))
261        return new Enumeration<MediaStatus>(this, MediaStatus.NULL, code);
262      if ("preparation".equals(codeString))
263        return new Enumeration<MediaStatus>(this, MediaStatus.PREPARATION, code);
264      if ("in-progress".equals(codeString))
265        return new Enumeration<MediaStatus>(this, MediaStatus.INPROGRESS, code);
266      if ("not-done".equals(codeString))
267        return new Enumeration<MediaStatus>(this, MediaStatus.NOTDONE, code);
268      if ("on-hold".equals(codeString))
269        return new Enumeration<MediaStatus>(this, MediaStatus.ONHOLD, code);
270      if ("stopped".equals(codeString))
271        return new Enumeration<MediaStatus>(this, MediaStatus.STOPPED, code);
272      if ("completed".equals(codeString))
273        return new Enumeration<MediaStatus>(this, MediaStatus.COMPLETED, code);
274      if ("entered-in-error".equals(codeString))
275        return new Enumeration<MediaStatus>(this, MediaStatus.ENTEREDINERROR, code);
276      if ("unknown".equals(codeString))
277        return new Enumeration<MediaStatus>(this, MediaStatus.UNKNOWN, code);
278      throw new FHIRException("Unknown MediaStatus code '" + codeString + "'");
279    }
280
281    public String toCode(MediaStatus code) {
282      if (code == MediaStatus.PREPARATION)
283        return "preparation";
284      if (code == MediaStatus.INPROGRESS)
285        return "in-progress";
286      if (code == MediaStatus.NOTDONE)
287        return "not-done";
288      if (code == MediaStatus.ONHOLD)
289        return "on-hold";
290      if (code == MediaStatus.STOPPED)
291        return "stopped";
292      if (code == MediaStatus.COMPLETED)
293        return "completed";
294      if (code == MediaStatus.ENTEREDINERROR)
295        return "entered-in-error";
296      if (code == MediaStatus.UNKNOWN)
297        return "unknown";
298      return "?";
299    }
300
301    public String toSystem(MediaStatus code) {
302      return code.getSystem();
303    }
304  }
305
306  /**
307   * Identifiers associated with the image - these may include identifiers for the
308   * image itself, identifiers for the context of its collection (e.g. series ids)
309   * and context ids such as accession numbers or other workflow identifiers.
310   */
311  @Child(name = "identifier", type = {
312      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
313  @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.")
314  protected List<Identifier> identifier;
315
316  /**
317   * A procedure that is fulfilled in whole or in part by the creation of this
318   * media.
319   */
320  @Child(name = "basedOn", type = { ServiceRequest.class,
321      CarePlan.class }, order = 1, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
322  @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.")
323  protected List<Reference> basedOn;
324  /**
325   * The actual objects that are the target of the reference (A procedure that is
326   * fulfilled in whole or in part by the creation of this media.)
327   */
328  protected List<Resource> basedOnTarget;
329
330  /**
331   * A larger event of which this particular event is a component or step.
332   */
333  @Child(name = "partOf", type = {
334      Reference.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
335  @Description(shortDefinition = "Part of referenced event", formalDefinition = "A larger event of which this particular event is a component or step.")
336  protected List<Reference> partOf;
337  /**
338   * The actual objects that are the target of the reference (A larger event of
339   * which this particular event is a component or step.)
340   */
341  protected List<Resource> partOfTarget;
342
343  /**
344   * The current state of the {{title}}.
345   */
346  @Child(name = "status", type = { CodeType.class }, order = 3, min = 1, max = 1, modifier = true, summary = true)
347  @Description(shortDefinition = "preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown", formalDefinition = "The current state of the {{title}}.")
348  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/event-status")
349  protected Enumeration<MediaStatus> status;
350
351  /**
352   * A code that classifies whether the media is an image, video or audio
353   * recording or some other media category.
354   */
355  @Child(name = "type", type = { CodeableConcept.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
356  @Description(shortDefinition = "Classification of media as image, video, or audio", formalDefinition = "A code that classifies whether the media is an image, video or audio recording or some other media category.")
357  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/media-type")
358  protected CodeableConcept type;
359
360  /**
361   * Details of the type of the media - usually, how it was acquired (what type of
362   * device). If images sourced from a DICOM system, are wrapped in a Media
363   * resource, then this is the modality.
364   */
365  @Child(name = "modality", type = {
366      CodeableConcept.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
367  @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.")
368  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/media-modality")
369  protected CodeableConcept modality;
370
371  /**
372   * The name of the imaging view e.g. Lateral or Antero-posterior (AP).
373   */
374  @Child(name = "view", type = { CodeableConcept.class }, order = 6, min = 0, max = 1, modifier = false, summary = true)
375  @Description(shortDefinition = "Imaging view, e.g. Lateral or Antero-posterior", formalDefinition = "The name of the imaging view e.g. Lateral or Antero-posterior (AP).")
376  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/media-view")
377  protected CodeableConcept view;
378
379  /**
380   * Who/What this Media is a record of.
381   */
382  @Child(name = "subject", type = { Patient.class, Practitioner.class, PractitionerRole.class, Group.class,
383      Device.class, Specimen.class, Location.class }, order = 7, min = 0, max = 1, modifier = false, summary = true)
384  @Description(shortDefinition = "Who/What this Media is a record of", formalDefinition = "Who/What this Media is a record of.")
385  protected Reference subject;
386
387  /**
388   * The actual object that is the target of the reference (Who/What this Media is
389   * a record of.)
390   */
391  protected Resource subjectTarget;
392
393  /**
394   * The encounter that establishes the context for this media.
395   */
396  @Child(name = "encounter", type = { Encounter.class }, order = 8, min = 0, max = 1, modifier = false, summary = true)
397  @Description(shortDefinition = "Encounter associated with media", formalDefinition = "The encounter that establishes the context for this media.")
398  protected Reference encounter;
399
400  /**
401   * The actual object that is the target of the reference (The encounter that
402   * establishes the context for this media.)
403   */
404  protected Encounter encounterTarget;
405
406  /**
407   * The date and time(s) at which the media was collected.
408   */
409  @Child(name = "created", type = { DateTimeType.class,
410      Period.class }, order = 9, min = 0, max = 1, modifier = false, summary = true)
411  @Description(shortDefinition = "When Media was collected", formalDefinition = "The date and time(s) at which the media was collected.")
412  protected Type created;
413
414  /**
415   * The date and time this version of the media was made available to providers,
416   * typically after having been reviewed.
417   */
418  @Child(name = "issued", type = { InstantType.class }, order = 10, min = 0, max = 1, modifier = false, summary = true)
419  @Description(shortDefinition = "Date/Time this version was made available", formalDefinition = "The date and time this version of the media was made available to providers, typically after having been reviewed.")
420  protected InstantType issued;
421
422  /**
423   * The person who administered the collection of the image.
424   */
425  @Child(name = "operator", type = { Practitioner.class, PractitionerRole.class, Organization.class, CareTeam.class,
426      Patient.class, Device.class,
427      RelatedPerson.class }, order = 11, min = 0, max = 1, modifier = false, summary = true)
428  @Description(shortDefinition = "The person who generated the image", formalDefinition = "The person who administered the collection of the image.")
429  protected Reference operator;
430
431  /**
432   * The actual object that is the target of the reference (The person who
433   * administered the collection of the image.)
434   */
435  protected Resource operatorTarget;
436
437  /**
438   * Describes why the event occurred in coded or textual form.
439   */
440  @Child(name = "reasonCode", type = {
441      CodeableConcept.class }, order = 12, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
442  @Description(shortDefinition = "Why was event performed?", formalDefinition = "Describes why the event occurred in coded or textual form.")
443  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/procedure-reason")
444  protected List<CodeableConcept> reasonCode;
445
446  /**
447   * Indicates the site on the subject's body where the observation was made (i.e.
448   * the target site).
449   */
450  @Child(name = "bodySite", type = {
451      CodeableConcept.class }, order = 13, min = 0, max = 1, modifier = false, summary = true)
452  @Description(shortDefinition = "Observed body part", formalDefinition = "Indicates the site on the subject's body where the observation was made (i.e. the target site).")
453  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/body-site")
454  protected CodeableConcept bodySite;
455
456  /**
457   * The name of the device / manufacturer of the device that was used to make the
458   * recording.
459   */
460  @Child(name = "deviceName", type = {
461      StringType.class }, order = 14, min = 0, max = 1, modifier = false, summary = true)
462  @Description(shortDefinition = "Name of the device/manufacturer", formalDefinition = "The name of the device / manufacturer of the device  that was used to make the recording.")
463  protected StringType deviceName;
464
465  /**
466   * The device used to collect the media.
467   */
468  @Child(name = "device", type = { Device.class, DeviceMetric.class,
469      Device.class }, order = 15, min = 0, max = 1, modifier = false, summary = true)
470  @Description(shortDefinition = "Observing Device", formalDefinition = "The device used to collect the media.")
471  protected Reference device;
472
473  /**
474   * The actual object that is the target of the reference (The device used to
475   * collect the media.)
476   */
477  protected Resource deviceTarget;
478
479  /**
480   * Height of the image in pixels (photo/video).
481   */
482  @Child(name = "height", type = {
483      PositiveIntType.class }, order = 16, min = 0, max = 1, modifier = false, summary = true)
484  @Description(shortDefinition = "Height of the image in pixels (photo/video)", formalDefinition = "Height of the image in pixels (photo/video).")
485  protected PositiveIntType height;
486
487  /**
488   * Width of the image in pixels (photo/video).
489   */
490  @Child(name = "width", type = {
491      PositiveIntType.class }, order = 17, min = 0, max = 1, modifier = false, summary = true)
492  @Description(shortDefinition = "Width of the image in pixels (photo/video)", formalDefinition = "Width of the image in pixels (photo/video).")
493  protected PositiveIntType width;
494
495  /**
496   * The number of frames in a photo. This is used with a multi-page fax, or an
497   * imaging acquisition context that takes multiple slices in a single image, or
498   * an animated gif. If there is more than one frame, this SHALL have a value in
499   * order to alert interface software that a multi-frame capable rendering widget
500   * is required.
501   */
502  @Child(name = "frames", type = {
503      PositiveIntType.class }, order = 18, min = 0, max = 1, modifier = false, summary = true)
504  @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.")
505  protected PositiveIntType frames;
506
507  /**
508   * The duration of the recording in seconds - for audio and video.
509   */
510  @Child(name = "duration", type = {
511      DecimalType.class }, order = 19, min = 0, max = 1, modifier = false, summary = true)
512  @Description(shortDefinition = "Length in seconds (audio / video)", formalDefinition = "The duration of the recording in seconds - for audio and video.")
513  protected DecimalType duration;
514
515  /**
516   * The actual content of the media - inline or by direct reference to the media
517   * source file.
518   */
519  @Child(name = "content", type = { Attachment.class }, order = 20, min = 1, max = 1, modifier = false, summary = true)
520  @Description(shortDefinition = "Actual Media - reference or data", formalDefinition = "The actual content of the media - inline or by direct reference to the media source file.")
521  protected Attachment content;
522
523  /**
524   * Comments made about the media by the performer, subject or other
525   * participants.
526   */
527  @Child(name = "note", type = {
528      Annotation.class }, order = 21, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
529  @Description(shortDefinition = "Comments made about the media", formalDefinition = "Comments made about the media by the performer, subject or other participants.")
530  protected List<Annotation> note;
531
532  private static final long serialVersionUID = 2069980126L;
533
534  /**
535   * Constructor
536   */
537  public Media() {
538    super();
539  }
540
541  /**
542   * Constructor
543   */
544  public Media(Enumeration<MediaStatus> status, Attachment content) {
545    super();
546    this.status = status;
547    this.content = content;
548  }
549
550  /**
551   * @return {@link #identifier} (Identifiers associated with the image - these
552   *         may include identifiers for the image itself, identifiers for the
553   *         context of its collection (e.g. series ids) and context ids such as
554   *         accession numbers or other workflow identifiers.)
555   */
556  public List<Identifier> getIdentifier() {
557    if (this.identifier == null)
558      this.identifier = new ArrayList<Identifier>();
559    return this.identifier;
560  }
561
562  /**
563   * @return Returns a reference to <code>this</code> for easy method chaining
564   */
565  public Media setIdentifier(List<Identifier> theIdentifier) {
566    this.identifier = theIdentifier;
567    return this;
568  }
569
570  public boolean hasIdentifier() {
571    if (this.identifier == null)
572      return false;
573    for (Identifier item : this.identifier)
574      if (!item.isEmpty())
575        return true;
576    return false;
577  }
578
579  public Identifier addIdentifier() { // 3
580    Identifier t = new Identifier();
581    if (this.identifier == null)
582      this.identifier = new ArrayList<Identifier>();
583    this.identifier.add(t);
584    return t;
585  }
586
587  public Media addIdentifier(Identifier t) { // 3
588    if (t == null)
589      return this;
590    if (this.identifier == null)
591      this.identifier = new ArrayList<Identifier>();
592    this.identifier.add(t);
593    return this;
594  }
595
596  /**
597   * @return The first repetition of repeating field {@link #identifier}, creating
598   *         it if it does not already exist
599   */
600  public Identifier getIdentifierFirstRep() {
601    if (getIdentifier().isEmpty()) {
602      addIdentifier();
603    }
604    return getIdentifier().get(0);
605  }
606
607  /**
608   * @return {@link #basedOn} (A procedure that is fulfilled in whole or in part
609   *         by the creation of this media.)
610   */
611  public List<Reference> getBasedOn() {
612    if (this.basedOn == null)
613      this.basedOn = new ArrayList<Reference>();
614    return this.basedOn;
615  }
616
617  /**
618   * @return Returns a reference to <code>this</code> for easy method chaining
619   */
620  public Media setBasedOn(List<Reference> theBasedOn) {
621    this.basedOn = theBasedOn;
622    return this;
623  }
624
625  public boolean hasBasedOn() {
626    if (this.basedOn == null)
627      return false;
628    for (Reference item : this.basedOn)
629      if (!item.isEmpty())
630        return true;
631    return false;
632  }
633
634  public Reference addBasedOn() { // 3
635    Reference t = new Reference();
636    if (this.basedOn == null)
637      this.basedOn = new ArrayList<Reference>();
638    this.basedOn.add(t);
639    return t;
640  }
641
642  public Media addBasedOn(Reference t) { // 3
643    if (t == null)
644      return this;
645    if (this.basedOn == null)
646      this.basedOn = new ArrayList<Reference>();
647    this.basedOn.add(t);
648    return this;
649  }
650
651  /**
652   * @return The first repetition of repeating field {@link #basedOn}, creating it
653   *         if it does not already exist
654   */
655  public Reference getBasedOnFirstRep() {
656    if (getBasedOn().isEmpty()) {
657      addBasedOn();
658    }
659    return getBasedOn().get(0);
660  }
661
662  /**
663   * @deprecated Use Reference#setResource(IBaseResource) instead
664   */
665  @Deprecated
666  public List<Resource> getBasedOnTarget() {
667    if (this.basedOnTarget == null)
668      this.basedOnTarget = new ArrayList<Resource>();
669    return this.basedOnTarget;
670  }
671
672  /**
673   * @return {@link #partOf} (A larger event of which this particular event is a
674   *         component or step.)
675   */
676  public List<Reference> getPartOf() {
677    if (this.partOf == null)
678      this.partOf = new ArrayList<Reference>();
679    return this.partOf;
680  }
681
682  /**
683   * @return Returns a reference to <code>this</code> for easy method chaining
684   */
685  public Media setPartOf(List<Reference> thePartOf) {
686    this.partOf = thePartOf;
687    return this;
688  }
689
690  public boolean hasPartOf() {
691    if (this.partOf == null)
692      return false;
693    for (Reference item : this.partOf)
694      if (!item.isEmpty())
695        return true;
696    return false;
697  }
698
699  public Reference addPartOf() { // 3
700    Reference t = new Reference();
701    if (this.partOf == null)
702      this.partOf = new ArrayList<Reference>();
703    this.partOf.add(t);
704    return t;
705  }
706
707  public Media addPartOf(Reference t) { // 3
708    if (t == null)
709      return this;
710    if (this.partOf == null)
711      this.partOf = new ArrayList<Reference>();
712    this.partOf.add(t);
713    return this;
714  }
715
716  /**
717   * @return The first repetition of repeating field {@link #partOf}, creating it
718   *         if it does not already exist
719   */
720  public Reference getPartOfFirstRep() {
721    if (getPartOf().isEmpty()) {
722      addPartOf();
723    }
724    return getPartOf().get(0);
725  }
726
727  /**
728   * @deprecated Use Reference#setResource(IBaseResource) instead
729   */
730  @Deprecated
731  public List<Resource> getPartOfTarget() {
732    if (this.partOfTarget == null)
733      this.partOfTarget = new ArrayList<Resource>();
734    return this.partOfTarget;
735  }
736
737  /**
738   * @return {@link #status} (The current state of the {{title}}.). This is the
739   *         underlying object with id, value and extensions. The accessor
740   *         "getStatus" gives direct access to the value
741   */
742  public Enumeration<MediaStatus> getStatusElement() {
743    if (this.status == null)
744      if (Configuration.errorOnAutoCreate())
745        throw new Error("Attempt to auto-create Media.status");
746      else if (Configuration.doAutoCreate())
747        this.status = new Enumeration<MediaStatus>(new MediaStatusEnumFactory()); // bb
748    return this.status;
749  }
750
751  public boolean hasStatusElement() {
752    return this.status != null && !this.status.isEmpty();
753  }
754
755  public boolean hasStatus() {
756    return this.status != null && !this.status.isEmpty();
757  }
758
759  /**
760   * @param value {@link #status} (The current state of the {{title}}.). This is
761   *              the underlying object with id, value and extensions. The
762   *              accessor "getStatus" gives direct access to the value
763   */
764  public Media setStatusElement(Enumeration<MediaStatus> value) {
765    this.status = value;
766    return this;
767  }
768
769  /**
770   * @return The current state of the {{title}}.
771   */
772  public MediaStatus getStatus() {
773    return this.status == null ? null : this.status.getValue();
774  }
775
776  /**
777   * @param value The current state of the {{title}}.
778   */
779  public Media setStatus(MediaStatus value) {
780    if (this.status == null)
781      this.status = new Enumeration<MediaStatus>(new MediaStatusEnumFactory());
782    this.status.setValue(value);
783    return this;
784  }
785
786  /**
787   * @return {@link #type} (A code that classifies whether the media is an image,
788   *         video or audio recording or some other media category.)
789   */
790  public CodeableConcept getType() {
791    if (this.type == null)
792      if (Configuration.errorOnAutoCreate())
793        throw new Error("Attempt to auto-create Media.type");
794      else if (Configuration.doAutoCreate())
795        this.type = new CodeableConcept(); // cc
796    return this.type;
797  }
798
799  public boolean hasType() {
800    return this.type != null && !this.type.isEmpty();
801  }
802
803  /**
804   * @param value {@link #type} (A code that classifies whether the media is an
805   *              image, video or audio recording or some other media category.)
806   */
807  public Media setType(CodeableConcept value) {
808    this.type = value;
809    return this;
810  }
811
812  /**
813   * @return {@link #modality} (Details of the type of the media - usually, how it
814   *         was acquired (what type of device). If images sourced from a DICOM
815   *         system, are wrapped in a Media resource, then this is the modality.)
816   */
817  public CodeableConcept getModality() {
818    if (this.modality == null)
819      if (Configuration.errorOnAutoCreate())
820        throw new Error("Attempt to auto-create Media.modality");
821      else if (Configuration.doAutoCreate())
822        this.modality = new CodeableConcept(); // cc
823    return this.modality;
824  }
825
826  public boolean hasModality() {
827    return this.modality != null && !this.modality.isEmpty();
828  }
829
830  /**
831   * @param value {@link #modality} (Details of the type of the media - usually,
832   *              how it was acquired (what type of device). If images sourced
833   *              from a DICOM system, are wrapped in a Media resource, then this
834   *              is the modality.)
835   */
836  public Media setModality(CodeableConcept value) {
837    this.modality = value;
838    return this;
839  }
840
841  /**
842   * @return {@link #view} (The name of the imaging view e.g. Lateral or
843   *         Antero-posterior (AP).)
844   */
845  public CodeableConcept getView() {
846    if (this.view == null)
847      if (Configuration.errorOnAutoCreate())
848        throw new Error("Attempt to auto-create Media.view");
849      else if (Configuration.doAutoCreate())
850        this.view = new CodeableConcept(); // cc
851    return this.view;
852  }
853
854  public boolean hasView() {
855    return this.view != null && !this.view.isEmpty();
856  }
857
858  /**
859   * @param value {@link #view} (The name of the imaging view e.g. Lateral or
860   *              Antero-posterior (AP).)
861   */
862  public Media setView(CodeableConcept value) {
863    this.view = value;
864    return this;
865  }
866
867  /**
868   * @return {@link #subject} (Who/What this Media is a record of.)
869   */
870  public Reference getSubject() {
871    if (this.subject == null)
872      if (Configuration.errorOnAutoCreate())
873        throw new Error("Attempt to auto-create Media.subject");
874      else if (Configuration.doAutoCreate())
875        this.subject = new Reference(); // cc
876    return this.subject;
877  }
878
879  public boolean hasSubject() {
880    return this.subject != null && !this.subject.isEmpty();
881  }
882
883  /**
884   * @param value {@link #subject} (Who/What this Media is a record of.)
885   */
886  public Media setSubject(Reference value) {
887    this.subject = value;
888    return this;
889  }
890
891  /**
892   * @return {@link #subject} The actual object that is the target of the
893   *         reference. The reference library doesn't populate this, but you can
894   *         use it to hold the resource if you resolve it. (Who/What this Media
895   *         is a record of.)
896   */
897  public Resource getSubjectTarget() {
898    return this.subjectTarget;
899  }
900
901  /**
902   * @param value {@link #subject} The actual object that is the target of the
903   *              reference. The reference library doesn't use these, but you can
904   *              use it to hold the resource if you resolve it. (Who/What this
905   *              Media is a record of.)
906   */
907  public Media setSubjectTarget(Resource value) {
908    this.subjectTarget = value;
909    return this;
910  }
911
912  /**
913   * @return {@link #encounter} (The encounter that establishes the context for
914   *         this media.)
915   */
916  public Reference getEncounter() {
917    if (this.encounter == null)
918      if (Configuration.errorOnAutoCreate())
919        throw new Error("Attempt to auto-create Media.encounter");
920      else if (Configuration.doAutoCreate())
921        this.encounter = new Reference(); // cc
922    return this.encounter;
923  }
924
925  public boolean hasEncounter() {
926    return this.encounter != null && !this.encounter.isEmpty();
927  }
928
929  /**
930   * @param value {@link #encounter} (The encounter that establishes the context
931   *              for this media.)
932   */
933  public Media setEncounter(Reference value) {
934    this.encounter = value;
935    return this;
936  }
937
938  /**
939   * @return {@link #encounter} The actual object that is the target of the
940   *         reference. The reference library doesn't populate this, but you can
941   *         use it to hold the resource if you resolve it. (The encounter that
942   *         establishes the context for this media.)
943   */
944  public Encounter getEncounterTarget() {
945    if (this.encounterTarget == null)
946      if (Configuration.errorOnAutoCreate())
947        throw new Error("Attempt to auto-create Media.encounter");
948      else if (Configuration.doAutoCreate())
949        this.encounterTarget = new Encounter(); // aa
950    return this.encounterTarget;
951  }
952
953  /**
954   * @param value {@link #encounter} The actual object that is the target of the
955   *              reference. The reference library doesn't use these, but you can
956   *              use it to hold the resource if you resolve it. (The encounter
957   *              that establishes the context for this media.)
958   */
959  public Media setEncounterTarget(Encounter value) {
960    this.encounterTarget = value;
961    return this;
962  }
963
964  /**
965   * @return {@link #created} (The date and time(s) at which the media was
966   *         collected.)
967   */
968  public Type getCreated() {
969    return this.created;
970  }
971
972  /**
973   * @return {@link #created} (The date and time(s) at which the media was
974   *         collected.)
975   */
976  public DateTimeType getCreatedDateTimeType() throws FHIRException {
977    if (this.created == null)
978      this.created = new DateTimeType();
979    if (!(this.created instanceof DateTimeType))
980      throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "
981          + this.created.getClass().getName() + " was encountered");
982    return (DateTimeType) this.created;
983  }
984
985  public boolean hasCreatedDateTimeType() {
986    return this != null && this.created instanceof DateTimeType;
987  }
988
989  /**
990   * @return {@link #created} (The date and time(s) at which the media was
991   *         collected.)
992   */
993  public Period getCreatedPeriod() throws FHIRException {
994    if (this.created == null)
995      this.created = new Period();
996    if (!(this.created instanceof Period))
997      throw new FHIRException(
998          "Type mismatch: the type Period was expected, but " + this.created.getClass().getName() + " was encountered");
999    return (Period) this.created;
1000  }
1001
1002  public boolean hasCreatedPeriod() {
1003    return this != null && this.created instanceof Period;
1004  }
1005
1006  public boolean hasCreated() {
1007    return this.created != null && !this.created.isEmpty();
1008  }
1009
1010  /**
1011   * @param value {@link #created} (The date and time(s) at which the media was
1012   *              collected.)
1013   */
1014  public Media setCreated(Type value) {
1015    if (value != null && !(value instanceof DateTimeType || value instanceof Period))
1016      throw new Error("Not the right type for Media.created[x]: " + value.fhirType());
1017    this.created = value;
1018    return this;
1019  }
1020
1021  /**
1022   * @return {@link #issued} (The date and time this version of the media was made
1023   *         available to providers, typically after having been reviewed.). This
1024   *         is the underlying object with id, value and extensions. The accessor
1025   *         "getIssued" gives direct access to the value
1026   */
1027  public InstantType getIssuedElement() {
1028    if (this.issued == null)
1029      if (Configuration.errorOnAutoCreate())
1030        throw new Error("Attempt to auto-create Media.issued");
1031      else if (Configuration.doAutoCreate())
1032        this.issued = new InstantType(); // bb
1033    return this.issued;
1034  }
1035
1036  public boolean hasIssuedElement() {
1037    return this.issued != null && !this.issued.isEmpty();
1038  }
1039
1040  public boolean hasIssued() {
1041    return this.issued != null && !this.issued.isEmpty();
1042  }
1043
1044  /**
1045   * @param value {@link #issued} (The date and time this version of the media was
1046   *              made available to providers, typically after having been
1047   *              reviewed.). This is the underlying object with id, value and
1048   *              extensions. The accessor "getIssued" gives direct access to the
1049   *              value
1050   */
1051  public Media setIssuedElement(InstantType value) {
1052    this.issued = value;
1053    return this;
1054  }
1055
1056  /**
1057   * @return The date and time this version of the media was made available to
1058   *         providers, typically after having been reviewed.
1059   */
1060  public Date getIssued() {
1061    return this.issued == null ? null : this.issued.getValue();
1062  }
1063
1064  /**
1065   * @param value The date and time this version of the media was made available
1066   *              to providers, typically after having been reviewed.
1067   */
1068  public Media setIssued(Date value) {
1069    if (value == null)
1070      this.issued = null;
1071    else {
1072      if (this.issued == null)
1073        this.issued = new InstantType();
1074      this.issued.setValue(value);
1075    }
1076    return this;
1077  }
1078
1079  /**
1080   * @return {@link #operator} (The person who administered the collection of the
1081   *         image.)
1082   */
1083  public Reference getOperator() {
1084    if (this.operator == null)
1085      if (Configuration.errorOnAutoCreate())
1086        throw new Error("Attempt to auto-create Media.operator");
1087      else if (Configuration.doAutoCreate())
1088        this.operator = new Reference(); // cc
1089    return this.operator;
1090  }
1091
1092  public boolean hasOperator() {
1093    return this.operator != null && !this.operator.isEmpty();
1094  }
1095
1096  /**
1097   * @param value {@link #operator} (The person who administered the collection of
1098   *              the image.)
1099   */
1100  public Media setOperator(Reference value) {
1101    this.operator = value;
1102    return this;
1103  }
1104
1105  /**
1106   * @return {@link #operator} The actual object that is the target of the
1107   *         reference. The reference library doesn't populate this, but you can
1108   *         use it to hold the resource if you resolve it. (The person who
1109   *         administered the collection of the image.)
1110   */
1111  public Resource getOperatorTarget() {
1112    return this.operatorTarget;
1113  }
1114
1115  /**
1116   * @param value {@link #operator} The actual object that is the target of the
1117   *              reference. The reference library doesn't use these, but you can
1118   *              use it to hold the resource if you resolve it. (The person who
1119   *              administered the collection of the image.)
1120   */
1121  public Media setOperatorTarget(Resource value) {
1122    this.operatorTarget = value;
1123    return this;
1124  }
1125
1126  /**
1127   * @return {@link #reasonCode} (Describes why the event occurred in coded or
1128   *         textual form.)
1129   */
1130  public List<CodeableConcept> getReasonCode() {
1131    if (this.reasonCode == null)
1132      this.reasonCode = new ArrayList<CodeableConcept>();
1133    return this.reasonCode;
1134  }
1135
1136  /**
1137   * @return Returns a reference to <code>this</code> for easy method chaining
1138   */
1139  public Media setReasonCode(List<CodeableConcept> theReasonCode) {
1140    this.reasonCode = theReasonCode;
1141    return this;
1142  }
1143
1144  public boolean hasReasonCode() {
1145    if (this.reasonCode == null)
1146      return false;
1147    for (CodeableConcept item : this.reasonCode)
1148      if (!item.isEmpty())
1149        return true;
1150    return false;
1151  }
1152
1153  public CodeableConcept addReasonCode() { // 3
1154    CodeableConcept t = new CodeableConcept();
1155    if (this.reasonCode == null)
1156      this.reasonCode = new ArrayList<CodeableConcept>();
1157    this.reasonCode.add(t);
1158    return t;
1159  }
1160
1161  public Media addReasonCode(CodeableConcept t) { // 3
1162    if (t == null)
1163      return this;
1164    if (this.reasonCode == null)
1165      this.reasonCode = new ArrayList<CodeableConcept>();
1166    this.reasonCode.add(t);
1167    return this;
1168  }
1169
1170  /**
1171   * @return The first repetition of repeating field {@link #reasonCode}, creating
1172   *         it if it does not already exist
1173   */
1174  public CodeableConcept getReasonCodeFirstRep() {
1175    if (getReasonCode().isEmpty()) {
1176      addReasonCode();
1177    }
1178    return getReasonCode().get(0);
1179  }
1180
1181  /**
1182   * @return {@link #bodySite} (Indicates the site on the subject's body where the
1183   *         observation was made (i.e. the target site).)
1184   */
1185  public CodeableConcept getBodySite() {
1186    if (this.bodySite == null)
1187      if (Configuration.errorOnAutoCreate())
1188        throw new Error("Attempt to auto-create Media.bodySite");
1189      else if (Configuration.doAutoCreate())
1190        this.bodySite = new CodeableConcept(); // cc
1191    return this.bodySite;
1192  }
1193
1194  public boolean hasBodySite() {
1195    return this.bodySite != null && !this.bodySite.isEmpty();
1196  }
1197
1198  /**
1199   * @param value {@link #bodySite} (Indicates the site on the subject's body
1200   *              where the observation was made (i.e. the target site).)
1201   */
1202  public Media setBodySite(CodeableConcept value) {
1203    this.bodySite = value;
1204    return this;
1205  }
1206
1207  /**
1208   * @return {@link #deviceName} (The name of the device / manufacturer of the
1209   *         device that was used to make the recording.). This is the underlying
1210   *         object with id, value and extensions. The accessor "getDeviceName"
1211   *         gives direct access to the value
1212   */
1213  public StringType getDeviceNameElement() {
1214    if (this.deviceName == null)
1215      if (Configuration.errorOnAutoCreate())
1216        throw new Error("Attempt to auto-create Media.deviceName");
1217      else if (Configuration.doAutoCreate())
1218        this.deviceName = new StringType(); // bb
1219    return this.deviceName;
1220  }
1221
1222  public boolean hasDeviceNameElement() {
1223    return this.deviceName != null && !this.deviceName.isEmpty();
1224  }
1225
1226  public boolean hasDeviceName() {
1227    return this.deviceName != null && !this.deviceName.isEmpty();
1228  }
1229
1230  /**
1231   * @param value {@link #deviceName} (The name of the device / manufacturer of
1232   *              the device that was used to make the recording.). This is the
1233   *              underlying object with id, value and extensions. The accessor
1234   *              "getDeviceName" gives direct access to the value
1235   */
1236  public Media setDeviceNameElement(StringType value) {
1237    this.deviceName = value;
1238    return this;
1239  }
1240
1241  /**
1242   * @return The name of the device / manufacturer of the device that was used to
1243   *         make the recording.
1244   */
1245  public String getDeviceName() {
1246    return this.deviceName == null ? null : this.deviceName.getValue();
1247  }
1248
1249  /**
1250   * @param value The name of the device / manufacturer of the device that was
1251   *              used to make the recording.
1252   */
1253  public Media setDeviceName(String value) {
1254    if (Utilities.noString(value))
1255      this.deviceName = null;
1256    else {
1257      if (this.deviceName == null)
1258        this.deviceName = new StringType();
1259      this.deviceName.setValue(value);
1260    }
1261    return this;
1262  }
1263
1264  /**
1265   * @return {@link #device} (The device used to collect the media.)
1266   */
1267  public Reference getDevice() {
1268    if (this.device == null)
1269      if (Configuration.errorOnAutoCreate())
1270        throw new Error("Attempt to auto-create Media.device");
1271      else if (Configuration.doAutoCreate())
1272        this.device = new Reference(); // cc
1273    return this.device;
1274  }
1275
1276  public boolean hasDevice() {
1277    return this.device != null && !this.device.isEmpty();
1278  }
1279
1280  /**
1281   * @param value {@link #device} (The device used to collect the media.)
1282   */
1283  public Media setDevice(Reference value) {
1284    this.device = value;
1285    return this;
1286  }
1287
1288  /**
1289   * @return {@link #device} The actual object that is the target of the
1290   *         reference. The reference library doesn't populate this, but you can
1291   *         use it to hold the resource if you resolve it. (The device used to
1292   *         collect the media.)
1293   */
1294  public Resource getDeviceTarget() {
1295    return this.deviceTarget;
1296  }
1297
1298  /**
1299   * @param value {@link #device} The actual object that is the target of the
1300   *              reference. The reference library doesn't use these, but you can
1301   *              use it to hold the resource if you resolve it. (The device used
1302   *              to collect the media.)
1303   */
1304  public Media setDeviceTarget(Resource value) {
1305    this.deviceTarget = value;
1306    return this;
1307  }
1308
1309  /**
1310   * @return {@link #height} (Height of the image in pixels (photo/video).). This
1311   *         is the underlying object with id, value and extensions. The accessor
1312   *         "getHeight" gives direct access to the value
1313   */
1314  public PositiveIntType getHeightElement() {
1315    if (this.height == null)
1316      if (Configuration.errorOnAutoCreate())
1317        throw new Error("Attempt to auto-create Media.height");
1318      else if (Configuration.doAutoCreate())
1319        this.height = new PositiveIntType(); // bb
1320    return this.height;
1321  }
1322
1323  public boolean hasHeightElement() {
1324    return this.height != null && !this.height.isEmpty();
1325  }
1326
1327  public boolean hasHeight() {
1328    return this.height != null && !this.height.isEmpty();
1329  }
1330
1331  /**
1332   * @param value {@link #height} (Height of the image in pixels (photo/video).).
1333   *              This is the underlying object with id, value and extensions. The
1334   *              accessor "getHeight" gives direct access to the value
1335   */
1336  public Media setHeightElement(PositiveIntType value) {
1337    this.height = value;
1338    return this;
1339  }
1340
1341  /**
1342   * @return Height of the image in pixels (photo/video).
1343   */
1344  public int getHeight() {
1345    return this.height == null || this.height.isEmpty() ? 0 : this.height.getValue();
1346  }
1347
1348  /**
1349   * @param value Height of the image in pixels (photo/video).
1350   */
1351  public Media setHeight(int value) {
1352    if (this.height == null)
1353      this.height = new PositiveIntType();
1354    this.height.setValue(value);
1355    return this;
1356  }
1357
1358  /**
1359   * @return {@link #width} (Width of the image in pixels (photo/video).). This is
1360   *         the underlying object with id, value and extensions. The accessor
1361   *         "getWidth" gives direct access to the value
1362   */
1363  public PositiveIntType getWidthElement() {
1364    if (this.width == null)
1365      if (Configuration.errorOnAutoCreate())
1366        throw new Error("Attempt to auto-create Media.width");
1367      else if (Configuration.doAutoCreate())
1368        this.width = new PositiveIntType(); // bb
1369    return this.width;
1370  }
1371
1372  public boolean hasWidthElement() {
1373    return this.width != null && !this.width.isEmpty();
1374  }
1375
1376  public boolean hasWidth() {
1377    return this.width != null && !this.width.isEmpty();
1378  }
1379
1380  /**
1381   * @param value {@link #width} (Width of the image in pixels (photo/video).).
1382   *              This is the underlying object with id, value and extensions. The
1383   *              accessor "getWidth" gives direct access to the value
1384   */
1385  public Media setWidthElement(PositiveIntType value) {
1386    this.width = value;
1387    return this;
1388  }
1389
1390  /**
1391   * @return Width of the image in pixels (photo/video).
1392   */
1393  public int getWidth() {
1394    return this.width == null || this.width.isEmpty() ? 0 : this.width.getValue();
1395  }
1396
1397  /**
1398   * @param value Width of the image in pixels (photo/video).
1399   */
1400  public Media setWidth(int value) {
1401    if (this.width == null)
1402      this.width = new PositiveIntType();
1403    this.width.setValue(value);
1404    return this;
1405  }
1406
1407  /**
1408   * @return {@link #frames} (The number of frames in a photo. This is used with a
1409   *         multi-page fax, or an imaging acquisition context that takes multiple
1410   *         slices in a single image, or an animated gif. If there is more than
1411   *         one frame, this SHALL have a value in order to alert interface
1412   *         software that a multi-frame capable rendering widget is required.).
1413   *         This is the underlying object with id, value and extensions. The
1414   *         accessor "getFrames" gives direct access to the value
1415   */
1416  public PositiveIntType getFramesElement() {
1417    if (this.frames == null)
1418      if (Configuration.errorOnAutoCreate())
1419        throw new Error("Attempt to auto-create Media.frames");
1420      else if (Configuration.doAutoCreate())
1421        this.frames = new PositiveIntType(); // bb
1422    return this.frames;
1423  }
1424
1425  public boolean hasFramesElement() {
1426    return this.frames != null && !this.frames.isEmpty();
1427  }
1428
1429  public boolean hasFrames() {
1430    return this.frames != null && !this.frames.isEmpty();
1431  }
1432
1433  /**
1434   * @param value {@link #frames} (The number of frames in a photo. This is used
1435   *              with a multi-page fax, or an imaging acquisition context that
1436   *              takes multiple slices in a single image, or an animated gif. If
1437   *              there is more than one frame, this SHALL have a value in order
1438   *              to alert interface software that a multi-frame capable rendering
1439   *              widget is required.). This is the underlying object with id,
1440   *              value and extensions. The accessor "getFrames" gives direct
1441   *              access to the value
1442   */
1443  public Media setFramesElement(PositiveIntType value) {
1444    this.frames = value;
1445    return this;
1446  }
1447
1448  /**
1449   * @return The number of frames in a photo. This is used with a multi-page fax,
1450   *         or an imaging acquisition context that takes multiple slices in a
1451   *         single image, or an animated gif. If there is more than one frame,
1452   *         this SHALL have a value in order to alert interface software that a
1453   *         multi-frame capable rendering widget is required.
1454   */
1455  public int getFrames() {
1456    return this.frames == null || this.frames.isEmpty() ? 0 : this.frames.getValue();
1457  }
1458
1459  /**
1460   * @param value The number of frames in a photo. This is used with a multi-page
1461   *              fax, or an imaging acquisition context that takes multiple
1462   *              slices in a single image, or an animated gif. If there is more
1463   *              than one frame, this SHALL have a value in order to alert
1464   *              interface software that a multi-frame capable rendering widget
1465   *              is required.
1466   */
1467  public Media setFrames(int value) {
1468    if (this.frames == null)
1469      this.frames = new PositiveIntType();
1470    this.frames.setValue(value);
1471    return this;
1472  }
1473
1474  /**
1475   * @return {@link #duration} (The duration of the recording in seconds - for
1476   *         audio and video.). This is the underlying object with id, value and
1477   *         extensions. The accessor "getDuration" gives direct access to the
1478   *         value
1479   */
1480  public DecimalType getDurationElement() {
1481    if (this.duration == null)
1482      if (Configuration.errorOnAutoCreate())
1483        throw new Error("Attempt to auto-create Media.duration");
1484      else if (Configuration.doAutoCreate())
1485        this.duration = new DecimalType(); // bb
1486    return this.duration;
1487  }
1488
1489  public boolean hasDurationElement() {
1490    return this.duration != null && !this.duration.isEmpty();
1491  }
1492
1493  public boolean hasDuration() {
1494    return this.duration != null && !this.duration.isEmpty();
1495  }
1496
1497  /**
1498   * @param value {@link #duration} (The duration of the recording in seconds -
1499   *              for audio and video.). This is the underlying object with id,
1500   *              value and extensions. The accessor "getDuration" gives direct
1501   *              access to the value
1502   */
1503  public Media setDurationElement(DecimalType value) {
1504    this.duration = value;
1505    return this;
1506  }
1507
1508  /**
1509   * @return The duration of the recording in seconds - for audio and video.
1510   */
1511  public BigDecimal getDuration() {
1512    return this.duration == null ? null : this.duration.getValue();
1513  }
1514
1515  /**
1516   * @param value The duration of the recording in seconds - for audio and video.
1517   */
1518  public Media setDuration(BigDecimal value) {
1519    if (value == null)
1520      this.duration = null;
1521    else {
1522      if (this.duration == null)
1523        this.duration = new DecimalType();
1524      this.duration.setValue(value);
1525    }
1526    return this;
1527  }
1528
1529  /**
1530   * @param value The duration of the recording in seconds - for audio and video.
1531   */
1532  public Media setDuration(long value) {
1533    this.duration = new DecimalType();
1534    this.duration.setValue(value);
1535    return this;
1536  }
1537
1538  /**
1539   * @param value The duration of the recording in seconds - for audio and video.
1540   */
1541  public Media setDuration(double value) {
1542    this.duration = new DecimalType();
1543    this.duration.setValue(value);
1544    return this;
1545  }
1546
1547  /**
1548   * @return {@link #content} (The actual content of the media - inline or by
1549   *         direct reference to the media source file.)
1550   */
1551  public Attachment getContent() {
1552    if (this.content == null)
1553      if (Configuration.errorOnAutoCreate())
1554        throw new Error("Attempt to auto-create Media.content");
1555      else if (Configuration.doAutoCreate())
1556        this.content = new Attachment(); // cc
1557    return this.content;
1558  }
1559
1560  public boolean hasContent() {
1561    return this.content != null && !this.content.isEmpty();
1562  }
1563
1564  /**
1565   * @param value {@link #content} (The actual content of the media - inline or by
1566   *              direct reference to the media source file.)
1567   */
1568  public Media setContent(Attachment value) {
1569    this.content = value;
1570    return this;
1571  }
1572
1573  /**
1574   * @return {@link #note} (Comments made about the media by the performer,
1575   *         subject or other participants.)
1576   */
1577  public List<Annotation> getNote() {
1578    if (this.note == null)
1579      this.note = new ArrayList<Annotation>();
1580    return this.note;
1581  }
1582
1583  /**
1584   * @return Returns a reference to <code>this</code> for easy method chaining
1585   */
1586  public Media setNote(List<Annotation> theNote) {
1587    this.note = theNote;
1588    return this;
1589  }
1590
1591  public boolean hasNote() {
1592    if (this.note == null)
1593      return false;
1594    for (Annotation item : this.note)
1595      if (!item.isEmpty())
1596        return true;
1597    return false;
1598  }
1599
1600  public Annotation addNote() { // 3
1601    Annotation t = new Annotation();
1602    if (this.note == null)
1603      this.note = new ArrayList<Annotation>();
1604    this.note.add(t);
1605    return t;
1606  }
1607
1608  public Media addNote(Annotation t) { // 3
1609    if (t == null)
1610      return this;
1611    if (this.note == null)
1612      this.note = new ArrayList<Annotation>();
1613    this.note.add(t);
1614    return this;
1615  }
1616
1617  /**
1618   * @return The first repetition of repeating field {@link #note}, creating it if
1619   *         it does not already exist
1620   */
1621  public Annotation getNoteFirstRep() {
1622    if (getNote().isEmpty()) {
1623      addNote();
1624    }
1625    return getNote().get(0);
1626  }
1627
1628  protected void listChildren(List<Property> children) {
1629    super.listChildren(children);
1630    children.add(new Property("identifier", "Identifier",
1631        "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.",
1632        0, java.lang.Integer.MAX_VALUE, identifier));
1633    children.add(new Property("basedOn", "Reference(ServiceRequest|CarePlan)",
1634        "A procedure that is fulfilled in whole or in part by the creation of this media.", 0,
1635        java.lang.Integer.MAX_VALUE, basedOn));
1636    children.add(new Property("partOf", "Reference(Any)",
1637        "A larger event of which this particular event is a component or step.", 0, java.lang.Integer.MAX_VALUE,
1638        partOf));
1639    children.add(new Property("status", "code", "The current state of the {{title}}.", 0, 1, status));
1640    children.add(new Property("type", "CodeableConcept",
1641        "A code that classifies whether the media is an image, video or audio recording or some other media category.",
1642        0, 1, type));
1643    children.add(new Property("modality", "CodeableConcept",
1644        "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.",
1645        0, 1, modality));
1646    children.add(new Property("view", "CodeableConcept",
1647        "The name of the imaging view e.g. Lateral or Antero-posterior (AP).", 0, 1, view));
1648    children
1649        .add(new Property("subject", "Reference(Patient|Practitioner|PractitionerRole|Group|Device|Specimen|Location)",
1650            "Who/What this Media is a record of.", 0, 1, subject));
1651    children.add(new Property("encounter", "Reference(Encounter)",
1652        "The encounter that establishes the context for this media.", 0, 1, encounter));
1653    children.add(new Property("created[x]", "dateTime|Period", "The date and time(s) at which the media was collected.",
1654        0, 1, created));
1655    children.add(new Property("issued", "instant",
1656        "The date and time this version of the media was made available to providers, typically after having been reviewed.",
1657        0, 1, issued));
1658    children.add(new Property("operator",
1659        "Reference(Practitioner|PractitionerRole|Organization|CareTeam|Patient|Device|RelatedPerson)",
1660        "The person who administered the collection of the image.", 0, 1, operator));
1661    children.add(new Property("reasonCode", "CodeableConcept",
1662        "Describes why the event occurred in coded or textual form.", 0, java.lang.Integer.MAX_VALUE, reasonCode));
1663    children.add(new Property("bodySite", "CodeableConcept",
1664        "Indicates the site on the subject's body where the observation was made (i.e. the target site).", 0, 1,
1665        bodySite));
1666    children.add(new Property("deviceName", "string",
1667        "The name of the device / manufacturer of the device  that was used to make the recording.", 0, 1, deviceName));
1668    children.add(new Property("device", "Reference(Device|DeviceMetric|Device)",
1669        "The device used to collect the media.", 0, 1, device));
1670    children.add(new Property("height", "positiveInt", "Height of the image in pixels (photo/video).", 0, 1, height));
1671    children.add(new Property("width", "positiveInt", "Width of the image in pixels (photo/video).", 0, 1, width));
1672    children.add(new Property("frames", "positiveInt",
1673        "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.",
1674        0, 1, frames));
1675    children.add(new Property("duration", "decimal", "The duration of the recording in seconds - for audio and video.",
1676        0, 1, duration));
1677    children.add(new Property("content", "Attachment",
1678        "The actual content of the media - inline or by direct reference to the media source file.", 0, 1, content));
1679    children.add(new Property("note", "Annotation",
1680        "Comments made about the media by the performer, subject or other participants.", 0,
1681        java.lang.Integer.MAX_VALUE, note));
1682  }
1683
1684  @Override
1685  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1686    switch (_hash) {
1687    case -1618432855:
1688      /* identifier */ return new Property("identifier", "Identifier",
1689          "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.",
1690          0, java.lang.Integer.MAX_VALUE, identifier);
1691    case -332612366:
1692      /* basedOn */ return new Property("basedOn", "Reference(ServiceRequest|CarePlan)",
1693          "A procedure that is fulfilled in whole or in part by the creation of this media.", 0,
1694          java.lang.Integer.MAX_VALUE, basedOn);
1695    case -995410646:
1696      /* partOf */ return new Property("partOf", "Reference(Any)",
1697          "A larger event of which this particular event is a component or step.", 0, java.lang.Integer.MAX_VALUE,
1698          partOf);
1699    case -892481550:
1700      /* status */ return new Property("status", "code", "The current state of the {{title}}.", 0, 1, status);
1701    case 3575610:
1702      /* type */ return new Property("type", "CodeableConcept",
1703          "A code that classifies whether the media is an image, video or audio recording or some other media category.",
1704          0, 1, type);
1705    case -622722335:
1706      /* modality */ return new Property("modality", "CodeableConcept",
1707          "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.",
1708          0, 1, modality);
1709    case 3619493:
1710      /* view */ return new Property("view", "CodeableConcept",
1711          "The name of the imaging view e.g. Lateral or Antero-posterior (AP).", 0, 1, view);
1712    case -1867885268:
1713      /* subject */ return new Property("subject",
1714          "Reference(Patient|Practitioner|PractitionerRole|Group|Device|Specimen|Location)",
1715          "Who/What this Media is a record of.", 0, 1, subject);
1716    case 1524132147:
1717      /* encounter */ return new Property("encounter", "Reference(Encounter)",
1718          "The encounter that establishes the context for this media.", 0, 1, encounter);
1719    case 1369676952:
1720      /* created[x] */ return new Property("created[x]", "dateTime|Period",
1721          "The date and time(s) at which the media was collected.", 0, 1, created);
1722    case 1028554472:
1723      /* created */ return new Property("created[x]", "dateTime|Period",
1724          "The date and time(s) at which the media was collected.", 0, 1, created);
1725    case -1968526685:
1726      /* createdDateTime */ return new Property("created[x]", "dateTime|Period",
1727          "The date and time(s) at which the media was collected.", 0, 1, created);
1728    case 1525027529:
1729      /* createdPeriod */ return new Property("created[x]", "dateTime|Period",
1730          "The date and time(s) at which the media was collected.", 0, 1, created);
1731    case -1179159893:
1732      /* issued */ return new Property("issued", "instant",
1733          "The date and time this version of the media was made available to providers, typically after having been reviewed.",
1734          0, 1, issued);
1735    case -500553564:
1736      /* operator */ return new Property("operator",
1737          "Reference(Practitioner|PractitionerRole|Organization|CareTeam|Patient|Device|RelatedPerson)",
1738          "The person who administered the collection of the image.", 0, 1, operator);
1739    case 722137681:
1740      /* reasonCode */ return new Property("reasonCode", "CodeableConcept",
1741          "Describes why the event occurred in coded or textual form.", 0, java.lang.Integer.MAX_VALUE, reasonCode);
1742    case 1702620169:
1743      /* bodySite */ return new Property("bodySite", "CodeableConcept",
1744          "Indicates the site on the subject's body where the observation was made (i.e. the target site).", 0, 1,
1745          bodySite);
1746    case 780988929:
1747      /* deviceName */ return new Property("deviceName", "string",
1748          "The name of the device / manufacturer of the device  that was used to make the recording.", 0, 1,
1749          deviceName);
1750    case -1335157162:
1751      /* device */ return new Property("device", "Reference(Device|DeviceMetric|Device)",
1752          "The device used to collect the media.", 0, 1, device);
1753    case -1221029593:
1754      /* height */ return new Property("height", "positiveInt", "Height of the image in pixels (photo/video).", 0, 1,
1755          height);
1756    case 113126854:
1757      /* width */ return new Property("width", "positiveInt", "Width of the image in pixels (photo/video).", 0, 1,
1758          width);
1759    case -1266514778:
1760      /* frames */ return new Property("frames", "positiveInt",
1761          "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.",
1762          0, 1, frames);
1763    case -1992012396:
1764      /* duration */ return new Property("duration", "decimal",
1765          "The duration of the recording in seconds - for audio and video.", 0, 1, duration);
1766    case 951530617:
1767      /* content */ return new Property("content", "Attachment",
1768          "The actual content of the media - inline or by direct reference to the media source file.", 0, 1, content);
1769    case 3387378:
1770      /* note */ return new Property("note", "Annotation",
1771          "Comments made about the media by the performer, subject or other participants.", 0,
1772          java.lang.Integer.MAX_VALUE, note);
1773    default:
1774      return super.getNamedProperty(_hash, _name, _checkValid);
1775    }
1776
1777  }
1778
1779  @Override
1780  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1781    switch (hash) {
1782    case -1618432855:
1783      /* identifier */ return this.identifier == null ? new Base[0]
1784          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1785    case -332612366:
1786      /* basedOn */ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
1787    case -995410646:
1788      /* partOf */ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
1789    case -892481550:
1790      /* status */ return this.status == null ? new Base[0] : new Base[] { this.status }; // Enumeration<MediaStatus>
1791    case 3575610:
1792      /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // CodeableConcept
1793    case -622722335:
1794      /* modality */ return this.modality == null ? new Base[0] : new Base[] { this.modality }; // CodeableConcept
1795    case 3619493:
1796      /* view */ return this.view == null ? new Base[0] : new Base[] { this.view }; // CodeableConcept
1797    case -1867885268:
1798      /* subject */ return this.subject == null ? new Base[0] : new Base[] { this.subject }; // Reference
1799    case 1524132147:
1800      /* encounter */ return this.encounter == null ? new Base[0] : new Base[] { this.encounter }; // Reference
1801    case 1028554472:
1802      /* created */ return this.created == null ? new Base[0] : new Base[] { this.created }; // Type
1803    case -1179159893:
1804      /* issued */ return this.issued == null ? new Base[0] : new Base[] { this.issued }; // InstantType
1805    case -500553564:
1806      /* operator */ return this.operator == null ? new Base[0] : new Base[] { this.operator }; // Reference
1807    case 722137681:
1808      /* reasonCode */ return this.reasonCode == null ? new Base[0]
1809          : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
1810    case 1702620169:
1811      /* bodySite */ return this.bodySite == null ? new Base[0] : new Base[] { this.bodySite }; // CodeableConcept
1812    case 780988929:
1813      /* deviceName */ return this.deviceName == null ? new Base[0] : new Base[] { this.deviceName }; // StringType
1814    case -1335157162:
1815      /* device */ return this.device == null ? new Base[0] : new Base[] { this.device }; // Reference
1816    case -1221029593:
1817      /* height */ return this.height == null ? new Base[0] : new Base[] { this.height }; // PositiveIntType
1818    case 113126854:
1819      /* width */ return this.width == null ? new Base[0] : new Base[] { this.width }; // PositiveIntType
1820    case -1266514778:
1821      /* frames */ return this.frames == null ? new Base[0] : new Base[] { this.frames }; // PositiveIntType
1822    case -1992012396:
1823      /* duration */ return this.duration == null ? new Base[0] : new Base[] { this.duration }; // DecimalType
1824    case 951530617:
1825      /* content */ return this.content == null ? new Base[0] : new Base[] { this.content }; // Attachment
1826    case 3387378:
1827      /* note */ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1828    default:
1829      return super.getProperty(hash, name, checkValid);
1830    }
1831
1832  }
1833
1834  @Override
1835  public Base setProperty(int hash, String name, Base value) throws FHIRException {
1836    switch (hash) {
1837    case -1618432855: // identifier
1838      this.getIdentifier().add(castToIdentifier(value)); // Identifier
1839      return value;
1840    case -332612366: // basedOn
1841      this.getBasedOn().add(castToReference(value)); // Reference
1842      return value;
1843    case -995410646: // partOf
1844      this.getPartOf().add(castToReference(value)); // Reference
1845      return value;
1846    case -892481550: // status
1847      value = new MediaStatusEnumFactory().fromType(castToCode(value));
1848      this.status = (Enumeration) value; // Enumeration<MediaStatus>
1849      return value;
1850    case 3575610: // type
1851      this.type = castToCodeableConcept(value); // CodeableConcept
1852      return value;
1853    case -622722335: // modality
1854      this.modality = castToCodeableConcept(value); // CodeableConcept
1855      return value;
1856    case 3619493: // view
1857      this.view = castToCodeableConcept(value); // CodeableConcept
1858      return value;
1859    case -1867885268: // subject
1860      this.subject = castToReference(value); // Reference
1861      return value;
1862    case 1524132147: // encounter
1863      this.encounter = castToReference(value); // Reference
1864      return value;
1865    case 1028554472: // created
1866      this.created = castToType(value); // Type
1867      return value;
1868    case -1179159893: // issued
1869      this.issued = castToInstant(value); // InstantType
1870      return value;
1871    case -500553564: // operator
1872      this.operator = castToReference(value); // Reference
1873      return value;
1874    case 722137681: // reasonCode
1875      this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
1876      return value;
1877    case 1702620169: // bodySite
1878      this.bodySite = castToCodeableConcept(value); // CodeableConcept
1879      return value;
1880    case 780988929: // deviceName
1881      this.deviceName = castToString(value); // StringType
1882      return value;
1883    case -1335157162: // device
1884      this.device = castToReference(value); // Reference
1885      return value;
1886    case -1221029593: // height
1887      this.height = castToPositiveInt(value); // PositiveIntType
1888      return value;
1889    case 113126854: // width
1890      this.width = castToPositiveInt(value); // PositiveIntType
1891      return value;
1892    case -1266514778: // frames
1893      this.frames = castToPositiveInt(value); // PositiveIntType
1894      return value;
1895    case -1992012396: // duration
1896      this.duration = castToDecimal(value); // DecimalType
1897      return value;
1898    case 951530617: // content
1899      this.content = castToAttachment(value); // Attachment
1900      return value;
1901    case 3387378: // note
1902      this.getNote().add(castToAnnotation(value)); // Annotation
1903      return value;
1904    default:
1905      return super.setProperty(hash, name, value);
1906    }
1907
1908  }
1909
1910  @Override
1911  public Base setProperty(String name, Base value) throws FHIRException {
1912    if (name.equals("identifier")) {
1913      this.getIdentifier().add(castToIdentifier(value));
1914    } else if (name.equals("basedOn")) {
1915      this.getBasedOn().add(castToReference(value));
1916    } else if (name.equals("partOf")) {
1917      this.getPartOf().add(castToReference(value));
1918    } else if (name.equals("status")) {
1919      value = new MediaStatusEnumFactory().fromType(castToCode(value));
1920      this.status = (Enumeration) value; // Enumeration<MediaStatus>
1921    } else if (name.equals("type")) {
1922      this.type = castToCodeableConcept(value); // CodeableConcept
1923    } else if (name.equals("modality")) {
1924      this.modality = castToCodeableConcept(value); // CodeableConcept
1925    } else if (name.equals("view")) {
1926      this.view = castToCodeableConcept(value); // CodeableConcept
1927    } else if (name.equals("subject")) {
1928      this.subject = castToReference(value); // Reference
1929    } else if (name.equals("encounter")) {
1930      this.encounter = castToReference(value); // Reference
1931    } else if (name.equals("created[x]")) {
1932      this.created = castToType(value); // Type
1933    } else if (name.equals("issued")) {
1934      this.issued = castToInstant(value); // InstantType
1935    } else if (name.equals("operator")) {
1936      this.operator = castToReference(value); // Reference
1937    } else if (name.equals("reasonCode")) {
1938      this.getReasonCode().add(castToCodeableConcept(value));
1939    } else if (name.equals("bodySite")) {
1940      this.bodySite = castToCodeableConcept(value); // CodeableConcept
1941    } else if (name.equals("deviceName")) {
1942      this.deviceName = castToString(value); // StringType
1943    } else if (name.equals("device")) {
1944      this.device = castToReference(value); // Reference
1945    } else if (name.equals("height")) {
1946      this.height = castToPositiveInt(value); // PositiveIntType
1947    } else if (name.equals("width")) {
1948      this.width = castToPositiveInt(value); // PositiveIntType
1949    } else if (name.equals("frames")) {
1950      this.frames = castToPositiveInt(value); // PositiveIntType
1951    } else if (name.equals("duration")) {
1952      this.duration = castToDecimal(value); // DecimalType
1953    } else if (name.equals("content")) {
1954      this.content = castToAttachment(value); // Attachment
1955    } else if (name.equals("note")) {
1956      this.getNote().add(castToAnnotation(value));
1957    } else
1958      return super.setProperty(name, value);
1959    return value;
1960  }
1961
1962  @Override
1963  public Base makeProperty(int hash, String name) throws FHIRException {
1964    switch (hash) {
1965    case -1618432855:
1966      return addIdentifier();
1967    case -332612366:
1968      return addBasedOn();
1969    case -995410646:
1970      return addPartOf();
1971    case -892481550:
1972      return getStatusElement();
1973    case 3575610:
1974      return getType();
1975    case -622722335:
1976      return getModality();
1977    case 3619493:
1978      return getView();
1979    case -1867885268:
1980      return getSubject();
1981    case 1524132147:
1982      return getEncounter();
1983    case 1369676952:
1984      return getCreated();
1985    case 1028554472:
1986      return getCreated();
1987    case -1179159893:
1988      return getIssuedElement();
1989    case -500553564:
1990      return getOperator();
1991    case 722137681:
1992      return addReasonCode();
1993    case 1702620169:
1994      return getBodySite();
1995    case 780988929:
1996      return getDeviceNameElement();
1997    case -1335157162:
1998      return getDevice();
1999    case -1221029593:
2000      return getHeightElement();
2001    case 113126854:
2002      return getWidthElement();
2003    case -1266514778:
2004      return getFramesElement();
2005    case -1992012396:
2006      return getDurationElement();
2007    case 951530617:
2008      return getContent();
2009    case 3387378:
2010      return addNote();
2011    default:
2012      return super.makeProperty(hash, name);
2013    }
2014
2015  }
2016
2017  @Override
2018  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2019    switch (hash) {
2020    case -1618432855:
2021      /* identifier */ return new String[] { "Identifier" };
2022    case -332612366:
2023      /* basedOn */ return new String[] { "Reference" };
2024    case -995410646:
2025      /* partOf */ return new String[] { "Reference" };
2026    case -892481550:
2027      /* status */ return new String[] { "code" };
2028    case 3575610:
2029      /* type */ return new String[] { "CodeableConcept" };
2030    case -622722335:
2031      /* modality */ return new String[] { "CodeableConcept" };
2032    case 3619493:
2033      /* view */ return new String[] { "CodeableConcept" };
2034    case -1867885268:
2035      /* subject */ return new String[] { "Reference" };
2036    case 1524132147:
2037      /* encounter */ return new String[] { "Reference" };
2038    case 1028554472:
2039      /* created */ return new String[] { "dateTime", "Period" };
2040    case -1179159893:
2041      /* issued */ return new String[] { "instant" };
2042    case -500553564:
2043      /* operator */ return new String[] { "Reference" };
2044    case 722137681:
2045      /* reasonCode */ return new String[] { "CodeableConcept" };
2046    case 1702620169:
2047      /* bodySite */ return new String[] { "CodeableConcept" };
2048    case 780988929:
2049      /* deviceName */ return new String[] { "string" };
2050    case -1335157162:
2051      /* device */ return new String[] { "Reference" };
2052    case -1221029593:
2053      /* height */ return new String[] { "positiveInt" };
2054    case 113126854:
2055      /* width */ return new String[] { "positiveInt" };
2056    case -1266514778:
2057      /* frames */ return new String[] { "positiveInt" };
2058    case -1992012396:
2059      /* duration */ return new String[] { "decimal" };
2060    case 951530617:
2061      /* content */ return new String[] { "Attachment" };
2062    case 3387378:
2063      /* note */ return new String[] { "Annotation" };
2064    default:
2065      return super.getTypesForProperty(hash, name);
2066    }
2067
2068  }
2069
2070  @Override
2071  public Base addChild(String name) throws FHIRException {
2072    if (name.equals("identifier")) {
2073      return addIdentifier();
2074    } else if (name.equals("basedOn")) {
2075      return addBasedOn();
2076    } else if (name.equals("partOf")) {
2077      return addPartOf();
2078    } else if (name.equals("status")) {
2079      throw new FHIRException("Cannot call addChild on a singleton property Media.status");
2080    } else if (name.equals("type")) {
2081      this.type = new CodeableConcept();
2082      return this.type;
2083    } else if (name.equals("modality")) {
2084      this.modality = new CodeableConcept();
2085      return this.modality;
2086    } else if (name.equals("view")) {
2087      this.view = new CodeableConcept();
2088      return this.view;
2089    } else if (name.equals("subject")) {
2090      this.subject = new Reference();
2091      return this.subject;
2092    } else if (name.equals("encounter")) {
2093      this.encounter = new Reference();
2094      return this.encounter;
2095    } else if (name.equals("createdDateTime")) {
2096      this.created = new DateTimeType();
2097      return this.created;
2098    } else if (name.equals("createdPeriod")) {
2099      this.created = new Period();
2100      return this.created;
2101    } else if (name.equals("issued")) {
2102      throw new FHIRException("Cannot call addChild on a singleton property Media.issued");
2103    } else if (name.equals("operator")) {
2104      this.operator = new Reference();
2105      return this.operator;
2106    } else if (name.equals("reasonCode")) {
2107      return addReasonCode();
2108    } else if (name.equals("bodySite")) {
2109      this.bodySite = new CodeableConcept();
2110      return this.bodySite;
2111    } else if (name.equals("deviceName")) {
2112      throw new FHIRException("Cannot call addChild on a singleton property Media.deviceName");
2113    } else if (name.equals("device")) {
2114      this.device = new Reference();
2115      return this.device;
2116    } else if (name.equals("height")) {
2117      throw new FHIRException("Cannot call addChild on a singleton property Media.height");
2118    } else if (name.equals("width")) {
2119      throw new FHIRException("Cannot call addChild on a singleton property Media.width");
2120    } else if (name.equals("frames")) {
2121      throw new FHIRException("Cannot call addChild on a singleton property Media.frames");
2122    } else if (name.equals("duration")) {
2123      throw new FHIRException("Cannot call addChild on a singleton property Media.duration");
2124    } else if (name.equals("content")) {
2125      this.content = new Attachment();
2126      return this.content;
2127    } else if (name.equals("note")) {
2128      return addNote();
2129    } else
2130      return super.addChild(name);
2131  }
2132
2133  public String fhirType() {
2134    return "Media";
2135
2136  }
2137
2138  public Media copy() {
2139    Media dst = new Media();
2140    copyValues(dst);
2141    return dst;
2142  }
2143
2144  public void copyValues(Media dst) {
2145    super.copyValues(dst);
2146    if (identifier != null) {
2147      dst.identifier = new ArrayList<Identifier>();
2148      for (Identifier i : identifier)
2149        dst.identifier.add(i.copy());
2150    }
2151    ;
2152    if (basedOn != null) {
2153      dst.basedOn = new ArrayList<Reference>();
2154      for (Reference i : basedOn)
2155        dst.basedOn.add(i.copy());
2156    }
2157    ;
2158    if (partOf != null) {
2159      dst.partOf = new ArrayList<Reference>();
2160      for (Reference i : partOf)
2161        dst.partOf.add(i.copy());
2162    }
2163    ;
2164    dst.status = status == null ? null : status.copy();
2165    dst.type = type == null ? null : type.copy();
2166    dst.modality = modality == null ? null : modality.copy();
2167    dst.view = view == null ? null : view.copy();
2168    dst.subject = subject == null ? null : subject.copy();
2169    dst.encounter = encounter == null ? null : encounter.copy();
2170    dst.created = created == null ? null : created.copy();
2171    dst.issued = issued == null ? null : issued.copy();
2172    dst.operator = operator == null ? null : operator.copy();
2173    if (reasonCode != null) {
2174      dst.reasonCode = new ArrayList<CodeableConcept>();
2175      for (CodeableConcept i : reasonCode)
2176        dst.reasonCode.add(i.copy());
2177    }
2178    ;
2179    dst.bodySite = bodySite == null ? null : bodySite.copy();
2180    dst.deviceName = deviceName == null ? null : deviceName.copy();
2181    dst.device = device == null ? null : device.copy();
2182    dst.height = height == null ? null : height.copy();
2183    dst.width = width == null ? null : width.copy();
2184    dst.frames = frames == null ? null : frames.copy();
2185    dst.duration = duration == null ? null : duration.copy();
2186    dst.content = content == null ? null : content.copy();
2187    if (note != null) {
2188      dst.note = new ArrayList<Annotation>();
2189      for (Annotation i : note)
2190        dst.note.add(i.copy());
2191    }
2192    ;
2193  }
2194
2195  protected Media typedCopy() {
2196    return copy();
2197  }
2198
2199  @Override
2200  public boolean equalsDeep(Base other_) {
2201    if (!super.equalsDeep(other_))
2202      return false;
2203    if (!(other_ instanceof Media))
2204      return false;
2205    Media o = (Media) other_;
2206    return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true)
2207        && compareDeep(partOf, o.partOf, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true)
2208        && compareDeep(modality, o.modality, true) && compareDeep(view, o.view, true)
2209        && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true)
2210        && compareDeep(created, o.created, true) && compareDeep(issued, o.issued, true)
2211        && compareDeep(operator, o.operator, true) && compareDeep(reasonCode, o.reasonCode, true)
2212        && compareDeep(bodySite, o.bodySite, true) && compareDeep(deviceName, o.deviceName, true)
2213        && compareDeep(device, o.device, true) && compareDeep(height, o.height, true)
2214        && compareDeep(width, o.width, true) && compareDeep(frames, o.frames, true)
2215        && compareDeep(duration, o.duration, true) && compareDeep(content, o.content, true)
2216        && compareDeep(note, o.note, true);
2217  }
2218
2219  @Override
2220  public boolean equalsShallow(Base other_) {
2221    if (!super.equalsShallow(other_))
2222      return false;
2223    if (!(other_ instanceof Media))
2224      return false;
2225    Media o = (Media) other_;
2226    return compareValues(status, o.status, true) && compareValues(issued, o.issued, true)
2227        && compareValues(deviceName, o.deviceName, true) && compareValues(height, o.height, true)
2228        && compareValues(width, o.width, true) && compareValues(frames, o.frames, true)
2229        && compareValues(duration, o.duration, true);
2230  }
2231
2232  public boolean isEmpty() {
2233    return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, partOf, status, type, modality,
2234        view, subject, encounter, created, issued, operator, reasonCode, bodySite, deviceName, device, height, width,
2235        frames, duration, content, note);
2236  }
2237
2238  @Override
2239  public ResourceType getResourceType() {
2240    return ResourceType.Media;
2241  }
2242
2243  /**
2244   * Search parameter: <b>identifier</b>
2245   * <p>
2246   * Description: <b>Identifier(s) for the image</b><br>
2247   * Type: <b>token</b><br>
2248   * Path: <b>Media.identifier</b><br>
2249   * </p>
2250   */
2251  @SearchParamDefinition(name = "identifier", path = "Media.identifier", description = "Identifier(s) for the image", type = "token")
2252  public static final String SP_IDENTIFIER = "identifier";
2253  /**
2254   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2255   * <p>
2256   * Description: <b>Identifier(s) for the image</b><br>
2257   * Type: <b>token</b><br>
2258   * Path: <b>Media.identifier</b><br>
2259   * </p>
2260   */
2261  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2262      SP_IDENTIFIER);
2263
2264  /**
2265   * Search parameter: <b>modality</b>
2266   * <p>
2267   * Description: <b>The type of acquisition equipment/process</b><br>
2268   * Type: <b>token</b><br>
2269   * Path: <b>Media.modality</b><br>
2270   * </p>
2271   */
2272  @SearchParamDefinition(name = "modality", path = "Media.modality", description = "The type of acquisition equipment/process", type = "token")
2273  public static final String SP_MODALITY = "modality";
2274  /**
2275   * <b>Fluent Client</b> search parameter constant for <b>modality</b>
2276   * <p>
2277   * Description: <b>The type of acquisition equipment/process</b><br>
2278   * Type: <b>token</b><br>
2279   * Path: <b>Media.modality</b><br>
2280   * </p>
2281   */
2282  public static final ca.uhn.fhir.rest.gclient.TokenClientParam MODALITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2283      SP_MODALITY);
2284
2285  /**
2286   * Search parameter: <b>subject</b>
2287   * <p>
2288   * Description: <b>Who/What this Media is a record of</b><br>
2289   * Type: <b>reference</b><br>
2290   * Path: <b>Media.subject</b><br>
2291   * </p>
2292   */
2293  @SearchParamDefinition(name = "subject", path = "Media.subject", description = "Who/What this Media is a record of", type = "reference", providesMembershipIn = {
2294      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Device"),
2295      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Patient"),
2296      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Practitioner") }, target = { Device.class, Group.class,
2297          Location.class, Patient.class, Practitioner.class, PractitionerRole.class, Specimen.class })
2298  public static final String SP_SUBJECT = "subject";
2299  /**
2300   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2301   * <p>
2302   * Description: <b>Who/What this Media is a record of</b><br>
2303   * Type: <b>reference</b><br>
2304   * Path: <b>Media.subject</b><br>
2305   * </p>
2306   */
2307  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2308      SP_SUBJECT);
2309
2310  /**
2311   * Constant for fluent queries to be used to add include statements. Specifies
2312   * the path value of "<b>Media:subject</b>".
2313   */
2314  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Media:subject")
2315      .toLocked();
2316
2317  /**
2318   * Search parameter: <b>created</b>
2319   * <p>
2320   * Description: <b>When Media was collected</b><br>
2321   * Type: <b>date</b><br>
2322   * Path: <b>Media.created[x]</b><br>
2323   * </p>
2324   */
2325  @SearchParamDefinition(name = "created", path = "Media.created", description = "When Media was collected", type = "date")
2326  public static final String SP_CREATED = "created";
2327  /**
2328   * <b>Fluent Client</b> search parameter constant for <b>created</b>
2329   * <p>
2330   * Description: <b>When Media was collected</b><br>
2331   * Type: <b>date</b><br>
2332   * Path: <b>Media.created[x]</b><br>
2333   * </p>
2334   */
2335  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(
2336      SP_CREATED);
2337
2338  /**
2339   * Search parameter: <b>encounter</b>
2340   * <p>
2341   * Description: <b>Encounter associated with media</b><br>
2342   * Type: <b>reference</b><br>
2343   * Path: <b>Media.encounter</b><br>
2344   * </p>
2345   */
2346  @SearchParamDefinition(name = "encounter", path = "Media.encounter", description = "Encounter associated with media", type = "reference", providesMembershipIn = {
2347      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Encounter") }, target = { Encounter.class })
2348  public static final String SP_ENCOUNTER = "encounter";
2349  /**
2350   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
2351   * <p>
2352   * Description: <b>Encounter associated with media</b><br>
2353   * Type: <b>reference</b><br>
2354   * Path: <b>Media.encounter</b><br>
2355   * </p>
2356   */
2357  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2358      SP_ENCOUNTER);
2359
2360  /**
2361   * Constant for fluent queries to be used to add include statements. Specifies
2362   * the path value of "<b>Media:encounter</b>".
2363   */
2364  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include(
2365      "Media:encounter").toLocked();
2366
2367  /**
2368   * Search parameter: <b>type</b>
2369   * <p>
2370   * Description: <b>Classification of media as image, video, or audio</b><br>
2371   * Type: <b>token</b><br>
2372   * Path: <b>Media.type</b><br>
2373   * </p>
2374   */
2375  @SearchParamDefinition(name = "type", path = "Media.type", description = "Classification of media as image, video, or audio", type = "token")
2376  public static final String SP_TYPE = "type";
2377  /**
2378   * <b>Fluent Client</b> search parameter constant for <b>type</b>
2379   * <p>
2380   * Description: <b>Classification of media as image, video, or audio</b><br>
2381   * Type: <b>token</b><br>
2382   * Path: <b>Media.type</b><br>
2383   * </p>
2384   */
2385  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2386      SP_TYPE);
2387
2388  /**
2389   * Search parameter: <b>operator</b>
2390   * <p>
2391   * Description: <b>The person who generated the image</b><br>
2392   * Type: <b>reference</b><br>
2393   * Path: <b>Media.operator</b><br>
2394   * </p>
2395   */
2396  @SearchParamDefinition(name = "operator", path = "Media.operator", description = "The person who generated the image", type = "reference", providesMembershipIn = {
2397      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Practitioner") }, target = { CareTeam.class, Device.class,
2398          Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class })
2399  public static final String SP_OPERATOR = "operator";
2400  /**
2401   * <b>Fluent Client</b> search parameter constant for <b>operator</b>
2402   * <p>
2403   * Description: <b>The person who generated the image</b><br>
2404   * Type: <b>reference</b><br>
2405   * Path: <b>Media.operator</b><br>
2406   * </p>
2407   */
2408  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam OPERATOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2409      SP_OPERATOR);
2410
2411  /**
2412   * Constant for fluent queries to be used to add include statements. Specifies
2413   * the path value of "<b>Media:operator</b>".
2414   */
2415  public static final ca.uhn.fhir.model.api.Include INCLUDE_OPERATOR = new ca.uhn.fhir.model.api.Include(
2416      "Media:operator").toLocked();
2417
2418  /**
2419   * Search parameter: <b>view</b>
2420   * <p>
2421   * Description: <b>Imaging view, e.g. Lateral or Antero-posterior</b><br>
2422   * Type: <b>token</b><br>
2423   * Path: <b>Media.view</b><br>
2424   * </p>
2425   */
2426  @SearchParamDefinition(name = "view", path = "Media.view", description = "Imaging view, e.g. Lateral or Antero-posterior", type = "token")
2427  public static final String SP_VIEW = "view";
2428  /**
2429   * <b>Fluent Client</b> search parameter constant for <b>view</b>
2430   * <p>
2431   * Description: <b>Imaging view, e.g. Lateral or Antero-posterior</b><br>
2432   * Type: <b>token</b><br>
2433   * Path: <b>Media.view</b><br>
2434   * </p>
2435   */
2436  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VIEW = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2437      SP_VIEW);
2438
2439  /**
2440   * Search parameter: <b>site</b>
2441   * <p>
2442   * Description: <b>Observed body part</b><br>
2443   * Type: <b>token</b><br>
2444   * Path: <b>Media.bodySite</b><br>
2445   * </p>
2446   */
2447  @SearchParamDefinition(name = "site", path = "Media.bodySite", description = "Observed body part", type = "token")
2448  public static final String SP_SITE = "site";
2449  /**
2450   * <b>Fluent Client</b> search parameter constant for <b>site</b>
2451   * <p>
2452   * Description: <b>Observed body part</b><br>
2453   * Type: <b>token</b><br>
2454   * Path: <b>Media.bodySite</b><br>
2455   * </p>
2456   */
2457  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2458      SP_SITE);
2459
2460  /**
2461   * Search parameter: <b>based-on</b>
2462   * <p>
2463   * Description: <b>Procedure that caused this media to be created</b><br>
2464   * Type: <b>reference</b><br>
2465   * Path: <b>Media.basedOn</b><br>
2466   * </p>
2467   */
2468  @SearchParamDefinition(name = "based-on", path = "Media.basedOn", description = "Procedure that caused this media to be created", type = "reference", target = {
2469      CarePlan.class, ServiceRequest.class })
2470  public static final String SP_BASED_ON = "based-on";
2471  /**
2472   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
2473   * <p>
2474   * Description: <b>Procedure that caused this media to be created</b><br>
2475   * Type: <b>reference</b><br>
2476   * Path: <b>Media.basedOn</b><br>
2477   * </p>
2478   */
2479  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2480      SP_BASED_ON);
2481
2482  /**
2483   * Constant for fluent queries to be used to add include statements. Specifies
2484   * the path value of "<b>Media:based-on</b>".
2485   */
2486  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include(
2487      "Media:based-on").toLocked();
2488
2489  /**
2490   * Search parameter: <b>patient</b>
2491   * <p>
2492   * Description: <b>Who/What this Media is a record of</b><br>
2493   * Type: <b>reference</b><br>
2494   * Path: <b>Media.subject</b><br>
2495   * </p>
2496   */
2497  @SearchParamDefinition(name = "patient", path = "Media.subject.where(resolve() is Patient)", description = "Who/What this Media is a record of", type = "reference", target = {
2498      Patient.class })
2499  public static final String SP_PATIENT = "patient";
2500  /**
2501   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2502   * <p>
2503   * Description: <b>Who/What this Media is a record of</b><br>
2504   * Type: <b>reference</b><br>
2505   * Path: <b>Media.subject</b><br>
2506   * </p>
2507   */
2508  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2509      SP_PATIENT);
2510
2511  /**
2512   * Constant for fluent queries to be used to add include statements. Specifies
2513   * the path value of "<b>Media:patient</b>".
2514   */
2515  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Media:patient")
2516      .toLocked();
2517
2518  /**
2519   * Search parameter: <b>device</b>
2520   * <p>
2521   * Description: <b>Observing Device</b><br>
2522   * Type: <b>reference</b><br>
2523   * Path: <b>Media.device</b><br>
2524   * </p>
2525   */
2526  @SearchParamDefinition(name = "device", path = "Media.device", description = "Observing Device", type = "reference", target = {
2527      Device.class, DeviceMetric.class })
2528  public static final String SP_DEVICE = "device";
2529  /**
2530   * <b>Fluent Client</b> search parameter constant for <b>device</b>
2531   * <p>
2532   * Description: <b>Observing Device</b><br>
2533   * Type: <b>reference</b><br>
2534   * Path: <b>Media.device</b><br>
2535   * </p>
2536   */
2537  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
2538      SP_DEVICE);
2539
2540  /**
2541   * Constant for fluent queries to be used to add include statements. Specifies
2542   * the path value of "<b>Media:device</b>".
2543   */
2544  public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("Media:device")
2545      .toLocked();
2546
2547  /**
2548   * Search parameter: <b>status</b>
2549   * <p>
2550   * Description: <b>preparation | in-progress | not-done | on-hold | stopped |
2551   * completed | entered-in-error | unknown</b><br>
2552   * Type: <b>token</b><br>
2553   * Path: <b>Media.status</b><br>
2554   * </p>
2555   */
2556  @SearchParamDefinition(name = "status", path = "Media.status", description = "preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown", type = "token")
2557  public static final String SP_STATUS = "status";
2558  /**
2559   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2560   * <p>
2561   * Description: <b>preparation | in-progress | not-done | on-hold | stopped |
2562   * completed | entered-in-error | unknown</b><br>
2563   * Type: <b>token</b><br>
2564   * Path: <b>Media.status</b><br>
2565   * </p>
2566   */
2567  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
2568      SP_STATUS);
2569
2570}