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