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