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