001package org.hl7.fhir.dstu2.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.dstu2
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/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, 
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this 
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, 
034     this list of conditions and the following disclaimer in the documentation 
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
049  POSSIBILITY OF SUCH DAMAGE.
050  
051*/
052
053// Generated on Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
054import java.util.ArrayList;
055import java.util.Date;
056import java.util.List;
057
058import ca.uhn.fhir.model.api.annotation.Block;
059import ca.uhn.fhir.model.api.annotation.Child;
060import ca.uhn.fhir.model.api.annotation.Description;
061import ca.uhn.fhir.model.api.annotation.ResourceDef;
062import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
063import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
064import org.hl7.fhir.exceptions.FHIRException;
065import org.hl7.fhir.utilities.Utilities;
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
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        throw new FHIRException("Unknown InstanceAvailability code '"+codeString+"'");
105        }
106        public String toCode() {
107          switch (this) {
108            case ONLINE: return "ONLINE";
109            case OFFLINE: return "OFFLINE";
110            case NEARLINE: return "NEARLINE";
111            case UNAVAILABLE: return "UNAVAILABLE";
112            default: return "?";
113          }
114        }
115        public String getSystem() {
116          switch (this) {
117            case ONLINE: return "http://nema.org/dicom/dicm";
118            case OFFLINE: return "http://nema.org/dicom/dicm";
119            case NEARLINE: return "http://nema.org/dicom/dicm";
120            case UNAVAILABLE: return "http://nema.org/dicom/dicm";
121            default: return "?";
122          }
123        }
124        public String getDefinition() {
125          switch (this) {
126            case ONLINE: return "";
127            case OFFLINE: return "";
128            case NEARLINE: return "";
129            case UNAVAILABLE: return "";
130            default: return "?";
131          }
132        }
133        public String getDisplay() {
134          switch (this) {
135            case ONLINE: return "ONLINE";
136            case OFFLINE: return "OFFLINE";
137            case NEARLINE: return "NEARLINE";
138            case UNAVAILABLE: return "UNAVAILABLE";
139            default: return "?";
140          }
141        }
142    }
143
144  public static class InstanceAvailabilityEnumFactory implements EnumFactory<InstanceAvailability> {
145    public InstanceAvailability fromCode(String codeString) throws IllegalArgumentException {
146      if (codeString == null || "".equals(codeString))
147            if (codeString == null || "".equals(codeString))
148                return null;
149        if ("ONLINE".equals(codeString))
150          return InstanceAvailability.ONLINE;
151        if ("OFFLINE".equals(codeString))
152          return InstanceAvailability.OFFLINE;
153        if ("NEARLINE".equals(codeString))
154          return InstanceAvailability.NEARLINE;
155        if ("UNAVAILABLE".equals(codeString))
156          return InstanceAvailability.UNAVAILABLE;
157        throw new IllegalArgumentException("Unknown InstanceAvailability code '"+codeString+"'");
158        }
159        public Enumeration<InstanceAvailability> fromType(Base code) throws FHIRException {
160          if (code == null || code.isEmpty())
161            return null;
162          String codeString = ((PrimitiveType) code).asStringValue();
163          if (codeString == null || "".equals(codeString))
164            return null;
165        if ("ONLINE".equals(codeString))
166          return new Enumeration<InstanceAvailability>(this, InstanceAvailability.ONLINE);
167        if ("OFFLINE".equals(codeString))
168          return new Enumeration<InstanceAvailability>(this, InstanceAvailability.OFFLINE);
169        if ("NEARLINE".equals(codeString))
170          return new Enumeration<InstanceAvailability>(this, InstanceAvailability.NEARLINE);
171        if ("UNAVAILABLE".equals(codeString))
172          return new Enumeration<InstanceAvailability>(this, InstanceAvailability.UNAVAILABLE);
173        throw new FHIRException("Unknown InstanceAvailability code '"+codeString+"'");
174        }
175    public String toCode(InstanceAvailability code) {
176      if (code == InstanceAvailability.ONLINE)
177        return "ONLINE";
178      if (code == InstanceAvailability.OFFLINE)
179        return "OFFLINE";
180      if (code == InstanceAvailability.NEARLINE)
181        return "NEARLINE";
182      if (code == InstanceAvailability.UNAVAILABLE)
183        return "UNAVAILABLE";
184      return "?";
185      }
186    }
187
188    @Block()
189    public static class ImagingStudySeriesComponent extends BackboneElement implements IBaseBackboneElement {
190        /**
191         * The Numeric identifier of this series in the study.
192         */
193        @Child(name = "number", type = {UnsignedIntType.class}, order=1, min=0, max=1, modifier=false, summary=true)
194        @Description(shortDefinition="Numeric identifier of this series", formalDefinition="The Numeric identifier of this series in the study." )
195        protected UnsignedIntType number;
196
197        /**
198         * The modality of this series sequence.
199         */
200        @Child(name = "modality", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true)
201        @Description(shortDefinition="The modality of the instances in the series", formalDefinition="The modality of this series sequence." )
202        protected Coding modality;
203
204        /**
205         * Formal identifier for this series.
206         */
207        @Child(name = "uid", type = {OidType.class}, order=3, min=1, max=1, modifier=false, summary=true)
208        @Description(shortDefinition="Formal identifier for this series", formalDefinition="Formal identifier for this series." )
209        protected OidType uid;
210
211        /**
212         * A description of the series.
213         */
214        @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
215        @Description(shortDefinition="A description of the series", formalDefinition="A description of the series." )
216        protected StringType description;
217
218        /**
219         * Number of SOP Instances in Series.
220         */
221        @Child(name = "numberOfInstances", type = {UnsignedIntType.class}, order=5, min=1, max=1, modifier=false, summary=true)
222        @Description(shortDefinition="Number of Series Related Instances", formalDefinition="Number of SOP Instances in Series." )
223        protected UnsignedIntType numberOfInstances;
224
225        /**
226         * Availability of series (online, offline or nearline).
227         */
228        @Child(name = "availability", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true)
229        @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE", formalDefinition="Availability of series (online, offline or nearline)." )
230        protected Enumeration<InstanceAvailability> availability;
231
232        /**
233         * URI/URL specifying the location of the referenced series using WADO-RS.
234         */
235        @Child(name = "url", type = {UriType.class}, order=7, min=0, max=1, modifier=false, summary=true)
236        @Description(shortDefinition="Location of the referenced instance(s)", formalDefinition="URI/URL specifying the location of the referenced series using WADO-RS." )
237        protected UriType url;
238
239        /**
240         * Body part examined. See  DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT.
241         */
242        @Child(name = "bodySite", type = {Coding.class}, order=8, min=0, max=1, modifier=false, summary=true)
243        @Description(shortDefinition="Body part examined", formalDefinition="Body part examined. See  DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT." )
244        protected Coding bodySite;
245
246        /**
247         * Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code.
248         */
249        @Child(name = "laterality", type = {Coding.class}, order=9, min=0, max=1, modifier=false, summary=true)
250        @Description(shortDefinition="Body part laterality", formalDefinition="Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code." )
251        protected Coding laterality;
252
253        /**
254         * The date and time the series was started.
255         */
256        @Child(name = "started", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=true)
257        @Description(shortDefinition="When the series started", formalDefinition="The date and time the series was started." )
258        protected DateTimeType started;
259
260        /**
261         * A single SOP Instance within the series, e.g. an image, or presentation state.
262         */
263        @Child(name = "instance", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
264        @Description(shortDefinition="A single SOP instance from the series", formalDefinition="A single SOP Instance within the series, e.g. an image, or presentation state." )
265        protected List<ImagingStudySeriesInstanceComponent> instance;
266
267        private static final long serialVersionUID = -1798366943L;
268
269    /*
270     * Constructor
271     */
272      public ImagingStudySeriesComponent() {
273        super();
274      }
275
276    /*
277     * Constructor
278     */
279      public ImagingStudySeriesComponent(Coding modality, OidType uid, UnsignedIntType numberOfInstances) {
280        super();
281        this.modality = modality;
282        this.uid = uid;
283        this.numberOfInstances = numberOfInstances;
284      }
285
286        /**
287         * @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
288         */
289        public UnsignedIntType getNumberElement() { 
290          if (this.number == null)
291            if (Configuration.errorOnAutoCreate())
292              throw new Error("Attempt to auto-create ImagingStudySeriesComponent.number");
293            else if (Configuration.doAutoCreate())
294              this.number = new UnsignedIntType(); // bb
295          return this.number;
296        }
297
298        public boolean hasNumberElement() { 
299          return this.number != null && !this.number.isEmpty();
300        }
301
302        public boolean hasNumber() { 
303          return this.number != null && !this.number.isEmpty();
304        }
305
306        /**
307         * @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
308         */
309        public ImagingStudySeriesComponent setNumberElement(UnsignedIntType value) { 
310          this.number = value;
311          return this;
312        }
313
314        /**
315         * @return The Numeric identifier of this series in the study.
316         */
317        public int getNumber() { 
318          return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue();
319        }
320
321        /**
322         * @param value The Numeric identifier of this series in the study.
323         */
324        public ImagingStudySeriesComponent setNumber(int value) { 
325            if (this.number == null)
326              this.number = new UnsignedIntType();
327            this.number.setValue(value);
328          return this;
329        }
330
331        /**
332         * @return {@link #modality} (The modality of this series sequence.)
333         */
334        public Coding getModality() { 
335          if (this.modality == null)
336            if (Configuration.errorOnAutoCreate())
337              throw new Error("Attempt to auto-create ImagingStudySeriesComponent.modality");
338            else if (Configuration.doAutoCreate())
339              this.modality = new Coding(); // cc
340          return this.modality;
341        }
342
343        public boolean hasModality() { 
344          return this.modality != null && !this.modality.isEmpty();
345        }
346
347        /**
348         * @param value {@link #modality} (The modality of this series sequence.)
349         */
350        public ImagingStudySeriesComponent setModality(Coding value) { 
351          this.modality = value;
352          return this;
353        }
354
355        /**
356         * @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
357         */
358        public OidType getUidElement() { 
359          if (this.uid == null)
360            if (Configuration.errorOnAutoCreate())
361              throw new Error("Attempt to auto-create ImagingStudySeriesComponent.uid");
362            else if (Configuration.doAutoCreate())
363              this.uid = new OidType(); // bb
364          return this.uid;
365        }
366
367        public boolean hasUidElement() { 
368          return this.uid != null && !this.uid.isEmpty();
369        }
370
371        public boolean hasUid() { 
372          return this.uid != null && !this.uid.isEmpty();
373        }
374
375        /**
376         * @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
377         */
378        public ImagingStudySeriesComponent setUidElement(OidType value) { 
379          this.uid = value;
380          return this;
381        }
382
383        /**
384         * @return Formal identifier for this series.
385         */
386        public String getUid() { 
387          return this.uid == null ? null : this.uid.getValue();
388        }
389
390        /**
391         * @param value Formal identifier for this series.
392         */
393        public ImagingStudySeriesComponent setUid(String value) { 
394            if (this.uid == null)
395              this.uid = new OidType();
396            this.uid.setValue(value);
397          return this;
398        }
399
400        /**
401         * @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
402         */
403        public StringType getDescriptionElement() { 
404          if (this.description == null)
405            if (Configuration.errorOnAutoCreate())
406              throw new Error("Attempt to auto-create ImagingStudySeriesComponent.description");
407            else if (Configuration.doAutoCreate())
408              this.description = new StringType(); // bb
409          return this.description;
410        }
411
412        public boolean hasDescriptionElement() { 
413          return this.description != null && !this.description.isEmpty();
414        }
415
416        public boolean hasDescription() { 
417          return this.description != null && !this.description.isEmpty();
418        }
419
420        /**
421         * @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
422         */
423        public ImagingStudySeriesComponent setDescriptionElement(StringType value) { 
424          this.description = value;
425          return this;
426        }
427
428        /**
429         * @return A description of the series.
430         */
431        public String getDescription() { 
432          return this.description == null ? null : this.description.getValue();
433        }
434
435        /**
436         * @param value A description of the series.
437         */
438        public ImagingStudySeriesComponent setDescription(String value) { 
439          if (Utilities.noString(value))
440            this.description = null;
441          else {
442            if (this.description == null)
443              this.description = new StringType();
444            this.description.setValue(value);
445          }
446          return this;
447        }
448
449        /**
450         * @return {@link #numberOfInstances} (Number of SOP Instances in Series.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value
451         */
452        public UnsignedIntType getNumberOfInstancesElement() { 
453          if (this.numberOfInstances == null)
454            if (Configuration.errorOnAutoCreate())
455              throw new Error("Attempt to auto-create ImagingStudySeriesComponent.numberOfInstances");
456            else if (Configuration.doAutoCreate())
457              this.numberOfInstances = new UnsignedIntType(); // bb
458          return this.numberOfInstances;
459        }
460
461        public boolean hasNumberOfInstancesElement() { 
462          return this.numberOfInstances != null && !this.numberOfInstances.isEmpty();
463        }
464
465        public boolean hasNumberOfInstances() { 
466          return this.numberOfInstances != null && !this.numberOfInstances.isEmpty();
467        }
468
469        /**
470         * @param value {@link #numberOfInstances} (Number of SOP Instances in Series.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value
471         */
472        public ImagingStudySeriesComponent setNumberOfInstancesElement(UnsignedIntType value) { 
473          this.numberOfInstances = value;
474          return this;
475        }
476
477        /**
478         * @return Number of SOP Instances in Series.
479         */
480        public int getNumberOfInstances() { 
481          return this.numberOfInstances == null || this.numberOfInstances.isEmpty() ? 0 : this.numberOfInstances.getValue();
482        }
483
484        /**
485         * @param value Number of SOP Instances in Series.
486         */
487        public ImagingStudySeriesComponent setNumberOfInstances(int value) { 
488            if (this.numberOfInstances == null)
489              this.numberOfInstances = new UnsignedIntType();
490            this.numberOfInstances.setValue(value);
491          return this;
492        }
493
494        /**
495         * @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
496         */
497        public Enumeration<InstanceAvailability> getAvailabilityElement() { 
498          if (this.availability == null)
499            if (Configuration.errorOnAutoCreate())
500              throw new Error("Attempt to auto-create ImagingStudySeriesComponent.availability");
501            else if (Configuration.doAutoCreate())
502              this.availability = new Enumeration<InstanceAvailability>(new InstanceAvailabilityEnumFactory()); // bb
503          return this.availability;
504        }
505
506        public boolean hasAvailabilityElement() { 
507          return this.availability != null && !this.availability.isEmpty();
508        }
509
510        public boolean hasAvailability() { 
511          return this.availability != null && !this.availability.isEmpty();
512        }
513
514        /**
515         * @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
516         */
517        public ImagingStudySeriesComponent setAvailabilityElement(Enumeration<InstanceAvailability> value) { 
518          this.availability = value;
519          return this;
520        }
521
522        /**
523         * @return Availability of series (online, offline or nearline).
524         */
525        public InstanceAvailability getAvailability() { 
526          return this.availability == null ? null : this.availability.getValue();
527        }
528
529        /**
530         * @param value Availability of series (online, offline or nearline).
531         */
532        public ImagingStudySeriesComponent setAvailability(InstanceAvailability value) { 
533          if (value == null)
534            this.availability = null;
535          else {
536            if (this.availability == null)
537              this.availability = new Enumeration<InstanceAvailability>(new InstanceAvailabilityEnumFactory());
538            this.availability.setValue(value);
539          }
540          return this;
541        }
542
543        /**
544         * @return {@link #url} (URI/URL specifying the location of the referenced series using WADO-RS.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
545         */
546        public UriType getUrlElement() { 
547          if (this.url == null)
548            if (Configuration.errorOnAutoCreate())
549              throw new Error("Attempt to auto-create ImagingStudySeriesComponent.url");
550            else if (Configuration.doAutoCreate())
551              this.url = new UriType(); // bb
552          return this.url;
553        }
554
555        public boolean hasUrlElement() { 
556          return this.url != null && !this.url.isEmpty();
557        }
558
559        public boolean hasUrl() { 
560          return this.url != null && !this.url.isEmpty();
561        }
562
563        /**
564         * @param value {@link #url} (URI/URL specifying the location of the referenced series using WADO-RS.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
565         */
566        public ImagingStudySeriesComponent setUrlElement(UriType value) { 
567          this.url = value;
568          return this;
569        }
570
571        /**
572         * @return URI/URL specifying the location of the referenced series using WADO-RS.
573         */
574        public String getUrl() { 
575          return this.url == null ? null : this.url.getValue();
576        }
577
578        /**
579         * @param value URI/URL specifying the location of the referenced series using WADO-RS.
580         */
581        public ImagingStudySeriesComponent setUrl(String value) { 
582          if (Utilities.noString(value))
583            this.url = null;
584          else {
585            if (this.url == null)
586              this.url = new UriType();
587            this.url.setValue(value);
588          }
589          return this;
590        }
591
592        /**
593         * @return {@link #bodySite} (Body part examined. See  DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT.)
594         */
595        public Coding getBodySite() { 
596          if (this.bodySite == null)
597            if (Configuration.errorOnAutoCreate())
598              throw new Error("Attempt to auto-create ImagingStudySeriesComponent.bodySite");
599            else if (Configuration.doAutoCreate())
600              this.bodySite = new Coding(); // cc
601          return this.bodySite;
602        }
603
604        public boolean hasBodySite() { 
605          return this.bodySite != null && !this.bodySite.isEmpty();
606        }
607
608        /**
609         * @param value {@link #bodySite} (Body part examined. See  DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT.)
610         */
611        public ImagingStudySeriesComponent setBodySite(Coding value) { 
612          this.bodySite = value;
613          return this;
614        }
615
616        /**
617         * @return {@link #laterality} (Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code.)
618         */
619        public Coding getLaterality() { 
620          if (this.laterality == null)
621            if (Configuration.errorOnAutoCreate())
622              throw new Error("Attempt to auto-create ImagingStudySeriesComponent.laterality");
623            else if (Configuration.doAutoCreate())
624              this.laterality = new Coding(); // cc
625          return this.laterality;
626        }
627
628        public boolean hasLaterality() { 
629          return this.laterality != null && !this.laterality.isEmpty();
630        }
631
632        /**
633         * @param value {@link #laterality} (Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code.)
634         */
635        public ImagingStudySeriesComponent setLaterality(Coding value) { 
636          this.laterality = value;
637          return this;
638        }
639
640        /**
641         * @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
642         */
643        public DateTimeType getStartedElement() { 
644          if (this.started == null)
645            if (Configuration.errorOnAutoCreate())
646              throw new Error("Attempt to auto-create ImagingStudySeriesComponent.started");
647            else if (Configuration.doAutoCreate())
648              this.started = new DateTimeType(); // bb
649          return this.started;
650        }
651
652        public boolean hasStartedElement() { 
653          return this.started != null && !this.started.isEmpty();
654        }
655
656        public boolean hasStarted() { 
657          return this.started != null && !this.started.isEmpty();
658        }
659
660        /**
661         * @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
662         */
663        public ImagingStudySeriesComponent setStartedElement(DateTimeType value) { 
664          this.started = value;
665          return this;
666        }
667
668        /**
669         * @return The date and time the series was started.
670         */
671        public Date getStarted() { 
672          return this.started == null ? null : this.started.getValue();
673        }
674
675        /**
676         * @param value The date and time the series was started.
677         */
678        public ImagingStudySeriesComponent setStarted(Date value) { 
679          if (value == null)
680            this.started = null;
681          else {
682            if (this.started == null)
683              this.started = new DateTimeType();
684            this.started.setValue(value);
685          }
686          return this;
687        }
688
689        /**
690         * @return {@link #instance} (A single SOP Instance within the series, e.g. an image, or presentation state.)
691         */
692        public List<ImagingStudySeriesInstanceComponent> getInstance() { 
693          if (this.instance == null)
694            this.instance = new ArrayList<ImagingStudySeriesInstanceComponent>();
695          return this.instance;
696        }
697
698        public boolean hasInstance() { 
699          if (this.instance == null)
700            return false;
701          for (ImagingStudySeriesInstanceComponent item : this.instance)
702            if (!item.isEmpty())
703              return true;
704          return false;
705        }
706
707        /**
708         * @return {@link #instance} (A single SOP Instance within the series, e.g. an image, or presentation state.)
709         */
710    // syntactic sugar
711        public ImagingStudySeriesInstanceComponent addInstance() { //3
712          ImagingStudySeriesInstanceComponent t = new ImagingStudySeriesInstanceComponent();
713          if (this.instance == null)
714            this.instance = new ArrayList<ImagingStudySeriesInstanceComponent>();
715          this.instance.add(t);
716          return t;
717        }
718
719    // syntactic sugar
720        public ImagingStudySeriesComponent addInstance(ImagingStudySeriesInstanceComponent t) { //3
721          if (t == null)
722            return this;
723          if (this.instance == null)
724            this.instance = new ArrayList<ImagingStudySeriesInstanceComponent>();
725          this.instance.add(t);
726          return this;
727        }
728
729        protected void listChildren(List<Property> childrenList) {
730          super.listChildren(childrenList);
731          childrenList.add(new Property("number", "unsignedInt", "The Numeric identifier of this series in the study.", 0, java.lang.Integer.MAX_VALUE, number));
732          childrenList.add(new Property("modality", "Coding", "The modality of this series sequence.", 0, java.lang.Integer.MAX_VALUE, modality));
733          childrenList.add(new Property("uid", "oid", "Formal identifier for this series.", 0, java.lang.Integer.MAX_VALUE, uid));
734          childrenList.add(new Property("description", "string", "A description of the series.", 0, java.lang.Integer.MAX_VALUE, description));
735          childrenList.add(new Property("numberOfInstances", "unsignedInt", "Number of SOP Instances in Series.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances));
736          childrenList.add(new Property("availability", "code", "Availability of series (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability));
737          childrenList.add(new Property("url", "uri", "URI/URL specifying the location of the referenced series using WADO-RS.", 0, java.lang.Integer.MAX_VALUE, url));
738          childrenList.add(new Property("bodySite", "Coding", "Body part examined. See  DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT.", 0, java.lang.Integer.MAX_VALUE, bodySite));
739          childrenList.add(new Property("laterality", "Coding", "Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code.", 0, java.lang.Integer.MAX_VALUE, laterality));
740          childrenList.add(new Property("started", "dateTime", "The date and time the series was started.", 0, java.lang.Integer.MAX_VALUE, started));
741          childrenList.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));
742        }
743
744      @Override
745      public void setProperty(String name, Base value) throws FHIRException {
746        if (name.equals("number"))
747          this.number = castToUnsignedInt(value); // UnsignedIntType
748        else if (name.equals("modality"))
749          this.modality = castToCoding(value); // Coding
750        else if (name.equals("uid"))
751          this.uid = castToOid(value); // OidType
752        else if (name.equals("description"))
753          this.description = castToString(value); // StringType
754        else if (name.equals("numberOfInstances"))
755          this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType
756        else if (name.equals("availability"))
757          this.availability = new InstanceAvailabilityEnumFactory().fromType(value); // Enumeration<InstanceAvailability>
758        else if (name.equals("url"))
759          this.url = castToUri(value); // UriType
760        else if (name.equals("bodySite"))
761          this.bodySite = castToCoding(value); // Coding
762        else if (name.equals("laterality"))
763          this.laterality = castToCoding(value); // Coding
764        else if (name.equals("started"))
765          this.started = castToDateTime(value); // DateTimeType
766        else if (name.equals("instance"))
767          this.getInstance().add((ImagingStudySeriesInstanceComponent) value);
768        else
769          super.setProperty(name, value);
770      }
771
772      @Override
773      public Base addChild(String name) throws FHIRException {
774        if (name.equals("number")) {
775          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.number");
776        }
777        else if (name.equals("modality")) {
778          this.modality = new Coding();
779          return this.modality;
780        }
781        else if (name.equals("uid")) {
782          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.uid");
783        }
784        else if (name.equals("description")) {
785          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.description");
786        }
787        else if (name.equals("numberOfInstances")) {
788          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.numberOfInstances");
789        }
790        else if (name.equals("availability")) {
791          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.availability");
792        }
793        else if (name.equals("url")) {
794          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.url");
795        }
796        else if (name.equals("bodySite")) {
797          this.bodySite = new Coding();
798          return this.bodySite;
799        }
800        else if (name.equals("laterality")) {
801          this.laterality = new Coding();
802          return this.laterality;
803        }
804        else if (name.equals("started")) {
805          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.started");
806        }
807        else if (name.equals("instance")) {
808          return addInstance();
809        }
810        else
811          return super.addChild(name);
812      }
813
814      public ImagingStudySeriesComponent copy() {
815        ImagingStudySeriesComponent dst = new ImagingStudySeriesComponent();
816        copyValues(dst);
817        dst.number = number == null ? null : number.copy();
818        dst.modality = modality == null ? null : modality.copy();
819        dst.uid = uid == null ? null : uid.copy();
820        dst.description = description == null ? null : description.copy();
821        dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy();
822        dst.availability = availability == null ? null : availability.copy();
823        dst.url = url == null ? null : url.copy();
824        dst.bodySite = bodySite == null ? null : bodySite.copy();
825        dst.laterality = laterality == null ? null : laterality.copy();
826        dst.started = started == null ? null : started.copy();
827        if (instance != null) {
828          dst.instance = new ArrayList<ImagingStudySeriesInstanceComponent>();
829          for (ImagingStudySeriesInstanceComponent i : instance)
830            dst.instance.add(i.copy());
831        };
832        return dst;
833      }
834
835      @Override
836      public boolean equalsDeep(Base other) {
837        if (!super.equalsDeep(other))
838          return false;
839        if (!(other instanceof ImagingStudySeriesComponent))
840          return false;
841        ImagingStudySeriesComponent o = (ImagingStudySeriesComponent) other;
842        return compareDeep(number, o.number, true) && compareDeep(modality, o.modality, true) && compareDeep(uid, o.uid, true)
843           && compareDeep(description, o.description, true) && compareDeep(numberOfInstances, o.numberOfInstances, true)
844           && compareDeep(availability, o.availability, true) && compareDeep(url, o.url, true) && compareDeep(bodySite, o.bodySite, true)
845           && compareDeep(laterality, o.laterality, true) && compareDeep(started, o.started, true) && compareDeep(instance, o.instance, true)
846          ;
847      }
848
849      @Override
850      public boolean equalsShallow(Base other) {
851        if (!super.equalsShallow(other))
852          return false;
853        if (!(other instanceof ImagingStudySeriesComponent))
854          return false;
855        ImagingStudySeriesComponent o = (ImagingStudySeriesComponent) other;
856        return compareValues(number, o.number, true) && compareValues(uid, o.uid, true) && compareValues(description, o.description, true)
857           && compareValues(numberOfInstances, o.numberOfInstances, true) && compareValues(availability, o.availability, true)
858           && compareValues(url, o.url, true) && compareValues(started, o.started, true);
859      }
860
861      public boolean isEmpty() {
862        return super.isEmpty() && (number == null || number.isEmpty()) && (modality == null || modality.isEmpty())
863           && (uid == null || uid.isEmpty()) && (description == null || description.isEmpty()) && (numberOfInstances == null || numberOfInstances.isEmpty())
864           && (availability == null || availability.isEmpty()) && (url == null || url.isEmpty()) && (bodySite == null || bodySite.isEmpty())
865           && (laterality == null || laterality.isEmpty()) && (started == null || started.isEmpty())
866           && (instance == null || instance.isEmpty());
867      }
868
869  public String fhirType() {
870    return "ImagingStudy.series";
871
872  }
873
874  }
875
876    @Block()
877    public static class ImagingStudySeriesInstanceComponent extends BackboneElement implements IBaseBackboneElement {
878        /**
879         * The number of instance in the series.
880         */
881        @Child(name = "number", type = {UnsignedIntType.class}, order=1, min=0, max=1, modifier=false, summary=true)
882        @Description(shortDefinition="The number of this instance in the series", formalDefinition="The number of instance in the series." )
883        protected UnsignedIntType number;
884
885        /**
886         * Formal identifier for this image or other content.
887         */
888        @Child(name = "uid", type = {OidType.class}, order=2, min=1, max=1, modifier=false, summary=true)
889        @Description(shortDefinition="Formal identifier for this instance", formalDefinition="Formal identifier for this image or other content." )
890        protected OidType uid;
891
892        /**
893         * DICOM instance  type.
894         */
895        @Child(name = "sopClass", type = {OidType.class}, order=3, min=1, max=1, modifier=false, summary=true)
896        @Description(shortDefinition="DICOM class type", formalDefinition="DICOM instance  type." )
897        protected OidType sopClass;
898
899        /**
900         * A human-friendly SOP Class name.
901         */
902        @Child(name = "type", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
903        @Description(shortDefinition="Type of instance (image etc.)", formalDefinition="A human-friendly SOP Class name." )
904        protected StringType type;
905
906        /**
907         * The description of the instance.
908         */
909        @Child(name = "title", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
910        @Description(shortDefinition="Description of instance", formalDefinition="The description of the instance." )
911        protected StringType title;
912
913        /**
914         * Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance.
915         */
916        @Child(name = "content", type = {Attachment.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
917        @Description(shortDefinition="Content of the instance", formalDefinition="Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance." )
918        protected List<Attachment> content;
919
920        private static final long serialVersionUID = -1450403705L;
921
922    /*
923     * Constructor
924     */
925      public ImagingStudySeriesInstanceComponent() {
926        super();
927      }
928
929    /*
930     * Constructor
931     */
932      public ImagingStudySeriesInstanceComponent(OidType uid, OidType sopClass) {
933        super();
934        this.uid = uid;
935        this.sopClass = sopClass;
936      }
937
938        /**
939         * @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
940         */
941        public UnsignedIntType getNumberElement() { 
942          if (this.number == null)
943            if (Configuration.errorOnAutoCreate())
944              throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.number");
945            else if (Configuration.doAutoCreate())
946              this.number = new UnsignedIntType(); // bb
947          return this.number;
948        }
949
950        public boolean hasNumberElement() { 
951          return this.number != null && !this.number.isEmpty();
952        }
953
954        public boolean hasNumber() { 
955          return this.number != null && !this.number.isEmpty();
956        }
957
958        /**
959         * @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
960         */
961        public ImagingStudySeriesInstanceComponent setNumberElement(UnsignedIntType value) { 
962          this.number = value;
963          return this;
964        }
965
966        /**
967         * @return The number of instance in the series.
968         */
969        public int getNumber() { 
970          return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue();
971        }
972
973        /**
974         * @param value The number of instance in the series.
975         */
976        public ImagingStudySeriesInstanceComponent setNumber(int value) { 
977            if (this.number == null)
978              this.number = new UnsignedIntType();
979            this.number.setValue(value);
980          return this;
981        }
982
983        /**
984         * @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
985         */
986        public OidType getUidElement() { 
987          if (this.uid == null)
988            if (Configuration.errorOnAutoCreate())
989              throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.uid");
990            else if (Configuration.doAutoCreate())
991              this.uid = new OidType(); // bb
992          return this.uid;
993        }
994
995        public boolean hasUidElement() { 
996          return this.uid != null && !this.uid.isEmpty();
997        }
998
999        public boolean hasUid() { 
1000          return this.uid != null && !this.uid.isEmpty();
1001        }
1002
1003        /**
1004         * @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
1005         */
1006        public ImagingStudySeriesInstanceComponent setUidElement(OidType value) { 
1007          this.uid = value;
1008          return this;
1009        }
1010
1011        /**
1012         * @return Formal identifier for this image or other content.
1013         */
1014        public String getUid() { 
1015          return this.uid == null ? null : this.uid.getValue();
1016        }
1017
1018        /**
1019         * @param value Formal identifier for this image or other content.
1020         */
1021        public ImagingStudySeriesInstanceComponent setUid(String value) { 
1022            if (this.uid == null)
1023              this.uid = new OidType();
1024            this.uid.setValue(value);
1025          return this;
1026        }
1027
1028        /**
1029         * @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
1030         */
1031        public OidType getSopClassElement() { 
1032          if (this.sopClass == null)
1033            if (Configuration.errorOnAutoCreate())
1034              throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.sopClass");
1035            else if (Configuration.doAutoCreate())
1036              this.sopClass = new OidType(); // bb
1037          return this.sopClass;
1038        }
1039
1040        public boolean hasSopClassElement() { 
1041          return this.sopClass != null && !this.sopClass.isEmpty();
1042        }
1043
1044        public boolean hasSopClass() { 
1045          return this.sopClass != null && !this.sopClass.isEmpty();
1046        }
1047
1048        /**
1049         * @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
1050         */
1051        public ImagingStudySeriesInstanceComponent setSopClassElement(OidType value) { 
1052          this.sopClass = value;
1053          return this;
1054        }
1055
1056        /**
1057         * @return DICOM instance  type.
1058         */
1059        public String getSopClass() { 
1060          return this.sopClass == null ? null : this.sopClass.getValue();
1061        }
1062
1063        /**
1064         * @param value DICOM instance  type.
1065         */
1066        public ImagingStudySeriesInstanceComponent setSopClass(String value) { 
1067            if (this.sopClass == null)
1068              this.sopClass = new OidType();
1069            this.sopClass.setValue(value);
1070          return this;
1071        }
1072
1073        /**
1074         * @return {@link #type} (A human-friendly SOP Class name.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1075         */
1076        public StringType getTypeElement() { 
1077          if (this.type == null)
1078            if (Configuration.errorOnAutoCreate())
1079              throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.type");
1080            else if (Configuration.doAutoCreate())
1081              this.type = new StringType(); // bb
1082          return this.type;
1083        }
1084
1085        public boolean hasTypeElement() { 
1086          return this.type != null && !this.type.isEmpty();
1087        }
1088
1089        public boolean hasType() { 
1090          return this.type != null && !this.type.isEmpty();
1091        }
1092
1093        /**
1094         * @param value {@link #type} (A human-friendly SOP Class name.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1095         */
1096        public ImagingStudySeriesInstanceComponent setTypeElement(StringType value) { 
1097          this.type = value;
1098          return this;
1099        }
1100
1101        /**
1102         * @return A human-friendly SOP Class name.
1103         */
1104        public String getType() { 
1105          return this.type == null ? null : this.type.getValue();
1106        }
1107
1108        /**
1109         * @param value A human-friendly SOP Class name.
1110         */
1111        public ImagingStudySeriesInstanceComponent setType(String value) { 
1112          if (Utilities.noString(value))
1113            this.type = null;
1114          else {
1115            if (this.type == null)
1116              this.type = new StringType();
1117            this.type.setValue(value);
1118          }
1119          return this;
1120        }
1121
1122        /**
1123         * @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
1124         */
1125        public StringType getTitleElement() { 
1126          if (this.title == null)
1127            if (Configuration.errorOnAutoCreate())
1128              throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.title");
1129            else if (Configuration.doAutoCreate())
1130              this.title = new StringType(); // bb
1131          return this.title;
1132        }
1133
1134        public boolean hasTitleElement() { 
1135          return this.title != null && !this.title.isEmpty();
1136        }
1137
1138        public boolean hasTitle() { 
1139          return this.title != null && !this.title.isEmpty();
1140        }
1141
1142        /**
1143         * @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
1144         */
1145        public ImagingStudySeriesInstanceComponent setTitleElement(StringType value) { 
1146          this.title = value;
1147          return this;
1148        }
1149
1150        /**
1151         * @return The description of the instance.
1152         */
1153        public String getTitle() { 
1154          return this.title == null ? null : this.title.getValue();
1155        }
1156
1157        /**
1158         * @param value The description of the instance.
1159         */
1160        public ImagingStudySeriesInstanceComponent setTitle(String value) { 
1161          if (Utilities.noString(value))
1162            this.title = null;
1163          else {
1164            if (this.title == null)
1165              this.title = new StringType();
1166            this.title.setValue(value);
1167          }
1168          return this;
1169        }
1170
1171        /**
1172         * @return {@link #content} (Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance.)
1173         */
1174        public List<Attachment> getContent() { 
1175          if (this.content == null)
1176            this.content = new ArrayList<Attachment>();
1177          return this.content;
1178        }
1179
1180        public boolean hasContent() { 
1181          if (this.content == null)
1182            return false;
1183          for (Attachment item : this.content)
1184            if (!item.isEmpty())
1185              return true;
1186          return false;
1187        }
1188
1189        /**
1190         * @return {@link #content} (Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance.)
1191         */
1192    // syntactic sugar
1193        public Attachment addContent() { //3
1194          Attachment t = new Attachment();
1195          if (this.content == null)
1196            this.content = new ArrayList<Attachment>();
1197          this.content.add(t);
1198          return t;
1199        }
1200
1201    // syntactic sugar
1202        public ImagingStudySeriesInstanceComponent addContent(Attachment t) { //3
1203          if (t == null)
1204            return this;
1205          if (this.content == null)
1206            this.content = new ArrayList<Attachment>();
1207          this.content.add(t);
1208          return this;
1209        }
1210
1211        protected void listChildren(List<Property> childrenList) {
1212          super.listChildren(childrenList);
1213          childrenList.add(new Property("number", "unsignedInt", "The number of instance in the series.", 0, java.lang.Integer.MAX_VALUE, number));
1214          childrenList.add(new Property("uid", "oid", "Formal identifier for this image or other content.", 0, java.lang.Integer.MAX_VALUE, uid));
1215          childrenList.add(new Property("sopClass", "oid", "DICOM instance  type.", 0, java.lang.Integer.MAX_VALUE, sopClass));
1216          childrenList.add(new Property("type", "string", "A human-friendly SOP Class name.", 0, java.lang.Integer.MAX_VALUE, type));
1217          childrenList.add(new Property("title", "string", "The description of the instance.", 0, java.lang.Integer.MAX_VALUE, title));
1218          childrenList.add(new Property("content", "Attachment", "Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance.", 0, java.lang.Integer.MAX_VALUE, content));
1219        }
1220
1221      @Override
1222      public void setProperty(String name, Base value) throws FHIRException {
1223        if (name.equals("number"))
1224          this.number = castToUnsignedInt(value); // UnsignedIntType
1225        else if (name.equals("uid"))
1226          this.uid = castToOid(value); // OidType
1227        else if (name.equals("sopClass"))
1228          this.sopClass = castToOid(value); // OidType
1229        else if (name.equals("type"))
1230          this.type = castToString(value); // StringType
1231        else if (name.equals("title"))
1232          this.title = castToString(value); // StringType
1233        else if (name.equals("content"))
1234          this.getContent().add(castToAttachment(value));
1235        else
1236          super.setProperty(name, value);
1237      }
1238
1239      @Override
1240      public Base addChild(String name) throws FHIRException {
1241        if (name.equals("number")) {
1242          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.number");
1243        }
1244        else if (name.equals("uid")) {
1245          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.uid");
1246        }
1247        else if (name.equals("sopClass")) {
1248          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.sopClass");
1249        }
1250        else if (name.equals("type")) {
1251          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.type");
1252        }
1253        else if (name.equals("title")) {
1254          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.title");
1255        }
1256        else if (name.equals("content")) {
1257          return addContent();
1258        }
1259        else
1260          return super.addChild(name);
1261      }
1262
1263      public ImagingStudySeriesInstanceComponent copy() {
1264        ImagingStudySeriesInstanceComponent dst = new ImagingStudySeriesInstanceComponent();
1265        copyValues(dst);
1266        dst.number = number == null ? null : number.copy();
1267        dst.uid = uid == null ? null : uid.copy();
1268        dst.sopClass = sopClass == null ? null : sopClass.copy();
1269        dst.type = type == null ? null : type.copy();
1270        dst.title = title == null ? null : title.copy();
1271        if (content != null) {
1272          dst.content = new ArrayList<Attachment>();
1273          for (Attachment i : content)
1274            dst.content.add(i.copy());
1275        };
1276        return dst;
1277      }
1278
1279      @Override
1280      public boolean equalsDeep(Base other) {
1281        if (!super.equalsDeep(other))
1282          return false;
1283        if (!(other instanceof ImagingStudySeriesInstanceComponent))
1284          return false;
1285        ImagingStudySeriesInstanceComponent o = (ImagingStudySeriesInstanceComponent) other;
1286        return compareDeep(number, o.number, true) && compareDeep(uid, o.uid, true) && compareDeep(sopClass, o.sopClass, true)
1287           && compareDeep(type, o.type, true) && compareDeep(title, o.title, true) && compareDeep(content, o.content, true)
1288          ;
1289      }
1290
1291      @Override
1292      public boolean equalsShallow(Base other) {
1293        if (!super.equalsShallow(other))
1294          return false;
1295        if (!(other instanceof ImagingStudySeriesInstanceComponent))
1296          return false;
1297        ImagingStudySeriesInstanceComponent o = (ImagingStudySeriesInstanceComponent) other;
1298        return compareValues(number, o.number, true) && compareValues(uid, o.uid, true) && compareValues(sopClass, o.sopClass, true)
1299           && compareValues(type, o.type, true) && compareValues(title, o.title, true);
1300      }
1301
1302      public boolean isEmpty() {
1303        return super.isEmpty() && (number == null || number.isEmpty()) && (uid == null || uid.isEmpty())
1304           && (sopClass == null || sopClass.isEmpty()) && (type == null || type.isEmpty()) && (title == null || title.isEmpty())
1305           && (content == null || content.isEmpty());
1306      }
1307
1308  public String fhirType() {
1309    return "ImagingStudy.series.instance";
1310
1311  }
1312
1313  }
1314
1315    /**
1316     * Date and Time the study started.
1317     */
1318    @Child(name = "started", type = {DateTimeType.class}, order=0, min=0, max=1, modifier=false, summary=true)
1319    @Description(shortDefinition="When the study was started", formalDefinition="Date and Time the study started." )
1320    protected DateTimeType started;
1321
1322    /**
1323     * The patient imaged in the study.
1324     */
1325    @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true)
1326    @Description(shortDefinition="Who the images are of", formalDefinition="The patient imaged in the study." )
1327    protected Reference patient;
1328
1329    /**
1330     * The actual object that is the target of the reference (The patient imaged in the study.)
1331     */
1332    protected Patient patientTarget;
1333
1334    /**
1335     * Formal identifier for the study.
1336     */
1337    @Child(name = "uid", type = {OidType.class}, order=2, min=1, max=1, modifier=false, summary=true)
1338    @Description(shortDefinition="Formal identifier for the study", formalDefinition="Formal identifier for the study." )
1339    protected OidType uid;
1340
1341    /**
1342     * 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).
1343     */
1344    @Child(name = "accession", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true)
1345    @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)." )
1346    protected Identifier accession;
1347
1348    /**
1349     * Other identifiers for the study.
1350     */
1351    @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1352    @Description(shortDefinition="Other identifiers for the study", formalDefinition="Other identifiers for the study." )
1353    protected List<Identifier> identifier;
1354
1355    /**
1356     * A list of the diagnostic orders that resulted in this imaging study being performed.
1357     */
1358    @Child(name = "order", type = {DiagnosticOrder.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1359    @Description(shortDefinition="Order(s) that caused this study to be performed", formalDefinition="A list of the diagnostic orders that resulted in this imaging study being performed." )
1360    protected List<Reference> order;
1361    /**
1362     * The actual objects that are the target of the reference (A list of the diagnostic orders that resulted in this imaging study being performed.)
1363     */
1364    protected List<DiagnosticOrder> orderTarget;
1365
1366
1367    /**
1368     * 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).
1369     */
1370    @Child(name = "modalityList", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1371    @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)." )
1372    protected List<Coding> modalityList;
1373
1374    /**
1375     * The requesting/referring physician.
1376     */
1377    @Child(name = "referrer", type = {Practitioner.class}, order=7, min=0, max=1, modifier=false, summary=true)
1378    @Description(shortDefinition="Referring physician (0008,0090)", formalDefinition="The requesting/referring physician." )
1379    protected Reference referrer;
1380
1381    /**
1382     * The actual object that is the target of the reference (The requesting/referring physician.)
1383     */
1384    protected Practitioner referrerTarget;
1385
1386    /**
1387     * Availability of study (online, offline or nearline).
1388     */
1389    @Child(name = "availability", type = {CodeType.class}, order=8, min=0, max=1, modifier=false, summary=true)
1390    @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)", formalDefinition="Availability of study (online, offline or nearline)." )
1391    protected Enumeration<InstanceAvailability> availability;
1392
1393    /**
1394     * WADO-RS resource where Study is available.
1395     */
1396    @Child(name = "url", type = {UriType.class}, order=9, min=0, max=1, modifier=false, summary=true)
1397    @Description(shortDefinition="Retrieve URI", formalDefinition="WADO-RS resource where Study is available." )
1398    protected UriType url;
1399
1400    /**
1401     * Number of Series in Study.
1402     */
1403    @Child(name = "numberOfSeries", type = {UnsignedIntType.class}, order=10, min=1, max=1, modifier=false, summary=true)
1404    @Description(shortDefinition="Number of Study Related Series", formalDefinition="Number of Series in Study." )
1405    protected UnsignedIntType numberOfSeries;
1406
1407    /**
1408     * Number of SOP Instances in Study.
1409     */
1410    @Child(name = "numberOfInstances", type = {UnsignedIntType.class}, order=11, min=1, max=1, modifier=false, summary=true)
1411    @Description(shortDefinition="Number of Study Related Instances", formalDefinition="Number of SOP Instances in Study." )
1412    protected UnsignedIntType numberOfInstances;
1413
1414    /**
1415     * Type of procedure performed.
1416     */
1417    @Child(name = "procedure", type = {Procedure.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1418    @Description(shortDefinition="Type of procedure performed", formalDefinition="Type of procedure performed." )
1419    protected List<Reference> procedure;
1420    /**
1421     * The actual objects that are the target of the reference (Type of procedure performed.)
1422     */
1423    protected List<Procedure> procedureTarget;
1424
1425
1426    /**
1427     * Who read the study and interpreted the images or other content.
1428     */
1429    @Child(name = "interpreter", type = {Practitioner.class}, order=13, min=0, max=1, modifier=false, summary=true)
1430    @Description(shortDefinition="Who interpreted images", formalDefinition="Who read the study and interpreted the images or other content." )
1431    protected Reference interpreter;
1432
1433    /**
1434     * The actual object that is the target of the reference (Who read the study and interpreted the images or other content.)
1435     */
1436    protected Practitioner interpreterTarget;
1437
1438    /**
1439     * Institution-generated description or classification of the Study performed.
1440     */
1441    @Child(name = "description", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=true)
1442    @Description(shortDefinition="Institution-generated description", formalDefinition="Institution-generated description or classification of the Study performed." )
1443    protected StringType description;
1444
1445    /**
1446     * Each study has one or more series of images or other content.
1447     */
1448    @Child(name = "series", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1449    @Description(shortDefinition="Each study has one or more series of instances", formalDefinition="Each study has one or more series of images or other content." )
1450    protected List<ImagingStudySeriesComponent> series;
1451
1452    private static final long serialVersionUID = 1895046380L;
1453
1454  /*
1455   * Constructor
1456   */
1457    public ImagingStudy() {
1458      super();
1459    }
1460
1461  /*
1462   * Constructor
1463   */
1464    public ImagingStudy(Reference patient, OidType uid, UnsignedIntType numberOfSeries, UnsignedIntType numberOfInstances) {
1465      super();
1466      this.patient = patient;
1467      this.uid = uid;
1468      this.numberOfSeries = numberOfSeries;
1469      this.numberOfInstances = numberOfInstances;
1470    }
1471
1472    /**
1473     * @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
1474     */
1475    public DateTimeType getStartedElement() { 
1476      if (this.started == null)
1477        if (Configuration.errorOnAutoCreate())
1478          throw new Error("Attempt to auto-create ImagingStudy.started");
1479        else if (Configuration.doAutoCreate())
1480          this.started = new DateTimeType(); // bb
1481      return this.started;
1482    }
1483
1484    public boolean hasStartedElement() { 
1485      return this.started != null && !this.started.isEmpty();
1486    }
1487
1488    public boolean hasStarted() { 
1489      return this.started != null && !this.started.isEmpty();
1490    }
1491
1492    /**
1493     * @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
1494     */
1495    public ImagingStudy setStartedElement(DateTimeType value) { 
1496      this.started = value;
1497      return this;
1498    }
1499
1500    /**
1501     * @return Date and Time the study started.
1502     */
1503    public Date getStarted() { 
1504      return this.started == null ? null : this.started.getValue();
1505    }
1506
1507    /**
1508     * @param value Date and Time the study started.
1509     */
1510    public ImagingStudy setStarted(Date value) { 
1511      if (value == null)
1512        this.started = null;
1513      else {
1514        if (this.started == null)
1515          this.started = new DateTimeType();
1516        this.started.setValue(value);
1517      }
1518      return this;
1519    }
1520
1521    /**
1522     * @return {@link #patient} (The patient imaged in the study.)
1523     */
1524    public Reference getPatient() { 
1525      if (this.patient == null)
1526        if (Configuration.errorOnAutoCreate())
1527          throw new Error("Attempt to auto-create ImagingStudy.patient");
1528        else if (Configuration.doAutoCreate())
1529          this.patient = new Reference(); // cc
1530      return this.patient;
1531    }
1532
1533    public boolean hasPatient() { 
1534      return this.patient != null && !this.patient.isEmpty();
1535    }
1536
1537    /**
1538     * @param value {@link #patient} (The patient imaged in the study.)
1539     */
1540    public ImagingStudy setPatient(Reference value) { 
1541      this.patient = value;
1542      return this;
1543    }
1544
1545    /**
1546     * @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.)
1547     */
1548    public Patient getPatientTarget() { 
1549      if (this.patientTarget == null)
1550        if (Configuration.errorOnAutoCreate())
1551          throw new Error("Attempt to auto-create ImagingStudy.patient");
1552        else if (Configuration.doAutoCreate())
1553          this.patientTarget = new Patient(); // aa
1554      return this.patientTarget;
1555    }
1556
1557    /**
1558     * @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.)
1559     */
1560    public ImagingStudy setPatientTarget(Patient value) { 
1561      this.patientTarget = value;
1562      return this;
1563    }
1564
1565    /**
1566     * @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
1567     */
1568    public OidType getUidElement() { 
1569      if (this.uid == null)
1570        if (Configuration.errorOnAutoCreate())
1571          throw new Error("Attempt to auto-create ImagingStudy.uid");
1572        else if (Configuration.doAutoCreate())
1573          this.uid = new OidType(); // bb
1574      return this.uid;
1575    }
1576
1577    public boolean hasUidElement() { 
1578      return this.uid != null && !this.uid.isEmpty();
1579    }
1580
1581    public boolean hasUid() { 
1582      return this.uid != null && !this.uid.isEmpty();
1583    }
1584
1585    /**
1586     * @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
1587     */
1588    public ImagingStudy setUidElement(OidType value) { 
1589      this.uid = value;
1590      return this;
1591    }
1592
1593    /**
1594     * @return Formal identifier for the study.
1595     */
1596    public String getUid() { 
1597      return this.uid == null ? null : this.uid.getValue();
1598    }
1599
1600    /**
1601     * @param value Formal identifier for the study.
1602     */
1603    public ImagingStudy setUid(String value) { 
1604        if (this.uid == null)
1605          this.uid = new OidType();
1606        this.uid.setValue(value);
1607      return this;
1608    }
1609
1610    /**
1611     * @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).)
1612     */
1613    public Identifier getAccession() { 
1614      if (this.accession == null)
1615        if (Configuration.errorOnAutoCreate())
1616          throw new Error("Attempt to auto-create ImagingStudy.accession");
1617        else if (Configuration.doAutoCreate())
1618          this.accession = new Identifier(); // cc
1619      return this.accession;
1620    }
1621
1622    public boolean hasAccession() { 
1623      return this.accession != null && !this.accession.isEmpty();
1624    }
1625
1626    /**
1627     * @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).)
1628     */
1629    public ImagingStudy setAccession(Identifier value) { 
1630      this.accession = value;
1631      return this;
1632    }
1633
1634    /**
1635     * @return {@link #identifier} (Other identifiers for the study.)
1636     */
1637    public List<Identifier> getIdentifier() { 
1638      if (this.identifier == null)
1639        this.identifier = new ArrayList<Identifier>();
1640      return this.identifier;
1641    }
1642
1643    public boolean hasIdentifier() { 
1644      if (this.identifier == null)
1645        return false;
1646      for (Identifier item : this.identifier)
1647        if (!item.isEmpty())
1648          return true;
1649      return false;
1650    }
1651
1652    /**
1653     * @return {@link #identifier} (Other identifiers for the study.)
1654     */
1655    // syntactic sugar
1656    public Identifier addIdentifier() { //3
1657      Identifier t = new Identifier();
1658      if (this.identifier == null)
1659        this.identifier = new ArrayList<Identifier>();
1660      this.identifier.add(t);
1661      return t;
1662    }
1663
1664    // syntactic sugar
1665    public ImagingStudy addIdentifier(Identifier t) { //3
1666      if (t == null)
1667        return this;
1668      if (this.identifier == null)
1669        this.identifier = new ArrayList<Identifier>();
1670      this.identifier.add(t);
1671      return this;
1672    }
1673
1674    /**
1675     * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.)
1676     */
1677    public List<Reference> getOrder() { 
1678      if (this.order == null)
1679        this.order = new ArrayList<Reference>();
1680      return this.order;
1681    }
1682
1683    public boolean hasOrder() { 
1684      if (this.order == null)
1685        return false;
1686      for (Reference item : this.order)
1687        if (!item.isEmpty())
1688          return true;
1689      return false;
1690    }
1691
1692    /**
1693     * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.)
1694     */
1695    // syntactic sugar
1696    public Reference addOrder() { //3
1697      Reference t = new Reference();
1698      if (this.order == null)
1699        this.order = new ArrayList<Reference>();
1700      this.order.add(t);
1701      return t;
1702    }
1703
1704    // syntactic sugar
1705    public ImagingStudy addOrder(Reference t) { //3
1706      if (t == null)
1707        return this;
1708      if (this.order == null)
1709        this.order = new ArrayList<Reference>();
1710      this.order.add(t);
1711      return this;
1712    }
1713
1714    /**
1715     * @return {@link #order} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A list of the diagnostic orders that resulted in this imaging study being performed.)
1716     */
1717    public List<DiagnosticOrder> getOrderTarget() { 
1718      if (this.orderTarget == null)
1719        this.orderTarget = new ArrayList<DiagnosticOrder>();
1720      return this.orderTarget;
1721    }
1722
1723    // syntactic sugar
1724    /**
1725     * @return {@link #order} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A list of the diagnostic orders that resulted in this imaging study being performed.)
1726     */
1727    public DiagnosticOrder addOrderTarget() { 
1728      DiagnosticOrder r = new DiagnosticOrder();
1729      if (this.orderTarget == null)
1730        this.orderTarget = new ArrayList<DiagnosticOrder>();
1731      this.orderTarget.add(r);
1732      return r;
1733    }
1734
1735    /**
1736     * @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).)
1737     */
1738    public List<Coding> getModalityList() { 
1739      if (this.modalityList == null)
1740        this.modalityList = new ArrayList<Coding>();
1741      return this.modalityList;
1742    }
1743
1744    public boolean hasModalityList() { 
1745      if (this.modalityList == null)
1746        return false;
1747      for (Coding item : this.modalityList)
1748        if (!item.isEmpty())
1749          return true;
1750      return false;
1751    }
1752
1753    /**
1754     * @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).)
1755     */
1756    // syntactic sugar
1757    public Coding addModalityList() { //3
1758      Coding t = new Coding();
1759      if (this.modalityList == null)
1760        this.modalityList = new ArrayList<Coding>();
1761      this.modalityList.add(t);
1762      return t;
1763    }
1764
1765    // syntactic sugar
1766    public ImagingStudy addModalityList(Coding t) { //3
1767      if (t == null)
1768        return this;
1769      if (this.modalityList == null)
1770        this.modalityList = new ArrayList<Coding>();
1771      this.modalityList.add(t);
1772      return this;
1773    }
1774
1775    /**
1776     * @return {@link #referrer} (The requesting/referring physician.)
1777     */
1778    public Reference getReferrer() { 
1779      if (this.referrer == null)
1780        if (Configuration.errorOnAutoCreate())
1781          throw new Error("Attempt to auto-create ImagingStudy.referrer");
1782        else if (Configuration.doAutoCreate())
1783          this.referrer = new Reference(); // cc
1784      return this.referrer;
1785    }
1786
1787    public boolean hasReferrer() { 
1788      return this.referrer != null && !this.referrer.isEmpty();
1789    }
1790
1791    /**
1792     * @param value {@link #referrer} (The requesting/referring physician.)
1793     */
1794    public ImagingStudy setReferrer(Reference value) { 
1795      this.referrer = value;
1796      return this;
1797    }
1798
1799    /**
1800     * @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.)
1801     */
1802    public Practitioner getReferrerTarget() { 
1803      if (this.referrerTarget == null)
1804        if (Configuration.errorOnAutoCreate())
1805          throw new Error("Attempt to auto-create ImagingStudy.referrer");
1806        else if (Configuration.doAutoCreate())
1807          this.referrerTarget = new Practitioner(); // aa
1808      return this.referrerTarget;
1809    }
1810
1811    /**
1812     * @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.)
1813     */
1814    public ImagingStudy setReferrerTarget(Practitioner value) { 
1815      this.referrerTarget = value;
1816      return this;
1817    }
1818
1819    /**
1820     * @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
1821     */
1822    public Enumeration<InstanceAvailability> getAvailabilityElement() { 
1823      if (this.availability == null)
1824        if (Configuration.errorOnAutoCreate())
1825          throw new Error("Attempt to auto-create ImagingStudy.availability");
1826        else if (Configuration.doAutoCreate())
1827          this.availability = new Enumeration<InstanceAvailability>(new InstanceAvailabilityEnumFactory()); // bb
1828      return this.availability;
1829    }
1830
1831    public boolean hasAvailabilityElement() { 
1832      return this.availability != null && !this.availability.isEmpty();
1833    }
1834
1835    public boolean hasAvailability() { 
1836      return this.availability != null && !this.availability.isEmpty();
1837    }
1838
1839    /**
1840     * @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
1841     */
1842    public ImagingStudy setAvailabilityElement(Enumeration<InstanceAvailability> value) { 
1843      this.availability = value;
1844      return this;
1845    }
1846
1847    /**
1848     * @return Availability of study (online, offline or nearline).
1849     */
1850    public InstanceAvailability getAvailability() { 
1851      return this.availability == null ? null : this.availability.getValue();
1852    }
1853
1854    /**
1855     * @param value Availability of study (online, offline or nearline).
1856     */
1857    public ImagingStudy setAvailability(InstanceAvailability value) { 
1858      if (value == null)
1859        this.availability = null;
1860      else {
1861        if (this.availability == null)
1862          this.availability = new Enumeration<InstanceAvailability>(new InstanceAvailabilityEnumFactory());
1863        this.availability.setValue(value);
1864      }
1865      return this;
1866    }
1867
1868    /**
1869     * @return {@link #url} (WADO-RS resource where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1870     */
1871    public UriType getUrlElement() { 
1872      if (this.url == null)
1873        if (Configuration.errorOnAutoCreate())
1874          throw new Error("Attempt to auto-create ImagingStudy.url");
1875        else if (Configuration.doAutoCreate())
1876          this.url = new UriType(); // bb
1877      return this.url;
1878    }
1879
1880    public boolean hasUrlElement() { 
1881      return this.url != null && !this.url.isEmpty();
1882    }
1883
1884    public boolean hasUrl() { 
1885      return this.url != null && !this.url.isEmpty();
1886    }
1887
1888    /**
1889     * @param value {@link #url} (WADO-RS resource where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1890     */
1891    public ImagingStudy setUrlElement(UriType value) { 
1892      this.url = value;
1893      return this;
1894    }
1895
1896    /**
1897     * @return WADO-RS resource where Study is available.
1898     */
1899    public String getUrl() { 
1900      return this.url == null ? null : this.url.getValue();
1901    }
1902
1903    /**
1904     * @param value WADO-RS resource where Study is available.
1905     */
1906    public ImagingStudy setUrl(String value) { 
1907      if (Utilities.noString(value))
1908        this.url = null;
1909      else {
1910        if (this.url == null)
1911          this.url = new UriType();
1912        this.url.setValue(value);
1913      }
1914      return this;
1915    }
1916
1917    /**
1918     * @return {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value
1919     */
1920    public UnsignedIntType getNumberOfSeriesElement() { 
1921      if (this.numberOfSeries == null)
1922        if (Configuration.errorOnAutoCreate())
1923          throw new Error("Attempt to auto-create ImagingStudy.numberOfSeries");
1924        else if (Configuration.doAutoCreate())
1925          this.numberOfSeries = new UnsignedIntType(); // bb
1926      return this.numberOfSeries;
1927    }
1928
1929    public boolean hasNumberOfSeriesElement() { 
1930      return this.numberOfSeries != null && !this.numberOfSeries.isEmpty();
1931    }
1932
1933    public boolean hasNumberOfSeries() { 
1934      return this.numberOfSeries != null && !this.numberOfSeries.isEmpty();
1935    }
1936
1937    /**
1938     * @param value {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value
1939     */
1940    public ImagingStudy setNumberOfSeriesElement(UnsignedIntType value) { 
1941      this.numberOfSeries = value;
1942      return this;
1943    }
1944
1945    /**
1946     * @return Number of Series in Study.
1947     */
1948    public int getNumberOfSeries() { 
1949      return this.numberOfSeries == null || this.numberOfSeries.isEmpty() ? 0 : this.numberOfSeries.getValue();
1950    }
1951
1952    /**
1953     * @param value Number of Series in Study.
1954     */
1955    public ImagingStudy setNumberOfSeries(int value) { 
1956        if (this.numberOfSeries == null)
1957          this.numberOfSeries = new UnsignedIntType();
1958        this.numberOfSeries.setValue(value);
1959      return this;
1960    }
1961
1962    /**
1963     * @return {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value
1964     */
1965    public UnsignedIntType getNumberOfInstancesElement() { 
1966      if (this.numberOfInstances == null)
1967        if (Configuration.errorOnAutoCreate())
1968          throw new Error("Attempt to auto-create ImagingStudy.numberOfInstances");
1969        else if (Configuration.doAutoCreate())
1970          this.numberOfInstances = new UnsignedIntType(); // bb
1971      return this.numberOfInstances;
1972    }
1973
1974    public boolean hasNumberOfInstancesElement() { 
1975      return this.numberOfInstances != null && !this.numberOfInstances.isEmpty();
1976    }
1977
1978    public boolean hasNumberOfInstances() { 
1979      return this.numberOfInstances != null && !this.numberOfInstances.isEmpty();
1980    }
1981
1982    /**
1983     * @param value {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value
1984     */
1985    public ImagingStudy setNumberOfInstancesElement(UnsignedIntType value) { 
1986      this.numberOfInstances = value;
1987      return this;
1988    }
1989
1990    /**
1991     * @return Number of SOP Instances in Study.
1992     */
1993    public int getNumberOfInstances() { 
1994      return this.numberOfInstances == null || this.numberOfInstances.isEmpty() ? 0 : this.numberOfInstances.getValue();
1995    }
1996
1997    /**
1998     * @param value Number of SOP Instances in Study.
1999     */
2000    public ImagingStudy setNumberOfInstances(int value) { 
2001        if (this.numberOfInstances == null)
2002          this.numberOfInstances = new UnsignedIntType();
2003        this.numberOfInstances.setValue(value);
2004      return this;
2005    }
2006
2007    /**
2008     * @return {@link #procedure} (Type of procedure performed.)
2009     */
2010    public List<Reference> getProcedure() { 
2011      if (this.procedure == null)
2012        this.procedure = new ArrayList<Reference>();
2013      return this.procedure;
2014    }
2015
2016    public boolean hasProcedure() { 
2017      if (this.procedure == null)
2018        return false;
2019      for (Reference item : this.procedure)
2020        if (!item.isEmpty())
2021          return true;
2022      return false;
2023    }
2024
2025    /**
2026     * @return {@link #procedure} (Type of procedure performed.)
2027     */
2028    // syntactic sugar
2029    public Reference addProcedure() { //3
2030      Reference t = new Reference();
2031      if (this.procedure == null)
2032        this.procedure = new ArrayList<Reference>();
2033      this.procedure.add(t);
2034      return t;
2035    }
2036
2037    // syntactic sugar
2038    public ImagingStudy addProcedure(Reference t) { //3
2039      if (t == null)
2040        return this;
2041      if (this.procedure == null)
2042        this.procedure = new ArrayList<Reference>();
2043      this.procedure.add(t);
2044      return this;
2045    }
2046
2047    /**
2048     * @return {@link #procedure} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Type of procedure performed.)
2049     */
2050    public List<Procedure> getProcedureTarget() { 
2051      if (this.procedureTarget == null)
2052        this.procedureTarget = new ArrayList<Procedure>();
2053      return this.procedureTarget;
2054    }
2055
2056    // syntactic sugar
2057    /**
2058     * @return {@link #procedure} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Type of procedure performed.)
2059     */
2060    public Procedure addProcedureTarget() { 
2061      Procedure r = new Procedure();
2062      if (this.procedureTarget == null)
2063        this.procedureTarget = new ArrayList<Procedure>();
2064      this.procedureTarget.add(r);
2065      return r;
2066    }
2067
2068    /**
2069     * @return {@link #interpreter} (Who read the study and interpreted the images or other content.)
2070     */
2071    public Reference getInterpreter() { 
2072      if (this.interpreter == null)
2073        if (Configuration.errorOnAutoCreate())
2074          throw new Error("Attempt to auto-create ImagingStudy.interpreter");
2075        else if (Configuration.doAutoCreate())
2076          this.interpreter = new Reference(); // cc
2077      return this.interpreter;
2078    }
2079
2080    public boolean hasInterpreter() { 
2081      return this.interpreter != null && !this.interpreter.isEmpty();
2082    }
2083
2084    /**
2085     * @param value {@link #interpreter} (Who read the study and interpreted the images or other content.)
2086     */
2087    public ImagingStudy setInterpreter(Reference value) { 
2088      this.interpreter = value;
2089      return this;
2090    }
2091
2092    /**
2093     * @return {@link #interpreter} 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. (Who read the study and interpreted the images or other content.)
2094     */
2095    public Practitioner getInterpreterTarget() { 
2096      if (this.interpreterTarget == null)
2097        if (Configuration.errorOnAutoCreate())
2098          throw new Error("Attempt to auto-create ImagingStudy.interpreter");
2099        else if (Configuration.doAutoCreate())
2100          this.interpreterTarget = new Practitioner(); // aa
2101      return this.interpreterTarget;
2102    }
2103
2104    /**
2105     * @param value {@link #interpreter} 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. (Who read the study and interpreted the images or other content.)
2106     */
2107    public ImagingStudy setInterpreterTarget(Practitioner value) { 
2108      this.interpreterTarget = value;
2109      return this;
2110    }
2111
2112    /**
2113     * @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
2114     */
2115    public StringType getDescriptionElement() { 
2116      if (this.description == null)
2117        if (Configuration.errorOnAutoCreate())
2118          throw new Error("Attempt to auto-create ImagingStudy.description");
2119        else if (Configuration.doAutoCreate())
2120          this.description = new StringType(); // bb
2121      return this.description;
2122    }
2123
2124    public boolean hasDescriptionElement() { 
2125      return this.description != null && !this.description.isEmpty();
2126    }
2127
2128    public boolean hasDescription() { 
2129      return this.description != null && !this.description.isEmpty();
2130    }
2131
2132    /**
2133     * @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
2134     */
2135    public ImagingStudy setDescriptionElement(StringType value) { 
2136      this.description = value;
2137      return this;
2138    }
2139
2140    /**
2141     * @return Institution-generated description or classification of the Study performed.
2142     */
2143    public String getDescription() { 
2144      return this.description == null ? null : this.description.getValue();
2145    }
2146
2147    /**
2148     * @param value Institution-generated description or classification of the Study performed.
2149     */
2150    public ImagingStudy setDescription(String value) { 
2151      if (Utilities.noString(value))
2152        this.description = null;
2153      else {
2154        if (this.description == null)
2155          this.description = new StringType();
2156        this.description.setValue(value);
2157      }
2158      return this;
2159    }
2160
2161    /**
2162     * @return {@link #series} (Each study has one or more series of images or other content.)
2163     */
2164    public List<ImagingStudySeriesComponent> getSeries() { 
2165      if (this.series == null)
2166        this.series = new ArrayList<ImagingStudySeriesComponent>();
2167      return this.series;
2168    }
2169
2170    public boolean hasSeries() { 
2171      if (this.series == null)
2172        return false;
2173      for (ImagingStudySeriesComponent item : this.series)
2174        if (!item.isEmpty())
2175          return true;
2176      return false;
2177    }
2178
2179    /**
2180     * @return {@link #series} (Each study has one or more series of images or other content.)
2181     */
2182    // syntactic sugar
2183    public ImagingStudySeriesComponent addSeries() { //3
2184      ImagingStudySeriesComponent t = new ImagingStudySeriesComponent();
2185      if (this.series == null)
2186        this.series = new ArrayList<ImagingStudySeriesComponent>();
2187      this.series.add(t);
2188      return t;
2189    }
2190
2191    // syntactic sugar
2192    public ImagingStudy addSeries(ImagingStudySeriesComponent t) { //3
2193      if (t == null)
2194        return this;
2195      if (this.series == null)
2196        this.series = new ArrayList<ImagingStudySeriesComponent>();
2197      this.series.add(t);
2198      return this;
2199    }
2200
2201      protected void listChildren(List<Property> childrenList) {
2202        super.listChildren(childrenList);
2203        childrenList.add(new Property("started", "dateTime", "Date and Time the study started.", 0, java.lang.Integer.MAX_VALUE, started));
2204        childrenList.add(new Property("patient", "Reference(Patient)", "The patient imaged in the study.", 0, java.lang.Integer.MAX_VALUE, patient));
2205        childrenList.add(new Property("uid", "oid", "Formal identifier for the study.", 0, java.lang.Integer.MAX_VALUE, uid));
2206        childrenList.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, java.lang.Integer.MAX_VALUE, accession));
2207        childrenList.add(new Property("identifier", "Identifier", "Other identifiers for the study.", 0, java.lang.Integer.MAX_VALUE, identifier));
2208        childrenList.add(new Property("order", "Reference(DiagnosticOrder)", "A list of the diagnostic orders that resulted in this imaging study being performed.", 0, java.lang.Integer.MAX_VALUE, order));
2209        childrenList.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));
2210        childrenList.add(new Property("referrer", "Reference(Practitioner)", "The requesting/referring physician.", 0, java.lang.Integer.MAX_VALUE, referrer));
2211        childrenList.add(new Property("availability", "code", "Availability of study (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability));
2212        childrenList.add(new Property("url", "uri", "WADO-RS resource where Study is available.", 0, java.lang.Integer.MAX_VALUE, url));
2213        childrenList.add(new Property("numberOfSeries", "unsignedInt", "Number of Series in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfSeries));
2214        childrenList.add(new Property("numberOfInstances", "unsignedInt", "Number of SOP Instances in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances));
2215        childrenList.add(new Property("procedure", "Reference(Procedure)", "Type of procedure performed.", 0, java.lang.Integer.MAX_VALUE, procedure));
2216        childrenList.add(new Property("interpreter", "Reference(Practitioner)", "Who read the study and interpreted the images or other content.", 0, java.lang.Integer.MAX_VALUE, interpreter));
2217        childrenList.add(new Property("description", "string", "Institution-generated description or classification of the Study performed.", 0, java.lang.Integer.MAX_VALUE, description));
2218        childrenList.add(new Property("series", "", "Each study has one or more series of images or other content.", 0, java.lang.Integer.MAX_VALUE, series));
2219      }
2220
2221      @Override
2222      public void setProperty(String name, Base value) throws FHIRException {
2223        if (name.equals("started"))
2224          this.started = castToDateTime(value); // DateTimeType
2225        else if (name.equals("patient"))
2226          this.patient = castToReference(value); // Reference
2227        else if (name.equals("uid"))
2228          this.uid = castToOid(value); // OidType
2229        else if (name.equals("accession"))
2230          this.accession = castToIdentifier(value); // Identifier
2231        else if (name.equals("identifier"))
2232          this.getIdentifier().add(castToIdentifier(value));
2233        else if (name.equals("order"))
2234          this.getOrder().add(castToReference(value));
2235        else if (name.equals("modalityList"))
2236          this.getModalityList().add(castToCoding(value));
2237        else if (name.equals("referrer"))
2238          this.referrer = castToReference(value); // Reference
2239        else if (name.equals("availability"))
2240          this.availability = new InstanceAvailabilityEnumFactory().fromType(value); // Enumeration<InstanceAvailability>
2241        else if (name.equals("url"))
2242          this.url = castToUri(value); // UriType
2243        else if (name.equals("numberOfSeries"))
2244          this.numberOfSeries = castToUnsignedInt(value); // UnsignedIntType
2245        else if (name.equals("numberOfInstances"))
2246          this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType
2247        else if (name.equals("procedure"))
2248          this.getProcedure().add(castToReference(value));
2249        else if (name.equals("interpreter"))
2250          this.interpreter = castToReference(value); // Reference
2251        else if (name.equals("description"))
2252          this.description = castToString(value); // StringType
2253        else if (name.equals("series"))
2254          this.getSeries().add((ImagingStudySeriesComponent) value);
2255        else
2256          super.setProperty(name, value);
2257      }
2258
2259      @Override
2260      public Base addChild(String name) throws FHIRException {
2261        if (name.equals("started")) {
2262          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.started");
2263        }
2264        else if (name.equals("patient")) {
2265          this.patient = new Reference();
2266          return this.patient;
2267        }
2268        else if (name.equals("uid")) {
2269          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.uid");
2270        }
2271        else if (name.equals("accession")) {
2272          this.accession = new Identifier();
2273          return this.accession;
2274        }
2275        else if (name.equals("identifier")) {
2276          return addIdentifier();
2277        }
2278        else if (name.equals("order")) {
2279          return addOrder();
2280        }
2281        else if (name.equals("modalityList")) {
2282          return addModalityList();
2283        }
2284        else if (name.equals("referrer")) {
2285          this.referrer = new Reference();
2286          return this.referrer;
2287        }
2288        else if (name.equals("availability")) {
2289          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.availability");
2290        }
2291        else if (name.equals("url")) {
2292          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.url");
2293        }
2294        else if (name.equals("numberOfSeries")) {
2295          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.numberOfSeries");
2296        }
2297        else if (name.equals("numberOfInstances")) {
2298          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.numberOfInstances");
2299        }
2300        else if (name.equals("procedure")) {
2301          return addProcedure();
2302        }
2303        else if (name.equals("interpreter")) {
2304          this.interpreter = new Reference();
2305          return this.interpreter;
2306        }
2307        else if (name.equals("description")) {
2308          throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.description");
2309        }
2310        else if (name.equals("series")) {
2311          return addSeries();
2312        }
2313        else
2314          return super.addChild(name);
2315      }
2316
2317  public String fhirType() {
2318    return "ImagingStudy";
2319
2320  }
2321
2322      public ImagingStudy copy() {
2323        ImagingStudy dst = new ImagingStudy();
2324        copyValues(dst);
2325        dst.started = started == null ? null : started.copy();
2326        dst.patient = patient == null ? null : patient.copy();
2327        dst.uid = uid == null ? null : uid.copy();
2328        dst.accession = accession == null ? null : accession.copy();
2329        if (identifier != null) {
2330          dst.identifier = new ArrayList<Identifier>();
2331          for (Identifier i : identifier)
2332            dst.identifier.add(i.copy());
2333        };
2334        if (order != null) {
2335          dst.order = new ArrayList<Reference>();
2336          for (Reference i : order)
2337            dst.order.add(i.copy());
2338        };
2339        if (modalityList != null) {
2340          dst.modalityList = new ArrayList<Coding>();
2341          for (Coding i : modalityList)
2342            dst.modalityList.add(i.copy());
2343        };
2344        dst.referrer = referrer == null ? null : referrer.copy();
2345        dst.availability = availability == null ? null : availability.copy();
2346        dst.url = url == null ? null : url.copy();
2347        dst.numberOfSeries = numberOfSeries == null ? null : numberOfSeries.copy();
2348        dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy();
2349        if (procedure != null) {
2350          dst.procedure = new ArrayList<Reference>();
2351          for (Reference i : procedure)
2352            dst.procedure.add(i.copy());
2353        };
2354        dst.interpreter = interpreter == null ? null : interpreter.copy();
2355        dst.description = description == null ? null : description.copy();
2356        if (series != null) {
2357          dst.series = new ArrayList<ImagingStudySeriesComponent>();
2358          for (ImagingStudySeriesComponent i : series)
2359            dst.series.add(i.copy());
2360        };
2361        return dst;
2362      }
2363
2364      protected ImagingStudy typedCopy() {
2365        return copy();
2366      }
2367
2368      @Override
2369      public boolean equalsDeep(Base other) {
2370        if (!super.equalsDeep(other))
2371          return false;
2372        if (!(other instanceof ImagingStudy))
2373          return false;
2374        ImagingStudy o = (ImagingStudy) other;
2375        return compareDeep(started, o.started, true) && compareDeep(patient, o.patient, true) && compareDeep(uid, o.uid, true)
2376           && compareDeep(accession, o.accession, true) && compareDeep(identifier, o.identifier, true) && compareDeep(order, o.order, true)
2377           && compareDeep(modalityList, o.modalityList, true) && compareDeep(referrer, o.referrer, true) && compareDeep(availability, o.availability, true)
2378           && compareDeep(url, o.url, true) && compareDeep(numberOfSeries, o.numberOfSeries, true) && compareDeep(numberOfInstances, o.numberOfInstances, true)
2379           && compareDeep(procedure, o.procedure, true) && compareDeep(interpreter, o.interpreter, true) && compareDeep(description, o.description, true)
2380           && compareDeep(series, o.series, true);
2381      }
2382
2383      @Override
2384      public boolean equalsShallow(Base other) {
2385        if (!super.equalsShallow(other))
2386          return false;
2387        if (!(other instanceof ImagingStudy))
2388          return false;
2389        ImagingStudy o = (ImagingStudy) other;
2390        return compareValues(started, o.started, true) && compareValues(uid, o.uid, true) && compareValues(availability, o.availability, true)
2391           && compareValues(url, o.url, true) && compareValues(numberOfSeries, o.numberOfSeries, true) && compareValues(numberOfInstances, o.numberOfInstances, true)
2392           && compareValues(description, o.description, true);
2393      }
2394
2395      public boolean isEmpty() {
2396        return super.isEmpty() && (started == null || started.isEmpty()) && (patient == null || patient.isEmpty())
2397           && (uid == null || uid.isEmpty()) && (accession == null || accession.isEmpty()) && (identifier == null || identifier.isEmpty())
2398           && (order == null || order.isEmpty()) && (modalityList == null || modalityList.isEmpty())
2399           && (referrer == null || referrer.isEmpty()) && (availability == null || availability.isEmpty())
2400           && (url == null || url.isEmpty()) && (numberOfSeries == null || numberOfSeries.isEmpty())
2401           && (numberOfInstances == null || numberOfInstances.isEmpty()) && (procedure == null || procedure.isEmpty())
2402           && (interpreter == null || interpreter.isEmpty()) && (description == null || description.isEmpty())
2403           && (series == null || series.isEmpty());
2404      }
2405
2406  @Override
2407  public ResourceType getResourceType() {
2408    return ResourceType.ImagingStudy;
2409   }
2410
2411  @SearchParamDefinition(name="uid", path="ImagingStudy.series.instance.uid", description="The instance unique identifier", type="uri" )
2412  public static final String SP_UID = "uid";
2413  @SearchParamDefinition(name="study", path="ImagingStudy.uid", description="The study identifier for the image", type="uri" )
2414  public static final String SP_STUDY = "study";
2415  @SearchParamDefinition(name="dicom-class", path="ImagingStudy.series.instance.sopClass", description="The type of the instance", type="uri" )
2416  public static final String SP_DICOMCLASS = "dicom-class";
2417  @SearchParamDefinition(name="modality", path="ImagingStudy.series.modality", description="The modality of the series", type="token" )
2418  public static final String SP_MODALITY = "modality";
2419  @SearchParamDefinition(name="bodysite", path="ImagingStudy.series.bodySite", description="The body site studied", type="token" )
2420  public static final String SP_BODYSITE = "bodysite";
2421  @SearchParamDefinition(name="patient", path="ImagingStudy.patient", description="Who the study is about", type="reference" )
2422  public static final String SP_PATIENT = "patient";
2423  @SearchParamDefinition(name="series", path="ImagingStudy.series.uid", description="The identifier of the series of images", type="uri" )
2424  public static final String SP_SERIES = "series";
2425  @SearchParamDefinition(name="started", path="ImagingStudy.started", description="When the study was started", type="date" )
2426  public static final String SP_STARTED = "started";
2427  @SearchParamDefinition(name="accession", path="ImagingStudy.accession", description="The accession identifier for the study", type="token" )
2428  public static final String SP_ACCESSION = "accession";
2429  @SearchParamDefinition(name="order", path="ImagingStudy.order", description="The order for the image", type="reference" )
2430  public static final String SP_ORDER = "order";
2431
2432}
2433