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