001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
033import java.util.ArrayList;
034import java.util.Date;
035import java.util.List;
036
037import org.hl7.fhir.exceptions.FHIRException;
038import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
039import org.hl7.fhir.utilities.Utilities;
040
041import ca.uhn.fhir.model.api.annotation.Block;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.Description;
044import ca.uhn.fhir.model.api.annotation.ResourceDef;
045import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
046
047/**
048 * Representation of the content produced in a DICOM imaging study. A study
049 * comprises a set of series, each of which includes a set of Service-Object
050 * Pair Instances (SOP Instances - images or other data) acquired or produced in
051 * a common context. A series is of only one modality (e.g. X-ray, CT, MR,
052 * ultrasound), but a study may have multiple series of different modalities.
053 */
054@ResourceDef(name = "ImagingStudy", profile = "http://hl7.org/fhir/StructureDefinition/ImagingStudy")
055public class ImagingStudy extends DomainResource {
056
057  public enum ImagingStudyStatus {
058    /**
059     * The existence of the imaging study is registered, but there is nothing yet
060     * available.
061     */
062    REGISTERED,
063    /**
064     * At least one instance has been associated with this imaging study.
065     */
066    AVAILABLE,
067    /**
068     * The imaging study is unavailable because the imaging study was not started or
069     * not completed (also sometimes called "aborted").
070     */
071    CANCELLED,
072    /**
073     * The imaging study has been withdrawn following a previous final release. This
074     * electronic record should never have existed, though it is possible that
075     * real-world decisions were based on it. (If real-world activity has occurred,
076     * the status should be "cancelled" rather than "entered-in-error".).
077     */
078    ENTEREDINERROR,
079    /**
080     * The system does not know which of the status values currently applies for
081     * this request. Note: This concept is not to be used for "other" - one of the
082     * listed statuses is presumed to apply, it's just not known which one.
083     */
084    UNKNOWN,
085    /**
086     * added to help the parsers with the generic types
087     */
088    NULL;
089
090    public static ImagingStudyStatus fromCode(String codeString) throws FHIRException {
091      if (codeString == null || "".equals(codeString))
092        return null;
093      if ("registered".equals(codeString))
094        return REGISTERED;
095      if ("available".equals(codeString))
096        return AVAILABLE;
097      if ("cancelled".equals(codeString))
098        return CANCELLED;
099      if ("entered-in-error".equals(codeString))
100        return ENTEREDINERROR;
101      if ("unknown".equals(codeString))
102        return UNKNOWN;
103      if (Configuration.isAcceptInvalidEnums())
104        return null;
105      else
106        throw new FHIRException("Unknown ImagingStudyStatus code '" + codeString + "'");
107    }
108
109    public String toCode() {
110      switch (this) {
111      case REGISTERED:
112        return "registered";
113      case AVAILABLE:
114        return "available";
115      case CANCELLED:
116        return "cancelled";
117      case ENTEREDINERROR:
118        return "entered-in-error";
119      case UNKNOWN:
120        return "unknown";
121      case NULL:
122        return null;
123      default:
124        return "?";
125      }
126    }
127
128    public String getSystem() {
129      switch (this) {
130      case REGISTERED:
131        return "http://hl7.org/fhir/imagingstudy-status";
132      case AVAILABLE:
133        return "http://hl7.org/fhir/imagingstudy-status";
134      case CANCELLED:
135        return "http://hl7.org/fhir/imagingstudy-status";
136      case ENTEREDINERROR:
137        return "http://hl7.org/fhir/imagingstudy-status";
138      case UNKNOWN:
139        return "http://hl7.org/fhir/imagingstudy-status";
140      case NULL:
141        return null;
142      default:
143        return "?";
144      }
145    }
146
147    public String getDefinition() {
148      switch (this) {
149      case REGISTERED:
150        return "The existence of the imaging study is registered, but there is nothing yet available.";
151      case AVAILABLE:
152        return "At least one instance has been associated with this imaging study.";
153      case CANCELLED:
154        return "The imaging study is unavailable because the imaging study was not started or not completed (also sometimes called \"aborted\").";
155      case ENTEREDINERROR:
156        return "The imaging study has been withdrawn following a previous final release.  This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be \"cancelled\" rather than \"entered-in-error\".).";
157      case UNKNOWN:
158        return "The system does not know which of the status values currently applies for this request. Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, it's just not known which one.";
159      case NULL:
160        return null;
161      default:
162        return "?";
163      }
164    }
165
166    public String getDisplay() {
167      switch (this) {
168      case REGISTERED:
169        return "Registered";
170      case AVAILABLE:
171        return "Available";
172      case CANCELLED:
173        return "Cancelled";
174      case ENTEREDINERROR:
175        return "Entered in Error";
176      case UNKNOWN:
177        return "Unknown";
178      case NULL:
179        return null;
180      default:
181        return "?";
182      }
183    }
184  }
185
186  public static class ImagingStudyStatusEnumFactory implements EnumFactory<ImagingStudyStatus> {
187    public ImagingStudyStatus fromCode(String codeString) throws IllegalArgumentException {
188      if (codeString == null || "".equals(codeString))
189        if (codeString == null || "".equals(codeString))
190          return null;
191      if ("registered".equals(codeString))
192        return ImagingStudyStatus.REGISTERED;
193      if ("available".equals(codeString))
194        return ImagingStudyStatus.AVAILABLE;
195      if ("cancelled".equals(codeString))
196        return ImagingStudyStatus.CANCELLED;
197      if ("entered-in-error".equals(codeString))
198        return ImagingStudyStatus.ENTEREDINERROR;
199      if ("unknown".equals(codeString))
200        return ImagingStudyStatus.UNKNOWN;
201      throw new IllegalArgumentException("Unknown ImagingStudyStatus code '" + codeString + "'");
202    }
203
204    public Enumeration<ImagingStudyStatus> fromType(PrimitiveType<?> code) throws FHIRException {
205      if (code == null)
206        return null;
207      if (code.isEmpty())
208        return new Enumeration<ImagingStudyStatus>(this, ImagingStudyStatus.NULL, code);
209      String codeString = code.asStringValue();
210      if (codeString == null || "".equals(codeString))
211        return new Enumeration<ImagingStudyStatus>(this, ImagingStudyStatus.NULL, code);
212      if ("registered".equals(codeString))
213        return new Enumeration<ImagingStudyStatus>(this, ImagingStudyStatus.REGISTERED, code);
214      if ("available".equals(codeString))
215        return new Enumeration<ImagingStudyStatus>(this, ImagingStudyStatus.AVAILABLE, code);
216      if ("cancelled".equals(codeString))
217        return new Enumeration<ImagingStudyStatus>(this, ImagingStudyStatus.CANCELLED, code);
218      if ("entered-in-error".equals(codeString))
219        return new Enumeration<ImagingStudyStatus>(this, ImagingStudyStatus.ENTEREDINERROR, code);
220      if ("unknown".equals(codeString))
221        return new Enumeration<ImagingStudyStatus>(this, ImagingStudyStatus.UNKNOWN, code);
222      throw new FHIRException("Unknown ImagingStudyStatus code '" + codeString + "'");
223    }
224
225    public String toCode(ImagingStudyStatus code) {
226       if (code == ImagingStudyStatus.NULL)
227           return null;
228       if (code == ImagingStudyStatus.REGISTERED)
229        return "registered";
230      if (code == ImagingStudyStatus.AVAILABLE)
231        return "available";
232      if (code == ImagingStudyStatus.CANCELLED)
233        return "cancelled";
234      if (code == ImagingStudyStatus.ENTEREDINERROR)
235        return "entered-in-error";
236      if (code == ImagingStudyStatus.UNKNOWN)
237        return "unknown";
238      return "?";
239   }
240
241    public String toSystem(ImagingStudyStatus code) {
242      return code.getSystem();
243    }
244  }
245
246  @Block()
247  public static class ImagingStudySeriesComponent extends BackboneElement implements IBaseBackboneElement {
248    /**
249     * The DICOM Series Instance UID for the series.
250     */
251    @Child(name = "uid", type = { IdType.class }, order = 1, min = 1, max = 1, modifier = false, summary = true)
252    @Description(shortDefinition = "DICOM Series Instance UID for the series", formalDefinition = "The DICOM Series Instance UID for the series.")
253    protected IdType uid;
254
255    /**
256     * The numeric identifier of this series in the study.
257     */
258    @Child(name = "number", type = {
259        UnsignedIntType.class }, order = 2, min = 0, max = 1, modifier = false, summary = true)
260    @Description(shortDefinition = "Numeric identifier of this series", formalDefinition = "The numeric identifier of this series in the study.")
261    protected UnsignedIntType number;
262
263    /**
264     * The modality of this series sequence.
265     */
266    @Child(name = "modality", type = { Coding.class }, order = 3, min = 1, max = 1, modifier = false, summary = true)
267    @Description(shortDefinition = "The modality of the instances in the series", formalDefinition = "The modality of this series sequence.")
268    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://dicom.nema.org/medical/dicom/current/output/chtml/part16/sect_CID_29.html")
269    protected Coding modality;
270
271    /**
272     * A description of the series.
273     */
274    @Child(name = "description", type = {
275        StringType.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
276    @Description(shortDefinition = "A short human readable summary of the series", formalDefinition = "A description of the series.")
277    protected StringType description;
278
279    /**
280     * Number of SOP Instances in the Study. The value given may be larger than the
281     * number of instance elements this resource contains due to resource
282     * availability, security, or other factors. This element should be present if
283     * any instance elements are present.
284     */
285    @Child(name = "numberOfInstances", type = {
286        UnsignedIntType.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
287    @Description(shortDefinition = "Number of Series Related Instances", formalDefinition = "Number of SOP Instances in the Study. The value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present.")
288    protected UnsignedIntType numberOfInstances;
289
290    /**
291     * The network service providing access (e.g., query, view, or retrieval) for
292     * this series. See implementation notes for information about using DICOM
293     * endpoints. A series-level endpoint, if present, has precedence over a
294     * study-level endpoint with the same Endpoint.connectionType.
295     */
296    @Child(name = "endpoint", type = {
297        Endpoint.class }, order = 6, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
298    @Description(shortDefinition = "Series access endpoint", formalDefinition = "The network service providing access (e.g., query, view, or retrieval) for this series. See implementation notes for information about using DICOM endpoints. A series-level endpoint, if present, has precedence over a study-level endpoint with the same Endpoint.connectionType.")
299    protected List<Reference> endpoint;
300    /**
301     * The actual objects that are the target of the reference (The network service
302     * providing access (e.g., query, view, or retrieval) for this series. See
303     * implementation notes for information about using DICOM endpoints. A
304     * series-level endpoint, if present, has precedence over a study-level endpoint
305     * with the same Endpoint.connectionType.)
306     */
307    protected List<Endpoint> endpointTarget;
308
309    /**
310     * The anatomic structures examined. See DICOM Part 16 Annex L
311     * (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html)
312     * for DICOM to SNOMED-CT mappings. The bodySite may indicate the laterality of
313     * body part imaged; if so, it shall be consistent with any content of
314     * ImagingStudy.series.laterality.
315     */
316    @Child(name = "bodySite", type = { Coding.class }, order = 7, min = 0, max = 1, modifier = false, summary = true)
317    @Description(shortDefinition = "Body part examined", formalDefinition = "The anatomic structures examined. See DICOM Part 16 Annex L (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html) for DICOM to SNOMED-CT mappings. The bodySite may indicate the laterality of body part imaged; if so, it shall be consistent with any content of ImagingStudy.series.laterality.")
318    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/body-site")
319    protected Coding bodySite;
320
321    /**
322     * The laterality of the (possibly paired) anatomic structures examined. E.g.,
323     * the left knee, both lungs, or unpaired abdomen. If present, shall be
324     * consistent with any laterality information indicated in
325     * ImagingStudy.series.bodySite.
326     */
327    @Child(name = "laterality", type = { Coding.class }, order = 8, min = 0, max = 1, modifier = false, summary = true)
328    @Description(shortDefinition = "Body part laterality", formalDefinition = "The laterality of the (possibly paired) anatomic structures examined. E.g., the left knee, both lungs, or unpaired abdomen. If present, shall be consistent with any laterality information indicated in ImagingStudy.series.bodySite.")
329    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/bodysite-laterality")
330    protected Coding laterality;
331
332    /**
333     * The specimen imaged, e.g., for whole slide imaging of a biopsy.
334     */
335    @Child(name = "specimen", type = {
336        Specimen.class }, order = 9, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
337    @Description(shortDefinition = "Specimen imaged", formalDefinition = "The specimen imaged, e.g., for whole slide imaging of a biopsy.")
338    protected List<Reference> specimen;
339    /**
340     * The actual objects that are the target of the reference (The specimen imaged,
341     * e.g., for whole slide imaging of a biopsy.)
342     */
343    protected List<Specimen> specimenTarget;
344
345    /**
346     * The date and time the series was started.
347     */
348    @Child(name = "started", type = {
349        DateTimeType.class }, order = 10, min = 0, max = 1, modifier = false, summary = true)
350    @Description(shortDefinition = "When the series started", formalDefinition = "The date and time the series was started.")
351    protected DateTimeType started;
352
353    /**
354     * Indicates who or what performed the series and how they were involved.
355     */
356    @Child(name = "performer", type = {}, order = 11, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
357    @Description(shortDefinition = "Who performed the series", formalDefinition = "Indicates who or what performed the series and how they were involved.")
358    protected List<ImagingStudySeriesPerformerComponent> performer;
359
360    /**
361     * A single SOP instance within the series, e.g. an image, or presentation
362     * state.
363     */
364    @Child(name = "instance", type = {}, order = 12, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
365    @Description(shortDefinition = "A single SOP instance from the series", formalDefinition = "A single SOP instance within the series, e.g. an image, or presentation state.")
366    protected List<ImagingStudySeriesInstanceComponent> instance;
367
368    private static final long serialVersionUID = -11423429L;
369
370    /**
371     * Constructor
372     */
373    public ImagingStudySeriesComponent() {
374      super();
375    }
376
377    /**
378     * Constructor
379     */
380    public ImagingStudySeriesComponent(IdType uid, Coding modality) {
381      super();
382      this.uid = uid;
383      this.modality = modality;
384    }
385
386    /**
387     * @return {@link #uid} (The DICOM Series Instance UID for the series.). This is
388     *         the underlying object with id, value and extensions. The accessor
389     *         "getUid" gives direct access to the value
390     */
391    public IdType getUidElement() {
392      if (this.uid == null)
393        if (Configuration.errorOnAutoCreate())
394          throw new Error("Attempt to auto-create ImagingStudySeriesComponent.uid");
395        else if (Configuration.doAutoCreate())
396          this.uid = new IdType(); // bb
397      return this.uid;
398    }
399
400    public boolean hasUidElement() {
401      return this.uid != null && !this.uid.isEmpty();
402    }
403
404    public boolean hasUid() {
405      return this.uid != null && !this.uid.isEmpty();
406    }
407
408    /**
409     * @param value {@link #uid} (The DICOM Series Instance UID for the series.).
410     *              This is the underlying object with id, value and extensions. The
411     *              accessor "getUid" gives direct access to the value
412     */
413    public ImagingStudySeriesComponent setUidElement(IdType value) {
414      this.uid = value;
415      return this;
416    }
417
418    /**
419     * @return The DICOM Series Instance UID for the series.
420     */
421    public String getUid() {
422      return this.uid == null ? null : this.uid.getValue();
423    }
424
425    /**
426     * @param value The DICOM Series Instance UID for the series.
427     */
428    public ImagingStudySeriesComponent setUid(String value) {
429      if (this.uid == null)
430        this.uid = new IdType();
431      this.uid.setValue(value);
432      return this;
433    }
434
435    /**
436     * @return {@link #number} (The numeric identifier of this series in the
437     *         study.). This is the underlying object with id, value and extensions.
438     *         The accessor "getNumber" gives direct access to the value
439     */
440    public UnsignedIntType getNumberElement() {
441      if (this.number == null)
442        if (Configuration.errorOnAutoCreate())
443          throw new Error("Attempt to auto-create ImagingStudySeriesComponent.number");
444        else if (Configuration.doAutoCreate())
445          this.number = new UnsignedIntType(); // bb
446      return this.number;
447    }
448
449    public boolean hasNumberElement() {
450      return this.number != null && !this.number.isEmpty();
451    }
452
453    public boolean hasNumber() {
454      return this.number != null && !this.number.isEmpty();
455    }
456
457    /**
458     * @param value {@link #number} (The numeric identifier of this series in the
459     *              study.). This is the underlying object with id, value and
460     *              extensions. The accessor "getNumber" gives direct access to the
461     *              value
462     */
463    public ImagingStudySeriesComponent setNumberElement(UnsignedIntType value) {
464      this.number = value;
465      return this;
466    }
467
468    /**
469     * @return The numeric identifier of this series in the study.
470     */
471    public int getNumber() {
472      return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue();
473    }
474
475    /**
476     * @param value The numeric identifier of this series in the study.
477     */
478    public ImagingStudySeriesComponent setNumber(int value) {
479      if (this.number == null)
480        this.number = new UnsignedIntType();
481      this.number.setValue(value);
482      return this;
483    }
484
485    /**
486     * @return {@link #modality} (The modality of this series sequence.)
487     */
488    public Coding getModality() {
489      if (this.modality == null)
490        if (Configuration.errorOnAutoCreate())
491          throw new Error("Attempt to auto-create ImagingStudySeriesComponent.modality");
492        else if (Configuration.doAutoCreate())
493          this.modality = new Coding(); // cc
494      return this.modality;
495    }
496
497    public boolean hasModality() {
498      return this.modality != null && !this.modality.isEmpty();
499    }
500
501    /**
502     * @param value {@link #modality} (The modality of this series sequence.)
503     */
504    public ImagingStudySeriesComponent setModality(Coding value) {
505      this.modality = value;
506      return this;
507    }
508
509    /**
510     * @return {@link #description} (A description of the series.). This is the
511     *         underlying object with id, value and extensions. The accessor
512     *         "getDescription" gives direct access to the value
513     */
514    public StringType getDescriptionElement() {
515      if (this.description == null)
516        if (Configuration.errorOnAutoCreate())
517          throw new Error("Attempt to auto-create ImagingStudySeriesComponent.description");
518        else if (Configuration.doAutoCreate())
519          this.description = new StringType(); // bb
520      return this.description;
521    }
522
523    public boolean hasDescriptionElement() {
524      return this.description != null && !this.description.isEmpty();
525    }
526
527    public boolean hasDescription() {
528      return this.description != null && !this.description.isEmpty();
529    }
530
531    /**
532     * @param value {@link #description} (A description of the series.). This is the
533     *              underlying object with id, value and extensions. The accessor
534     *              "getDescription" gives direct access to the value
535     */
536    public ImagingStudySeriesComponent setDescriptionElement(StringType value) {
537      this.description = value;
538      return this;
539    }
540
541    /**
542     * @return A description of the series.
543     */
544    public String getDescription() {
545      return this.description == null ? null : this.description.getValue();
546    }
547
548    /**
549     * @param value A description of the series.
550     */
551    public ImagingStudySeriesComponent setDescription(String value) {
552      if (Utilities.noString(value))
553        this.description = null;
554      else {
555        if (this.description == null)
556          this.description = new StringType();
557        this.description.setValue(value);
558      }
559      return this;
560    }
561
562    /**
563     * @return {@link #numberOfInstances} (Number of SOP Instances in the Study. The
564     *         value given may be larger than the number of instance elements this
565     *         resource contains due to resource availability, security, or other
566     *         factors. This element should be present if any instance elements are
567     *         present.). This is the underlying object with id, value and
568     *         extensions. The accessor "getNumberOfInstances" gives direct access
569     *         to the value
570     */
571    public UnsignedIntType getNumberOfInstancesElement() {
572      if (this.numberOfInstances == null)
573        if (Configuration.errorOnAutoCreate())
574          throw new Error("Attempt to auto-create ImagingStudySeriesComponent.numberOfInstances");
575        else if (Configuration.doAutoCreate())
576          this.numberOfInstances = new UnsignedIntType(); // bb
577      return this.numberOfInstances;
578    }
579
580    public boolean hasNumberOfInstancesElement() {
581      return this.numberOfInstances != null && !this.numberOfInstances.isEmpty();
582    }
583
584    public boolean hasNumberOfInstances() {
585      return this.numberOfInstances != null && !this.numberOfInstances.isEmpty();
586    }
587
588    /**
589     * @param value {@link #numberOfInstances} (Number of SOP Instances in the
590     *              Study. The value given may be larger than the number of instance
591     *              elements this resource contains due to resource availability,
592     *              security, or other factors. This element should be present if
593     *              any instance elements are present.). This is the underlying
594     *              object with id, value and extensions. The accessor
595     *              "getNumberOfInstances" gives direct access to the value
596     */
597    public ImagingStudySeriesComponent setNumberOfInstancesElement(UnsignedIntType value) {
598      this.numberOfInstances = value;
599      return this;
600    }
601
602    /**
603     * @return Number of SOP Instances in the Study. The value given may be larger
604     *         than the number of instance elements this resource contains due to
605     *         resource availability, security, or other factors. This element
606     *         should be present if any instance elements are present.
607     */
608    public int getNumberOfInstances() {
609      return this.numberOfInstances == null || this.numberOfInstances.isEmpty() ? 0 : this.numberOfInstances.getValue();
610    }
611
612    /**
613     * @param value Number of SOP Instances in the Study. The value given may be
614     *              larger than the number of instance elements this resource
615     *              contains due to resource availability, security, or other
616     *              factors. This element should be present if any instance elements
617     *              are present.
618     */
619    public ImagingStudySeriesComponent setNumberOfInstances(int value) {
620      if (this.numberOfInstances == null)
621        this.numberOfInstances = new UnsignedIntType();
622      this.numberOfInstances.setValue(value);
623      return this;
624    }
625
626    /**
627     * @return {@link #endpoint} (The network service providing access (e.g., query,
628     *         view, or retrieval) for this series. See implementation notes for
629     *         information about using DICOM endpoints. A series-level endpoint, if
630     *         present, has precedence over a study-level endpoint with the same
631     *         Endpoint.connectionType.)
632     */
633    public List<Reference> getEndpoint() {
634      if (this.endpoint == null)
635        this.endpoint = new ArrayList<Reference>();
636      return this.endpoint;
637    }
638
639    /**
640     * @return Returns a reference to <code>this</code> for easy method chaining
641     */
642    public ImagingStudySeriesComponent setEndpoint(List<Reference> theEndpoint) {
643      this.endpoint = theEndpoint;
644      return this;
645    }
646
647    public boolean hasEndpoint() {
648      if (this.endpoint == null)
649        return false;
650      for (Reference item : this.endpoint)
651        if (!item.isEmpty())
652          return true;
653      return false;
654    }
655
656    public Reference addEndpoint() { // 3
657      Reference t = new Reference();
658      if (this.endpoint == null)
659        this.endpoint = new ArrayList<Reference>();
660      this.endpoint.add(t);
661      return t;
662    }
663
664    public ImagingStudySeriesComponent addEndpoint(Reference t) { // 3
665      if (t == null)
666        return this;
667      if (this.endpoint == null)
668        this.endpoint = new ArrayList<Reference>();
669      this.endpoint.add(t);
670      return this;
671    }
672
673    /**
674     * @return The first repetition of repeating field {@link #endpoint}, creating
675     *         it if it does not already exist
676     */
677    public Reference getEndpointFirstRep() {
678      if (getEndpoint().isEmpty()) {
679        addEndpoint();
680      }
681      return getEndpoint().get(0);
682    }
683
684    /**
685     * @return {@link #bodySite} (The anatomic structures examined. See DICOM Part
686     *         16 Annex L
687     *         (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html)
688     *         for DICOM to SNOMED-CT mappings. The bodySite may indicate the
689     *         laterality of body part imaged; if so, it shall be consistent with
690     *         any content of ImagingStudy.series.laterality.)
691     */
692    public Coding getBodySite() {
693      if (this.bodySite == null)
694        if (Configuration.errorOnAutoCreate())
695          throw new Error("Attempt to auto-create ImagingStudySeriesComponent.bodySite");
696        else if (Configuration.doAutoCreate())
697          this.bodySite = new Coding(); // cc
698      return this.bodySite;
699    }
700
701    public boolean hasBodySite() {
702      return this.bodySite != null && !this.bodySite.isEmpty();
703    }
704
705    /**
706     * @param value {@link #bodySite} (The anatomic structures examined. See DICOM
707     *              Part 16 Annex L
708     *              (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html)
709     *              for DICOM to SNOMED-CT mappings. The bodySite may indicate the
710     *              laterality of body part imaged; if so, it shall be consistent
711     *              with any content of ImagingStudy.series.laterality.)
712     */
713    public ImagingStudySeriesComponent setBodySite(Coding value) {
714      this.bodySite = value;
715      return this;
716    }
717
718    /**
719     * @return {@link #laterality} (The laterality of the (possibly paired) anatomic
720     *         structures examined. E.g., the left knee, both lungs, or unpaired
721     *         abdomen. If present, shall be consistent with any laterality
722     *         information indicated in ImagingStudy.series.bodySite.)
723     */
724    public Coding getLaterality() {
725      if (this.laterality == null)
726        if (Configuration.errorOnAutoCreate())
727          throw new Error("Attempt to auto-create ImagingStudySeriesComponent.laterality");
728        else if (Configuration.doAutoCreate())
729          this.laterality = new Coding(); // cc
730      return this.laterality;
731    }
732
733    public boolean hasLaterality() {
734      return this.laterality != null && !this.laterality.isEmpty();
735    }
736
737    /**
738     * @param value {@link #laterality} (The laterality of the (possibly paired)
739     *              anatomic structures examined. E.g., the left knee, both lungs,
740     *              or unpaired abdomen. If present, shall be consistent with any
741     *              laterality information indicated in
742     *              ImagingStudy.series.bodySite.)
743     */
744    public ImagingStudySeriesComponent setLaterality(Coding value) {
745      this.laterality = value;
746      return this;
747    }
748
749    /**
750     * @return {@link #specimen} (The specimen imaged, e.g., for whole slide imaging
751     *         of a biopsy.)
752     */
753    public List<Reference> getSpecimen() {
754      if (this.specimen == null)
755        this.specimen = new ArrayList<Reference>();
756      return this.specimen;
757    }
758
759    /**
760     * @return Returns a reference to <code>this</code> for easy method chaining
761     */
762    public ImagingStudySeriesComponent setSpecimen(List<Reference> theSpecimen) {
763      this.specimen = theSpecimen;
764      return this;
765    }
766
767    public boolean hasSpecimen() {
768      if (this.specimen == null)
769        return false;
770      for (Reference item : this.specimen)
771        if (!item.isEmpty())
772          return true;
773      return false;
774    }
775
776    public Reference addSpecimen() { // 3
777      Reference t = new Reference();
778      if (this.specimen == null)
779        this.specimen = new ArrayList<Reference>();
780      this.specimen.add(t);
781      return t;
782    }
783
784    public ImagingStudySeriesComponent addSpecimen(Reference t) { // 3
785      if (t == null)
786        return this;
787      if (this.specimen == null)
788        this.specimen = new ArrayList<Reference>();
789      this.specimen.add(t);
790      return this;
791    }
792
793    /**
794     * @return The first repetition of repeating field {@link #specimen}, creating
795     *         it if it does not already exist
796     */
797    public Reference getSpecimenFirstRep() {
798      if (getSpecimen().isEmpty()) {
799        addSpecimen();
800      }
801      return getSpecimen().get(0);
802    }
803
804    /**
805     * @return {@link #started} (The date and time the series was started.). This is
806     *         the underlying object with id, value and extensions. The accessor
807     *         "getStarted" gives direct access to the value
808     */
809    public DateTimeType getStartedElement() {
810      if (this.started == null)
811        if (Configuration.errorOnAutoCreate())
812          throw new Error("Attempt to auto-create ImagingStudySeriesComponent.started");
813        else if (Configuration.doAutoCreate())
814          this.started = new DateTimeType(); // bb
815      return this.started;
816    }
817
818    public boolean hasStartedElement() {
819      return this.started != null && !this.started.isEmpty();
820    }
821
822    public boolean hasStarted() {
823      return this.started != null && !this.started.isEmpty();
824    }
825
826    /**
827     * @param value {@link #started} (The date and time the series was started.).
828     *              This is the underlying object with id, value and extensions. The
829     *              accessor "getStarted" gives direct access to the value
830     */
831    public ImagingStudySeriesComponent setStartedElement(DateTimeType value) {
832      this.started = value;
833      return this;
834    }
835
836    /**
837     * @return The date and time the series was started.
838     */
839    public Date getStarted() {
840      return this.started == null ? null : this.started.getValue();
841    }
842
843    /**
844     * @param value The date and time the series was started.
845     */
846    public ImagingStudySeriesComponent setStarted(Date value) {
847      if (value == null)
848        this.started = null;
849      else {
850        if (this.started == null)
851          this.started = new DateTimeType();
852        this.started.setValue(value);
853      }
854      return this;
855    }
856
857    /**
858     * @return {@link #performer} (Indicates who or what performed the series and
859     *         how they were involved.)
860     */
861    public List<ImagingStudySeriesPerformerComponent> getPerformer() {
862      if (this.performer == null)
863        this.performer = new ArrayList<ImagingStudySeriesPerformerComponent>();
864      return this.performer;
865    }
866
867    /**
868     * @return Returns a reference to <code>this</code> for easy method chaining
869     */
870    public ImagingStudySeriesComponent setPerformer(List<ImagingStudySeriesPerformerComponent> thePerformer) {
871      this.performer = thePerformer;
872      return this;
873    }
874
875    public boolean hasPerformer() {
876      if (this.performer == null)
877        return false;
878      for (ImagingStudySeriesPerformerComponent item : this.performer)
879        if (!item.isEmpty())
880          return true;
881      return false;
882    }
883
884    public ImagingStudySeriesPerformerComponent addPerformer() { // 3
885      ImagingStudySeriesPerformerComponent t = new ImagingStudySeriesPerformerComponent();
886      if (this.performer == null)
887        this.performer = new ArrayList<ImagingStudySeriesPerformerComponent>();
888      this.performer.add(t);
889      return t;
890    }
891
892    public ImagingStudySeriesComponent addPerformer(ImagingStudySeriesPerformerComponent t) { // 3
893      if (t == null)
894        return this;
895      if (this.performer == null)
896        this.performer = new ArrayList<ImagingStudySeriesPerformerComponent>();
897      this.performer.add(t);
898      return this;
899    }
900
901    /**
902     * @return The first repetition of repeating field {@link #performer}, creating
903     *         it if it does not already exist
904     */
905    public ImagingStudySeriesPerformerComponent getPerformerFirstRep() {
906      if (getPerformer().isEmpty()) {
907        addPerformer();
908      }
909      return getPerformer().get(0);
910    }
911
912    /**
913     * @return {@link #instance} (A single SOP instance within the series, e.g. an
914     *         image, or presentation state.)
915     */
916    public List<ImagingStudySeriesInstanceComponent> getInstance() {
917      if (this.instance == null)
918        this.instance = new ArrayList<ImagingStudySeriesInstanceComponent>();
919      return this.instance;
920    }
921
922    /**
923     * @return Returns a reference to <code>this</code> for easy method chaining
924     */
925    public ImagingStudySeriesComponent setInstance(List<ImagingStudySeriesInstanceComponent> theInstance) {
926      this.instance = theInstance;
927      return this;
928    }
929
930    public boolean hasInstance() {
931      if (this.instance == null)
932        return false;
933      for (ImagingStudySeriesInstanceComponent item : this.instance)
934        if (!item.isEmpty())
935          return true;
936      return false;
937    }
938
939    public ImagingStudySeriesInstanceComponent addInstance() { // 3
940      ImagingStudySeriesInstanceComponent t = new ImagingStudySeriesInstanceComponent();
941      if (this.instance == null)
942        this.instance = new ArrayList<ImagingStudySeriesInstanceComponent>();
943      this.instance.add(t);
944      return t;
945    }
946
947    public ImagingStudySeriesComponent addInstance(ImagingStudySeriesInstanceComponent t) { // 3
948      if (t == null)
949        return this;
950      if (this.instance == null)
951        this.instance = new ArrayList<ImagingStudySeriesInstanceComponent>();
952      this.instance.add(t);
953      return this;
954    }
955
956    /**
957     * @return The first repetition of repeating field {@link #instance}, creating
958     *         it if it does not already exist
959     */
960    public ImagingStudySeriesInstanceComponent getInstanceFirstRep() {
961      if (getInstance().isEmpty()) {
962        addInstance();
963      }
964      return getInstance().get(0);
965    }
966
967    protected void listChildren(List<Property> children) {
968      super.listChildren(children);
969      children.add(new Property("uid", "id", "The DICOM Series Instance UID for the series.", 0, 1, uid));
970      children.add(
971          new Property("number", "unsignedInt", "The numeric identifier of this series in the study.", 0, 1, number));
972      children.add(new Property("modality", "Coding", "The modality of this series sequence.", 0, 1, modality));
973      children.add(new Property("description", "string", "A description of the series.", 0, 1, description));
974      children.add(new Property("numberOfInstances", "unsignedInt",
975          "Number of SOP Instances in the Study. The value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present.",
976          0, 1, numberOfInstances));
977      children.add(new Property("endpoint", "Reference(Endpoint)",
978          "The network service providing access (e.g., query, view, or retrieval) for this series. See implementation notes for information about using DICOM endpoints. A series-level endpoint, if present, has precedence over a study-level endpoint with the same Endpoint.connectionType.",
979          0, java.lang.Integer.MAX_VALUE, endpoint));
980      children.add(new Property("bodySite", "Coding",
981          "The anatomic structures examined. See DICOM Part 16 Annex L (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html) for DICOM to SNOMED-CT mappings. The bodySite may indicate the laterality of body part imaged; if so, it shall be consistent with any content of ImagingStudy.series.laterality.",
982          0, 1, bodySite));
983      children.add(new Property("laterality", "Coding",
984          "The laterality of the (possibly paired) anatomic structures examined. E.g., the left knee, both lungs, or unpaired abdomen. If present, shall be consistent with any laterality information indicated in ImagingStudy.series.bodySite.",
985          0, 1, laterality));
986      children.add(new Property("specimen", "Reference(Specimen)",
987          "The specimen imaged, e.g., for whole slide imaging of a biopsy.", 0, java.lang.Integer.MAX_VALUE, specimen));
988      children.add(new Property("started", "dateTime", "The date and time the series was started.", 0, 1, started));
989      children
990          .add(new Property("performer", "", "Indicates who or what performed the series and how they were involved.",
991              0, java.lang.Integer.MAX_VALUE, performer));
992      children.add(
993          new Property("instance", "", "A single SOP instance within the series, e.g. an image, or presentation state.",
994              0, java.lang.Integer.MAX_VALUE, instance));
995    }
996
997    @Override
998    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
999      switch (_hash) {
1000      case 115792:
1001        /* uid */ return new Property("uid", "id", "The DICOM Series Instance UID for the series.", 0, 1, uid);
1002      case -1034364087:
1003        /* number */ return new Property("number", "unsignedInt", "The numeric identifier of this series in the study.",
1004            0, 1, number);
1005      case -622722335:
1006        /* modality */ return new Property("modality", "Coding", "The modality of this series sequence.", 0, 1,
1007            modality);
1008      case -1724546052:
1009        /* description */ return new Property("description", "string", "A description of the series.", 0, 1,
1010            description);
1011      case -1043544226:
1012        /* numberOfInstances */ return new Property("numberOfInstances", "unsignedInt",
1013            "Number of SOP Instances in the Study. The value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present.",
1014            0, 1, numberOfInstances);
1015      case 1741102485:
1016        /* endpoint */ return new Property("endpoint", "Reference(Endpoint)",
1017            "The network service providing access (e.g., query, view, or retrieval) for this series. See implementation notes for information about using DICOM endpoints. A series-level endpoint, if present, has precedence over a study-level endpoint with the same Endpoint.connectionType.",
1018            0, java.lang.Integer.MAX_VALUE, endpoint);
1019      case 1702620169:
1020        /* bodySite */ return new Property("bodySite", "Coding",
1021            "The anatomic structures examined. See DICOM Part 16 Annex L (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html) for DICOM to SNOMED-CT mappings. The bodySite may indicate the laterality of body part imaged; if so, it shall be consistent with any content of ImagingStudy.series.laterality.",
1022            0, 1, bodySite);
1023      case -170291817:
1024        /* laterality */ return new Property("laterality", "Coding",
1025            "The laterality of the (possibly paired) anatomic structures examined. E.g., the left knee, both lungs, or unpaired abdomen. If present, shall be consistent with any laterality information indicated in ImagingStudy.series.bodySite.",
1026            0, 1, laterality);
1027      case -2132868344:
1028        /* specimen */ return new Property("specimen", "Reference(Specimen)",
1029            "The specimen imaged, e.g., for whole slide imaging of a biopsy.", 0, java.lang.Integer.MAX_VALUE,
1030            specimen);
1031      case -1897185151:
1032        /* started */ return new Property("started", "dateTime", "The date and time the series was started.", 0, 1,
1033            started);
1034      case 481140686:
1035        /* performer */ return new Property("performer", "",
1036            "Indicates who or what performed the series and how they were involved.", 0, java.lang.Integer.MAX_VALUE,
1037            performer);
1038      case 555127957:
1039        /* instance */ return new Property("instance", "",
1040            "A single SOP instance within the series, e.g. an image, or presentation state.", 0,
1041            java.lang.Integer.MAX_VALUE, instance);
1042      default:
1043        return super.getNamedProperty(_hash, _name, _checkValid);
1044      }
1045
1046    }
1047
1048    @Override
1049    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1050      switch (hash) {
1051      case 115792:
1052        /* uid */ return this.uid == null ? new Base[0] : new Base[] { this.uid }; // IdType
1053      case -1034364087:
1054        /* number */ return this.number == null ? new Base[0] : new Base[] { this.number }; // UnsignedIntType
1055      case -622722335:
1056        /* modality */ return this.modality == null ? new Base[0] : new Base[] { this.modality }; // Coding
1057      case -1724546052:
1058        /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // StringType
1059      case -1043544226:
1060        /* numberOfInstances */ return this.numberOfInstances == null ? new Base[0]
1061            : new Base[] { this.numberOfInstances }; // UnsignedIntType
1062      case 1741102485:
1063        /* endpoint */ return this.endpoint == null ? new Base[0]
1064            : this.endpoint.toArray(new Base[this.endpoint.size()]); // Reference
1065      case 1702620169:
1066        /* bodySite */ return this.bodySite == null ? new Base[0] : new Base[] { this.bodySite }; // Coding
1067      case -170291817:
1068        /* laterality */ return this.laterality == null ? new Base[0] : new Base[] { this.laterality }; // Coding
1069      case -2132868344:
1070        /* specimen */ return this.specimen == null ? new Base[0]
1071            : this.specimen.toArray(new Base[this.specimen.size()]); // Reference
1072      case -1897185151:
1073        /* started */ return this.started == null ? new Base[0] : new Base[] { this.started }; // DateTimeType
1074      case 481140686:
1075        /* performer */ return this.performer == null ? new Base[0]
1076            : this.performer.toArray(new Base[this.performer.size()]); // ImagingStudySeriesPerformerComponent
1077      case 555127957:
1078        /* instance */ return this.instance == null ? new Base[0]
1079            : this.instance.toArray(new Base[this.instance.size()]); // ImagingStudySeriesInstanceComponent
1080      default:
1081        return super.getProperty(hash, name, checkValid);
1082      }
1083
1084    }
1085
1086    @Override
1087    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1088      switch (hash) {
1089      case 115792: // uid
1090        this.uid = castToId(value); // IdType
1091        return value;
1092      case -1034364087: // number
1093        this.number = castToUnsignedInt(value); // UnsignedIntType
1094        return value;
1095      case -622722335: // modality
1096        this.modality = castToCoding(value); // Coding
1097        return value;
1098      case -1724546052: // description
1099        this.description = castToString(value); // StringType
1100        return value;
1101      case -1043544226: // numberOfInstances
1102        this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType
1103        return value;
1104      case 1741102485: // endpoint
1105        this.getEndpoint().add(castToReference(value)); // Reference
1106        return value;
1107      case 1702620169: // bodySite
1108        this.bodySite = castToCoding(value); // Coding
1109        return value;
1110      case -170291817: // laterality
1111        this.laterality = castToCoding(value); // Coding
1112        return value;
1113      case -2132868344: // specimen
1114        this.getSpecimen().add(castToReference(value)); // Reference
1115        return value;
1116      case -1897185151: // started
1117        this.started = castToDateTime(value); // DateTimeType
1118        return value;
1119      case 481140686: // performer
1120        this.getPerformer().add((ImagingStudySeriesPerformerComponent) value); // ImagingStudySeriesPerformerComponent
1121        return value;
1122      case 555127957: // instance
1123        this.getInstance().add((ImagingStudySeriesInstanceComponent) value); // ImagingStudySeriesInstanceComponent
1124        return value;
1125      default:
1126        return super.setProperty(hash, name, value);
1127      }
1128
1129    }
1130
1131    @Override
1132    public Base setProperty(String name, Base value) throws FHIRException {
1133      if (name.equals("uid")) {
1134        this.uid = castToId(value); // IdType
1135      } else if (name.equals("number")) {
1136        this.number = castToUnsignedInt(value); // UnsignedIntType
1137      } else if (name.equals("modality")) {
1138        this.modality = castToCoding(value); // Coding
1139      } else if (name.equals("description")) {
1140        this.description = castToString(value); // StringType
1141      } else if (name.equals("numberOfInstances")) {
1142        this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType
1143      } else if (name.equals("endpoint")) {
1144        this.getEndpoint().add(castToReference(value));
1145      } else if (name.equals("bodySite")) {
1146        this.bodySite = castToCoding(value); // Coding
1147      } else if (name.equals("laterality")) {
1148        this.laterality = castToCoding(value); // Coding
1149      } else if (name.equals("specimen")) {
1150        this.getSpecimen().add(castToReference(value));
1151      } else if (name.equals("started")) {
1152        this.started = castToDateTime(value); // DateTimeType
1153      } else if (name.equals("performer")) {
1154        this.getPerformer().add((ImagingStudySeriesPerformerComponent) value);
1155      } else if (name.equals("instance")) {
1156        this.getInstance().add((ImagingStudySeriesInstanceComponent) value);
1157      } else
1158        return super.setProperty(name, value);
1159      return value;
1160    }
1161
1162  @Override
1163  public void removeChild(String name, Base value) throws FHIRException {
1164      if (name.equals("uid")) {
1165        this.uid = null;
1166      } else if (name.equals("number")) {
1167        this.number = null;
1168      } else if (name.equals("modality")) {
1169        this.modality = null;
1170      } else if (name.equals("description")) {
1171        this.description = null;
1172      } else if (name.equals("numberOfInstances")) {
1173        this.numberOfInstances = null;
1174      } else if (name.equals("endpoint")) {
1175        this.getEndpoint().remove(castToReference(value));
1176      } else if (name.equals("bodySite")) {
1177        this.bodySite = null;
1178      } else if (name.equals("laterality")) {
1179        this.laterality = null;
1180      } else if (name.equals("specimen")) {
1181        this.getSpecimen().remove(castToReference(value));
1182      } else if (name.equals("started")) {
1183        this.started = null;
1184      } else if (name.equals("performer")) {
1185        this.getPerformer().remove((ImagingStudySeriesPerformerComponent) value);
1186      } else if (name.equals("instance")) {
1187        this.getInstance().remove((ImagingStudySeriesInstanceComponent) value);
1188      } else
1189        super.removeChild(name, value);
1190      
1191    }
1192
1193    @Override
1194    public Base makeProperty(int hash, String name) throws FHIRException {
1195      switch (hash) {
1196      case 115792:
1197        return getUidElement();
1198      case -1034364087:
1199        return getNumberElement();
1200      case -622722335:
1201        return getModality();
1202      case -1724546052:
1203        return getDescriptionElement();
1204      case -1043544226:
1205        return getNumberOfInstancesElement();
1206      case 1741102485:
1207        return addEndpoint();
1208      case 1702620169:
1209        return getBodySite();
1210      case -170291817:
1211        return getLaterality();
1212      case -2132868344:
1213        return addSpecimen();
1214      case -1897185151:
1215        return getStartedElement();
1216      case 481140686:
1217        return addPerformer();
1218      case 555127957:
1219        return addInstance();
1220      default:
1221        return super.makeProperty(hash, name);
1222      }
1223
1224    }
1225
1226    @Override
1227    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1228      switch (hash) {
1229      case 115792:
1230        /* uid */ return new String[] { "id" };
1231      case -1034364087:
1232        /* number */ return new String[] { "unsignedInt" };
1233      case -622722335:
1234        /* modality */ return new String[] { "Coding" };
1235      case -1724546052:
1236        /* description */ return new String[] { "string" };
1237      case -1043544226:
1238        /* numberOfInstances */ return new String[] { "unsignedInt" };
1239      case 1741102485:
1240        /* endpoint */ return new String[] { "Reference" };
1241      case 1702620169:
1242        /* bodySite */ return new String[] { "Coding" };
1243      case -170291817:
1244        /* laterality */ return new String[] { "Coding" };
1245      case -2132868344:
1246        /* specimen */ return new String[] { "Reference" };
1247      case -1897185151:
1248        /* started */ return new String[] { "dateTime" };
1249      case 481140686:
1250        /* performer */ return new String[] {};
1251      case 555127957:
1252        /* instance */ return new String[] {};
1253      default:
1254        return super.getTypesForProperty(hash, name);
1255      }
1256
1257    }
1258
1259    @Override
1260    public Base addChild(String name) throws FHIRException {
1261      if (name.equals("uid")) {
1262        throw new FHIRException("Cannot call addChild on a singleton property ImagingStudy.uid");
1263      } else if (name.equals("number")) {
1264        throw new FHIRException("Cannot call addChild on a singleton property ImagingStudy.number");
1265      } else if (name.equals("modality")) {
1266        this.modality = new Coding();
1267        return this.modality;
1268      } else if (name.equals("description")) {
1269        throw new FHIRException("Cannot call addChild on a singleton property ImagingStudy.description");
1270      } else if (name.equals("numberOfInstances")) {
1271        throw new FHIRException("Cannot call addChild on a singleton property ImagingStudy.numberOfInstances");
1272      } else if (name.equals("endpoint")) {
1273        return addEndpoint();
1274      } else if (name.equals("bodySite")) {
1275        this.bodySite = new Coding();
1276        return this.bodySite;
1277      } else if (name.equals("laterality")) {
1278        this.laterality = new Coding();
1279        return this.laterality;
1280      } else if (name.equals("specimen")) {
1281        return addSpecimen();
1282      } else if (name.equals("started")) {
1283        throw new FHIRException("Cannot call addChild on a singleton property ImagingStudy.started");
1284      } else if (name.equals("performer")) {
1285        return addPerformer();
1286      } else if (name.equals("instance")) {
1287        return addInstance();
1288      } else
1289        return super.addChild(name);
1290    }
1291
1292    public ImagingStudySeriesComponent copy() {
1293      ImagingStudySeriesComponent dst = new ImagingStudySeriesComponent();
1294      copyValues(dst);
1295      return dst;
1296    }
1297
1298    public void copyValues(ImagingStudySeriesComponent dst) {
1299      super.copyValues(dst);
1300      dst.uid = uid == null ? null : uid.copy();
1301      dst.number = number == null ? null : number.copy();
1302      dst.modality = modality == null ? null : modality.copy();
1303      dst.description = description == null ? null : description.copy();
1304      dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy();
1305      if (endpoint != null) {
1306        dst.endpoint = new ArrayList<Reference>();
1307        for (Reference i : endpoint)
1308          dst.endpoint.add(i.copy());
1309      }
1310      ;
1311      dst.bodySite = bodySite == null ? null : bodySite.copy();
1312      dst.laterality = laterality == null ? null : laterality.copy();
1313      if (specimen != null) {
1314        dst.specimen = new ArrayList<Reference>();
1315        for (Reference i : specimen)
1316          dst.specimen.add(i.copy());
1317      }
1318      ;
1319      dst.started = started == null ? null : started.copy();
1320      if (performer != null) {
1321        dst.performer = new ArrayList<ImagingStudySeriesPerformerComponent>();
1322        for (ImagingStudySeriesPerformerComponent i : performer)
1323          dst.performer.add(i.copy());
1324      }
1325      ;
1326      if (instance != null) {
1327        dst.instance = new ArrayList<ImagingStudySeriesInstanceComponent>();
1328        for (ImagingStudySeriesInstanceComponent i : instance)
1329          dst.instance.add(i.copy());
1330      }
1331      ;
1332    }
1333
1334    @Override
1335    public boolean equalsDeep(Base other_) {
1336      if (!super.equalsDeep(other_))
1337        return false;
1338      if (!(other_ instanceof ImagingStudySeriesComponent))
1339        return false;
1340      ImagingStudySeriesComponent o = (ImagingStudySeriesComponent) other_;
1341      return compareDeep(uid, o.uid, true) && compareDeep(number, o.number, true)
1342          && compareDeep(modality, o.modality, true) && compareDeep(description, o.description, true)
1343          && compareDeep(numberOfInstances, o.numberOfInstances, true) && compareDeep(endpoint, o.endpoint, true)
1344          && compareDeep(bodySite, o.bodySite, true) && compareDeep(laterality, o.laterality, true)
1345          && compareDeep(specimen, o.specimen, true) && compareDeep(started, o.started, true)
1346          && compareDeep(performer, o.performer, true) && compareDeep(instance, o.instance, true);
1347    }
1348
1349    @Override
1350    public boolean equalsShallow(Base other_) {
1351      if (!super.equalsShallow(other_))
1352        return false;
1353      if (!(other_ instanceof ImagingStudySeriesComponent))
1354        return false;
1355      ImagingStudySeriesComponent o = (ImagingStudySeriesComponent) other_;
1356      return compareValues(uid, o.uid, true) && compareValues(number, o.number, true)
1357          && compareValues(description, o.description, true)
1358          && compareValues(numberOfInstances, o.numberOfInstances, true) && compareValues(started, o.started, true);
1359    }
1360
1361    public boolean isEmpty() {
1362      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(uid, number, modality, description,
1363          numberOfInstances, endpoint, bodySite, laterality, specimen, started, performer, instance);
1364    }
1365
1366    public String fhirType() {
1367      return "ImagingStudy.series";
1368
1369    }
1370
1371  }
1372
1373  @Block()
1374  public static class ImagingStudySeriesPerformerComponent extends BackboneElement implements IBaseBackboneElement {
1375    /**
1376     * Distinguishes the type of involvement of the performer in the series.
1377     */
1378    @Child(name = "function", type = {
1379        CodeableConcept.class }, order = 1, min = 0, max = 1, modifier = false, summary = true)
1380    @Description(shortDefinition = "Type of performance", formalDefinition = "Distinguishes the type of involvement of the performer in the series.")
1381    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/series-performer-function")
1382    protected CodeableConcept function;
1383
1384    /**
1385     * Indicates who or what performed the series.
1386     */
1387    @Child(name = "actor", type = { Practitioner.class, PractitionerRole.class, Organization.class, CareTeam.class,
1388        Patient.class, Device.class,
1389        RelatedPerson.class }, order = 2, min = 1, max = 1, modifier = false, summary = true)
1390    @Description(shortDefinition = "Who performed the series", formalDefinition = "Indicates who or what performed the series.")
1391    protected Reference actor;
1392
1393    /**
1394     * The actual object that is the target of the reference (Indicates who or what
1395     * performed the series.)
1396     */
1397    protected Resource actorTarget;
1398
1399    private static final long serialVersionUID = 1424001049L;
1400
1401    /**
1402     * Constructor
1403     */
1404    public ImagingStudySeriesPerformerComponent() {
1405      super();
1406    }
1407
1408    /**
1409     * Constructor
1410     */
1411    public ImagingStudySeriesPerformerComponent(Reference actor) {
1412      super();
1413      this.actor = actor;
1414    }
1415
1416    /**
1417     * @return {@link #function} (Distinguishes the type of involvement of the
1418     *         performer in the series.)
1419     */
1420    public CodeableConcept getFunction() {
1421      if (this.function == null)
1422        if (Configuration.errorOnAutoCreate())
1423          throw new Error("Attempt to auto-create ImagingStudySeriesPerformerComponent.function");
1424        else if (Configuration.doAutoCreate())
1425          this.function = new CodeableConcept(); // cc
1426      return this.function;
1427    }
1428
1429    public boolean hasFunction() {
1430      return this.function != null && !this.function.isEmpty();
1431    }
1432
1433    /**
1434     * @param value {@link #function} (Distinguishes the type of involvement of the
1435     *              performer in the series.)
1436     */
1437    public ImagingStudySeriesPerformerComponent setFunction(CodeableConcept value) {
1438      this.function = value;
1439      return this;
1440    }
1441
1442    /**
1443     * @return {@link #actor} (Indicates who or what performed the series.)
1444     */
1445    public Reference getActor() {
1446      if (this.actor == null)
1447        if (Configuration.errorOnAutoCreate())
1448          throw new Error("Attempt to auto-create ImagingStudySeriesPerformerComponent.actor");
1449        else if (Configuration.doAutoCreate())
1450          this.actor = new Reference(); // cc
1451      return this.actor;
1452    }
1453
1454    public boolean hasActor() {
1455      return this.actor != null && !this.actor.isEmpty();
1456    }
1457
1458    /**
1459     * @param value {@link #actor} (Indicates who or what performed the series.)
1460     */
1461    public ImagingStudySeriesPerformerComponent setActor(Reference value) {
1462      this.actor = value;
1463      return this;
1464    }
1465
1466    /**
1467     * @return {@link #actor} The actual object that is the target of the reference.
1468     *         The reference library doesn't populate this, but you can use it to
1469     *         hold the resource if you resolve it. (Indicates who or what performed
1470     *         the series.)
1471     */
1472    public Resource getActorTarget() {
1473      return this.actorTarget;
1474    }
1475
1476    /**
1477     * @param value {@link #actor} The actual object that is the target of the
1478     *              reference. The reference library doesn't use these, but you can
1479     *              use it to hold the resource if you resolve it. (Indicates who or
1480     *              what performed the series.)
1481     */
1482    public ImagingStudySeriesPerformerComponent setActorTarget(Resource value) {
1483      this.actorTarget = value;
1484      return this;
1485    }
1486
1487    protected void listChildren(List<Property> children) {
1488      super.listChildren(children);
1489      children.add(new Property("function", "CodeableConcept",
1490          "Distinguishes the type of involvement of the performer in the series.", 0, 1, function));
1491      children.add(new Property("actor",
1492          "Reference(Practitioner|PractitionerRole|Organization|CareTeam|Patient|Device|RelatedPerson)",
1493          "Indicates who or what performed the series.", 0, 1, actor));
1494    }
1495
1496    @Override
1497    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1498      switch (_hash) {
1499      case 1380938712:
1500        /* function */ return new Property("function", "CodeableConcept",
1501            "Distinguishes the type of involvement of the performer in the series.", 0, 1, function);
1502      case 92645877:
1503        /* actor */ return new Property("actor",
1504            "Reference(Practitioner|PractitionerRole|Organization|CareTeam|Patient|Device|RelatedPerson)",
1505            "Indicates who or what performed the series.", 0, 1, actor);
1506      default:
1507        return super.getNamedProperty(_hash, _name, _checkValid);
1508      }
1509
1510    }
1511
1512    @Override
1513    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1514      switch (hash) {
1515      case 1380938712:
1516        /* function */ return this.function == null ? new Base[0] : new Base[] { this.function }; // CodeableConcept
1517      case 92645877:
1518        /* actor */ return this.actor == null ? new Base[0] : new Base[] { this.actor }; // Reference
1519      default:
1520        return super.getProperty(hash, name, checkValid);
1521      }
1522
1523    }
1524
1525    @Override
1526    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1527      switch (hash) {
1528      case 1380938712: // function
1529        this.function = castToCodeableConcept(value); // CodeableConcept
1530        return value;
1531      case 92645877: // actor
1532        this.actor = castToReference(value); // Reference
1533        return value;
1534      default:
1535        return super.setProperty(hash, name, value);
1536      }
1537
1538    }
1539
1540    @Override
1541    public Base setProperty(String name, Base value) throws FHIRException {
1542      if (name.equals("function")) {
1543        this.function = castToCodeableConcept(value); // CodeableConcept
1544      } else if (name.equals("actor")) {
1545        this.actor = castToReference(value); // Reference
1546      } else
1547        return super.setProperty(name, value);
1548      return value;
1549    }
1550
1551  @Override
1552  public void removeChild(String name, Base value) throws FHIRException {
1553      if (name.equals("function")) {
1554        this.function = null;
1555      } else if (name.equals("actor")) {
1556        this.actor = null;
1557      } else
1558        super.removeChild(name, value);
1559      
1560    }
1561
1562    @Override
1563    public Base makeProperty(int hash, String name) throws FHIRException {
1564      switch (hash) {
1565      case 1380938712:
1566        return getFunction();
1567      case 92645877:
1568        return getActor();
1569      default:
1570        return super.makeProperty(hash, name);
1571      }
1572
1573    }
1574
1575    @Override
1576    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1577      switch (hash) {
1578      case 1380938712:
1579        /* function */ return new String[] { "CodeableConcept" };
1580      case 92645877:
1581        /* actor */ return new String[] { "Reference" };
1582      default:
1583        return super.getTypesForProperty(hash, name);
1584      }
1585
1586    }
1587
1588    @Override
1589    public Base addChild(String name) throws FHIRException {
1590      if (name.equals("function")) {
1591        this.function = new CodeableConcept();
1592        return this.function;
1593      } else if (name.equals("actor")) {
1594        this.actor = new Reference();
1595        return this.actor;
1596      } else
1597        return super.addChild(name);
1598    }
1599
1600    public ImagingStudySeriesPerformerComponent copy() {
1601      ImagingStudySeriesPerformerComponent dst = new ImagingStudySeriesPerformerComponent();
1602      copyValues(dst);
1603      return dst;
1604    }
1605
1606    public void copyValues(ImagingStudySeriesPerformerComponent dst) {
1607      super.copyValues(dst);
1608      dst.function = function == null ? null : function.copy();
1609      dst.actor = actor == null ? null : actor.copy();
1610    }
1611
1612    @Override
1613    public boolean equalsDeep(Base other_) {
1614      if (!super.equalsDeep(other_))
1615        return false;
1616      if (!(other_ instanceof ImagingStudySeriesPerformerComponent))
1617        return false;
1618      ImagingStudySeriesPerformerComponent o = (ImagingStudySeriesPerformerComponent) other_;
1619      return compareDeep(function, o.function, true) && compareDeep(actor, o.actor, true);
1620    }
1621
1622    @Override
1623    public boolean equalsShallow(Base other_) {
1624      if (!super.equalsShallow(other_))
1625        return false;
1626      if (!(other_ instanceof ImagingStudySeriesPerformerComponent))
1627        return false;
1628      ImagingStudySeriesPerformerComponent o = (ImagingStudySeriesPerformerComponent) other_;
1629      return true;
1630    }
1631
1632    public boolean isEmpty() {
1633      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(function, actor);
1634    }
1635
1636    public String fhirType() {
1637      return "ImagingStudy.series.performer";
1638
1639    }
1640
1641  }
1642
1643  @Block()
1644  public static class ImagingStudySeriesInstanceComponent extends BackboneElement implements IBaseBackboneElement {
1645    /**
1646     * The DICOM SOP Instance UID for this image or other DICOM content.
1647     */
1648    @Child(name = "uid", type = { IdType.class }, order = 1, min = 1, max = 1, modifier = false, summary = false)
1649    @Description(shortDefinition = "DICOM SOP Instance UID", formalDefinition = "The DICOM SOP Instance UID for this image or other DICOM content.")
1650    protected IdType uid;
1651
1652    /**
1653     * DICOM instance type.
1654     */
1655    @Child(name = "sopClass", type = { Coding.class }, order = 2, min = 1, max = 1, modifier = false, summary = false)
1656    @Description(shortDefinition = "DICOM class type", formalDefinition = "DICOM instance  type.")
1657    protected Coding sopClass;
1658
1659    /**
1660     * The number of instance in the series.
1661     */
1662    @Child(name = "number", type = {
1663        UnsignedIntType.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
1664    @Description(shortDefinition = "The number of this instance in the series", formalDefinition = "The number of instance in the series.")
1665    protected UnsignedIntType number;
1666
1667    /**
1668     * The description of the instance.
1669     */
1670    @Child(name = "title", type = { StringType.class }, order = 4, min = 0, max = 1, modifier = false, summary = false)
1671    @Description(shortDefinition = "Description of instance", formalDefinition = "The description of the instance.")
1672    protected StringType title;
1673
1674    private static final long serialVersionUID = -888152445L;
1675
1676    /**
1677     * Constructor
1678     */
1679    public ImagingStudySeriesInstanceComponent() {
1680      super();
1681    }
1682
1683    /**
1684     * Constructor
1685     */
1686    public ImagingStudySeriesInstanceComponent(IdType uid, Coding sopClass) {
1687      super();
1688      this.uid = uid;
1689      this.sopClass = sopClass;
1690    }
1691
1692    /**
1693     * @return {@link #uid} (The DICOM SOP Instance UID for this image or other
1694     *         DICOM content.). This is the underlying object with id, value and
1695     *         extensions. The accessor "getUid" gives direct access to the value
1696     */
1697    public IdType getUidElement() {
1698      if (this.uid == null)
1699        if (Configuration.errorOnAutoCreate())
1700          throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.uid");
1701        else if (Configuration.doAutoCreate())
1702          this.uid = new IdType(); // bb
1703      return this.uid;
1704    }
1705
1706    public boolean hasUidElement() {
1707      return this.uid != null && !this.uid.isEmpty();
1708    }
1709
1710    public boolean hasUid() {
1711      return this.uid != null && !this.uid.isEmpty();
1712    }
1713
1714    /**
1715     * @param value {@link #uid} (The DICOM SOP Instance UID for this image or other
1716     *              DICOM content.). This is the underlying object with id, value
1717     *              and extensions. The accessor "getUid" gives direct access to the
1718     *              value
1719     */
1720    public ImagingStudySeriesInstanceComponent setUidElement(IdType value) {
1721      this.uid = value;
1722      return this;
1723    }
1724
1725    /**
1726     * @return The DICOM SOP Instance UID for this image or other DICOM content.
1727     */
1728    public String getUid() {
1729      return this.uid == null ? null : this.uid.getValue();
1730    }
1731
1732    /**
1733     * @param value The DICOM SOP Instance UID for this image or other DICOM
1734     *              content.
1735     */
1736    public ImagingStudySeriesInstanceComponent setUid(String value) {
1737      if (this.uid == null)
1738        this.uid = new IdType();
1739      this.uid.setValue(value);
1740      return this;
1741    }
1742
1743    /**
1744     * @return {@link #sopClass} (DICOM instance type.)
1745     */
1746    public Coding getSopClass() {
1747      if (this.sopClass == null)
1748        if (Configuration.errorOnAutoCreate())
1749          throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.sopClass");
1750        else if (Configuration.doAutoCreate())
1751          this.sopClass = new Coding(); // cc
1752      return this.sopClass;
1753    }
1754
1755    public boolean hasSopClass() {
1756      return this.sopClass != null && !this.sopClass.isEmpty();
1757    }
1758
1759    /**
1760     * @param value {@link #sopClass} (DICOM instance type.)
1761     */
1762    public ImagingStudySeriesInstanceComponent setSopClass(Coding value) {
1763      this.sopClass = value;
1764      return this;
1765    }
1766
1767    /**
1768     * @return {@link #number} (The number of instance in the series.). This is the
1769     *         underlying object with id, value and extensions. The accessor
1770     *         "getNumber" gives direct access to the value
1771     */
1772    public UnsignedIntType getNumberElement() {
1773      if (this.number == null)
1774        if (Configuration.errorOnAutoCreate())
1775          throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.number");
1776        else if (Configuration.doAutoCreate())
1777          this.number = new UnsignedIntType(); // bb
1778      return this.number;
1779    }
1780
1781    public boolean hasNumberElement() {
1782      return this.number != null && !this.number.isEmpty();
1783    }
1784
1785    public boolean hasNumber() {
1786      return this.number != null && !this.number.isEmpty();
1787    }
1788
1789    /**
1790     * @param value {@link #number} (The number of instance in the series.). This is
1791     *              the underlying object with id, value and extensions. The
1792     *              accessor "getNumber" gives direct access to the value
1793     */
1794    public ImagingStudySeriesInstanceComponent setNumberElement(UnsignedIntType value) {
1795      this.number = value;
1796      return this;
1797    }
1798
1799    /**
1800     * @return The number of instance in the series.
1801     */
1802    public int getNumber() {
1803      return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue();
1804    }
1805
1806    /**
1807     * @param value The number of instance in the series.
1808     */
1809    public ImagingStudySeriesInstanceComponent setNumber(int value) {
1810      if (this.number == null)
1811        this.number = new UnsignedIntType();
1812      this.number.setValue(value);
1813      return this;
1814    }
1815
1816    /**
1817     * @return {@link #title} (The description of the instance.). This is the
1818     *         underlying object with id, value and extensions. The accessor
1819     *         "getTitle" gives direct access to the value
1820     */
1821    public StringType getTitleElement() {
1822      if (this.title == null)
1823        if (Configuration.errorOnAutoCreate())
1824          throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.title");
1825        else if (Configuration.doAutoCreate())
1826          this.title = new StringType(); // bb
1827      return this.title;
1828    }
1829
1830    public boolean hasTitleElement() {
1831      return this.title != null && !this.title.isEmpty();
1832    }
1833
1834    public boolean hasTitle() {
1835      return this.title != null && !this.title.isEmpty();
1836    }
1837
1838    /**
1839     * @param value {@link #title} (The description of the instance.). This is the
1840     *              underlying object with id, value and extensions. The accessor
1841     *              "getTitle" gives direct access to the value
1842     */
1843    public ImagingStudySeriesInstanceComponent setTitleElement(StringType value) {
1844      this.title = value;
1845      return this;
1846    }
1847
1848    /**
1849     * @return The description of the instance.
1850     */
1851    public String getTitle() {
1852      return this.title == null ? null : this.title.getValue();
1853    }
1854
1855    /**
1856     * @param value The description of the instance.
1857     */
1858    public ImagingStudySeriesInstanceComponent setTitle(String value) {
1859      if (Utilities.noString(value))
1860        this.title = null;
1861      else {
1862        if (this.title == null)
1863          this.title = new StringType();
1864        this.title.setValue(value);
1865      }
1866      return this;
1867    }
1868
1869    protected void listChildren(List<Property> children) {
1870      super.listChildren(children);
1871      children.add(
1872          new Property("uid", "id", "The DICOM SOP Instance UID for this image or other DICOM content.", 0, 1, uid));
1873      children.add(new Property("sopClass", "Coding", "DICOM instance  type.", 0, 1, sopClass));
1874      children.add(new Property("number", "unsignedInt", "The number of instance in the series.", 0, 1, number));
1875      children.add(new Property("title", "string", "The description of the instance.", 0, 1, title));
1876    }
1877
1878    @Override
1879    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1880      switch (_hash) {
1881      case 115792:
1882        /* uid */ return new Property("uid", "id", "The DICOM SOP Instance UID for this image or other DICOM content.",
1883            0, 1, uid);
1884      case 1560041540:
1885        /* sopClass */ return new Property("sopClass", "Coding", "DICOM instance  type.", 0, 1, sopClass);
1886      case -1034364087:
1887        /* number */ return new Property("number", "unsignedInt", "The number of instance in the series.", 0, 1,
1888            number);
1889      case 110371416:
1890        /* title */ return new Property("title", "string", "The description of the instance.", 0, 1, title);
1891      default:
1892        return super.getNamedProperty(_hash, _name, _checkValid);
1893      }
1894
1895    }
1896
1897    @Override
1898    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1899      switch (hash) {
1900      case 115792:
1901        /* uid */ return this.uid == null ? new Base[0] : new Base[] { this.uid }; // IdType
1902      case 1560041540:
1903        /* sopClass */ return this.sopClass == null ? new Base[0] : new Base[] { this.sopClass }; // Coding
1904      case -1034364087:
1905        /* number */ return this.number == null ? new Base[0] : new Base[] { this.number }; // UnsignedIntType
1906      case 110371416:
1907        /* title */ return this.title == null ? new Base[0] : new Base[] { this.title }; // StringType
1908      default:
1909        return super.getProperty(hash, name, checkValid);
1910      }
1911
1912    }
1913
1914    @Override
1915    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1916      switch (hash) {
1917      case 115792: // uid
1918        this.uid = castToId(value); // IdType
1919        return value;
1920      case 1560041540: // sopClass
1921        this.sopClass = castToCoding(value); // Coding
1922        return value;
1923      case -1034364087: // number
1924        this.number = castToUnsignedInt(value); // UnsignedIntType
1925        return value;
1926      case 110371416: // title
1927        this.title = castToString(value); // StringType
1928        return value;
1929      default:
1930        return super.setProperty(hash, name, value);
1931      }
1932
1933    }
1934
1935    @Override
1936    public Base setProperty(String name, Base value) throws FHIRException {
1937      if (name.equals("uid")) {
1938        this.uid = castToId(value); // IdType
1939      } else if (name.equals("sopClass")) {
1940        this.sopClass = castToCoding(value); // Coding
1941      } else if (name.equals("number")) {
1942        this.number = castToUnsignedInt(value); // UnsignedIntType
1943      } else if (name.equals("title")) {
1944        this.title = castToString(value); // StringType
1945      } else
1946        return super.setProperty(name, value);
1947      return value;
1948    }
1949
1950  @Override
1951  public void removeChild(String name, Base value) throws FHIRException {
1952      if (name.equals("uid")) {
1953        this.uid = null;
1954      } else if (name.equals("sopClass")) {
1955        this.sopClass = null;
1956      } else if (name.equals("number")) {
1957        this.number = null;
1958      } else if (name.equals("title")) {
1959        this.title = null;
1960      } else
1961        super.removeChild(name, value);
1962      
1963    }
1964
1965    @Override
1966    public Base makeProperty(int hash, String name) throws FHIRException {
1967      switch (hash) {
1968      case 115792:
1969        return getUidElement();
1970      case 1560041540:
1971        return getSopClass();
1972      case -1034364087:
1973        return getNumberElement();
1974      case 110371416:
1975        return getTitleElement();
1976      default:
1977        return super.makeProperty(hash, name);
1978      }
1979
1980    }
1981
1982    @Override
1983    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1984      switch (hash) {
1985      case 115792:
1986        /* uid */ return new String[] { "id" };
1987      case 1560041540:
1988        /* sopClass */ return new String[] { "Coding" };
1989      case -1034364087:
1990        /* number */ return new String[] { "unsignedInt" };
1991      case 110371416:
1992        /* title */ return new String[] { "string" };
1993      default:
1994        return super.getTypesForProperty(hash, name);
1995      }
1996
1997    }
1998
1999    @Override
2000    public Base addChild(String name) throws FHIRException {
2001      if (name.equals("uid")) {
2002        throw new FHIRException("Cannot call addChild on a singleton property ImagingStudy.uid");
2003      } else if (name.equals("sopClass")) {
2004        this.sopClass = new Coding();
2005        return this.sopClass;
2006      } else if (name.equals("number")) {
2007        throw new FHIRException("Cannot call addChild on a singleton property ImagingStudy.number");
2008      } else if (name.equals("title")) {
2009        throw new FHIRException("Cannot call addChild on a singleton property ImagingStudy.title");
2010      } else
2011        return super.addChild(name);
2012    }
2013
2014    public ImagingStudySeriesInstanceComponent copy() {
2015      ImagingStudySeriesInstanceComponent dst = new ImagingStudySeriesInstanceComponent();
2016      copyValues(dst);
2017      return dst;
2018    }
2019
2020    public void copyValues(ImagingStudySeriesInstanceComponent dst) {
2021      super.copyValues(dst);
2022      dst.uid = uid == null ? null : uid.copy();
2023      dst.sopClass = sopClass == null ? null : sopClass.copy();
2024      dst.number = number == null ? null : number.copy();
2025      dst.title = title == null ? null : title.copy();
2026    }
2027
2028    @Override
2029    public boolean equalsDeep(Base other_) {
2030      if (!super.equalsDeep(other_))
2031        return false;
2032      if (!(other_ instanceof ImagingStudySeriesInstanceComponent))
2033        return false;
2034      ImagingStudySeriesInstanceComponent o = (ImagingStudySeriesInstanceComponent) other_;
2035      return compareDeep(uid, o.uid, true) && compareDeep(sopClass, o.sopClass, true)
2036          && compareDeep(number, o.number, true) && compareDeep(title, o.title, true);
2037    }
2038
2039    @Override
2040    public boolean equalsShallow(Base other_) {
2041      if (!super.equalsShallow(other_))
2042        return false;
2043      if (!(other_ instanceof ImagingStudySeriesInstanceComponent))
2044        return false;
2045      ImagingStudySeriesInstanceComponent o = (ImagingStudySeriesInstanceComponent) other_;
2046      return compareValues(uid, o.uid, true) && compareValues(number, o.number, true)
2047          && compareValues(title, o.title, true);
2048    }
2049
2050    public boolean isEmpty() {
2051      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(uid, sopClass, number, title);
2052    }
2053
2054    public String fhirType() {
2055      return "ImagingStudy.series.instance";
2056
2057    }
2058
2059  }
2060
2061  /**
2062   * Identifiers for the ImagingStudy such as DICOM Study Instance UID, and
2063   * Accession Number.
2064   */
2065  @Child(name = "identifier", type = {
2066      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
2067  @Description(shortDefinition = "Identifiers for the whole study", formalDefinition = "Identifiers for the ImagingStudy such as DICOM Study Instance UID, and Accession Number.")
2068  protected List<Identifier> identifier;
2069
2070  /**
2071   * The current state of the ImagingStudy.
2072   */
2073  @Child(name = "status", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = true, summary = true)
2074  @Description(shortDefinition = "registered | available | cancelled | entered-in-error | unknown", formalDefinition = "The current state of the ImagingStudy.")
2075  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/imagingstudy-status")
2076  protected Enumeration<ImagingStudyStatus> status;
2077
2078  /**
2079   * A list of all the series.modality values that are actual acquisition
2080   * modalities, i.e. those in the DICOM Context Group 29 (value set OID
2081   * 1.2.840.10008.6.1.19).
2082   */
2083  @Child(name = "modality", type = {
2084      Coding.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
2085  @Description(shortDefinition = "All series modality if actual acquisition modalities", formalDefinition = "A list of all the series.modality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).")
2086  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://dicom.nema.org/medical/dicom/current/output/chtml/part16/sect_CID_29.html")
2087  protected List<Coding> modality;
2088
2089  /**
2090   * The subject, typically a patient, of the imaging study.
2091   */
2092  @Child(name = "subject", type = { Patient.class, Device.class,
2093      Group.class }, order = 3, min = 1, max = 1, modifier = false, summary = true)
2094  @Description(shortDefinition = "Who or what is the subject of the study", formalDefinition = "The subject, typically a patient, of the imaging study.")
2095  protected Reference subject;
2096
2097  /**
2098   * The actual object that is the target of the reference (The subject, typically
2099   * a patient, of the imaging study.)
2100   */
2101  protected Resource subjectTarget;
2102
2103  /**
2104   * The healthcare event (e.g. a patient and healthcare provider interaction)
2105   * during which this ImagingStudy is made.
2106   */
2107  @Child(name = "encounter", type = { Encounter.class }, order = 4, min = 0, max = 1, modifier = false, summary = true)
2108  @Description(shortDefinition = "Encounter with which this imaging study is associated", formalDefinition = "The healthcare event (e.g. a patient and healthcare provider interaction) during which this ImagingStudy is made.")
2109  protected Reference encounter;
2110
2111  /**
2112   * The actual object that is the target of the reference (The healthcare event
2113   * (e.g. a patient and healthcare provider interaction) during which this
2114   * ImagingStudy is made.)
2115   */
2116  protected Encounter encounterTarget;
2117
2118  /**
2119   * Date and time the study started.
2120   */
2121  @Child(name = "started", type = { DateTimeType.class }, order = 5, min = 0, max = 1, modifier = false, summary = true)
2122  @Description(shortDefinition = "When the study was started", formalDefinition = "Date and time the study started.")
2123  protected DateTimeType started;
2124
2125  /**
2126   * A list of the diagnostic requests that resulted in this imaging study being
2127   * performed.
2128   */
2129  @Child(name = "basedOn", type = { CarePlan.class, ServiceRequest.class, Appointment.class, AppointmentResponse.class,
2130      Task.class }, order = 6, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
2131  @Description(shortDefinition = "Request fulfilled", formalDefinition = "A list of the diagnostic requests that resulted in this imaging study being performed.")
2132  protected List<Reference> basedOn;
2133  /**
2134   * The actual objects that are the target of the reference (A list of the
2135   * diagnostic requests that resulted in this imaging study being performed.)
2136   */
2137  protected List<Resource> basedOnTarget;
2138
2139  /**
2140   * The requesting/referring physician.
2141   */
2142  @Child(name = "referrer", type = { Practitioner.class,
2143      PractitionerRole.class }, order = 7, min = 0, max = 1, modifier = false, summary = true)
2144  @Description(shortDefinition = "Referring physician", formalDefinition = "The requesting/referring physician.")
2145  protected Reference referrer;
2146
2147  /**
2148   * The actual object that is the target of the reference (The
2149   * requesting/referring physician.)
2150   */
2151  protected Resource referrerTarget;
2152
2153  /**
2154   * Who read the study and interpreted the images or other content.
2155   */
2156  @Child(name = "interpreter", type = { Practitioner.class,
2157      PractitionerRole.class }, order = 8, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
2158  @Description(shortDefinition = "Who interpreted images", formalDefinition = "Who read the study and interpreted the images or other content.")
2159  protected List<Reference> interpreter;
2160  /**
2161   * The actual objects that are the target of the reference (Who read the study
2162   * and interpreted the images or other content.)
2163   */
2164  protected List<Resource> interpreterTarget;
2165
2166  /**
2167   * The network service providing access (e.g., query, view, or retrieval) for
2168   * the study. See implementation notes for information about using DICOM
2169   * endpoints. A study-level endpoint applies to each series in the study, unless
2170   * overridden by a series-level endpoint with the same Endpoint.connectionType.
2171   */
2172  @Child(name = "endpoint", type = {
2173      Endpoint.class }, order = 9, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
2174  @Description(shortDefinition = "Study access endpoint", formalDefinition = "The network service providing access (e.g., query, view, or retrieval) for the study. See implementation notes for information about using DICOM endpoints. A study-level endpoint applies to each series in the study, unless overridden by a series-level endpoint with the same Endpoint.connectionType.")
2175  protected List<Reference> endpoint;
2176  /**
2177   * The actual objects that are the target of the reference (The network service
2178   * providing access (e.g., query, view, or retrieval) for the study. See
2179   * implementation notes for information about using DICOM endpoints. A
2180   * study-level endpoint applies to each series in the study, unless overridden
2181   * by a series-level endpoint with the same Endpoint.connectionType.)
2182   */
2183  protected List<Endpoint> endpointTarget;
2184
2185  /**
2186   * Number of Series in the Study. This value given may be larger than the number
2187   * of series elements this Resource contains due to resource availability,
2188   * security, or other factors. This element should be present if any series
2189   * elements are present.
2190   */
2191  @Child(name = "numberOfSeries", type = {
2192      UnsignedIntType.class }, order = 10, min = 0, max = 1, modifier = false, summary = true)
2193  @Description(shortDefinition = "Number of Study Related Series", formalDefinition = "Number of Series in the Study. This value given may be larger than the number of series elements this Resource contains due to resource availability, security, or other factors. This element should be present if any series elements are present.")
2194  protected UnsignedIntType numberOfSeries;
2195
2196  /**
2197   * Number of SOP Instances in Study. This value given may be larger than the
2198   * number of instance elements this resource contains due to resource
2199   * availability, security, or other factors. This element should be present if
2200   * any instance elements are present.
2201   */
2202  @Child(name = "numberOfInstances", type = {
2203      UnsignedIntType.class }, order = 11, min = 0, max = 1, modifier = false, summary = true)
2204  @Description(shortDefinition = "Number of Study Related Instances", formalDefinition = "Number of SOP Instances in Study. This value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present.")
2205  protected UnsignedIntType numberOfInstances;
2206
2207  /**
2208   * The procedure which this ImagingStudy was part of.
2209   */
2210  @Child(name = "procedureReference", type = {
2211      Procedure.class }, order = 12, min = 0, max = 1, modifier = false, summary = true)
2212  @Description(shortDefinition = "The performed Procedure reference", formalDefinition = "The procedure which this ImagingStudy was part of.")
2213  protected Reference procedureReference;
2214
2215  /**
2216   * The actual object that is the target of the reference (The procedure which
2217   * this ImagingStudy was part of.)
2218   */
2219  protected Procedure procedureReferenceTarget;
2220
2221  /**
2222   * The code for the performed procedure type.
2223   */
2224  @Child(name = "procedureCode", type = {
2225      CodeableConcept.class }, order = 13, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
2226  @Description(shortDefinition = "The performed procedure code", formalDefinition = "The code for the performed procedure type.")
2227  protected List<CodeableConcept> procedureCode;
2228
2229  /**
2230   * The principal physical location where the ImagingStudy was performed.
2231   */
2232  @Child(name = "location", type = { Location.class }, order = 14, min = 0, max = 1, modifier = false, summary = true)
2233  @Description(shortDefinition = "Where ImagingStudy occurred", formalDefinition = "The principal physical location where the ImagingStudy was performed.")
2234  protected Reference location;
2235
2236  /**
2237   * The actual object that is the target of the reference (The principal physical
2238   * location where the ImagingStudy was performed.)
2239   */
2240  protected Location locationTarget;
2241
2242  /**
2243   * Description of clinical condition indicating why the ImagingStudy was
2244   * requested.
2245   */
2246  @Child(name = "reasonCode", type = {
2247      CodeableConcept.class }, order = 15, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
2248  @Description(shortDefinition = "Why the study was requested", formalDefinition = "Description of clinical condition indicating why the ImagingStudy was requested.")
2249  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/procedure-reason")
2250  protected List<CodeableConcept> reasonCode;
2251
2252  /**
2253   * Indicates another resource whose existence justifies this Study.
2254   */
2255  @Child(name = "reasonReference", type = { Condition.class, Observation.class, Media.class, DiagnosticReport.class,
2256      DocumentReference.class }, order = 16, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
2257  @Description(shortDefinition = "Why was study performed", formalDefinition = "Indicates another resource whose existence justifies this Study.")
2258  protected List<Reference> reasonReference;
2259  /**
2260   * The actual objects that are the target of the reference (Indicates another
2261   * resource whose existence justifies this Study.)
2262   */
2263  protected List<Resource> reasonReferenceTarget;
2264
2265  /**
2266   * Per the recommended DICOM mapping, this element is derived from the Study
2267   * Description attribute (0008,1030). Observations or findings about the imaging
2268   * study should be recorded in another resource, e.g. Observation, and not in
2269   * this element.
2270   */
2271  @Child(name = "note", type = {
2272      Annotation.class }, order = 17, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
2273  @Description(shortDefinition = "User-defined comments", formalDefinition = "Per the recommended DICOM mapping, this element is derived from the Study Description attribute (0008,1030). Observations or findings about the imaging study should be recorded in another resource, e.g. Observation, and not in this element.")
2274  protected List<Annotation> note;
2275
2276  /**
2277   * The Imaging Manager description of the study. Institution-generated
2278   * description or classification of the Study (component) performed.
2279   */
2280  @Child(name = "description", type = {
2281      StringType.class }, order = 18, min = 0, max = 1, modifier = false, summary = true)
2282  @Description(shortDefinition = "Institution-generated description", formalDefinition = "The Imaging Manager description of the study. Institution-generated description or classification of the Study (component) performed.")
2283  protected StringType description;
2284
2285  /**
2286   * Each study has one or more series of images or other content.
2287   */
2288  @Child(name = "series", type = {}, order = 19, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
2289  @Description(shortDefinition = "Each study has one or more series of instances", formalDefinition = "Each study has one or more series of images or other content.")
2290  protected List<ImagingStudySeriesComponent> series;
2291
2292  private static final long serialVersionUID = -647973361L;
2293
2294  /**
2295   * Constructor
2296   */
2297  public ImagingStudy() {
2298    super();
2299  }
2300
2301  /**
2302   * Constructor
2303   */
2304  public ImagingStudy(Enumeration<ImagingStudyStatus> status, Reference subject) {
2305    super();
2306    this.status = status;
2307    this.subject = subject;
2308  }
2309
2310  /**
2311   * @return {@link #identifier} (Identifiers for the ImagingStudy such as DICOM
2312   *         Study Instance UID, and Accession Number.)
2313   */
2314  public List<Identifier> getIdentifier() {
2315    if (this.identifier == null)
2316      this.identifier = new ArrayList<Identifier>();
2317    return this.identifier;
2318  }
2319
2320  /**
2321   * @return Returns a reference to <code>this</code> for easy method chaining
2322   */
2323  public ImagingStudy setIdentifier(List<Identifier> theIdentifier) {
2324    this.identifier = theIdentifier;
2325    return this;
2326  }
2327
2328  public boolean hasIdentifier() {
2329    if (this.identifier == null)
2330      return false;
2331    for (Identifier item : this.identifier)
2332      if (!item.isEmpty())
2333        return true;
2334    return false;
2335  }
2336
2337  public Identifier addIdentifier() { // 3
2338    Identifier t = new Identifier();
2339    if (this.identifier == null)
2340      this.identifier = new ArrayList<Identifier>();
2341    this.identifier.add(t);
2342    return t;
2343  }
2344
2345  public ImagingStudy addIdentifier(Identifier t) { // 3
2346    if (t == null)
2347      return this;
2348    if (this.identifier == null)
2349      this.identifier = new ArrayList<Identifier>();
2350    this.identifier.add(t);
2351    return this;
2352  }
2353
2354  /**
2355   * @return The first repetition of repeating field {@link #identifier}, creating
2356   *         it if it does not already exist
2357   */
2358  public Identifier getIdentifierFirstRep() {
2359    if (getIdentifier().isEmpty()) {
2360      addIdentifier();
2361    }
2362    return getIdentifier().get(0);
2363  }
2364
2365  /**
2366   * @return {@link #status} (The current state of the ImagingStudy.). This is the
2367   *         underlying object with id, value and extensions. The accessor
2368   *         "getStatus" gives direct access to the value
2369   */
2370  public Enumeration<ImagingStudyStatus> getStatusElement() {
2371    if (this.status == null)
2372      if (Configuration.errorOnAutoCreate())
2373        throw new Error("Attempt to auto-create ImagingStudy.status");
2374      else if (Configuration.doAutoCreate())
2375        this.status = new Enumeration<ImagingStudyStatus>(new ImagingStudyStatusEnumFactory()); // bb
2376    return this.status;
2377  }
2378
2379  public boolean hasStatusElement() {
2380    return this.status != null && !this.status.isEmpty();
2381  }
2382
2383  public boolean hasStatus() {
2384    return this.status != null && !this.status.isEmpty();
2385  }
2386
2387  /**
2388   * @param value {@link #status} (The current state of the ImagingStudy.). This
2389   *              is the underlying object with id, value and extensions. The
2390   *              accessor "getStatus" gives direct access to the value
2391   */
2392  public ImagingStudy setStatusElement(Enumeration<ImagingStudyStatus> value) {
2393    this.status = value;
2394    return this;
2395  }
2396
2397  /**
2398   * @return The current state of the ImagingStudy.
2399   */
2400  public ImagingStudyStatus getStatus() {
2401    return this.status == null ? null : this.status.getValue();
2402  }
2403
2404  /**
2405   * @param value The current state of the ImagingStudy.
2406   */
2407  public ImagingStudy setStatus(ImagingStudyStatus value) {
2408    if (this.status == null)
2409      this.status = new Enumeration<ImagingStudyStatus>(new ImagingStudyStatusEnumFactory());
2410    this.status.setValue(value);
2411    return this;
2412  }
2413
2414  /**
2415   * @return {@link #modality} (A list of all the series.modality values that are
2416   *         actual acquisition modalities, i.e. those in the DICOM Context Group
2417   *         29 (value set OID 1.2.840.10008.6.1.19).)
2418   */
2419  public List<Coding> getModality() {
2420    if (this.modality == null)
2421      this.modality = new ArrayList<Coding>();
2422    return this.modality;
2423  }
2424
2425  /**
2426   * @return Returns a reference to <code>this</code> for easy method chaining
2427   */
2428  public ImagingStudy setModality(List<Coding> theModality) {
2429    this.modality = theModality;
2430    return this;
2431  }
2432
2433  public boolean hasModality() {
2434    if (this.modality == null)
2435      return false;
2436    for (Coding item : this.modality)
2437      if (!item.isEmpty())
2438        return true;
2439    return false;
2440  }
2441
2442  public Coding addModality() { // 3
2443    Coding t = new Coding();
2444    if (this.modality == null)
2445      this.modality = new ArrayList<Coding>();
2446    this.modality.add(t);
2447    return t;
2448  }
2449
2450  public ImagingStudy addModality(Coding t) { // 3
2451    if (t == null)
2452      return this;
2453    if (this.modality == null)
2454      this.modality = new ArrayList<Coding>();
2455    this.modality.add(t);
2456    return this;
2457  }
2458
2459  /**
2460   * @return The first repetition of repeating field {@link #modality}, creating
2461   *         it if it does not already exist
2462   */
2463  public Coding getModalityFirstRep() {
2464    if (getModality().isEmpty()) {
2465      addModality();
2466    }
2467    return getModality().get(0);
2468  }
2469
2470  /**
2471   * @return {@link #subject} (The subject, typically a patient, of the imaging
2472   *         study.)
2473   */
2474  public Reference getSubject() {
2475    if (this.subject == null)
2476      if (Configuration.errorOnAutoCreate())
2477        throw new Error("Attempt to auto-create ImagingStudy.subject");
2478      else if (Configuration.doAutoCreate())
2479        this.subject = new Reference(); // cc
2480    return this.subject;
2481  }
2482
2483  public boolean hasSubject() {
2484    return this.subject != null && !this.subject.isEmpty();
2485  }
2486
2487  /**
2488   * @param value {@link #subject} (The subject, typically a patient, of the
2489   *              imaging study.)
2490   */
2491  public ImagingStudy setSubject(Reference value) {
2492    this.subject = value;
2493    return this;
2494  }
2495
2496  /**
2497   * @return {@link #subject} The actual object that is the target of the
2498   *         reference. The reference library doesn't populate this, but you can
2499   *         use it to hold the resource if you resolve it. (The subject,
2500   *         typically a patient, of the imaging study.)
2501   */
2502  public Resource getSubjectTarget() {
2503    return this.subjectTarget;
2504  }
2505
2506  /**
2507   * @param value {@link #subject} The actual object that is the target of the
2508   *              reference. The reference library doesn't use these, but you can
2509   *              use it to hold the resource if you resolve it. (The subject,
2510   *              typically a patient, of the imaging study.)
2511   */
2512  public ImagingStudy setSubjectTarget(Resource value) {
2513    this.subjectTarget = value;
2514    return this;
2515  }
2516
2517  /**
2518   * @return {@link #encounter} (The healthcare event (e.g. a patient and
2519   *         healthcare provider interaction) during which this ImagingStudy is
2520   *         made.)
2521   */
2522  public Reference getEncounter() {
2523    if (this.encounter == null)
2524      if (Configuration.errorOnAutoCreate())
2525        throw new Error("Attempt to auto-create ImagingStudy.encounter");
2526      else if (Configuration.doAutoCreate())
2527        this.encounter = new Reference(); // cc
2528    return this.encounter;
2529  }
2530
2531  public boolean hasEncounter() {
2532    return this.encounter != null && !this.encounter.isEmpty();
2533  }
2534
2535  /**
2536   * @param value {@link #encounter} (The healthcare event (e.g. a patient and
2537   *              healthcare provider interaction) during which this ImagingStudy
2538   *              is made.)
2539   */
2540  public ImagingStudy setEncounter(Reference value) {
2541    this.encounter = value;
2542    return this;
2543  }
2544
2545  /**
2546   * @return {@link #encounter} The actual object that is the target of the
2547   *         reference. The reference library doesn't populate this, but you can
2548   *         use it to hold the resource if you resolve it. (The healthcare event
2549   *         (e.g. a patient and healthcare provider interaction) during which
2550   *         this ImagingStudy is made.)
2551   */
2552  public Encounter getEncounterTarget() {
2553    if (this.encounterTarget == null)
2554      if (Configuration.errorOnAutoCreate())
2555        throw new Error("Attempt to auto-create ImagingStudy.encounter");
2556      else if (Configuration.doAutoCreate())
2557        this.encounterTarget = new Encounter(); // aa
2558    return this.encounterTarget;
2559  }
2560
2561  /**
2562   * @param value {@link #encounter} The actual object that is the target of the
2563   *              reference. The reference library doesn't use these, but you can
2564   *              use it to hold the resource if you resolve it. (The healthcare
2565   *              event (e.g. a patient and healthcare provider interaction)
2566   *              during which this ImagingStudy is made.)
2567   */
2568  public ImagingStudy setEncounterTarget(Encounter value) {
2569    this.encounterTarget = value;
2570    return this;
2571  }
2572
2573  /**
2574   * @return {@link #started} (Date and time the study started.). This is the
2575   *         underlying object with id, value and extensions. The accessor
2576   *         "getStarted" gives direct access to the value
2577   */
2578  public DateTimeType getStartedElement() {
2579    if (this.started == null)
2580      if (Configuration.errorOnAutoCreate())
2581        throw new Error("Attempt to auto-create ImagingStudy.started");
2582      else if (Configuration.doAutoCreate())
2583        this.started = new DateTimeType(); // bb
2584    return this.started;
2585  }
2586
2587  public boolean hasStartedElement() {
2588    return this.started != null && !this.started.isEmpty();
2589  }
2590
2591  public boolean hasStarted() {
2592    return this.started != null && !this.started.isEmpty();
2593  }
2594
2595  /**
2596   * @param value {@link #started} (Date and time the study started.). This is the
2597   *              underlying object with id, value and extensions. The accessor
2598   *              "getStarted" gives direct access to the value
2599   */
2600  public ImagingStudy setStartedElement(DateTimeType value) {
2601    this.started = value;
2602    return this;
2603  }
2604
2605  /**
2606   * @return Date and time the study started.
2607   */
2608  public Date getStarted() {
2609    return this.started == null ? null : this.started.getValue();
2610  }
2611
2612  /**
2613   * @param value Date and time the study started.
2614   */
2615  public ImagingStudy setStarted(Date value) {
2616    if (value == null)
2617      this.started = null;
2618    else {
2619      if (this.started == null)
2620        this.started = new DateTimeType();
2621      this.started.setValue(value);
2622    }
2623    return this;
2624  }
2625
2626  /**
2627   * @return {@link #basedOn} (A list of the diagnostic requests that resulted in
2628   *         this imaging study being performed.)
2629   */
2630  public List<Reference> getBasedOn() {
2631    if (this.basedOn == null)
2632      this.basedOn = new ArrayList<Reference>();
2633    return this.basedOn;
2634  }
2635
2636  /**
2637   * @return Returns a reference to <code>this</code> for easy method chaining
2638   */
2639  public ImagingStudy setBasedOn(List<Reference> theBasedOn) {
2640    this.basedOn = theBasedOn;
2641    return this;
2642  }
2643
2644  public boolean hasBasedOn() {
2645    if (this.basedOn == null)
2646      return false;
2647    for (Reference item : this.basedOn)
2648      if (!item.isEmpty())
2649        return true;
2650    return false;
2651  }
2652
2653  public Reference addBasedOn() { // 3
2654    Reference t = new Reference();
2655    if (this.basedOn == null)
2656      this.basedOn = new ArrayList<Reference>();
2657    this.basedOn.add(t);
2658    return t;
2659  }
2660
2661  public ImagingStudy addBasedOn(Reference t) { // 3
2662    if (t == null)
2663      return this;
2664    if (this.basedOn == null)
2665      this.basedOn = new ArrayList<Reference>();
2666    this.basedOn.add(t);
2667    return this;
2668  }
2669
2670  /**
2671   * @return The first repetition of repeating field {@link #basedOn}, creating it
2672   *         if it does not already exist
2673   */
2674  public Reference getBasedOnFirstRep() {
2675    if (getBasedOn().isEmpty()) {
2676      addBasedOn();
2677    }
2678    return getBasedOn().get(0);
2679  }
2680
2681  /**
2682   * @return {@link #referrer} (The requesting/referring physician.)
2683   */
2684  public Reference getReferrer() {
2685    if (this.referrer == null)
2686      if (Configuration.errorOnAutoCreate())
2687        throw new Error("Attempt to auto-create ImagingStudy.referrer");
2688      else if (Configuration.doAutoCreate())
2689        this.referrer = new Reference(); // cc
2690    return this.referrer;
2691  }
2692
2693  public boolean hasReferrer() {
2694    return this.referrer != null && !this.referrer.isEmpty();
2695  }
2696
2697  /**
2698   * @param value {@link #referrer} (The requesting/referring physician.)
2699   */
2700  public ImagingStudy setReferrer(Reference value) {
2701    this.referrer = value;
2702    return this;
2703  }
2704
2705  /**
2706   * @return {@link #referrer} The actual object that is the target of the
2707   *         reference. The reference library doesn't populate this, but you can
2708   *         use it to hold the resource if you resolve it. (The
2709   *         requesting/referring physician.)
2710   */
2711  public Resource getReferrerTarget() {
2712    return this.referrerTarget;
2713  }
2714
2715  /**
2716   * @param value {@link #referrer} The actual object that is the target of the
2717   *              reference. The reference library doesn't use these, but you can
2718   *              use it to hold the resource if you resolve it. (The
2719   *              requesting/referring physician.)
2720   */
2721  public ImagingStudy setReferrerTarget(Resource value) {
2722    this.referrerTarget = value;
2723    return this;
2724  }
2725
2726  /**
2727   * @return {@link #interpreter} (Who read the study and interpreted the images
2728   *         or other content.)
2729   */
2730  public List<Reference> getInterpreter() {
2731    if (this.interpreter == null)
2732      this.interpreter = new ArrayList<Reference>();
2733    return this.interpreter;
2734  }
2735
2736  /**
2737   * @return Returns a reference to <code>this</code> for easy method chaining
2738   */
2739  public ImagingStudy setInterpreter(List<Reference> theInterpreter) {
2740    this.interpreter = theInterpreter;
2741    return this;
2742  }
2743
2744  public boolean hasInterpreter() {
2745    if (this.interpreter == null)
2746      return false;
2747    for (Reference item : this.interpreter)
2748      if (!item.isEmpty())
2749        return true;
2750    return false;
2751  }
2752
2753  public Reference addInterpreter() { // 3
2754    Reference t = new Reference();
2755    if (this.interpreter == null)
2756      this.interpreter = new ArrayList<Reference>();
2757    this.interpreter.add(t);
2758    return t;
2759  }
2760
2761  public ImagingStudy addInterpreter(Reference t) { // 3
2762    if (t == null)
2763      return this;
2764    if (this.interpreter == null)
2765      this.interpreter = new ArrayList<Reference>();
2766    this.interpreter.add(t);
2767    return this;
2768  }
2769
2770  /**
2771   * @return The first repetition of repeating field {@link #interpreter},
2772   *         creating it if it does not already exist
2773   */
2774  public Reference getInterpreterFirstRep() {
2775    if (getInterpreter().isEmpty()) {
2776      addInterpreter();
2777    }
2778    return getInterpreter().get(0);
2779  }
2780
2781  /**
2782   * @return {@link #endpoint} (The network service providing access (e.g., query,
2783   *         view, or retrieval) for the study. See implementation notes for
2784   *         information about using DICOM endpoints. A study-level endpoint
2785   *         applies to each series in the study, unless overridden by a
2786   *         series-level endpoint with the same Endpoint.connectionType.)
2787   */
2788  public List<Reference> getEndpoint() {
2789    if (this.endpoint == null)
2790      this.endpoint = new ArrayList<Reference>();
2791    return this.endpoint;
2792  }
2793
2794  /**
2795   * @return Returns a reference to <code>this</code> for easy method chaining
2796   */
2797  public ImagingStudy setEndpoint(List<Reference> theEndpoint) {
2798    this.endpoint = theEndpoint;
2799    return this;
2800  }
2801
2802  public boolean hasEndpoint() {
2803    if (this.endpoint == null)
2804      return false;
2805    for (Reference item : this.endpoint)
2806      if (!item.isEmpty())
2807        return true;
2808    return false;
2809  }
2810
2811  public Reference addEndpoint() { // 3
2812    Reference t = new Reference();
2813    if (this.endpoint == null)
2814      this.endpoint = new ArrayList<Reference>();
2815    this.endpoint.add(t);
2816    return t;
2817  }
2818
2819  public ImagingStudy addEndpoint(Reference t) { // 3
2820    if (t == null)
2821      return this;
2822    if (this.endpoint == null)
2823      this.endpoint = new ArrayList<Reference>();
2824    this.endpoint.add(t);
2825    return this;
2826  }
2827
2828  /**
2829   * @return The first repetition of repeating field {@link #endpoint}, creating
2830   *         it if it does not already exist
2831   */
2832  public Reference getEndpointFirstRep() {
2833    if (getEndpoint().isEmpty()) {
2834      addEndpoint();
2835    }
2836    return getEndpoint().get(0);
2837  }
2838
2839  /**
2840   * @return {@link #numberOfSeries} (Number of Series in the Study. This value
2841   *         given may be larger than the number of series elements this Resource
2842   *         contains due to resource availability, security, or other factors.
2843   *         This element should be present if any series elements are present.).
2844   *         This is the underlying object with id, value and extensions. The
2845   *         accessor "getNumberOfSeries" gives direct access to the value
2846   */
2847  public UnsignedIntType getNumberOfSeriesElement() {
2848    if (this.numberOfSeries == null)
2849      if (Configuration.errorOnAutoCreate())
2850        throw new Error("Attempt to auto-create ImagingStudy.numberOfSeries");
2851      else if (Configuration.doAutoCreate())
2852        this.numberOfSeries = new UnsignedIntType(); // bb
2853    return this.numberOfSeries;
2854  }
2855
2856  public boolean hasNumberOfSeriesElement() {
2857    return this.numberOfSeries != null && !this.numberOfSeries.isEmpty();
2858  }
2859
2860  public boolean hasNumberOfSeries() {
2861    return this.numberOfSeries != null && !this.numberOfSeries.isEmpty();
2862  }
2863
2864  /**
2865   * @param value {@link #numberOfSeries} (Number of Series in the Study. This
2866   *              value given may be larger than the number of series elements
2867   *              this Resource contains due to resource availability, security,
2868   *              or other factors. This element should be present if any series
2869   *              elements are present.). This is the underlying object with id,
2870   *              value and extensions. The accessor "getNumberOfSeries" gives
2871   *              direct access to the value
2872   */
2873  public ImagingStudy setNumberOfSeriesElement(UnsignedIntType value) {
2874    this.numberOfSeries = value;
2875    return this;
2876  }
2877
2878  /**
2879   * @return Number of Series in the Study. This value given may be larger than
2880   *         the number of series elements this Resource contains due to resource
2881   *         availability, security, or other factors. This element should be
2882   *         present if any series elements are present.
2883   */
2884  public int getNumberOfSeries() {
2885    return this.numberOfSeries == null || this.numberOfSeries.isEmpty() ? 0 : this.numberOfSeries.getValue();
2886  }
2887
2888  /**
2889   * @param value Number of Series in the Study. This value given may be larger
2890   *              than the number of series elements this Resource contains due to
2891   *              resource availability, security, or other factors. This element
2892   *              should be present if any series elements are present.
2893   */
2894  public ImagingStudy setNumberOfSeries(int value) {
2895    if (this.numberOfSeries == null)
2896      this.numberOfSeries = new UnsignedIntType();
2897    this.numberOfSeries.setValue(value);
2898    return this;
2899  }
2900
2901  /**
2902   * @return {@link #numberOfInstances} (Number of SOP Instances in Study. This
2903   *         value given may be larger than the number of instance elements this
2904   *         resource contains due to resource availability, security, or other
2905   *         factors. This element should be present if any instance elements are
2906   *         present.). This is the underlying object with id, value and
2907   *         extensions. The accessor "getNumberOfInstances" gives direct access
2908   *         to the value
2909   */
2910  public UnsignedIntType getNumberOfInstancesElement() {
2911    if (this.numberOfInstances == null)
2912      if (Configuration.errorOnAutoCreate())
2913        throw new Error("Attempt to auto-create ImagingStudy.numberOfInstances");
2914      else if (Configuration.doAutoCreate())
2915        this.numberOfInstances = new UnsignedIntType(); // bb
2916    return this.numberOfInstances;
2917  }
2918
2919  public boolean hasNumberOfInstancesElement() {
2920    return this.numberOfInstances != null && !this.numberOfInstances.isEmpty();
2921  }
2922
2923  public boolean hasNumberOfInstances() {
2924    return this.numberOfInstances != null && !this.numberOfInstances.isEmpty();
2925  }
2926
2927  /**
2928   * @param value {@link #numberOfInstances} (Number of SOP Instances in Study.
2929   *              This value given may be larger than the number of instance
2930   *              elements this resource contains due to resource availability,
2931   *              security, or other factors. This element should be present if
2932   *              any instance elements are present.). This is the underlying
2933   *              object with id, value and extensions. The accessor
2934   *              "getNumberOfInstances" gives direct access to the value
2935   */
2936  public ImagingStudy setNumberOfInstancesElement(UnsignedIntType value) {
2937    this.numberOfInstances = value;
2938    return this;
2939  }
2940
2941  /**
2942   * @return Number of SOP Instances in Study. This value given may be larger than
2943   *         the number of instance elements this resource contains due to
2944   *         resource availability, security, or other factors. This element
2945   *         should be present if any instance elements are present.
2946   */
2947  public int getNumberOfInstances() {
2948    return this.numberOfInstances == null || this.numberOfInstances.isEmpty() ? 0 : this.numberOfInstances.getValue();
2949  }
2950
2951  /**
2952   * @param value Number of SOP Instances in Study. This value given may be larger
2953   *              than the number of instance elements this resource contains due
2954   *              to resource availability, security, or other factors. This
2955   *              element should be present if any instance elements are present.
2956   */
2957  public ImagingStudy setNumberOfInstances(int value) {
2958    if (this.numberOfInstances == null)
2959      this.numberOfInstances = new UnsignedIntType();
2960    this.numberOfInstances.setValue(value);
2961    return this;
2962  }
2963
2964  /**
2965   * @return {@link #procedureReference} (The procedure which this ImagingStudy
2966   *         was part of.)
2967   */
2968  public Reference getProcedureReference() {
2969    if (this.procedureReference == null)
2970      if (Configuration.errorOnAutoCreate())
2971        throw new Error("Attempt to auto-create ImagingStudy.procedureReference");
2972      else if (Configuration.doAutoCreate())
2973        this.procedureReference = new Reference(); // cc
2974    return this.procedureReference;
2975  }
2976
2977  public boolean hasProcedureReference() {
2978    return this.procedureReference != null && !this.procedureReference.isEmpty();
2979  }
2980
2981  /**
2982   * @param value {@link #procedureReference} (The procedure which this
2983   *              ImagingStudy was part of.)
2984   */
2985  public ImagingStudy setProcedureReference(Reference value) {
2986    this.procedureReference = value;
2987    return this;
2988  }
2989
2990  /**
2991   * @return {@link #procedureReference} The actual object that is the target of
2992   *         the reference. The reference library doesn't populate this, but you
2993   *         can use it to hold the resource if you resolve it. (The procedure
2994   *         which this ImagingStudy was part of.)
2995   */
2996  public Procedure getProcedureReferenceTarget() {
2997    if (this.procedureReferenceTarget == null)
2998      if (Configuration.errorOnAutoCreate())
2999        throw new Error("Attempt to auto-create ImagingStudy.procedureReference");
3000      else if (Configuration.doAutoCreate())
3001        this.procedureReferenceTarget = new Procedure(); // aa
3002    return this.procedureReferenceTarget;
3003  }
3004
3005  /**
3006   * @param value {@link #procedureReference} The actual object that is the target
3007   *              of the reference. The reference library doesn't use these, but
3008   *              you can use it to hold the resource if you resolve it. (The
3009   *              procedure which this ImagingStudy was part of.)
3010   */
3011  public ImagingStudy setProcedureReferenceTarget(Procedure value) {
3012    this.procedureReferenceTarget = value;
3013    return this;
3014  }
3015
3016  /**
3017   * @return {@link #procedureCode} (The code for the performed procedure type.)
3018   */
3019  public List<CodeableConcept> getProcedureCode() {
3020    if (this.procedureCode == null)
3021      this.procedureCode = new ArrayList<CodeableConcept>();
3022    return this.procedureCode;
3023  }
3024
3025  /**
3026   * @return Returns a reference to <code>this</code> for easy method chaining
3027   */
3028  public ImagingStudy setProcedureCode(List<CodeableConcept> theProcedureCode) {
3029    this.procedureCode = theProcedureCode;
3030    return this;
3031  }
3032
3033  public boolean hasProcedureCode() {
3034    if (this.procedureCode == null)
3035      return false;
3036    for (CodeableConcept item : this.procedureCode)
3037      if (!item.isEmpty())
3038        return true;
3039    return false;
3040  }
3041
3042  public CodeableConcept addProcedureCode() { // 3
3043    CodeableConcept t = new CodeableConcept();
3044    if (this.procedureCode == null)
3045      this.procedureCode = new ArrayList<CodeableConcept>();
3046    this.procedureCode.add(t);
3047    return t;
3048  }
3049
3050  public ImagingStudy addProcedureCode(CodeableConcept t) { // 3
3051    if (t == null)
3052      return this;
3053    if (this.procedureCode == null)
3054      this.procedureCode = new ArrayList<CodeableConcept>();
3055    this.procedureCode.add(t);
3056    return this;
3057  }
3058
3059  /**
3060   * @return The first repetition of repeating field {@link #procedureCode},
3061   *         creating it if it does not already exist
3062   */
3063  public CodeableConcept getProcedureCodeFirstRep() {
3064    if (getProcedureCode().isEmpty()) {
3065      addProcedureCode();
3066    }
3067    return getProcedureCode().get(0);
3068  }
3069
3070  /**
3071   * @return {@link #location} (The principal physical location where the
3072   *         ImagingStudy was performed.)
3073   */
3074  public Reference getLocation() {
3075    if (this.location == null)
3076      if (Configuration.errorOnAutoCreate())
3077        throw new Error("Attempt to auto-create ImagingStudy.location");
3078      else if (Configuration.doAutoCreate())
3079        this.location = new Reference(); // cc
3080    return this.location;
3081  }
3082
3083  public boolean hasLocation() {
3084    return this.location != null && !this.location.isEmpty();
3085  }
3086
3087  /**
3088   * @param value {@link #location} (The principal physical location where the
3089   *              ImagingStudy was performed.)
3090   */
3091  public ImagingStudy setLocation(Reference value) {
3092    this.location = value;
3093    return this;
3094  }
3095
3096  /**
3097   * @return {@link #location} The actual object that is the target of the
3098   *         reference. The reference library doesn't populate this, but you can
3099   *         use it to hold the resource if you resolve it. (The principal
3100   *         physical location where the ImagingStudy was performed.)
3101   */
3102  public Location getLocationTarget() {
3103    if (this.locationTarget == null)
3104      if (Configuration.errorOnAutoCreate())
3105        throw new Error("Attempt to auto-create ImagingStudy.location");
3106      else if (Configuration.doAutoCreate())
3107        this.locationTarget = new Location(); // aa
3108    return this.locationTarget;
3109  }
3110
3111  /**
3112   * @param value {@link #location} The actual object that is the target of the
3113   *              reference. The reference library doesn't use these, but you can
3114   *              use it to hold the resource if you resolve it. (The principal
3115   *              physical location where the ImagingStudy was performed.)
3116   */
3117  public ImagingStudy setLocationTarget(Location value) {
3118    this.locationTarget = value;
3119    return this;
3120  }
3121
3122  /**
3123   * @return {@link #reasonCode} (Description of clinical condition indicating why
3124   *         the ImagingStudy was requested.)
3125   */
3126  public List<CodeableConcept> getReasonCode() {
3127    if (this.reasonCode == null)
3128      this.reasonCode = new ArrayList<CodeableConcept>();
3129    return this.reasonCode;
3130  }
3131
3132  /**
3133   * @return Returns a reference to <code>this</code> for easy method chaining
3134   */
3135  public ImagingStudy setReasonCode(List<CodeableConcept> theReasonCode) {
3136    this.reasonCode = theReasonCode;
3137    return this;
3138  }
3139
3140  public boolean hasReasonCode() {
3141    if (this.reasonCode == null)
3142      return false;
3143    for (CodeableConcept item : this.reasonCode)
3144      if (!item.isEmpty())
3145        return true;
3146    return false;
3147  }
3148
3149  public CodeableConcept addReasonCode() { // 3
3150    CodeableConcept t = new CodeableConcept();
3151    if (this.reasonCode == null)
3152      this.reasonCode = new ArrayList<CodeableConcept>();
3153    this.reasonCode.add(t);
3154    return t;
3155  }
3156
3157  public ImagingStudy addReasonCode(CodeableConcept t) { // 3
3158    if (t == null)
3159      return this;
3160    if (this.reasonCode == null)
3161      this.reasonCode = new ArrayList<CodeableConcept>();
3162    this.reasonCode.add(t);
3163    return this;
3164  }
3165
3166  /**
3167   * @return The first repetition of repeating field {@link #reasonCode}, creating
3168   *         it if it does not already exist
3169   */
3170  public CodeableConcept getReasonCodeFirstRep() {
3171    if (getReasonCode().isEmpty()) {
3172      addReasonCode();
3173    }
3174    return getReasonCode().get(0);
3175  }
3176
3177  /**
3178   * @return {@link #reasonReference} (Indicates another resource whose existence
3179   *         justifies this Study.)
3180   */
3181  public List<Reference> getReasonReference() {
3182    if (this.reasonReference == null)
3183      this.reasonReference = new ArrayList<Reference>();
3184    return this.reasonReference;
3185  }
3186
3187  /**
3188   * @return Returns a reference to <code>this</code> for easy method chaining
3189   */
3190  public ImagingStudy setReasonReference(List<Reference> theReasonReference) {
3191    this.reasonReference = theReasonReference;
3192    return this;
3193  }
3194
3195  public boolean hasReasonReference() {
3196    if (this.reasonReference == null)
3197      return false;
3198    for (Reference item : this.reasonReference)
3199      if (!item.isEmpty())
3200        return true;
3201    return false;
3202  }
3203
3204  public Reference addReasonReference() { // 3
3205    Reference t = new Reference();
3206    if (this.reasonReference == null)
3207      this.reasonReference = new ArrayList<Reference>();
3208    this.reasonReference.add(t);
3209    return t;
3210  }
3211
3212  public ImagingStudy addReasonReference(Reference t) { // 3
3213    if (t == null)
3214      return this;
3215    if (this.reasonReference == null)
3216      this.reasonReference = new ArrayList<Reference>();
3217    this.reasonReference.add(t);
3218    return this;
3219  }
3220
3221  /**
3222   * @return The first repetition of repeating field {@link #reasonReference},
3223   *         creating it if it does not already exist
3224   */
3225  public Reference getReasonReferenceFirstRep() {
3226    if (getReasonReference().isEmpty()) {
3227      addReasonReference();
3228    }
3229    return getReasonReference().get(0);
3230  }
3231
3232  /**
3233   * @return {@link #note} (Per the recommended DICOM mapping, this element is
3234   *         derived from the Study Description attribute (0008,1030).
3235   *         Observations or findings about the imaging study should be recorded
3236   *         in another resource, e.g. Observation, and not in this element.)
3237   */
3238  public List<Annotation> getNote() {
3239    if (this.note == null)
3240      this.note = new ArrayList<Annotation>();
3241    return this.note;
3242  }
3243
3244  /**
3245   * @return Returns a reference to <code>this</code> for easy method chaining
3246   */
3247  public ImagingStudy setNote(List<Annotation> theNote) {
3248    this.note = theNote;
3249    return this;
3250  }
3251
3252  public boolean hasNote() {
3253    if (this.note == null)
3254      return false;
3255    for (Annotation item : this.note)
3256      if (!item.isEmpty())
3257        return true;
3258    return false;
3259  }
3260
3261  public Annotation addNote() { // 3
3262    Annotation t = new Annotation();
3263    if (this.note == null)
3264      this.note = new ArrayList<Annotation>();
3265    this.note.add(t);
3266    return t;
3267  }
3268
3269  public ImagingStudy addNote(Annotation t) { // 3
3270    if (t == null)
3271      return this;
3272    if (this.note == null)
3273      this.note = new ArrayList<Annotation>();
3274    this.note.add(t);
3275    return this;
3276  }
3277
3278  /**
3279   * @return The first repetition of repeating field {@link #note}, creating it if
3280   *         it does not already exist
3281   */
3282  public Annotation getNoteFirstRep() {
3283    if (getNote().isEmpty()) {
3284      addNote();
3285    }
3286    return getNote().get(0);
3287  }
3288
3289  /**
3290   * @return {@link #description} (The Imaging Manager description of the study.
3291   *         Institution-generated description or classification of the Study
3292   *         (component) performed.). This is the underlying object with id, value
3293   *         and extensions. The accessor "getDescription" gives direct access to
3294   *         the value
3295   */
3296  public StringType getDescriptionElement() {
3297    if (this.description == null)
3298      if (Configuration.errorOnAutoCreate())
3299        throw new Error("Attempt to auto-create ImagingStudy.description");
3300      else if (Configuration.doAutoCreate())
3301        this.description = new StringType(); // bb
3302    return this.description;
3303  }
3304
3305  public boolean hasDescriptionElement() {
3306    return this.description != null && !this.description.isEmpty();
3307  }
3308
3309  public boolean hasDescription() {
3310    return this.description != null && !this.description.isEmpty();
3311  }
3312
3313  /**
3314   * @param value {@link #description} (The Imaging Manager description of the
3315   *              study. Institution-generated description or classification of
3316   *              the Study (component) performed.). This is the underlying object
3317   *              with id, value and extensions. The accessor "getDescription"
3318   *              gives direct access to the value
3319   */
3320  public ImagingStudy setDescriptionElement(StringType value) {
3321    this.description = value;
3322    return this;
3323  }
3324
3325  /**
3326   * @return The Imaging Manager description of the study. Institution-generated
3327   *         description or classification of the Study (component) performed.
3328   */
3329  public String getDescription() {
3330    return this.description == null ? null : this.description.getValue();
3331  }
3332
3333  /**
3334   * @param value The Imaging Manager description of the study.
3335   *              Institution-generated description or classification of the Study
3336   *              (component) performed.
3337   */
3338  public ImagingStudy setDescription(String value) {
3339    if (Utilities.noString(value))
3340      this.description = null;
3341    else {
3342      if (this.description == null)
3343        this.description = new StringType();
3344      this.description.setValue(value);
3345    }
3346    return this;
3347  }
3348
3349  /**
3350   * @return {@link #series} (Each study has one or more series of images or other
3351   *         content.)
3352   */
3353  public List<ImagingStudySeriesComponent> getSeries() {
3354    if (this.series == null)
3355      this.series = new ArrayList<ImagingStudySeriesComponent>();
3356    return this.series;
3357  }
3358
3359  /**
3360   * @return Returns a reference to <code>this</code> for easy method chaining
3361   */
3362  public ImagingStudy setSeries(List<ImagingStudySeriesComponent> theSeries) {
3363    this.series = theSeries;
3364    return this;
3365  }
3366
3367  public boolean hasSeries() {
3368    if (this.series == null)
3369      return false;
3370    for (ImagingStudySeriesComponent item : this.series)
3371      if (!item.isEmpty())
3372        return true;
3373    return false;
3374  }
3375
3376  public ImagingStudySeriesComponent addSeries() { // 3
3377    ImagingStudySeriesComponent t = new ImagingStudySeriesComponent();
3378    if (this.series == null)
3379      this.series = new ArrayList<ImagingStudySeriesComponent>();
3380    this.series.add(t);
3381    return t;
3382  }
3383
3384  public ImagingStudy addSeries(ImagingStudySeriesComponent t) { // 3
3385    if (t == null)
3386      return this;
3387    if (this.series == null)
3388      this.series = new ArrayList<ImagingStudySeriesComponent>();
3389    this.series.add(t);
3390    return this;
3391  }
3392
3393  /**
3394   * @return The first repetition of repeating field {@link #series}, creating it
3395   *         if it does not already exist
3396   */
3397  public ImagingStudySeriesComponent getSeriesFirstRep() {
3398    if (getSeries().isEmpty()) {
3399      addSeries();
3400    }
3401    return getSeries().get(0);
3402  }
3403
3404  protected void listChildren(List<Property> children) {
3405    super.listChildren(children);
3406    children.add(new Property("identifier", "Identifier",
3407        "Identifiers for the ImagingStudy such as DICOM Study Instance UID, and Accession Number.", 0,
3408        java.lang.Integer.MAX_VALUE, identifier));
3409    children.add(new Property("status", "code", "The current state of the ImagingStudy.", 0, 1, status));
3410    children.add(new Property("modality", "Coding",
3411        "A list of all the series.modality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).",
3412        0, java.lang.Integer.MAX_VALUE, modality));
3413    children.add(new Property("subject", "Reference(Patient|Device|Group)",
3414        "The subject, typically a patient, of the imaging study.", 0, 1, subject));
3415    children.add(new Property("encounter", "Reference(Encounter)",
3416        "The healthcare event (e.g. a patient and healthcare provider interaction) during which this ImagingStudy is made.",
3417        0, 1, encounter));
3418    children.add(new Property("started", "dateTime", "Date and time the study started.", 0, 1, started));
3419    children.add(new Property("basedOn", "Reference(CarePlan|ServiceRequest|Appointment|AppointmentResponse|Task)",
3420        "A list of the diagnostic requests that resulted in this imaging study being performed.", 0,
3421        java.lang.Integer.MAX_VALUE, basedOn));
3422    children.add(new Property("referrer", "Reference(Practitioner|PractitionerRole)",
3423        "The requesting/referring physician.", 0, 1, referrer));
3424    children.add(new Property("interpreter", "Reference(Practitioner|PractitionerRole)",
3425        "Who read the study and interpreted the images or other content.", 0, java.lang.Integer.MAX_VALUE,
3426        interpreter));
3427    children.add(new Property("endpoint", "Reference(Endpoint)",
3428        "The network service providing access (e.g., query, view, or retrieval) for the study. See implementation notes for information about using DICOM endpoints. A study-level endpoint applies to each series in the study, unless overridden by a series-level endpoint with the same Endpoint.connectionType.",
3429        0, java.lang.Integer.MAX_VALUE, endpoint));
3430    children.add(new Property("numberOfSeries", "unsignedInt",
3431        "Number of Series in the Study. This value given may be larger than the number of series elements this Resource contains due to resource availability, security, or other factors. This element should be present if any series elements are present.",
3432        0, 1, numberOfSeries));
3433    children.add(new Property("numberOfInstances", "unsignedInt",
3434        "Number of SOP Instances in Study. This value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present.",
3435        0, 1, numberOfInstances));
3436    children.add(new Property("procedureReference", "Reference(Procedure)",
3437        "The procedure which this ImagingStudy was part of.", 0, 1, procedureReference));
3438    children.add(new Property("procedureCode", "CodeableConcept", "The code for the performed procedure type.", 0,
3439        java.lang.Integer.MAX_VALUE, procedureCode));
3440    children.add(new Property("location", "Reference(Location)",
3441        "The principal physical location where the ImagingStudy was performed.", 0, 1, location));
3442    children.add(new Property("reasonCode", "CodeableConcept",
3443        "Description of clinical condition indicating why the ImagingStudy was requested.", 0,
3444        java.lang.Integer.MAX_VALUE, reasonCode));
3445    children.add(
3446        new Property("reasonReference", "Reference(Condition|Observation|Media|DiagnosticReport|DocumentReference)",
3447            "Indicates another resource whose existence justifies this Study.", 0, java.lang.Integer.MAX_VALUE,
3448            reasonReference));
3449    children.add(new Property("note", "Annotation",
3450        "Per the recommended DICOM mapping, this element is derived from the Study Description attribute (0008,1030). Observations or findings about the imaging study should be recorded in another resource, e.g. Observation, and not in this element.",
3451        0, java.lang.Integer.MAX_VALUE, note));
3452    children.add(new Property("description", "string",
3453        "The Imaging Manager description of the study. Institution-generated description or classification of the Study (component) performed.",
3454        0, 1, description));
3455    children.add(new Property("series", "", "Each study has one or more series of images or other content.", 0,
3456        java.lang.Integer.MAX_VALUE, series));
3457  }
3458
3459  @Override
3460  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3461    switch (_hash) {
3462    case -1618432855:
3463      /* identifier */ return new Property("identifier", "Identifier",
3464          "Identifiers for the ImagingStudy such as DICOM Study Instance UID, and Accession Number.", 0,
3465          java.lang.Integer.MAX_VALUE, identifier);
3466    case -892481550:
3467      /* status */ return new Property("status", "code", "The current state of the ImagingStudy.", 0, 1, status);
3468    case -622722335:
3469      /* modality */ return new Property("modality", "Coding",
3470          "A list of all the series.modality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).",
3471          0, java.lang.Integer.MAX_VALUE, modality);
3472    case -1867885268:
3473      /* subject */ return new Property("subject", "Reference(Patient|Device|Group)",
3474          "The subject, typically a patient, of the imaging study.", 0, 1, subject);
3475    case 1524132147:
3476      /* encounter */ return new Property("encounter", "Reference(Encounter)",
3477          "The healthcare event (e.g. a patient and healthcare provider interaction) during which this ImagingStudy is made.",
3478          0, 1, encounter);
3479    case -1897185151:
3480      /* started */ return new Property("started", "dateTime", "Date and time the study started.", 0, 1, started);
3481    case -332612366:
3482      /* basedOn */ return new Property("basedOn",
3483          "Reference(CarePlan|ServiceRequest|Appointment|AppointmentResponse|Task)",
3484          "A list of the diagnostic requests that resulted in this imaging study being performed.", 0,
3485          java.lang.Integer.MAX_VALUE, basedOn);
3486    case -722568161:
3487      /* referrer */ return new Property("referrer", "Reference(Practitioner|PractitionerRole)",
3488          "The requesting/referring physician.", 0, 1, referrer);
3489    case -2008009094:
3490      /* interpreter */ return new Property("interpreter", "Reference(Practitioner|PractitionerRole)",
3491          "Who read the study and interpreted the images or other content.", 0, java.lang.Integer.MAX_VALUE,
3492          interpreter);
3493    case 1741102485:
3494      /* endpoint */ return new Property("endpoint", "Reference(Endpoint)",
3495          "The network service providing access (e.g., query, view, or retrieval) for the study. See implementation notes for information about using DICOM endpoints. A study-level endpoint applies to each series in the study, unless overridden by a series-level endpoint with the same Endpoint.connectionType.",
3496          0, java.lang.Integer.MAX_VALUE, endpoint);
3497    case 1920000407:
3498      /* numberOfSeries */ return new Property("numberOfSeries", "unsignedInt",
3499          "Number of Series in the Study. This value given may be larger than the number of series elements this Resource contains due to resource availability, security, or other factors. This element should be present if any series elements are present.",
3500          0, 1, numberOfSeries);
3501    case -1043544226:
3502      /* numberOfInstances */ return new Property("numberOfInstances", "unsignedInt",
3503          "Number of SOP Instances in Study. This value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present.",
3504          0, 1, numberOfInstances);
3505    case 881809848:
3506      /* procedureReference */ return new Property("procedureReference", "Reference(Procedure)",
3507          "The procedure which this ImagingStudy was part of.", 0, 1, procedureReference);
3508    case -698023072:
3509      /* procedureCode */ return new Property("procedureCode", "CodeableConcept",
3510          "The code for the performed procedure type.", 0, java.lang.Integer.MAX_VALUE, procedureCode);
3511    case 1901043637:
3512      /* location */ return new Property("location", "Reference(Location)",
3513          "The principal physical location where the ImagingStudy was performed.", 0, 1, location);
3514    case 722137681:
3515      /* reasonCode */ return new Property("reasonCode", "CodeableConcept",
3516          "Description of clinical condition indicating why the ImagingStudy was requested.", 0,
3517          java.lang.Integer.MAX_VALUE, reasonCode);
3518    case -1146218137:
3519      /* reasonReference */ return new Property("reasonReference",
3520          "Reference(Condition|Observation|Media|DiagnosticReport|DocumentReference)",
3521          "Indicates another resource whose existence justifies this Study.", 0, java.lang.Integer.MAX_VALUE,
3522          reasonReference);
3523    case 3387378:
3524      /* note */ return new Property("note", "Annotation",
3525          "Per the recommended DICOM mapping, this element is derived from the Study Description attribute (0008,1030). Observations or findings about the imaging study should be recorded in another resource, e.g. Observation, and not in this element.",
3526          0, java.lang.Integer.MAX_VALUE, note);
3527    case -1724546052:
3528      /* description */ return new Property("description", "string",
3529          "The Imaging Manager description of the study. Institution-generated description or classification of the Study (component) performed.",
3530          0, 1, description);
3531    case -905838985:
3532      /* series */ return new Property("series", "", "Each study has one or more series of images or other content.", 0,
3533          java.lang.Integer.MAX_VALUE, series);
3534    default:
3535      return super.getNamedProperty(_hash, _name, _checkValid);
3536    }
3537
3538  }
3539
3540  @Override
3541  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3542    switch (hash) {
3543    case -1618432855:
3544      /* identifier */ return this.identifier == null ? new Base[0]
3545          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3546    case -892481550:
3547      /* status */ return this.status == null ? new Base[0] : new Base[] { this.status }; // Enumeration<ImagingStudyStatus>
3548    case -622722335:
3549      /* modality */ return this.modality == null ? new Base[0] : this.modality.toArray(new Base[this.modality.size()]); // Coding
3550    case -1867885268:
3551      /* subject */ return this.subject == null ? new Base[0] : new Base[] { this.subject }; // Reference
3552    case 1524132147:
3553      /* encounter */ return this.encounter == null ? new Base[0] : new Base[] { this.encounter }; // Reference
3554    case -1897185151:
3555      /* started */ return this.started == null ? new Base[0] : new Base[] { this.started }; // DateTimeType
3556    case -332612366:
3557      /* basedOn */ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
3558    case -722568161:
3559      /* referrer */ return this.referrer == null ? new Base[0] : new Base[] { this.referrer }; // Reference
3560    case -2008009094:
3561      /* interpreter */ return this.interpreter == null ? new Base[0]
3562          : this.interpreter.toArray(new Base[this.interpreter.size()]); // Reference
3563    case 1741102485:
3564      /* endpoint */ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // Reference
3565    case 1920000407:
3566      /* numberOfSeries */ return this.numberOfSeries == null ? new Base[0] : new Base[] { this.numberOfSeries }; // UnsignedIntType
3567    case -1043544226:
3568      /* numberOfInstances */ return this.numberOfInstances == null ? new Base[0]
3569          : new Base[] { this.numberOfInstances }; // UnsignedIntType
3570    case 881809848:
3571      /* procedureReference */ return this.procedureReference == null ? new Base[0]
3572          : new Base[] { this.procedureReference }; // Reference
3573    case -698023072:
3574      /* procedureCode */ return this.procedureCode == null ? new Base[0]
3575          : this.procedureCode.toArray(new Base[this.procedureCode.size()]); // CodeableConcept
3576    case 1901043637:
3577      /* location */ return this.location == null ? new Base[0] : new Base[] { this.location }; // Reference
3578    case 722137681:
3579      /* reasonCode */ return this.reasonCode == null ? new Base[0]
3580          : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
3581    case -1146218137:
3582      /* reasonReference */ return this.reasonReference == null ? new Base[0]
3583          : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
3584    case 3387378:
3585      /* note */ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
3586    case -1724546052:
3587      /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // StringType
3588    case -905838985:
3589      /* series */ return this.series == null ? new Base[0] : this.series.toArray(new Base[this.series.size()]); // ImagingStudySeriesComponent
3590    default:
3591      return super.getProperty(hash, name, checkValid);
3592    }
3593
3594  }
3595
3596  @Override
3597  public Base setProperty(int hash, String name, Base value) throws FHIRException {
3598    switch (hash) {
3599    case -1618432855: // identifier
3600      this.getIdentifier().add(castToIdentifier(value)); // Identifier
3601      return value;
3602    case -892481550: // status
3603      value = new ImagingStudyStatusEnumFactory().fromType(castToCode(value));
3604      this.status = (Enumeration) value; // Enumeration<ImagingStudyStatus>
3605      return value;
3606    case -622722335: // modality
3607      this.getModality().add(castToCoding(value)); // Coding
3608      return value;
3609    case -1867885268: // subject
3610      this.subject = castToReference(value); // Reference
3611      return value;
3612    case 1524132147: // encounter
3613      this.encounter = castToReference(value); // Reference
3614      return value;
3615    case -1897185151: // started
3616      this.started = castToDateTime(value); // DateTimeType
3617      return value;
3618    case -332612366: // basedOn
3619      this.getBasedOn().add(castToReference(value)); // Reference
3620      return value;
3621    case -722568161: // referrer
3622      this.referrer = castToReference(value); // Reference
3623      return value;
3624    case -2008009094: // interpreter
3625      this.getInterpreter().add(castToReference(value)); // Reference
3626      return value;
3627    case 1741102485: // endpoint
3628      this.getEndpoint().add(castToReference(value)); // Reference
3629      return value;
3630    case 1920000407: // numberOfSeries
3631      this.numberOfSeries = castToUnsignedInt(value); // UnsignedIntType
3632      return value;
3633    case -1043544226: // numberOfInstances
3634      this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType
3635      return value;
3636    case 881809848: // procedureReference
3637      this.procedureReference = castToReference(value); // Reference
3638      return value;
3639    case -698023072: // procedureCode
3640      this.getProcedureCode().add(castToCodeableConcept(value)); // CodeableConcept
3641      return value;
3642    case 1901043637: // location
3643      this.location = castToReference(value); // Reference
3644      return value;
3645    case 722137681: // reasonCode
3646      this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
3647      return value;
3648    case -1146218137: // reasonReference
3649      this.getReasonReference().add(castToReference(value)); // Reference
3650      return value;
3651    case 3387378: // note
3652      this.getNote().add(castToAnnotation(value)); // Annotation
3653      return value;
3654    case -1724546052: // description
3655      this.description = castToString(value); // StringType
3656      return value;
3657    case -905838985: // series
3658      this.getSeries().add((ImagingStudySeriesComponent) value); // ImagingStudySeriesComponent
3659      return value;
3660    default:
3661      return super.setProperty(hash, name, value);
3662    }
3663
3664  }
3665
3666  @Override
3667  public Base setProperty(String name, Base value) throws FHIRException {
3668    if (name.equals("identifier")) {
3669      this.getIdentifier().add(castToIdentifier(value));
3670    } else if (name.equals("status")) {
3671      value = new ImagingStudyStatusEnumFactory().fromType(castToCode(value));
3672      this.status = (Enumeration) value; // Enumeration<ImagingStudyStatus>
3673    } else if (name.equals("modality")) {
3674      this.getModality().add(castToCoding(value));
3675    } else if (name.equals("subject")) {
3676      this.subject = castToReference(value); // Reference
3677    } else if (name.equals("encounter")) {
3678      this.encounter = castToReference(value); // Reference
3679    } else if (name.equals("started")) {
3680      this.started = castToDateTime(value); // DateTimeType
3681    } else if (name.equals("basedOn")) {
3682      this.getBasedOn().add(castToReference(value));
3683    } else if (name.equals("referrer")) {
3684      this.referrer = castToReference(value); // Reference
3685    } else if (name.equals("interpreter")) {
3686      this.getInterpreter().add(castToReference(value));
3687    } else if (name.equals("endpoint")) {
3688      this.getEndpoint().add(castToReference(value));
3689    } else if (name.equals("numberOfSeries")) {
3690      this.numberOfSeries = castToUnsignedInt(value); // UnsignedIntType
3691    } else if (name.equals("numberOfInstances")) {
3692      this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType
3693    } else if (name.equals("procedureReference")) {
3694      this.procedureReference = castToReference(value); // Reference
3695    } else if (name.equals("procedureCode")) {
3696      this.getProcedureCode().add(castToCodeableConcept(value));
3697    } else if (name.equals("location")) {
3698      this.location = castToReference(value); // Reference
3699    } else if (name.equals("reasonCode")) {
3700      this.getReasonCode().add(castToCodeableConcept(value));
3701    } else if (name.equals("reasonReference")) {
3702      this.getReasonReference().add(castToReference(value));
3703    } else if (name.equals("note")) {
3704      this.getNote().add(castToAnnotation(value));
3705    } else if (name.equals("description")) {
3706      this.description = castToString(value); // StringType
3707    } else if (name.equals("series")) {
3708      this.getSeries().add((ImagingStudySeriesComponent) value);
3709    } else
3710      return super.setProperty(name, value);
3711    return value;
3712  }
3713
3714  @Override
3715  public void removeChild(String name, Base value) throws FHIRException {
3716    if (name.equals("identifier")) {
3717      this.getIdentifier().remove(castToIdentifier(value));
3718    } else if (name.equals("status")) {
3719      this.status = null;
3720    } else if (name.equals("modality")) {
3721      this.getModality().remove(castToCoding(value));
3722    } else if (name.equals("subject")) {
3723      this.subject = null;
3724    } else if (name.equals("encounter")) {
3725      this.encounter = null;
3726    } else if (name.equals("started")) {
3727      this.started = null;
3728    } else if (name.equals("basedOn")) {
3729      this.getBasedOn().remove(castToReference(value));
3730    } else if (name.equals("referrer")) {
3731      this.referrer = null;
3732    } else if (name.equals("interpreter")) {
3733      this.getInterpreter().remove(castToReference(value));
3734    } else if (name.equals("endpoint")) {
3735      this.getEndpoint().remove(castToReference(value));
3736    } else if (name.equals("numberOfSeries")) {
3737      this.numberOfSeries = null;
3738    } else if (name.equals("numberOfInstances")) {
3739      this.numberOfInstances = null;
3740    } else if (name.equals("procedureReference")) {
3741      this.procedureReference = null;
3742    } else if (name.equals("procedureCode")) {
3743      this.getProcedureCode().remove(castToCodeableConcept(value));
3744    } else if (name.equals("location")) {
3745      this.location = null;
3746    } else if (name.equals("reasonCode")) {
3747      this.getReasonCode().remove(castToCodeableConcept(value));
3748    } else if (name.equals("reasonReference")) {
3749      this.getReasonReference().remove(castToReference(value));
3750    } else if (name.equals("note")) {
3751      this.getNote().remove(castToAnnotation(value));
3752    } else if (name.equals("description")) {
3753      this.description = null;
3754    } else if (name.equals("series")) {
3755      this.getSeries().remove((ImagingStudySeriesComponent) value);
3756    } else
3757      super.removeChild(name, value);
3758    
3759  }
3760
3761  @Override
3762  public Base makeProperty(int hash, String name) throws FHIRException {
3763    switch (hash) {
3764    case -1618432855:
3765      return addIdentifier();
3766    case -892481550:
3767      return getStatusElement();
3768    case -622722335:
3769      return addModality();
3770    case -1867885268:
3771      return getSubject();
3772    case 1524132147:
3773      return getEncounter();
3774    case -1897185151:
3775      return getStartedElement();
3776    case -332612366:
3777      return addBasedOn();
3778    case -722568161:
3779      return getReferrer();
3780    case -2008009094:
3781      return addInterpreter();
3782    case 1741102485:
3783      return addEndpoint();
3784    case 1920000407:
3785      return getNumberOfSeriesElement();
3786    case -1043544226:
3787      return getNumberOfInstancesElement();
3788    case 881809848:
3789      return getProcedureReference();
3790    case -698023072:
3791      return addProcedureCode();
3792    case 1901043637:
3793      return getLocation();
3794    case 722137681:
3795      return addReasonCode();
3796    case -1146218137:
3797      return addReasonReference();
3798    case 3387378:
3799      return addNote();
3800    case -1724546052:
3801      return getDescriptionElement();
3802    case -905838985:
3803      return addSeries();
3804    default:
3805      return super.makeProperty(hash, name);
3806    }
3807
3808  }
3809
3810  @Override
3811  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3812    switch (hash) {
3813    case -1618432855:
3814      /* identifier */ return new String[] { "Identifier" };
3815    case -892481550:
3816      /* status */ return new String[] { "code" };
3817    case -622722335:
3818      /* modality */ return new String[] { "Coding" };
3819    case -1867885268:
3820      /* subject */ return new String[] { "Reference" };
3821    case 1524132147:
3822      /* encounter */ return new String[] { "Reference" };
3823    case -1897185151:
3824      /* started */ return new String[] { "dateTime" };
3825    case -332612366:
3826      /* basedOn */ return new String[] { "Reference" };
3827    case -722568161:
3828      /* referrer */ return new String[] { "Reference" };
3829    case -2008009094:
3830      /* interpreter */ return new String[] { "Reference" };
3831    case 1741102485:
3832      /* endpoint */ return new String[] { "Reference" };
3833    case 1920000407:
3834      /* numberOfSeries */ return new String[] { "unsignedInt" };
3835    case -1043544226:
3836      /* numberOfInstances */ return new String[] { "unsignedInt" };
3837    case 881809848:
3838      /* procedureReference */ return new String[] { "Reference" };
3839    case -698023072:
3840      /* procedureCode */ return new String[] { "CodeableConcept" };
3841    case 1901043637:
3842      /* location */ return new String[] { "Reference" };
3843    case 722137681:
3844      /* reasonCode */ return new String[] { "CodeableConcept" };
3845    case -1146218137:
3846      /* reasonReference */ return new String[] { "Reference" };
3847    case 3387378:
3848      /* note */ return new String[] { "Annotation" };
3849    case -1724546052:
3850      /* description */ return new String[] { "string" };
3851    case -905838985:
3852      /* series */ return new String[] {};
3853    default:
3854      return super.getTypesForProperty(hash, name);
3855    }
3856
3857  }
3858
3859  @Override
3860  public Base addChild(String name) throws FHIRException {
3861    if (name.equals("identifier")) {
3862      return addIdentifier();
3863    } else if (name.equals("status")) {
3864      throw new FHIRException("Cannot call addChild on a singleton property ImagingStudy.status");
3865    } else if (name.equals("modality")) {
3866      return addModality();
3867    } else if (name.equals("subject")) {
3868      this.subject = new Reference();
3869      return this.subject;
3870    } else if (name.equals("encounter")) {
3871      this.encounter = new Reference();
3872      return this.encounter;
3873    } else if (name.equals("started")) {
3874      throw new FHIRException("Cannot call addChild on a singleton property ImagingStudy.started");
3875    } else if (name.equals("basedOn")) {
3876      return addBasedOn();
3877    } else if (name.equals("referrer")) {
3878      this.referrer = new Reference();
3879      return this.referrer;
3880    } else if (name.equals("interpreter")) {
3881      return addInterpreter();
3882    } else if (name.equals("endpoint")) {
3883      return addEndpoint();
3884    } else if (name.equals("numberOfSeries")) {
3885      throw new FHIRException("Cannot call addChild on a singleton property ImagingStudy.numberOfSeries");
3886    } else if (name.equals("numberOfInstances")) {
3887      throw new FHIRException("Cannot call addChild on a singleton property ImagingStudy.numberOfInstances");
3888    } else if (name.equals("procedureReference")) {
3889      this.procedureReference = new Reference();
3890      return this.procedureReference;
3891    } else if (name.equals("procedureCode")) {
3892      return addProcedureCode();
3893    } else if (name.equals("location")) {
3894      this.location = new Reference();
3895      return this.location;
3896    } else if (name.equals("reasonCode")) {
3897      return addReasonCode();
3898    } else if (name.equals("reasonReference")) {
3899      return addReasonReference();
3900    } else if (name.equals("note")) {
3901      return addNote();
3902    } else if (name.equals("description")) {
3903      throw new FHIRException("Cannot call addChild on a singleton property ImagingStudy.description");
3904    } else if (name.equals("series")) {
3905      return addSeries();
3906    } else
3907      return super.addChild(name);
3908  }
3909
3910  public String fhirType() {
3911    return "ImagingStudy";
3912
3913  }
3914
3915  public ImagingStudy copy() {
3916    ImagingStudy dst = new ImagingStudy();
3917    copyValues(dst);
3918    return dst;
3919  }
3920
3921  public void copyValues(ImagingStudy dst) {
3922    super.copyValues(dst);
3923    if (identifier != null) {
3924      dst.identifier = new ArrayList<Identifier>();
3925      for (Identifier i : identifier)
3926        dst.identifier.add(i.copy());
3927    }
3928    ;
3929    dst.status = status == null ? null : status.copy();
3930    if (modality != null) {
3931      dst.modality = new ArrayList<Coding>();
3932      for (Coding i : modality)
3933        dst.modality.add(i.copy());
3934    }
3935    ;
3936    dst.subject = subject == null ? null : subject.copy();
3937    dst.encounter = encounter == null ? null : encounter.copy();
3938    dst.started = started == null ? null : started.copy();
3939    if (basedOn != null) {
3940      dst.basedOn = new ArrayList<Reference>();
3941      for (Reference i : basedOn)
3942        dst.basedOn.add(i.copy());
3943    }
3944    ;
3945    dst.referrer = referrer == null ? null : referrer.copy();
3946    if (interpreter != null) {
3947      dst.interpreter = new ArrayList<Reference>();
3948      for (Reference i : interpreter)
3949        dst.interpreter.add(i.copy());
3950    }
3951    ;
3952    if (endpoint != null) {
3953      dst.endpoint = new ArrayList<Reference>();
3954      for (Reference i : endpoint)
3955        dst.endpoint.add(i.copy());
3956    }
3957    ;
3958    dst.numberOfSeries = numberOfSeries == null ? null : numberOfSeries.copy();
3959    dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy();
3960    dst.procedureReference = procedureReference == null ? null : procedureReference.copy();
3961    if (procedureCode != null) {
3962      dst.procedureCode = new ArrayList<CodeableConcept>();
3963      for (CodeableConcept i : procedureCode)
3964        dst.procedureCode.add(i.copy());
3965    }
3966    ;
3967    dst.location = location == null ? null : location.copy();
3968    if (reasonCode != null) {
3969      dst.reasonCode = new ArrayList<CodeableConcept>();
3970      for (CodeableConcept i : reasonCode)
3971        dst.reasonCode.add(i.copy());
3972    }
3973    ;
3974    if (reasonReference != null) {
3975      dst.reasonReference = new ArrayList<Reference>();
3976      for (Reference i : reasonReference)
3977        dst.reasonReference.add(i.copy());
3978    }
3979    ;
3980    if (note != null) {
3981      dst.note = new ArrayList<Annotation>();
3982      for (Annotation i : note)
3983        dst.note.add(i.copy());
3984    }
3985    ;
3986    dst.description = description == null ? null : description.copy();
3987    if (series != null) {
3988      dst.series = new ArrayList<ImagingStudySeriesComponent>();
3989      for (ImagingStudySeriesComponent i : series)
3990        dst.series.add(i.copy());
3991    }
3992    ;
3993  }
3994
3995  protected ImagingStudy typedCopy() {
3996    return copy();
3997  }
3998
3999  @Override
4000  public boolean equalsDeep(Base other_) {
4001    if (!super.equalsDeep(other_))
4002      return false;
4003    if (!(other_ instanceof ImagingStudy))
4004      return false;
4005    ImagingStudy o = (ImagingStudy) other_;
4006    return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true)
4007        && compareDeep(modality, o.modality, true) && compareDeep(subject, o.subject, true)
4008        && compareDeep(encounter, o.encounter, true) && compareDeep(started, o.started, true)
4009        && compareDeep(basedOn, o.basedOn, true) && compareDeep(referrer, o.referrer, true)
4010        && compareDeep(interpreter, o.interpreter, true) && compareDeep(endpoint, o.endpoint, true)
4011        && compareDeep(numberOfSeries, o.numberOfSeries, true)
4012        && compareDeep(numberOfInstances, o.numberOfInstances, true)
4013        && compareDeep(procedureReference, o.procedureReference, true)
4014        && compareDeep(procedureCode, o.procedureCode, true) && compareDeep(location, o.location, true)
4015        && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true)
4016        && compareDeep(note, o.note, true) && compareDeep(description, o.description, true)
4017        && compareDeep(series, o.series, true);
4018  }
4019
4020  @Override
4021  public boolean equalsShallow(Base other_) {
4022    if (!super.equalsShallow(other_))
4023      return false;
4024    if (!(other_ instanceof ImagingStudy))
4025      return false;
4026    ImagingStudy o = (ImagingStudy) other_;
4027    return compareValues(status, o.status, true) && compareValues(started, o.started, true)
4028        && compareValues(numberOfSeries, o.numberOfSeries, true)
4029        && compareValues(numberOfInstances, o.numberOfInstances, true)
4030        && compareValues(description, o.description, true);
4031  }
4032
4033  public boolean isEmpty() {
4034    return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, modality, subject, encounter,
4035        started, basedOn, referrer, interpreter, endpoint, numberOfSeries, numberOfInstances, procedureReference,
4036        procedureCode, location, reasonCode, reasonReference, note, description, series);
4037  }
4038
4039  @Override
4040  public ResourceType getResourceType() {
4041    return ResourceType.ImagingStudy;
4042  }
4043
4044  /**
4045   * Search parameter: <b>identifier</b>
4046   * <p>
4047   * Description: <b>Identifiers for the Study, such as DICOM Study Instance UID
4048   * and Accession number</b><br>
4049   * Type: <b>token</b><br>
4050   * Path: <b>ImagingStudy.identifier</b><br>
4051   * </p>
4052   */
4053  @SearchParamDefinition(name = "identifier", path = "ImagingStudy.identifier", description = "Identifiers for the Study, such as DICOM Study Instance UID and Accession number", type = "token")
4054  public static final String SP_IDENTIFIER = "identifier";
4055  /**
4056   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4057   * <p>
4058   * Description: <b>Identifiers for the Study, such as DICOM Study Instance UID
4059   * and Accession number</b><br>
4060   * Type: <b>token</b><br>
4061   * Path: <b>ImagingStudy.identifier</b><br>
4062   * </p>
4063   */
4064  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
4065      SP_IDENTIFIER);
4066
4067  /**
4068   * Search parameter: <b>reason</b>
4069   * <p>
4070   * Description: <b>The reason for the study</b><br>
4071   * Type: <b>token</b><br>
4072   * Path: <b>ImagingStudy.reasonCode</b><br>
4073   * </p>
4074   */
4075  @SearchParamDefinition(name = "reason", path = "ImagingStudy.reasonCode", description = "The reason for the study", type = "token")
4076  public static final String SP_REASON = "reason";
4077  /**
4078   * <b>Fluent Client</b> search parameter constant for <b>reason</b>
4079   * <p>
4080   * Description: <b>The reason for the study</b><br>
4081   * Type: <b>token</b><br>
4082   * Path: <b>ImagingStudy.reasonCode</b><br>
4083   * </p>
4084   */
4085  public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(
4086      SP_REASON);
4087
4088  /**
4089   * Search parameter: <b>dicom-class</b>
4090   * <p>
4091   * Description: <b>The type of the instance</b><br>
4092   * Type: <b>token</b><br>
4093   * Path: <b>ImagingStudy.series.instance.sopClass</b><br>
4094   * </p>
4095   */
4096  @SearchParamDefinition(name = "dicom-class", path = "ImagingStudy.series.instance.sopClass", description = "The type of the instance", type = "token")
4097  public static final String SP_DICOM_CLASS = "dicom-class";
4098  /**
4099   * <b>Fluent Client</b> search parameter constant for <b>dicom-class</b>
4100   * <p>
4101   * Description: <b>The type of the instance</b><br>
4102   * Type: <b>token</b><br>
4103   * Path: <b>ImagingStudy.series.instance.sopClass</b><br>
4104   * </p>
4105   */
4106  public static final ca.uhn.fhir.rest.gclient.TokenClientParam DICOM_CLASS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
4107      SP_DICOM_CLASS);
4108
4109  /**
4110   * Search parameter: <b>modality</b>
4111   * <p>
4112   * Description: <b>The modality of the series</b><br>
4113   * Type: <b>token</b><br>
4114   * Path: <b>ImagingStudy.series.modality</b><br>
4115   * </p>
4116   */
4117  @SearchParamDefinition(name = "modality", path = "ImagingStudy.series.modality", description = "The modality of the series", type = "token")
4118  public static final String SP_MODALITY = "modality";
4119  /**
4120   * <b>Fluent Client</b> search parameter constant for <b>modality</b>
4121   * <p>
4122   * Description: <b>The modality of the series</b><br>
4123   * Type: <b>token</b><br>
4124   * Path: <b>ImagingStudy.series.modality</b><br>
4125   * </p>
4126   */
4127  public static final ca.uhn.fhir.rest.gclient.TokenClientParam MODALITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(
4128      SP_MODALITY);
4129
4130  /**
4131   * Search parameter: <b>bodysite</b>
4132   * <p>
4133   * Description: <b>The body site studied</b><br>
4134   * Type: <b>token</b><br>
4135   * Path: <b>ImagingStudy.series.bodySite</b><br>
4136   * </p>
4137   */
4138  @SearchParamDefinition(name = "bodysite", path = "ImagingStudy.series.bodySite", description = "The body site studied", type = "token")
4139  public static final String SP_BODYSITE = "bodysite";
4140  /**
4141   * <b>Fluent Client</b> search parameter constant for <b>bodysite</b>
4142   * <p>
4143   * Description: <b>The body site studied</b><br>
4144   * Type: <b>token</b><br>
4145   * Path: <b>ImagingStudy.series.bodySite</b><br>
4146   * </p>
4147   */
4148  public static final ca.uhn.fhir.rest.gclient.TokenClientParam BODYSITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
4149      SP_BODYSITE);
4150
4151  /**
4152   * Search parameter: <b>instance</b>
4153   * <p>
4154   * Description: <b>SOP Instance UID for an instance</b><br>
4155   * Type: <b>token</b><br>
4156   * Path: <b>ImagingStudy.series.instance.uid</b><br>
4157   * </p>
4158   */
4159  @SearchParamDefinition(name = "instance", path = "ImagingStudy.series.instance.uid", description = "SOP Instance UID for an instance", type = "token")
4160  public static final String SP_INSTANCE = "instance";
4161  /**
4162   * <b>Fluent Client</b> search parameter constant for <b>instance</b>
4163   * <p>
4164   * Description: <b>SOP Instance UID for an instance</b><br>
4165   * Type: <b>token</b><br>
4166   * Path: <b>ImagingStudy.series.instance.uid</b><br>
4167   * </p>
4168   */
4169  public static final ca.uhn.fhir.rest.gclient.TokenClientParam INSTANCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
4170      SP_INSTANCE);
4171
4172  /**
4173   * Search parameter: <b>performer</b>
4174   * <p>
4175   * Description: <b>The person who performed the study</b><br>
4176   * Type: <b>reference</b><br>
4177   * Path: <b>ImagingStudy.series.performer.actor</b><br>
4178   * </p>
4179   */
4180  @SearchParamDefinition(name = "performer", path = "ImagingStudy.series.performer.actor", description = "The person who performed the study", type = "reference", target = {
4181      CareTeam.class, Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class,
4182      RelatedPerson.class })
4183  public static final String SP_PERFORMER = "performer";
4184  /**
4185   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
4186   * <p>
4187   * Description: <b>The person who performed the study</b><br>
4188   * Type: <b>reference</b><br>
4189   * Path: <b>ImagingStudy.series.performer.actor</b><br>
4190   * </p>
4191   */
4192  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
4193      SP_PERFORMER);
4194
4195  /**
4196   * Constant for fluent queries to be used to add include statements. Specifies
4197   * the path value of "<b>ImagingStudy:performer</b>".
4198   */
4199  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include(
4200      "ImagingStudy:performer").toLocked();
4201
4202  /**
4203   * Search parameter: <b>subject</b>
4204   * <p>
4205   * Description: <b>Who the study is about</b><br>
4206   * Type: <b>reference</b><br>
4207   * Path: <b>ImagingStudy.subject</b><br>
4208   * </p>
4209   */
4210  @SearchParamDefinition(name = "subject", path = "ImagingStudy.subject", description = "Who the study is about", type = "reference", target = {
4211      Device.class, Group.class, Patient.class })
4212  public static final String SP_SUBJECT = "subject";
4213  /**
4214   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
4215   * <p>
4216   * Description: <b>Who the study is about</b><br>
4217   * Type: <b>reference</b><br>
4218   * Path: <b>ImagingStudy.subject</b><br>
4219   * </p>
4220   */
4221  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
4222      SP_SUBJECT);
4223
4224  /**
4225   * Constant for fluent queries to be used to add include statements. Specifies
4226   * the path value of "<b>ImagingStudy:subject</b>".
4227   */
4228  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include(
4229      "ImagingStudy:subject").toLocked();
4230
4231  /**
4232   * Search parameter: <b>started</b>
4233   * <p>
4234   * Description: <b>When the study was started</b><br>
4235   * Type: <b>date</b><br>
4236   * Path: <b>ImagingStudy.started</b><br>
4237   * </p>
4238   */
4239  @SearchParamDefinition(name = "started", path = "ImagingStudy.started", description = "When the study was started", type = "date")
4240  public static final String SP_STARTED = "started";
4241  /**
4242   * <b>Fluent Client</b> search parameter constant for <b>started</b>
4243   * <p>
4244   * Description: <b>When the study was started</b><br>
4245   * Type: <b>date</b><br>
4246   * Path: <b>ImagingStudy.started</b><br>
4247   * </p>
4248   */
4249  public static final ca.uhn.fhir.rest.gclient.DateClientParam STARTED = new ca.uhn.fhir.rest.gclient.DateClientParam(
4250      SP_STARTED);
4251
4252  /**
4253   * Search parameter: <b>interpreter</b>
4254   * <p>
4255   * Description: <b>Who interpreted the images</b><br>
4256   * Type: <b>reference</b><br>
4257   * Path: <b>ImagingStudy.interpreter</b><br>
4258   * </p>
4259   */
4260  @SearchParamDefinition(name = "interpreter", path = "ImagingStudy.interpreter", description = "Who interpreted the images", type = "reference", target = {
4261      Practitioner.class, PractitionerRole.class })
4262  public static final String SP_INTERPRETER = "interpreter";
4263  /**
4264   * <b>Fluent Client</b> search parameter constant for <b>interpreter</b>
4265   * <p>
4266   * Description: <b>Who interpreted the images</b><br>
4267   * Type: <b>reference</b><br>
4268   * Path: <b>ImagingStudy.interpreter</b><br>
4269   * </p>
4270   */
4271  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INTERPRETER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
4272      SP_INTERPRETER);
4273
4274  /**
4275   * Constant for fluent queries to be used to add include statements. Specifies
4276   * the path value of "<b>ImagingStudy:interpreter</b>".
4277   */
4278  public static final ca.uhn.fhir.model.api.Include INCLUDE_INTERPRETER = new ca.uhn.fhir.model.api.Include(
4279      "ImagingStudy:interpreter").toLocked();
4280
4281  /**
4282   * Search parameter: <b>encounter</b>
4283   * <p>
4284   * Description: <b>The context of the study</b><br>
4285   * Type: <b>reference</b><br>
4286   * Path: <b>ImagingStudy.encounter</b><br>
4287   * </p>
4288   */
4289  @SearchParamDefinition(name = "encounter", path = "ImagingStudy.encounter", description = "The context of the study", type = "reference", target = {
4290      Encounter.class })
4291  public static final String SP_ENCOUNTER = "encounter";
4292  /**
4293   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
4294   * <p>
4295   * Description: <b>The context of the study</b><br>
4296   * Type: <b>reference</b><br>
4297   * Path: <b>ImagingStudy.encounter</b><br>
4298   * </p>
4299   */
4300  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
4301      SP_ENCOUNTER);
4302
4303  /**
4304   * Constant for fluent queries to be used to add include statements. Specifies
4305   * the path value of "<b>ImagingStudy:encounter</b>".
4306   */
4307  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include(
4308      "ImagingStudy:encounter").toLocked();
4309
4310  /**
4311   * Search parameter: <b>referrer</b>
4312   * <p>
4313   * Description: <b>The referring physician</b><br>
4314   * Type: <b>reference</b><br>
4315   * Path: <b>ImagingStudy.referrer</b><br>
4316   * </p>
4317   */
4318  @SearchParamDefinition(name = "referrer", path = "ImagingStudy.referrer", description = "The referring physician", type = "reference", target = {
4319      Practitioner.class, PractitionerRole.class })
4320  public static final String SP_REFERRER = "referrer";
4321  /**
4322   * <b>Fluent Client</b> search parameter constant for <b>referrer</b>
4323   * <p>
4324   * Description: <b>The referring physician</b><br>
4325   * Type: <b>reference</b><br>
4326   * Path: <b>ImagingStudy.referrer</b><br>
4327   * </p>
4328   */
4329  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REFERRER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
4330      SP_REFERRER);
4331
4332  /**
4333   * Constant for fluent queries to be used to add include statements. Specifies
4334   * the path value of "<b>ImagingStudy:referrer</b>".
4335   */
4336  public static final ca.uhn.fhir.model.api.Include INCLUDE_REFERRER = new ca.uhn.fhir.model.api.Include(
4337      "ImagingStudy:referrer").toLocked();
4338
4339  /**
4340   * Search parameter: <b>endpoint</b>
4341   * <p>
4342   * Description: <b>The endpoint for the study or series</b><br>
4343   * Type: <b>reference</b><br>
4344   * Path: <b>ImagingStudy.endpoint, ImagingStudy.series.endpoint</b><br>
4345   * </p>
4346   */
4347  @SearchParamDefinition(name = "endpoint", path = "ImagingStudy.endpoint | ImagingStudy.series.endpoint", description = "The endpoint for the study or series", type = "reference", target = {
4348      Endpoint.class })
4349  public static final String SP_ENDPOINT = "endpoint";
4350  /**
4351   * <b>Fluent Client</b> search parameter constant for <b>endpoint</b>
4352   * <p>
4353   * Description: <b>The endpoint for the study or series</b><br>
4354   * Type: <b>reference</b><br>
4355   * Path: <b>ImagingStudy.endpoint, ImagingStudy.series.endpoint</b><br>
4356   * </p>
4357   */
4358  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENDPOINT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
4359      SP_ENDPOINT);
4360
4361  /**
4362   * Constant for fluent queries to be used to add include statements. Specifies
4363   * the path value of "<b>ImagingStudy:endpoint</b>".
4364   */
4365  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENDPOINT = new ca.uhn.fhir.model.api.Include(
4366      "ImagingStudy:endpoint").toLocked();
4367
4368  /**
4369   * Search parameter: <b>patient</b>
4370   * <p>
4371   * Description: <b>Who the study is about</b><br>
4372   * Type: <b>reference</b><br>
4373   * Path: <b>ImagingStudy.subject</b><br>
4374   * </p>
4375   */
4376  @SearchParamDefinition(name = "patient", path = "ImagingStudy.subject.where(resolve() is Patient)", description = "Who the study is about", type = "reference", providesMembershipIn = {
4377      @ca.uhn.fhir.model.api.annotation.Compartment(name = "Patient") }, target = { Patient.class })
4378  public static final String SP_PATIENT = "patient";
4379  /**
4380   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
4381   * <p>
4382   * Description: <b>Who the study is about</b><br>
4383   * Type: <b>reference</b><br>
4384   * Path: <b>ImagingStudy.subject</b><br>
4385   * </p>
4386   */
4387  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
4388      SP_PATIENT);
4389
4390  /**
4391   * Constant for fluent queries to be used to add include statements. Specifies
4392   * the path value of "<b>ImagingStudy:patient</b>".
4393   */
4394  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include(
4395      "ImagingStudy:patient").toLocked();
4396
4397  /**
4398   * Search parameter: <b>series</b>
4399   * <p>
4400   * Description: <b>DICOM Series Instance UID for a series</b><br>
4401   * Type: <b>token</b><br>
4402   * Path: <b>ImagingStudy.series.uid</b><br>
4403   * </p>
4404   */
4405  @SearchParamDefinition(name = "series", path = "ImagingStudy.series.uid", description = "DICOM Series Instance UID for a series", type = "token")
4406  public static final String SP_SERIES = "series";
4407  /**
4408   * <b>Fluent Client</b> search parameter constant for <b>series</b>
4409   * <p>
4410   * Description: <b>DICOM Series Instance UID for a series</b><br>
4411   * Type: <b>token</b><br>
4412   * Path: <b>ImagingStudy.series.uid</b><br>
4413   * </p>
4414   */
4415  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERIES = new ca.uhn.fhir.rest.gclient.TokenClientParam(
4416      SP_SERIES);
4417
4418  /**
4419   * Search parameter: <b>basedon</b>
4420   * <p>
4421   * Description: <b>The order for the image</b><br>
4422   * Type: <b>reference</b><br>
4423   * Path: <b>ImagingStudy.basedOn</b><br>
4424   * </p>
4425   */
4426  @SearchParamDefinition(name = "basedon", path = "ImagingStudy.basedOn", description = "The order for the image", type = "reference", target = {
4427      Appointment.class, AppointmentResponse.class, CarePlan.class, ServiceRequest.class, Task.class })
4428  public static final String SP_BASEDON = "basedon";
4429  /**
4430   * <b>Fluent Client</b> search parameter constant for <b>basedon</b>
4431   * <p>
4432   * Description: <b>The order for the image</b><br>
4433   * Type: <b>reference</b><br>
4434   * Path: <b>ImagingStudy.basedOn</b><br>
4435   * </p>
4436   */
4437  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASEDON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(
4438      SP_BASEDON);
4439
4440  /**
4441   * Constant for fluent queries to be used to add include statements. Specifies
4442   * the path value of "<b>ImagingStudy:basedon</b>".
4443   */
4444  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASEDON = new ca.uhn.fhir.model.api.Include(
4445      "ImagingStudy:basedon").toLocked();
4446
4447  /**
4448   * Search parameter: <b>status</b>
4449   * <p>
4450   * Description: <b>The status of the study</b><br>
4451   * Type: <b>token</b><br>
4452   * Path: <b>ImagingStudy.status</b><br>
4453   * </p>
4454   */
4455  @SearchParamDefinition(name = "status", path = "ImagingStudy.status", description = "The status of the study", type = "token")
4456  public static final String SP_STATUS = "status";
4457  /**
4458   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4459   * <p>
4460   * Description: <b>The status of the study</b><br>
4461   * Type: <b>token</b><br>
4462   * Path: <b>ImagingStudy.status</b><br>
4463   * </p>
4464   */
4465  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
4466      SP_STATUS);
4467
4468}