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