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