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