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