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