001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import java.math.*;
038import org.hl7.fhir.utilities.Utilities;
039import org.hl7.fhir.r5.model.Enumerations.*;
040import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
041import org.hl7.fhir.exceptions.FHIRException;
042import org.hl7.fhir.instance.model.api.ICompositeType;
043import ca.uhn.fhir.model.api.annotation.ResourceDef;
044import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
045import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.ChildOrder;
048import ca.uhn.fhir.model.api.annotation.Description;
049import ca.uhn.fhir.model.api.annotation.Block;
050
051/**
052 * A selection of DICOM SOP instances and/or frames within a single Study and Series. This might include additional specifics such as an image region, an Observation UID or a Segmentation Number, allowing linkage to an Observation Resource or transferring this information along with the ImagingStudy Resource.
053 */
054@ResourceDef(name="ImagingSelection", profile="http://hl7.org/fhir/StructureDefinition/ImagingSelection")
055public class ImagingSelection extends DomainResource {
056
057    public enum ImagingSelectionCoordinateType {
058        /**
059         * The selected image region is defined in a 2D coordinate system.
060         */
061        _2D, 
062        /**
063         * The selected image region is defined in a 3D coordinate system.
064         */
065        _3D, 
066        /**
067         * added to help the parsers with the generic types
068         */
069        NULL;
070        public static ImagingSelectionCoordinateType fromCode(String codeString) throws FHIRException {
071            if (codeString == null || "".equals(codeString))
072                return null;
073        if ("2d".equals(codeString))
074          return _2D;
075        if ("3d".equals(codeString))
076          return _3D;
077        if (Configuration.isAcceptInvalidEnums())
078          return null;
079        else
080          throw new FHIRException("Unknown ImagingSelectionCoordinateType code '"+codeString+"'");
081        }
082        public String toCode() {
083          switch (this) {
084            case _2D: return "2d";
085            case _3D: return "3d";
086            default: return "?";
087          }
088        }
089        public String getSystem() {
090          switch (this) {
091            case _2D: return "http://hl7.org/fhir/imagingselection-coordinatetype";
092            case _3D: return "http://hl7.org/fhir/imagingselection-coordinatetype";
093            default: return "?";
094          }
095        }
096        public String getDefinition() {
097          switch (this) {
098            case _2D: return "The selected image region is defined in a 2D coordinate system.";
099            case _3D: return "The selected image region is defined in a 3D coordinate system.";
100            default: return "?";
101          }
102        }
103        public String getDisplay() {
104          switch (this) {
105            case _2D: return "2D";
106            case _3D: return "3D";
107            default: return "?";
108          }
109        }
110    }
111
112  public static class ImagingSelectionCoordinateTypeEnumFactory implements EnumFactory<ImagingSelectionCoordinateType> {
113    public ImagingSelectionCoordinateType fromCode(String codeString) throws IllegalArgumentException {
114      if (codeString == null || "".equals(codeString))
115            if (codeString == null || "".equals(codeString))
116                return null;
117        if ("2d".equals(codeString))
118          return ImagingSelectionCoordinateType._2D;
119        if ("3d".equals(codeString))
120          return ImagingSelectionCoordinateType._3D;
121        throw new IllegalArgumentException("Unknown ImagingSelectionCoordinateType code '"+codeString+"'");
122        }
123        public Enumeration<ImagingSelectionCoordinateType> fromType(Base code) throws FHIRException {
124          if (code == null)
125            return null;
126          if (code.isEmpty())
127            return new Enumeration<ImagingSelectionCoordinateType>(this);
128          String codeString = ((PrimitiveType) code).asStringValue();
129          if (codeString == null || "".equals(codeString))
130            return null;
131        if ("2d".equals(codeString))
132          return new Enumeration<ImagingSelectionCoordinateType>(this, ImagingSelectionCoordinateType._2D);
133        if ("3d".equals(codeString))
134          return new Enumeration<ImagingSelectionCoordinateType>(this, ImagingSelectionCoordinateType._3D);
135        throw new FHIRException("Unknown ImagingSelectionCoordinateType code '"+codeString+"'");
136        }
137    public String toCode(ImagingSelectionCoordinateType code) {
138      if (code == ImagingSelectionCoordinateType._2D)
139        return "2d";
140      if (code == ImagingSelectionCoordinateType._3D)
141        return "3d";
142      return "?";
143      }
144    public String toSystem(ImagingSelectionCoordinateType code) {
145      return code.getSystem();
146      }
147    }
148
149    public enum ImagingSelectionGraphicType {
150        /**
151         * A single location denoted by a single (x,y,z) triplet.
152         */
153        POINT, 
154        /**
155         * multiple locations each denoted by an (x,y,z) triplet; the points need not be coplanar.
156         */
157        MULTIPOINT, 
158        /**
159         * a series of connected line segments with ordered vertices denoted by (x,y,z) triplets; the points need not be coplanar.
160         */
161        POLYLINE, 
162        /**
163         * a series of connected line segments with ordered vertices denoted by (x,y,z) triplets, where the first and last vertices shall be the same forming a polygon; the points shall be coplanar.
164         */
165        POLYGON, 
166        /**
167         * an ellipse defined by four (x,y,z) triplets, the first two triplets specifying the endpoints of the major axis and the second two triplets specifying the endpoints of the minor axis.
168         */
169        ELLIPSE, 
170        /**
171         * a three-dimensional geometric surface whose plane sections are either ellipses or circles and contains three intersecting orthogonal axes, \"a\", \"b\", and \"c\"; the ellipsoid is defined by six (x,y,z) triplets, the first and second triplets specifying the endpoints of axis \"a\", the third and fourth triplets specifying the endpoints of axis \"b\", and the fifth and sixth triplets specifying the endpoints of axis \"c\".
172         */
173        ELLIPSOID, 
174        /**
175         * added to help the parsers with the generic types
176         */
177        NULL;
178        public static ImagingSelectionGraphicType fromCode(String codeString) throws FHIRException {
179            if (codeString == null || "".equals(codeString))
180                return null;
181        if ("POINT".equals(codeString))
182          return POINT;
183        if ("MULTIPOINT".equals(codeString))
184          return MULTIPOINT;
185        if ("POLYLINE".equals(codeString))
186          return POLYLINE;
187        if ("POLYGON".equals(codeString))
188          return POLYGON;
189        if ("ELLIPSE".equals(codeString))
190          return ELLIPSE;
191        if ("ELLIPSOID".equals(codeString))
192          return ELLIPSOID;
193        if (Configuration.isAcceptInvalidEnums())
194          return null;
195        else
196          throw new FHIRException("Unknown ImagingSelectionGraphicType code '"+codeString+"'");
197        }
198        public String toCode() {
199          switch (this) {
200            case POINT: return "POINT";
201            case MULTIPOINT: return "MULTIPOINT";
202            case POLYLINE: return "POLYLINE";
203            case POLYGON: return "POLYGON";
204            case ELLIPSE: return "ELLIPSE";
205            case ELLIPSOID: return "ELLIPSOID";
206            default: return "?";
207          }
208        }
209        public String getSystem() {
210          switch (this) {
211            case POINT: return "http://hl7.org/fhir/imagingselection-graphictype";
212            case MULTIPOINT: return "http://hl7.org/fhir/imagingselection-graphictype";
213            case POLYLINE: return "http://hl7.org/fhir/imagingselection-graphictype";
214            case POLYGON: return "http://hl7.org/fhir/imagingselection-graphictype";
215            case ELLIPSE: return "http://hl7.org/fhir/imagingselection-graphictype";
216            case ELLIPSOID: return "http://hl7.org/fhir/imagingselection-graphictype";
217            default: return "?";
218          }
219        }
220        public String getDefinition() {
221          switch (this) {
222            case POINT: return "A single location denoted by a single (x,y,z) triplet.";
223            case MULTIPOINT: return "multiple locations each denoted by an (x,y,z) triplet; the points need not be coplanar.";
224            case POLYLINE: return "a series of connected line segments with ordered vertices denoted by (x,y,z) triplets; the points need not be coplanar.";
225            case POLYGON: return "a series of connected line segments with ordered vertices denoted by (x,y,z) triplets, where the first and last vertices shall be the same forming a polygon; the points shall be coplanar.";
226            case ELLIPSE: return "an ellipse defined by four (x,y,z) triplets, the first two triplets specifying the endpoints of the major axis and the second two triplets specifying the endpoints of the minor axis.";
227            case ELLIPSOID: return "a three-dimensional geometric surface whose plane sections are either ellipses or circles and contains three intersecting orthogonal axes, \"a\", \"b\", and \"c\"; the ellipsoid is defined by six (x,y,z) triplets, the first and second triplets specifying the endpoints of axis \"a\", the third and fourth triplets specifying the endpoints of axis \"b\", and the fifth and sixth triplets specifying the endpoints of axis \"c\".";
228            default: return "?";
229          }
230        }
231        public String getDisplay() {
232          switch (this) {
233            case POINT: return "POINT";
234            case MULTIPOINT: return "MULTIPOINT";
235            case POLYLINE: return "POLYLINE";
236            case POLYGON: return "POLYGON";
237            case ELLIPSE: return "ELLIPSE";
238            case ELLIPSOID: return "ELLIPSOID";
239            default: return "?";
240          }
241        }
242    }
243
244  public static class ImagingSelectionGraphicTypeEnumFactory implements EnumFactory<ImagingSelectionGraphicType> {
245    public ImagingSelectionGraphicType fromCode(String codeString) throws IllegalArgumentException {
246      if (codeString == null || "".equals(codeString))
247            if (codeString == null || "".equals(codeString))
248                return null;
249        if ("POINT".equals(codeString))
250          return ImagingSelectionGraphicType.POINT;
251        if ("MULTIPOINT".equals(codeString))
252          return ImagingSelectionGraphicType.MULTIPOINT;
253        if ("POLYLINE".equals(codeString))
254          return ImagingSelectionGraphicType.POLYLINE;
255        if ("POLYGON".equals(codeString))
256          return ImagingSelectionGraphicType.POLYGON;
257        if ("ELLIPSE".equals(codeString))
258          return ImagingSelectionGraphicType.ELLIPSE;
259        if ("ELLIPSOID".equals(codeString))
260          return ImagingSelectionGraphicType.ELLIPSOID;
261        throw new IllegalArgumentException("Unknown ImagingSelectionGraphicType code '"+codeString+"'");
262        }
263        public Enumeration<ImagingSelectionGraphicType> fromType(Base code) throws FHIRException {
264          if (code == null)
265            return null;
266          if (code.isEmpty())
267            return new Enumeration<ImagingSelectionGraphicType>(this);
268          String codeString = ((PrimitiveType) code).asStringValue();
269          if (codeString == null || "".equals(codeString))
270            return null;
271        if ("POINT".equals(codeString))
272          return new Enumeration<ImagingSelectionGraphicType>(this, ImagingSelectionGraphicType.POINT);
273        if ("MULTIPOINT".equals(codeString))
274          return new Enumeration<ImagingSelectionGraphicType>(this, ImagingSelectionGraphicType.MULTIPOINT);
275        if ("POLYLINE".equals(codeString))
276          return new Enumeration<ImagingSelectionGraphicType>(this, ImagingSelectionGraphicType.POLYLINE);
277        if ("POLYGON".equals(codeString))
278          return new Enumeration<ImagingSelectionGraphicType>(this, ImagingSelectionGraphicType.POLYGON);
279        if ("ELLIPSE".equals(codeString))
280          return new Enumeration<ImagingSelectionGraphicType>(this, ImagingSelectionGraphicType.ELLIPSE);
281        if ("ELLIPSOID".equals(codeString))
282          return new Enumeration<ImagingSelectionGraphicType>(this, ImagingSelectionGraphicType.ELLIPSOID);
283        throw new FHIRException("Unknown ImagingSelectionGraphicType code '"+codeString+"'");
284        }
285    public String toCode(ImagingSelectionGraphicType code) {
286      if (code == ImagingSelectionGraphicType.POINT)
287        return "POINT";
288      if (code == ImagingSelectionGraphicType.MULTIPOINT)
289        return "MULTIPOINT";
290      if (code == ImagingSelectionGraphicType.POLYLINE)
291        return "POLYLINE";
292      if (code == ImagingSelectionGraphicType.POLYGON)
293        return "POLYGON";
294      if (code == ImagingSelectionGraphicType.ELLIPSE)
295        return "ELLIPSE";
296      if (code == ImagingSelectionGraphicType.ELLIPSOID)
297        return "ELLIPSOID";
298      return "?";
299      }
300    public String toSystem(ImagingSelectionGraphicType code) {
301      return code.getSystem();
302      }
303    }
304
305    @Block()
306    public static class ImagingSelectionPerformerComponent extends BackboneElement implements IBaseBackboneElement {
307        /**
308         * Distinguishes the type of involvement of the performer.
309         */
310        @Child(name = "function", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
311        @Description(shortDefinition="Type of performer", formalDefinition="Distinguishes the type of involvement of the performer." )
312        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/series-performer-function")
313        protected CodeableConcept function;
314
315        /**
316         * Author ? human or machine.
317         */
318        @Child(name = "actor", type = {Practitioner.class, PractitionerRole.class, Device.class, Organization.class, CareTeam.class, Patient.class, RelatedPerson.class, HealthcareService.class}, order=2, min=0, max=1, modifier=false, summary=true)
319        @Description(shortDefinition="Author (human or machine)", formalDefinition="Author ? human or machine." )
320        protected Reference actor;
321
322        private static final long serialVersionUID = -576943815L;
323
324    /**
325     * Constructor
326     */
327      public ImagingSelectionPerformerComponent() {
328        super();
329      }
330
331        /**
332         * @return {@link #function} (Distinguishes the type of involvement of the performer.)
333         */
334        public CodeableConcept getFunction() { 
335          if (this.function == null)
336            if (Configuration.errorOnAutoCreate())
337              throw new Error("Attempt to auto-create ImagingSelectionPerformerComponent.function");
338            else if (Configuration.doAutoCreate())
339              this.function = new CodeableConcept(); // cc
340          return this.function;
341        }
342
343        public boolean hasFunction() { 
344          return this.function != null && !this.function.isEmpty();
345        }
346
347        /**
348         * @param value {@link #function} (Distinguishes the type of involvement of the performer.)
349         */
350        public ImagingSelectionPerformerComponent setFunction(CodeableConcept value) { 
351          this.function = value;
352          return this;
353        }
354
355        /**
356         * @return {@link #actor} (Author ? human or machine.)
357         */
358        public Reference getActor() { 
359          if (this.actor == null)
360            if (Configuration.errorOnAutoCreate())
361              throw new Error("Attempt to auto-create ImagingSelectionPerformerComponent.actor");
362            else if (Configuration.doAutoCreate())
363              this.actor = new Reference(); // cc
364          return this.actor;
365        }
366
367        public boolean hasActor() { 
368          return this.actor != null && !this.actor.isEmpty();
369        }
370
371        /**
372         * @param value {@link #actor} (Author ? human or machine.)
373         */
374        public ImagingSelectionPerformerComponent setActor(Reference value) { 
375          this.actor = value;
376          return this;
377        }
378
379        protected void listChildren(List<Property> children) {
380          super.listChildren(children);
381          children.add(new Property("function", "CodeableConcept", "Distinguishes the type of involvement of the performer.", 0, 1, function));
382          children.add(new Property("actor", "Reference(Practitioner|PractitionerRole|Device|Organization|CareTeam|Patient|RelatedPerson|HealthcareService)", "Author ? human or machine.", 0, 1, actor));
383        }
384
385        @Override
386        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
387          switch (_hash) {
388          case 1380938712: /*function*/  return new Property("function", "CodeableConcept", "Distinguishes the type of involvement of the performer.", 0, 1, function);
389          case 92645877: /*actor*/  return new Property("actor", "Reference(Practitioner|PractitionerRole|Device|Organization|CareTeam|Patient|RelatedPerson|HealthcareService)", "Author ? human or machine.", 0, 1, actor);
390          default: return super.getNamedProperty(_hash, _name, _checkValid);
391          }
392
393        }
394
395      @Override
396      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
397        switch (hash) {
398        case 1380938712: /*function*/ return this.function == null ? new Base[0] : new Base[] {this.function}; // CodeableConcept
399        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
400        default: return super.getProperty(hash, name, checkValid);
401        }
402
403      }
404
405      @Override
406      public Base setProperty(int hash, String name, Base value) throws FHIRException {
407        switch (hash) {
408        case 1380938712: // function
409          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
410          return value;
411        case 92645877: // actor
412          this.actor = TypeConvertor.castToReference(value); // Reference
413          return value;
414        default: return super.setProperty(hash, name, value);
415        }
416
417      }
418
419      @Override
420      public Base setProperty(String name, Base value) throws FHIRException {
421        if (name.equals("function")) {
422          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
423        } else if (name.equals("actor")) {
424          this.actor = TypeConvertor.castToReference(value); // Reference
425        } else
426          return super.setProperty(name, value);
427        return value;
428      }
429
430      @Override
431      public Base makeProperty(int hash, String name) throws FHIRException {
432        switch (hash) {
433        case 1380938712:  return getFunction();
434        case 92645877:  return getActor();
435        default: return super.makeProperty(hash, name);
436        }
437
438      }
439
440      @Override
441      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
442        switch (hash) {
443        case 1380938712: /*function*/ return new String[] {"CodeableConcept"};
444        case 92645877: /*actor*/ return new String[] {"Reference"};
445        default: return super.getTypesForProperty(hash, name);
446        }
447
448      }
449
450      @Override
451      public Base addChild(String name) throws FHIRException {
452        if (name.equals("function")) {
453          this.function = new CodeableConcept();
454          return this.function;
455        }
456        else if (name.equals("actor")) {
457          this.actor = new Reference();
458          return this.actor;
459        }
460        else
461          return super.addChild(name);
462      }
463
464      public ImagingSelectionPerformerComponent copy() {
465        ImagingSelectionPerformerComponent dst = new ImagingSelectionPerformerComponent();
466        copyValues(dst);
467        return dst;
468      }
469
470      public void copyValues(ImagingSelectionPerformerComponent dst) {
471        super.copyValues(dst);
472        dst.function = function == null ? null : function.copy();
473        dst.actor = actor == null ? null : actor.copy();
474      }
475
476      @Override
477      public boolean equalsDeep(Base other_) {
478        if (!super.equalsDeep(other_))
479          return false;
480        if (!(other_ instanceof ImagingSelectionPerformerComponent))
481          return false;
482        ImagingSelectionPerformerComponent o = (ImagingSelectionPerformerComponent) other_;
483        return compareDeep(function, o.function, true) && compareDeep(actor, o.actor, true);
484      }
485
486      @Override
487      public boolean equalsShallow(Base other_) {
488        if (!super.equalsShallow(other_))
489          return false;
490        if (!(other_ instanceof ImagingSelectionPerformerComponent))
491          return false;
492        ImagingSelectionPerformerComponent o = (ImagingSelectionPerformerComponent) other_;
493        return true;
494      }
495
496      public boolean isEmpty() {
497        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(function, actor);
498      }
499
500  public String fhirType() {
501    return "ImagingSelection.performer";
502
503  }
504
505  }
506
507    @Block()
508    public static class ImagingSelectionInstanceComponent extends BackboneElement implements IBaseBackboneElement {
509        /**
510         * The SOP Instance UID for the selected DICOM instance.
511         */
512        @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true)
513        @Description(shortDefinition="DICOM SOP Instance UID", formalDefinition="The SOP Instance UID for the selected DICOM instance." )
514        protected OidType uid;
515
516        /**
517         * The SOP Class UID for the selected DICOM instance.
518         */
519        @Child(name = "sopClass", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false)
520        @Description(shortDefinition="DICOM SOP Class UID", formalDefinition="The SOP Class UID for the selected DICOM instance." )
521        @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")
522        protected Coding sopClass;
523
524        /**
525         * The set of frames within a multi-frame SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate frame numbers.       If this is absent, all frames within the referenced SOP Instance are included in the selection.
526         */
527        @Child(name = "frameList", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
528        @Description(shortDefinition="List of selected frames encoded as a comma separated list of one or more non duplicate frame numbers", formalDefinition="The set of frames within a multi-frame SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate frame numbers.       If this is absent, all frames within the referenced SOP Instance are included in the selection." )
529        protected StringType frameList;
530
531        /**
532         * The unique identifier for the observation Content Item (and its subsidiary Content Items, if any) that are included in the imaging selection.
533         */
534        @Child(name = "observationUid", type = {OidType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
535        @Description(shortDefinition="Selected observations in a DICOM SR", formalDefinition="The unique identifier for the observation Content Item (and its subsidiary Content Items, if any) that are included in the imaging selection." )
536        protected List<OidType> observationUid;
537
538        /**
539         * The set of segments within a segmentation SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate segment numbers.       If this is absent, all segments within the referenced segmentation SOP Instance are included in the selection.
540         */
541        @Child(name = "segmentList", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
542        @Description(shortDefinition="List of selected segments encoded as a comma separated list of one or more non duplicate segnent numbers", formalDefinition="The set of segments within a segmentation SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate segment numbers.       If this is absent, all segments within the referenced segmentation SOP Instance are included in the selection." )
543        protected StringType segmentList;
544
545        /**
546         * The set of regions of interest (ROI) within a radiotherapy structure set instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate ROI numbers.       If this is absent, all ROIs within the referenced radiotherapy structure set SOP Instance are included in the selection.
547         */
548        @Child(name = "roiList", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
549        @Description(shortDefinition="List of selected regions of interest (ROI) encoded as a comma separated list of one or more non duplicate ROI numbers", formalDefinition="The set of regions of interest (ROI) within a radiotherapy structure set instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate ROI numbers.       If this is absent, all ROIs within the referenced radiotherapy structure set SOP Instance are included in the selection." )
550        protected StringType roiList;
551
552        private static final long serialVersionUID = -1574362633L;
553
554    /**
555     * Constructor
556     */
557      public ImagingSelectionInstanceComponent() {
558        super();
559      }
560
561    /**
562     * Constructor
563     */
564      public ImagingSelectionInstanceComponent(String uid) {
565        super();
566        this.setUid(uid);
567      }
568
569        /**
570         * @return {@link #uid} (The SOP Instance UID for the selected DICOM instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value
571         */
572        public OidType getUidElement() { 
573          if (this.uid == null)
574            if (Configuration.errorOnAutoCreate())
575              throw new Error("Attempt to auto-create ImagingSelectionInstanceComponent.uid");
576            else if (Configuration.doAutoCreate())
577              this.uid = new OidType(); // bb
578          return this.uid;
579        }
580
581        public boolean hasUidElement() { 
582          return this.uid != null && !this.uid.isEmpty();
583        }
584
585        public boolean hasUid() { 
586          return this.uid != null && !this.uid.isEmpty();
587        }
588
589        /**
590         * @param value {@link #uid} (The SOP Instance UID for the selected DICOM instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value
591         */
592        public ImagingSelectionInstanceComponent setUidElement(OidType value) { 
593          this.uid = value;
594          return this;
595        }
596
597        /**
598         * @return The SOP Instance UID for the selected DICOM instance.
599         */
600        public String getUid() { 
601          return this.uid == null ? null : this.uid.getValue();
602        }
603
604        /**
605         * @param value The SOP Instance UID for the selected DICOM instance.
606         */
607        public ImagingSelectionInstanceComponent setUid(String value) { 
608            if (this.uid == null)
609              this.uid = new OidType();
610            this.uid.setValue(value);
611          return this;
612        }
613
614        /**
615         * @return {@link #sopClass} (The SOP Class UID for the selected DICOM instance.)
616         */
617        public Coding getSopClass() { 
618          if (this.sopClass == null)
619            if (Configuration.errorOnAutoCreate())
620              throw new Error("Attempt to auto-create ImagingSelectionInstanceComponent.sopClass");
621            else if (Configuration.doAutoCreate())
622              this.sopClass = new Coding(); // cc
623          return this.sopClass;
624        }
625
626        public boolean hasSopClass() { 
627          return this.sopClass != null && !this.sopClass.isEmpty();
628        }
629
630        /**
631         * @param value {@link #sopClass} (The SOP Class UID for the selected DICOM instance.)
632         */
633        public ImagingSelectionInstanceComponent setSopClass(Coding value) { 
634          this.sopClass = value;
635          return this;
636        }
637
638        /**
639         * @return {@link #frameList} (The set of frames within a multi-frame SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate frame numbers.       If this is absent, all frames within the referenced SOP Instance are included in the selection.). This is the underlying object with id, value and extensions. The accessor "getFrameList" gives direct access to the value
640         */
641        public StringType getFrameListElement() { 
642          if (this.frameList == null)
643            if (Configuration.errorOnAutoCreate())
644              throw new Error("Attempt to auto-create ImagingSelectionInstanceComponent.frameList");
645            else if (Configuration.doAutoCreate())
646              this.frameList = new StringType(); // bb
647          return this.frameList;
648        }
649
650        public boolean hasFrameListElement() { 
651          return this.frameList != null && !this.frameList.isEmpty();
652        }
653
654        public boolean hasFrameList() { 
655          return this.frameList != null && !this.frameList.isEmpty();
656        }
657
658        /**
659         * @param value {@link #frameList} (The set of frames within a multi-frame SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate frame numbers.       If this is absent, all frames within the referenced SOP Instance are included in the selection.). This is the underlying object with id, value and extensions. The accessor "getFrameList" gives direct access to the value
660         */
661        public ImagingSelectionInstanceComponent setFrameListElement(StringType value) { 
662          this.frameList = value;
663          return this;
664        }
665
666        /**
667         * @return The set of frames within a multi-frame SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate frame numbers.       If this is absent, all frames within the referenced SOP Instance are included in the selection.
668         */
669        public String getFrameList() { 
670          return this.frameList == null ? null : this.frameList.getValue();
671        }
672
673        /**
674         * @param value The set of frames within a multi-frame SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate frame numbers.       If this is absent, all frames within the referenced SOP Instance are included in the selection.
675         */
676        public ImagingSelectionInstanceComponent setFrameList(String value) { 
677          if (Utilities.noString(value))
678            this.frameList = null;
679          else {
680            if (this.frameList == null)
681              this.frameList = new StringType();
682            this.frameList.setValue(value);
683          }
684          return this;
685        }
686
687        /**
688         * @return {@link #observationUid} (The unique identifier for the observation Content Item (and its subsidiary Content Items, if any) that are included in the imaging selection.)
689         */
690        public List<OidType> getObservationUid() { 
691          if (this.observationUid == null)
692            this.observationUid = new ArrayList<OidType>();
693          return this.observationUid;
694        }
695
696        /**
697         * @return Returns a reference to <code>this</code> for easy method chaining
698         */
699        public ImagingSelectionInstanceComponent setObservationUid(List<OidType> theObservationUid) { 
700          this.observationUid = theObservationUid;
701          return this;
702        }
703
704        public boolean hasObservationUid() { 
705          if (this.observationUid == null)
706            return false;
707          for (OidType item : this.observationUid)
708            if (!item.isEmpty())
709              return true;
710          return false;
711        }
712
713        /**
714         * @return {@link #observationUid} (The unique identifier for the observation Content Item (and its subsidiary Content Items, if any) that are included in the imaging selection.)
715         */
716        public OidType addObservationUidElement() {//2 
717          OidType t = new OidType();
718          if (this.observationUid == null)
719            this.observationUid = new ArrayList<OidType>();
720          this.observationUid.add(t);
721          return t;
722        }
723
724        /**
725         * @param value {@link #observationUid} (The unique identifier for the observation Content Item (and its subsidiary Content Items, if any) that are included in the imaging selection.)
726         */
727        public ImagingSelectionInstanceComponent addObservationUid(String value) { //1
728          OidType t = new OidType();
729          t.setValue(value);
730          if (this.observationUid == null)
731            this.observationUid = new ArrayList<OidType>();
732          this.observationUid.add(t);
733          return this;
734        }
735
736        /**
737         * @param value {@link #observationUid} (The unique identifier for the observation Content Item (and its subsidiary Content Items, if any) that are included in the imaging selection.)
738         */
739        public boolean hasObservationUid(String value) { 
740          if (this.observationUid == null)
741            return false;
742          for (OidType v : this.observationUid)
743            if (v.getValue().equals(value)) // oid
744              return true;
745          return false;
746        }
747
748        /**
749         * @return {@link #segmentList} (The set of segments within a segmentation SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate segment numbers.       If this is absent, all segments within the referenced segmentation SOP Instance are included in the selection.). This is the underlying object with id, value and extensions. The accessor "getSegmentList" gives direct access to the value
750         */
751        public StringType getSegmentListElement() { 
752          if (this.segmentList == null)
753            if (Configuration.errorOnAutoCreate())
754              throw new Error("Attempt to auto-create ImagingSelectionInstanceComponent.segmentList");
755            else if (Configuration.doAutoCreate())
756              this.segmentList = new StringType(); // bb
757          return this.segmentList;
758        }
759
760        public boolean hasSegmentListElement() { 
761          return this.segmentList != null && !this.segmentList.isEmpty();
762        }
763
764        public boolean hasSegmentList() { 
765          return this.segmentList != null && !this.segmentList.isEmpty();
766        }
767
768        /**
769         * @param value {@link #segmentList} (The set of segments within a segmentation SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate segment numbers.       If this is absent, all segments within the referenced segmentation SOP Instance are included in the selection.). This is the underlying object with id, value and extensions. The accessor "getSegmentList" gives direct access to the value
770         */
771        public ImagingSelectionInstanceComponent setSegmentListElement(StringType value) { 
772          this.segmentList = value;
773          return this;
774        }
775
776        /**
777         * @return The set of segments within a segmentation SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate segment numbers.       If this is absent, all segments within the referenced segmentation SOP Instance are included in the selection.
778         */
779        public String getSegmentList() { 
780          return this.segmentList == null ? null : this.segmentList.getValue();
781        }
782
783        /**
784         * @param value The set of segments within a segmentation SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate segment numbers.       If this is absent, all segments within the referenced segmentation SOP Instance are included in the selection.
785         */
786        public ImagingSelectionInstanceComponent setSegmentList(String value) { 
787          if (Utilities.noString(value))
788            this.segmentList = null;
789          else {
790            if (this.segmentList == null)
791              this.segmentList = new StringType();
792            this.segmentList.setValue(value);
793          }
794          return this;
795        }
796
797        /**
798         * @return {@link #roiList} (The set of regions of interest (ROI) within a radiotherapy structure set instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate ROI numbers.       If this is absent, all ROIs within the referenced radiotherapy structure set SOP Instance are included in the selection.). This is the underlying object with id, value and extensions. The accessor "getRoiList" gives direct access to the value
799         */
800        public StringType getRoiListElement() { 
801          if (this.roiList == null)
802            if (Configuration.errorOnAutoCreate())
803              throw new Error("Attempt to auto-create ImagingSelectionInstanceComponent.roiList");
804            else if (Configuration.doAutoCreate())
805              this.roiList = new StringType(); // bb
806          return this.roiList;
807        }
808
809        public boolean hasRoiListElement() { 
810          return this.roiList != null && !this.roiList.isEmpty();
811        }
812
813        public boolean hasRoiList() { 
814          return this.roiList != null && !this.roiList.isEmpty();
815        }
816
817        /**
818         * @param value {@link #roiList} (The set of regions of interest (ROI) within a radiotherapy structure set instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate ROI numbers.       If this is absent, all ROIs within the referenced radiotherapy structure set SOP Instance are included in the selection.). This is the underlying object with id, value and extensions. The accessor "getRoiList" gives direct access to the value
819         */
820        public ImagingSelectionInstanceComponent setRoiListElement(StringType value) { 
821          this.roiList = value;
822          return this;
823        }
824
825        /**
826         * @return The set of regions of interest (ROI) within a radiotherapy structure set instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate ROI numbers.       If this is absent, all ROIs within the referenced radiotherapy structure set SOP Instance are included in the selection.
827         */
828        public String getRoiList() { 
829          return this.roiList == null ? null : this.roiList.getValue();
830        }
831
832        /**
833         * @param value The set of regions of interest (ROI) within a radiotherapy structure set instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate ROI numbers.       If this is absent, all ROIs within the referenced radiotherapy structure set SOP Instance are included in the selection.
834         */
835        public ImagingSelectionInstanceComponent setRoiList(String value) { 
836          if (Utilities.noString(value))
837            this.roiList = null;
838          else {
839            if (this.roiList == null)
840              this.roiList = new StringType();
841            this.roiList.setValue(value);
842          }
843          return this;
844        }
845
846        protected void listChildren(List<Property> children) {
847          super.listChildren(children);
848          children.add(new Property("uid", "oid", "The SOP Instance UID for the selected DICOM instance.", 0, 1, uid));
849          children.add(new Property("sopClass", "Coding", "The SOP Class UID for the selected DICOM instance.", 0, 1, sopClass));
850          children.add(new Property("frameList", "string", "The set of frames within a multi-frame SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate frame numbers.       If this is absent, all frames within the referenced SOP Instance are included in the selection.", 0, 1, frameList));
851          children.add(new Property("observationUid", "oid", "The unique identifier for the observation Content Item (and its subsidiary Content Items, if any) that are included in the imaging selection.", 0, java.lang.Integer.MAX_VALUE, observationUid));
852          children.add(new Property("segmentList", "string", "The set of segments within a segmentation SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate segment numbers.       If this is absent, all segments within the referenced segmentation SOP Instance are included in the selection.", 0, 1, segmentList));
853          children.add(new Property("roiList", "string", "The set of regions of interest (ROI) within a radiotherapy structure set instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate ROI numbers.       If this is absent, all ROIs within the referenced radiotherapy structure set SOP Instance are included in the selection.", 0, 1, roiList));
854        }
855
856        @Override
857        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
858          switch (_hash) {
859          case 115792: /*uid*/  return new Property("uid", "oid", "The SOP Instance UID for the selected DICOM instance.", 0, 1, uid);
860          case 1560041540: /*sopClass*/  return new Property("sopClass", "Coding", "The SOP Class UID for the selected DICOM instance.", 0, 1, sopClass);
861          case 544886699: /*frameList*/  return new Property("frameList", "string", "The set of frames within a multi-frame SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate frame numbers.       If this is absent, all frames within the referenced SOP Instance are included in the selection.", 0, 1, frameList);
862          case -1631882108: /*observationUid*/  return new Property("observationUid", "oid", "The unique identifier for the observation Content Item (and its subsidiary Content Items, if any) that are included in the imaging selection.", 0, java.lang.Integer.MAX_VALUE, observationUid);
863          case -953159055: /*segmentList*/  return new Property("segmentList", "string", "The set of segments within a segmentation SOP Instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate segment numbers.       If this is absent, all segments within the referenced segmentation SOP Instance are included in the selection.", 0, 1, segmentList);
864          case 1373378698: /*roiList*/  return new Property("roiList", "string", "The set of regions of interest (ROI) within a radiotherapy structure set instance that are included in the imaging selection.       Encoded as a comma separated list of one or more non duplicate ROI numbers.       If this is absent, all ROIs within the referenced radiotherapy structure set SOP Instance are included in the selection.", 0, 1, roiList);
865          default: return super.getNamedProperty(_hash, _name, _checkValid);
866          }
867
868        }
869
870      @Override
871      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
872        switch (hash) {
873        case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType
874        case 1560041540: /*sopClass*/ return this.sopClass == null ? new Base[0] : new Base[] {this.sopClass}; // Coding
875        case 544886699: /*frameList*/ return this.frameList == null ? new Base[0] : new Base[] {this.frameList}; // StringType
876        case -1631882108: /*observationUid*/ return this.observationUid == null ? new Base[0] : this.observationUid.toArray(new Base[this.observationUid.size()]); // OidType
877        case -953159055: /*segmentList*/ return this.segmentList == null ? new Base[0] : new Base[] {this.segmentList}; // StringType
878        case 1373378698: /*roiList*/ return this.roiList == null ? new Base[0] : new Base[] {this.roiList}; // StringType
879        default: return super.getProperty(hash, name, checkValid);
880        }
881
882      }
883
884      @Override
885      public Base setProperty(int hash, String name, Base value) throws FHIRException {
886        switch (hash) {
887        case 115792: // uid
888          this.uid = TypeConvertor.castToOid(value); // OidType
889          return value;
890        case 1560041540: // sopClass
891          this.sopClass = TypeConvertor.castToCoding(value); // Coding
892          return value;
893        case 544886699: // frameList
894          this.frameList = TypeConvertor.castToString(value); // StringType
895          return value;
896        case -1631882108: // observationUid
897          this.getObservationUid().add(TypeConvertor.castToOid(value)); // OidType
898          return value;
899        case -953159055: // segmentList
900          this.segmentList = TypeConvertor.castToString(value); // StringType
901          return value;
902        case 1373378698: // roiList
903          this.roiList = TypeConvertor.castToString(value); // StringType
904          return value;
905        default: return super.setProperty(hash, name, value);
906        }
907
908      }
909
910      @Override
911      public Base setProperty(String name, Base value) throws FHIRException {
912        if (name.equals("uid")) {
913          this.uid = TypeConvertor.castToOid(value); // OidType
914        } else if (name.equals("sopClass")) {
915          this.sopClass = TypeConvertor.castToCoding(value); // Coding
916        } else if (name.equals("frameList")) {
917          this.frameList = TypeConvertor.castToString(value); // StringType
918        } else if (name.equals("observationUid")) {
919          this.getObservationUid().add(TypeConvertor.castToOid(value));
920        } else if (name.equals("segmentList")) {
921          this.segmentList = TypeConvertor.castToString(value); // StringType
922        } else if (name.equals("roiList")) {
923          this.roiList = TypeConvertor.castToString(value); // StringType
924        } else
925          return super.setProperty(name, value);
926        return value;
927      }
928
929      @Override
930      public Base makeProperty(int hash, String name) throws FHIRException {
931        switch (hash) {
932        case 115792:  return getUidElement();
933        case 1560041540:  return getSopClass();
934        case 544886699:  return getFrameListElement();
935        case -1631882108:  return addObservationUidElement();
936        case -953159055:  return getSegmentListElement();
937        case 1373378698:  return getRoiListElement();
938        default: return super.makeProperty(hash, name);
939        }
940
941      }
942
943      @Override
944      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
945        switch (hash) {
946        case 115792: /*uid*/ return new String[] {"oid"};
947        case 1560041540: /*sopClass*/ return new String[] {"Coding"};
948        case 544886699: /*frameList*/ return new String[] {"string"};
949        case -1631882108: /*observationUid*/ return new String[] {"oid"};
950        case -953159055: /*segmentList*/ return new String[] {"string"};
951        case 1373378698: /*roiList*/ return new String[] {"string"};
952        default: return super.getTypesForProperty(hash, name);
953        }
954
955      }
956
957      @Override
958      public Base addChild(String name) throws FHIRException {
959        if (name.equals("uid")) {
960          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.instance.uid");
961        }
962        else if (name.equals("sopClass")) {
963          this.sopClass = new Coding();
964          return this.sopClass;
965        }
966        else if (name.equals("frameList")) {
967          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.instance.frameList");
968        }
969        else if (name.equals("observationUid")) {
970          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.instance.observationUid");
971        }
972        else if (name.equals("segmentList")) {
973          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.instance.segmentList");
974        }
975        else if (name.equals("roiList")) {
976          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.instance.roiList");
977        }
978        else
979          return super.addChild(name);
980      }
981
982      public ImagingSelectionInstanceComponent copy() {
983        ImagingSelectionInstanceComponent dst = new ImagingSelectionInstanceComponent();
984        copyValues(dst);
985        return dst;
986      }
987
988      public void copyValues(ImagingSelectionInstanceComponent dst) {
989        super.copyValues(dst);
990        dst.uid = uid == null ? null : uid.copy();
991        dst.sopClass = sopClass == null ? null : sopClass.copy();
992        dst.frameList = frameList == null ? null : frameList.copy();
993        if (observationUid != null) {
994          dst.observationUid = new ArrayList<OidType>();
995          for (OidType i : observationUid)
996            dst.observationUid.add(i.copy());
997        };
998        dst.segmentList = segmentList == null ? null : segmentList.copy();
999        dst.roiList = roiList == null ? null : roiList.copy();
1000      }
1001
1002      @Override
1003      public boolean equalsDeep(Base other_) {
1004        if (!super.equalsDeep(other_))
1005          return false;
1006        if (!(other_ instanceof ImagingSelectionInstanceComponent))
1007          return false;
1008        ImagingSelectionInstanceComponent o = (ImagingSelectionInstanceComponent) other_;
1009        return compareDeep(uid, o.uid, true) && compareDeep(sopClass, o.sopClass, true) && compareDeep(frameList, o.frameList, true)
1010           && compareDeep(observationUid, o.observationUid, true) && compareDeep(segmentList, o.segmentList, true)
1011           && compareDeep(roiList, o.roiList, true);
1012      }
1013
1014      @Override
1015      public boolean equalsShallow(Base other_) {
1016        if (!super.equalsShallow(other_))
1017          return false;
1018        if (!(other_ instanceof ImagingSelectionInstanceComponent))
1019          return false;
1020        ImagingSelectionInstanceComponent o = (ImagingSelectionInstanceComponent) other_;
1021        return compareValues(uid, o.uid, true) && compareValues(frameList, o.frameList, true) && compareValues(observationUid, o.observationUid, true)
1022           && compareValues(segmentList, o.segmentList, true) && compareValues(roiList, o.roiList, true);
1023      }
1024
1025      public boolean isEmpty() {
1026        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(uid, sopClass, frameList
1027          , observationUid, segmentList, roiList);
1028      }
1029
1030  public String fhirType() {
1031    return "ImagingSelection.instance";
1032
1033  }
1034
1035  }
1036
1037    @Block()
1038    public static class ImagingSelectionImageRegionComponent extends BackboneElement implements IBaseBackboneElement {
1039        /**
1040         * Specifies the type of image region.
1041         */
1042        @Child(name = "regionType", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1043        @Description(shortDefinition="POINT | MULTIPOINT | POLYLINE | POLYGON | ELLIPSE | ELLIPSOID", formalDefinition="Specifies the type of image region." )
1044        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/imagingselection-graphictype")
1045        protected Enumeration<ImagingSelectionGraphicType> regionType;
1046
1047        /**
1048         * Specifies the type of coordinate system that define the image region.
1049         */
1050        @Child(name = "coordinateType", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false)
1051        @Description(shortDefinition="2d | 3d", formalDefinition="Specifies the type of coordinate system that define the image region." )
1052        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/imagingselection-coordinatetype")
1053        protected Enumeration<ImagingSelectionCoordinateType> coordinateType;
1054
1055        /**
1056         * The coordinates describing the image region.       If coordinateType is 2D this specifies sequence of (x,y) coordinates in the coordinate system of the image specified by the instance.uid element that contains this image region.       If coordinateType is 3D this specifies sequence of (x,y,z) coordinates in the coordinate system specified by the frameOfReferenceUid element.
1057         */
1058        @Child(name = "coordinates", type = {DecimalType.class}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1059        @Description(shortDefinition="Specifies the type of coordinates that define the image region 2d | 3d", formalDefinition="The coordinates describing the image region.       If coordinateType is 2D this specifies sequence of (x,y) coordinates in the coordinate system of the image specified by the instance.uid element that contains this image region.       If coordinateType is 3D this specifies sequence of (x,y,z) coordinates in the coordinate system specified by the frameOfReferenceUid element." )
1060        protected List<DecimalType> coordinates;
1061
1062        private static final long serialVersionUID = -1266111852L;
1063
1064    /**
1065     * Constructor
1066     */
1067      public ImagingSelectionImageRegionComponent() {
1068        super();
1069      }
1070
1071    /**
1072     * Constructor
1073     */
1074      public ImagingSelectionImageRegionComponent(ImagingSelectionGraphicType regionType, ImagingSelectionCoordinateType coordinateType, BigDecimal coordinates) {
1075        super();
1076        this.setRegionType(regionType);
1077        this.setCoordinateType(coordinateType);
1078        this.addCoordinates(coordinates);
1079      }
1080
1081        /**
1082         * @return {@link #regionType} (Specifies the type of image region.). This is the underlying object with id, value and extensions. The accessor "getRegionType" gives direct access to the value
1083         */
1084        public Enumeration<ImagingSelectionGraphicType> getRegionTypeElement() { 
1085          if (this.regionType == null)
1086            if (Configuration.errorOnAutoCreate())
1087              throw new Error("Attempt to auto-create ImagingSelectionImageRegionComponent.regionType");
1088            else if (Configuration.doAutoCreate())
1089              this.regionType = new Enumeration<ImagingSelectionGraphicType>(new ImagingSelectionGraphicTypeEnumFactory()); // bb
1090          return this.regionType;
1091        }
1092
1093        public boolean hasRegionTypeElement() { 
1094          return this.regionType != null && !this.regionType.isEmpty();
1095        }
1096
1097        public boolean hasRegionType() { 
1098          return this.regionType != null && !this.regionType.isEmpty();
1099        }
1100
1101        /**
1102         * @param value {@link #regionType} (Specifies the type of image region.). This is the underlying object with id, value and extensions. The accessor "getRegionType" gives direct access to the value
1103         */
1104        public ImagingSelectionImageRegionComponent setRegionTypeElement(Enumeration<ImagingSelectionGraphicType> value) { 
1105          this.regionType = value;
1106          return this;
1107        }
1108
1109        /**
1110         * @return Specifies the type of image region.
1111         */
1112        public ImagingSelectionGraphicType getRegionType() { 
1113          return this.regionType == null ? null : this.regionType.getValue();
1114        }
1115
1116        /**
1117         * @param value Specifies the type of image region.
1118         */
1119        public ImagingSelectionImageRegionComponent setRegionType(ImagingSelectionGraphicType value) { 
1120            if (this.regionType == null)
1121              this.regionType = new Enumeration<ImagingSelectionGraphicType>(new ImagingSelectionGraphicTypeEnumFactory());
1122            this.regionType.setValue(value);
1123          return this;
1124        }
1125
1126        /**
1127         * @return {@link #coordinateType} (Specifies the type of coordinate system that define the image region.). This is the underlying object with id, value and extensions. The accessor "getCoordinateType" gives direct access to the value
1128         */
1129        public Enumeration<ImagingSelectionCoordinateType> getCoordinateTypeElement() { 
1130          if (this.coordinateType == null)
1131            if (Configuration.errorOnAutoCreate())
1132              throw new Error("Attempt to auto-create ImagingSelectionImageRegionComponent.coordinateType");
1133            else if (Configuration.doAutoCreate())
1134              this.coordinateType = new Enumeration<ImagingSelectionCoordinateType>(new ImagingSelectionCoordinateTypeEnumFactory()); // bb
1135          return this.coordinateType;
1136        }
1137
1138        public boolean hasCoordinateTypeElement() { 
1139          return this.coordinateType != null && !this.coordinateType.isEmpty();
1140        }
1141
1142        public boolean hasCoordinateType() { 
1143          return this.coordinateType != null && !this.coordinateType.isEmpty();
1144        }
1145
1146        /**
1147         * @param value {@link #coordinateType} (Specifies the type of coordinate system that define the image region.). This is the underlying object with id, value and extensions. The accessor "getCoordinateType" gives direct access to the value
1148         */
1149        public ImagingSelectionImageRegionComponent setCoordinateTypeElement(Enumeration<ImagingSelectionCoordinateType> value) { 
1150          this.coordinateType = value;
1151          return this;
1152        }
1153
1154        /**
1155         * @return Specifies the type of coordinate system that define the image region.
1156         */
1157        public ImagingSelectionCoordinateType getCoordinateType() { 
1158          return this.coordinateType == null ? null : this.coordinateType.getValue();
1159        }
1160
1161        /**
1162         * @param value Specifies the type of coordinate system that define the image region.
1163         */
1164        public ImagingSelectionImageRegionComponent setCoordinateType(ImagingSelectionCoordinateType value) { 
1165            if (this.coordinateType == null)
1166              this.coordinateType = new Enumeration<ImagingSelectionCoordinateType>(new ImagingSelectionCoordinateTypeEnumFactory());
1167            this.coordinateType.setValue(value);
1168          return this;
1169        }
1170
1171        /**
1172         * @return {@link #coordinates} (The coordinates describing the image region.       If coordinateType is 2D this specifies sequence of (x,y) coordinates in the coordinate system of the image specified by the instance.uid element that contains this image region.       If coordinateType is 3D this specifies sequence of (x,y,z) coordinates in the coordinate system specified by the frameOfReferenceUid element.)
1173         */
1174        public List<DecimalType> getCoordinates() { 
1175          if (this.coordinates == null)
1176            this.coordinates = new ArrayList<DecimalType>();
1177          return this.coordinates;
1178        }
1179
1180        /**
1181         * @return Returns a reference to <code>this</code> for easy method chaining
1182         */
1183        public ImagingSelectionImageRegionComponent setCoordinates(List<DecimalType> theCoordinates) { 
1184          this.coordinates = theCoordinates;
1185          return this;
1186        }
1187
1188        public boolean hasCoordinates() { 
1189          if (this.coordinates == null)
1190            return false;
1191          for (DecimalType item : this.coordinates)
1192            if (!item.isEmpty())
1193              return true;
1194          return false;
1195        }
1196
1197        /**
1198         * @return {@link #coordinates} (The coordinates describing the image region.       If coordinateType is 2D this specifies sequence of (x,y) coordinates in the coordinate system of the image specified by the instance.uid element that contains this image region.       If coordinateType is 3D this specifies sequence of (x,y,z) coordinates in the coordinate system specified by the frameOfReferenceUid element.)
1199         */
1200        public DecimalType addCoordinatesElement() {//2 
1201          DecimalType t = new DecimalType();
1202          if (this.coordinates == null)
1203            this.coordinates = new ArrayList<DecimalType>();
1204          this.coordinates.add(t);
1205          return t;
1206        }
1207
1208        /**
1209         * @param value {@link #coordinates} (The coordinates describing the image region.       If coordinateType is 2D this specifies sequence of (x,y) coordinates in the coordinate system of the image specified by the instance.uid element that contains this image region.       If coordinateType is 3D this specifies sequence of (x,y,z) coordinates in the coordinate system specified by the frameOfReferenceUid element.)
1210         */
1211        public ImagingSelectionImageRegionComponent addCoordinates(BigDecimal value) { //1
1212          DecimalType t = new DecimalType();
1213          t.setValue(value);
1214          if (this.coordinates == null)
1215            this.coordinates = new ArrayList<DecimalType>();
1216          this.coordinates.add(t);
1217          return this;
1218        }
1219
1220        /**
1221         * @param value {@link #coordinates} (The coordinates describing the image region.       If coordinateType is 2D this specifies sequence of (x,y) coordinates in the coordinate system of the image specified by the instance.uid element that contains this image region.       If coordinateType is 3D this specifies sequence of (x,y,z) coordinates in the coordinate system specified by the frameOfReferenceUid element.)
1222         */
1223        public boolean hasCoordinates(BigDecimal value) { 
1224          if (this.coordinates == null)
1225            return false;
1226          for (DecimalType v : this.coordinates)
1227            if (v.getValue().equals(value)) // decimal
1228              return true;
1229          return false;
1230        }
1231
1232        protected void listChildren(List<Property> children) {
1233          super.listChildren(children);
1234          children.add(new Property("regionType", "code", "Specifies the type of image region.", 0, 1, regionType));
1235          children.add(new Property("coordinateType", "code", "Specifies the type of coordinate system that define the image region.", 0, 1, coordinateType));
1236          children.add(new Property("coordinates", "decimal", "The coordinates describing the image region.       If coordinateType is 2D this specifies sequence of (x,y) coordinates in the coordinate system of the image specified by the instance.uid element that contains this image region.       If coordinateType is 3D this specifies sequence of (x,y,z) coordinates in the coordinate system specified by the frameOfReferenceUid element.", 0, java.lang.Integer.MAX_VALUE, coordinates));
1237        }
1238
1239        @Override
1240        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1241          switch (_hash) {
1242          case -1990487986: /*regionType*/  return new Property("regionType", "code", "Specifies the type of image region.", 0, 1, regionType);
1243          case 500956370: /*coordinateType*/  return new Property("coordinateType", "code", "Specifies the type of coordinate system that define the image region.", 0, 1, coordinateType);
1244          case 1871919611: /*coordinates*/  return new Property("coordinates", "decimal", "The coordinates describing the image region.       If coordinateType is 2D this specifies sequence of (x,y) coordinates in the coordinate system of the image specified by the instance.uid element that contains this image region.       If coordinateType is 3D this specifies sequence of (x,y,z) coordinates in the coordinate system specified by the frameOfReferenceUid element.", 0, java.lang.Integer.MAX_VALUE, coordinates);
1245          default: return super.getNamedProperty(_hash, _name, _checkValid);
1246          }
1247
1248        }
1249
1250      @Override
1251      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1252        switch (hash) {
1253        case -1990487986: /*regionType*/ return this.regionType == null ? new Base[0] : new Base[] {this.regionType}; // Enumeration<ImagingSelectionGraphicType>
1254        case 500956370: /*coordinateType*/ return this.coordinateType == null ? new Base[0] : new Base[] {this.coordinateType}; // Enumeration<ImagingSelectionCoordinateType>
1255        case 1871919611: /*coordinates*/ return this.coordinates == null ? new Base[0] : this.coordinates.toArray(new Base[this.coordinates.size()]); // DecimalType
1256        default: return super.getProperty(hash, name, checkValid);
1257        }
1258
1259      }
1260
1261      @Override
1262      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1263        switch (hash) {
1264        case -1990487986: // regionType
1265          value = new ImagingSelectionGraphicTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1266          this.regionType = (Enumeration) value; // Enumeration<ImagingSelectionGraphicType>
1267          return value;
1268        case 500956370: // coordinateType
1269          value = new ImagingSelectionCoordinateTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1270          this.coordinateType = (Enumeration) value; // Enumeration<ImagingSelectionCoordinateType>
1271          return value;
1272        case 1871919611: // coordinates
1273          this.getCoordinates().add(TypeConvertor.castToDecimal(value)); // DecimalType
1274          return value;
1275        default: return super.setProperty(hash, name, value);
1276        }
1277
1278      }
1279
1280      @Override
1281      public Base setProperty(String name, Base value) throws FHIRException {
1282        if (name.equals("regionType")) {
1283          value = new ImagingSelectionGraphicTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1284          this.regionType = (Enumeration) value; // Enumeration<ImagingSelectionGraphicType>
1285        } else if (name.equals("coordinateType")) {
1286          value = new ImagingSelectionCoordinateTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1287          this.coordinateType = (Enumeration) value; // Enumeration<ImagingSelectionCoordinateType>
1288        } else if (name.equals("coordinates")) {
1289          this.getCoordinates().add(TypeConvertor.castToDecimal(value));
1290        } else
1291          return super.setProperty(name, value);
1292        return value;
1293      }
1294
1295      @Override
1296      public Base makeProperty(int hash, String name) throws FHIRException {
1297        switch (hash) {
1298        case -1990487986:  return getRegionTypeElement();
1299        case 500956370:  return getCoordinateTypeElement();
1300        case 1871919611:  return addCoordinatesElement();
1301        default: return super.makeProperty(hash, name);
1302        }
1303
1304      }
1305
1306      @Override
1307      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1308        switch (hash) {
1309        case -1990487986: /*regionType*/ return new String[] {"code"};
1310        case 500956370: /*coordinateType*/ return new String[] {"code"};
1311        case 1871919611: /*coordinates*/ return new String[] {"decimal"};
1312        default: return super.getTypesForProperty(hash, name);
1313        }
1314
1315      }
1316
1317      @Override
1318      public Base addChild(String name) throws FHIRException {
1319        if (name.equals("regionType")) {
1320          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.imageRegion.regionType");
1321        }
1322        else if (name.equals("coordinateType")) {
1323          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.imageRegion.coordinateType");
1324        }
1325        else if (name.equals("coordinates")) {
1326          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.imageRegion.coordinates");
1327        }
1328        else
1329          return super.addChild(name);
1330      }
1331
1332      public ImagingSelectionImageRegionComponent copy() {
1333        ImagingSelectionImageRegionComponent dst = new ImagingSelectionImageRegionComponent();
1334        copyValues(dst);
1335        return dst;
1336      }
1337
1338      public void copyValues(ImagingSelectionImageRegionComponent dst) {
1339        super.copyValues(dst);
1340        dst.regionType = regionType == null ? null : regionType.copy();
1341        dst.coordinateType = coordinateType == null ? null : coordinateType.copy();
1342        if (coordinates != null) {
1343          dst.coordinates = new ArrayList<DecimalType>();
1344          for (DecimalType i : coordinates)
1345            dst.coordinates.add(i.copy());
1346        };
1347      }
1348
1349      @Override
1350      public boolean equalsDeep(Base other_) {
1351        if (!super.equalsDeep(other_))
1352          return false;
1353        if (!(other_ instanceof ImagingSelectionImageRegionComponent))
1354          return false;
1355        ImagingSelectionImageRegionComponent o = (ImagingSelectionImageRegionComponent) other_;
1356        return compareDeep(regionType, o.regionType, true) && compareDeep(coordinateType, o.coordinateType, true)
1357           && compareDeep(coordinates, o.coordinates, true);
1358      }
1359
1360      @Override
1361      public boolean equalsShallow(Base other_) {
1362        if (!super.equalsShallow(other_))
1363          return false;
1364        if (!(other_ instanceof ImagingSelectionImageRegionComponent))
1365          return false;
1366        ImagingSelectionImageRegionComponent o = (ImagingSelectionImageRegionComponent) other_;
1367        return compareValues(regionType, o.regionType, true) && compareValues(coordinateType, o.coordinateType, true)
1368           && compareValues(coordinates, o.coordinates, true);
1369      }
1370
1371      public boolean isEmpty() {
1372        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(regionType, coordinateType
1373          , coordinates);
1374      }
1375
1376  public String fhirType() {
1377    return "ImagingSelection.imageRegion";
1378
1379  }
1380
1381  }
1382
1383    /**
1384     * A unique identifier assigned to this imaging selection.
1385     */
1386    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1387    @Description(shortDefinition="Business Identifier for Imaging Selection", formalDefinition="A unique identifier assigned to this imaging selection." )
1388    protected List<Identifier> identifier;
1389
1390    /**
1391     * A list of the diagnostic requests that resulted in this imaging selection being performed.
1392     */
1393    @Child(name = "basedOn", type = {CarePlan.class, ServiceRequest.class, Appointment.class, AppointmentResponse.class, Task.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1394    @Description(shortDefinition="Associated request", formalDefinition="A list of the diagnostic requests that resulted in this imaging selection being performed." )
1395    protected List<Reference> basedOn;
1396
1397    /**
1398     * The patient, or group of patients, location, device, organization, procedure or practitioner this imaging selection is about and into whose or what record the imaging selection is placed.
1399     */
1400    @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class, Organization.class, Procedure.class, Practitioner.class, Medication.class, Substance.class, Specimen.class}, order=2, min=0, max=1, modifier=false, summary=true)
1401    @Description(shortDefinition="Subject of the selected instances and / or frames", formalDefinition="The patient, or group of patients, location, device, organization, procedure or practitioner this imaging selection is about and into whose or what record the imaging selection is placed." )
1402    protected Reference subject;
1403
1404    /**
1405     * The date and time this imaging selection was created.
1406     */
1407    @Child(name = "issued", type = {InstantType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1408    @Description(shortDefinition="Date / Time when the selection of instances was made", formalDefinition="The date and time this imaging selection was created." )
1409    protected InstantType issued;
1410
1411    /**
1412     * Author ? human or machine.
1413     */
1414    @Child(name = "performer", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1415    @Description(shortDefinition="Author (human or machine)", formalDefinition="Author ? human or machine." )
1416    protected List<ImagingSelectionPerformerComponent> performer;
1417
1418    /**
1419     * Describes the imaging selection.
1420     */
1421    @Child(name = "code", type = {CodeableConcept.class}, order=5, min=1, max=1, modifier=false, summary=true)
1422    @Description(shortDefinition="Imaging Selection description text or code", formalDefinition="Describes the imaging selection." )
1423    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://dicom.nema.org/medical/dicom/current/output/chtml/part16/sect_CID_7010.html")
1424    protected CodeableConcept code;
1425
1426    /**
1427     * The Study Instance UID for the DICOM Study from which the images were selected.
1428     */
1429    @Child(name = "studyUid", type = {OidType.class}, order=6, min=0, max=1, modifier=false, summary=true)
1430    @Description(shortDefinition="DICOM Study Instance UID", formalDefinition="The Study Instance UID for the DICOM Study from which the images were selected." )
1431    protected OidType studyUid;
1432
1433    /**
1434     * The imaging study from which the imaging selection is made.
1435     */
1436    @Child(name = "derivedFrom", type = {ImagingStudy.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1437    @Description(shortDefinition="The imaging study from which the imaging selection is derived", formalDefinition="The imaging study from which the imaging selection is made." )
1438    protected List<Reference> derivedFrom;
1439
1440    /**
1441     * The network service providing retrieval access to the selected images, frames, etc. See implementation notes for information about using DICOM endpoints.
1442     */
1443    @Child(name = "endpoint", type = {Endpoint.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1444    @Description(shortDefinition="The network service providing retrieval for the images referenced in the imaging selection", formalDefinition="The network service providing retrieval access to the selected images, frames, etc. See implementation notes for information about using DICOM endpoints." )
1445    protected List<Reference> endpoint;
1446
1447    /**
1448     * The Series Instance UID for the DICOM Series from which the images were selected.
1449     */
1450    @Child(name = "seriesUid", type = {OidType.class}, order=9, min=0, max=1, modifier=false, summary=true)
1451    @Description(shortDefinition="DICOM Series Instance UID", formalDefinition="The Series Instance UID for the DICOM Series from which the images were selected." )
1452    protected OidType seriesUid;
1453
1454    /**
1455     * The Frame of Reference UID identifying the coordinate system that conveys spatial and/or temporal information for the selected images or frames.
1456     */
1457    @Child(name = "frameOfReferenceUid", type = {OidType.class}, order=10, min=0, max=1, modifier=false, summary=true)
1458    @Description(shortDefinition="The Frame of Reference UID for the selected images", formalDefinition="The Frame of Reference UID identifying the coordinate system that conveys spatial and/or temporal information for the selected images or frames." )
1459    protected OidType frameOfReferenceUid;
1460
1461    /**
1462     * 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.
1463     */
1464    @Child(name = "bodySite", type = {Coding.class}, order=11, min=0, max=1, modifier=false, summary=true)
1465    @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." )
1466    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/body-site")
1467    protected Coding bodySite;
1468
1469    /**
1470     * Each imaging selection includes one or more selected DICOM SOP instances.
1471     */
1472    @Child(name = "instance", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1473    @Description(shortDefinition="The selected instances", formalDefinition="Each imaging selection includes one or more selected DICOM SOP instances." )
1474    protected List<ImagingSelectionInstanceComponent> instance;
1475
1476    /**
1477     * Each imaging selection might includes one or more image regions. Image regions are specified by a region type and a set of 2D or 3D coordinates.
1478     */
1479    @Child(name = "imageRegion", type = {}, order=13, min=0, max=1, modifier=false, summary=false)
1480    @Description(shortDefinition="A specific region in a DICOM image / frame", formalDefinition="Each imaging selection might includes one or more image regions. Image regions are specified by a region type and a set of 2D or 3D coordinates." )
1481    protected ImagingSelectionImageRegionComponent imageRegion;
1482
1483    private static final long serialVersionUID = 4408161L;
1484
1485  /**
1486   * Constructor
1487   */
1488    public ImagingSelection() {
1489      super();
1490    }
1491
1492  /**
1493   * Constructor
1494   */
1495    public ImagingSelection(CodeableConcept code) {
1496      super();
1497      this.setCode(code);
1498    }
1499
1500    /**
1501     * @return {@link #identifier} (A unique identifier assigned to this imaging selection.)
1502     */
1503    public List<Identifier> getIdentifier() { 
1504      if (this.identifier == null)
1505        this.identifier = new ArrayList<Identifier>();
1506      return this.identifier;
1507    }
1508
1509    /**
1510     * @return Returns a reference to <code>this</code> for easy method chaining
1511     */
1512    public ImagingSelection setIdentifier(List<Identifier> theIdentifier) { 
1513      this.identifier = theIdentifier;
1514      return this;
1515    }
1516
1517    public boolean hasIdentifier() { 
1518      if (this.identifier == null)
1519        return false;
1520      for (Identifier item : this.identifier)
1521        if (!item.isEmpty())
1522          return true;
1523      return false;
1524    }
1525
1526    public Identifier addIdentifier() { //3
1527      Identifier t = new Identifier();
1528      if (this.identifier == null)
1529        this.identifier = new ArrayList<Identifier>();
1530      this.identifier.add(t);
1531      return t;
1532    }
1533
1534    public ImagingSelection addIdentifier(Identifier t) { //3
1535      if (t == null)
1536        return this;
1537      if (this.identifier == null)
1538        this.identifier = new ArrayList<Identifier>();
1539      this.identifier.add(t);
1540      return this;
1541    }
1542
1543    /**
1544     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1545     */
1546    public Identifier getIdentifierFirstRep() { 
1547      if (getIdentifier().isEmpty()) {
1548        addIdentifier();
1549      }
1550      return getIdentifier().get(0);
1551    }
1552
1553    /**
1554     * @return {@link #basedOn} (A list of the diagnostic requests that resulted in this imaging selection being performed.)
1555     */
1556    public List<Reference> getBasedOn() { 
1557      if (this.basedOn == null)
1558        this.basedOn = new ArrayList<Reference>();
1559      return this.basedOn;
1560    }
1561
1562    /**
1563     * @return Returns a reference to <code>this</code> for easy method chaining
1564     */
1565    public ImagingSelection setBasedOn(List<Reference> theBasedOn) { 
1566      this.basedOn = theBasedOn;
1567      return this;
1568    }
1569
1570    public boolean hasBasedOn() { 
1571      if (this.basedOn == null)
1572        return false;
1573      for (Reference item : this.basedOn)
1574        if (!item.isEmpty())
1575          return true;
1576      return false;
1577    }
1578
1579    public Reference addBasedOn() { //3
1580      Reference t = new Reference();
1581      if (this.basedOn == null)
1582        this.basedOn = new ArrayList<Reference>();
1583      this.basedOn.add(t);
1584      return t;
1585    }
1586
1587    public ImagingSelection addBasedOn(Reference t) { //3
1588      if (t == null)
1589        return this;
1590      if (this.basedOn == null)
1591        this.basedOn = new ArrayList<Reference>();
1592      this.basedOn.add(t);
1593      return this;
1594    }
1595
1596    /**
1597     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
1598     */
1599    public Reference getBasedOnFirstRep() { 
1600      if (getBasedOn().isEmpty()) {
1601        addBasedOn();
1602      }
1603      return getBasedOn().get(0);
1604    }
1605
1606    /**
1607     * @return {@link #subject} (The patient, or group of patients, location, device, organization, procedure or practitioner this imaging selection is about and into whose or what record the imaging selection is placed.)
1608     */
1609    public Reference getSubject() { 
1610      if (this.subject == null)
1611        if (Configuration.errorOnAutoCreate())
1612          throw new Error("Attempt to auto-create ImagingSelection.subject");
1613        else if (Configuration.doAutoCreate())
1614          this.subject = new Reference(); // cc
1615      return this.subject;
1616    }
1617
1618    public boolean hasSubject() { 
1619      return this.subject != null && !this.subject.isEmpty();
1620    }
1621
1622    /**
1623     * @param value {@link #subject} (The patient, or group of patients, location, device, organization, procedure or practitioner this imaging selection is about and into whose or what record the imaging selection is placed.)
1624     */
1625    public ImagingSelection setSubject(Reference value) { 
1626      this.subject = value;
1627      return this;
1628    }
1629
1630    /**
1631     * @return {@link #issued} (The date and time this imaging selection was created.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
1632     */
1633    public InstantType getIssuedElement() { 
1634      if (this.issued == null)
1635        if (Configuration.errorOnAutoCreate())
1636          throw new Error("Attempt to auto-create ImagingSelection.issued");
1637        else if (Configuration.doAutoCreate())
1638          this.issued = new InstantType(); // bb
1639      return this.issued;
1640    }
1641
1642    public boolean hasIssuedElement() { 
1643      return this.issued != null && !this.issued.isEmpty();
1644    }
1645
1646    public boolean hasIssued() { 
1647      return this.issued != null && !this.issued.isEmpty();
1648    }
1649
1650    /**
1651     * @param value {@link #issued} (The date and time this imaging selection was created.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
1652     */
1653    public ImagingSelection setIssuedElement(InstantType value) { 
1654      this.issued = value;
1655      return this;
1656    }
1657
1658    /**
1659     * @return The date and time this imaging selection was created.
1660     */
1661    public Date getIssued() { 
1662      return this.issued == null ? null : this.issued.getValue();
1663    }
1664
1665    /**
1666     * @param value The date and time this imaging selection was created.
1667     */
1668    public ImagingSelection setIssued(Date value) { 
1669      if (value == null)
1670        this.issued = null;
1671      else {
1672        if (this.issued == null)
1673          this.issued = new InstantType();
1674        this.issued.setValue(value);
1675      }
1676      return this;
1677    }
1678
1679    /**
1680     * @return {@link #performer} (Author ? human or machine.)
1681     */
1682    public List<ImagingSelectionPerformerComponent> getPerformer() { 
1683      if (this.performer == null)
1684        this.performer = new ArrayList<ImagingSelectionPerformerComponent>();
1685      return this.performer;
1686    }
1687
1688    /**
1689     * @return Returns a reference to <code>this</code> for easy method chaining
1690     */
1691    public ImagingSelection setPerformer(List<ImagingSelectionPerformerComponent> thePerformer) { 
1692      this.performer = thePerformer;
1693      return this;
1694    }
1695
1696    public boolean hasPerformer() { 
1697      if (this.performer == null)
1698        return false;
1699      for (ImagingSelectionPerformerComponent item : this.performer)
1700        if (!item.isEmpty())
1701          return true;
1702      return false;
1703    }
1704
1705    public ImagingSelectionPerformerComponent addPerformer() { //3
1706      ImagingSelectionPerformerComponent t = new ImagingSelectionPerformerComponent();
1707      if (this.performer == null)
1708        this.performer = new ArrayList<ImagingSelectionPerformerComponent>();
1709      this.performer.add(t);
1710      return t;
1711    }
1712
1713    public ImagingSelection addPerformer(ImagingSelectionPerformerComponent t) { //3
1714      if (t == null)
1715        return this;
1716      if (this.performer == null)
1717        this.performer = new ArrayList<ImagingSelectionPerformerComponent>();
1718      this.performer.add(t);
1719      return this;
1720    }
1721
1722    /**
1723     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist {3}
1724     */
1725    public ImagingSelectionPerformerComponent getPerformerFirstRep() { 
1726      if (getPerformer().isEmpty()) {
1727        addPerformer();
1728      }
1729      return getPerformer().get(0);
1730    }
1731
1732    /**
1733     * @return {@link #code} (Describes the imaging selection.)
1734     */
1735    public CodeableConcept getCode() { 
1736      if (this.code == null)
1737        if (Configuration.errorOnAutoCreate())
1738          throw new Error("Attempt to auto-create ImagingSelection.code");
1739        else if (Configuration.doAutoCreate())
1740          this.code = new CodeableConcept(); // cc
1741      return this.code;
1742    }
1743
1744    public boolean hasCode() { 
1745      return this.code != null && !this.code.isEmpty();
1746    }
1747
1748    /**
1749     * @param value {@link #code} (Describes the imaging selection.)
1750     */
1751    public ImagingSelection setCode(CodeableConcept value) { 
1752      this.code = value;
1753      return this;
1754    }
1755
1756    /**
1757     * @return {@link #studyUid} (The Study Instance UID for the DICOM Study from which the images were selected.). This is the underlying object with id, value and extensions. The accessor "getStudyUid" gives direct access to the value
1758     */
1759    public OidType getStudyUidElement() { 
1760      if (this.studyUid == null)
1761        if (Configuration.errorOnAutoCreate())
1762          throw new Error("Attempt to auto-create ImagingSelection.studyUid");
1763        else if (Configuration.doAutoCreate())
1764          this.studyUid = new OidType(); // bb
1765      return this.studyUid;
1766    }
1767
1768    public boolean hasStudyUidElement() { 
1769      return this.studyUid != null && !this.studyUid.isEmpty();
1770    }
1771
1772    public boolean hasStudyUid() { 
1773      return this.studyUid != null && !this.studyUid.isEmpty();
1774    }
1775
1776    /**
1777     * @param value {@link #studyUid} (The Study Instance UID for the DICOM Study from which the images were selected.). This is the underlying object with id, value and extensions. The accessor "getStudyUid" gives direct access to the value
1778     */
1779    public ImagingSelection setStudyUidElement(OidType value) { 
1780      this.studyUid = value;
1781      return this;
1782    }
1783
1784    /**
1785     * @return The Study Instance UID for the DICOM Study from which the images were selected.
1786     */
1787    public String getStudyUid() { 
1788      return this.studyUid == null ? null : this.studyUid.getValue();
1789    }
1790
1791    /**
1792     * @param value The Study Instance UID for the DICOM Study from which the images were selected.
1793     */
1794    public ImagingSelection setStudyUid(String value) { 
1795      if (Utilities.noString(value))
1796        this.studyUid = null;
1797      else {
1798        if (this.studyUid == null)
1799          this.studyUid = new OidType();
1800        this.studyUid.setValue(value);
1801      }
1802      return this;
1803    }
1804
1805    /**
1806     * @return {@link #derivedFrom} (The imaging study from which the imaging selection is made.)
1807     */
1808    public List<Reference> getDerivedFrom() { 
1809      if (this.derivedFrom == null)
1810        this.derivedFrom = new ArrayList<Reference>();
1811      return this.derivedFrom;
1812    }
1813
1814    /**
1815     * @return Returns a reference to <code>this</code> for easy method chaining
1816     */
1817    public ImagingSelection setDerivedFrom(List<Reference> theDerivedFrom) { 
1818      this.derivedFrom = theDerivedFrom;
1819      return this;
1820    }
1821
1822    public boolean hasDerivedFrom() { 
1823      if (this.derivedFrom == null)
1824        return false;
1825      for (Reference item : this.derivedFrom)
1826        if (!item.isEmpty())
1827          return true;
1828      return false;
1829    }
1830
1831    public Reference addDerivedFrom() { //3
1832      Reference t = new Reference();
1833      if (this.derivedFrom == null)
1834        this.derivedFrom = new ArrayList<Reference>();
1835      this.derivedFrom.add(t);
1836      return t;
1837    }
1838
1839    public ImagingSelection addDerivedFrom(Reference t) { //3
1840      if (t == null)
1841        return this;
1842      if (this.derivedFrom == null)
1843        this.derivedFrom = new ArrayList<Reference>();
1844      this.derivedFrom.add(t);
1845      return this;
1846    }
1847
1848    /**
1849     * @return The first repetition of repeating field {@link #derivedFrom}, creating it if it does not already exist {3}
1850     */
1851    public Reference getDerivedFromFirstRep() { 
1852      if (getDerivedFrom().isEmpty()) {
1853        addDerivedFrom();
1854      }
1855      return getDerivedFrom().get(0);
1856    }
1857
1858    /**
1859     * @return {@link #endpoint} (The network service providing retrieval access to the selected images, frames, etc. See implementation notes for information about using DICOM endpoints.)
1860     */
1861    public List<Reference> getEndpoint() { 
1862      if (this.endpoint == null)
1863        this.endpoint = new ArrayList<Reference>();
1864      return this.endpoint;
1865    }
1866
1867    /**
1868     * @return Returns a reference to <code>this</code> for easy method chaining
1869     */
1870    public ImagingSelection setEndpoint(List<Reference> theEndpoint) { 
1871      this.endpoint = theEndpoint;
1872      return this;
1873    }
1874
1875    public boolean hasEndpoint() { 
1876      if (this.endpoint == null)
1877        return false;
1878      for (Reference item : this.endpoint)
1879        if (!item.isEmpty())
1880          return true;
1881      return false;
1882    }
1883
1884    public Reference addEndpoint() { //3
1885      Reference t = new Reference();
1886      if (this.endpoint == null)
1887        this.endpoint = new ArrayList<Reference>();
1888      this.endpoint.add(t);
1889      return t;
1890    }
1891
1892    public ImagingSelection addEndpoint(Reference t) { //3
1893      if (t == null)
1894        return this;
1895      if (this.endpoint == null)
1896        this.endpoint = new ArrayList<Reference>();
1897      this.endpoint.add(t);
1898      return this;
1899    }
1900
1901    /**
1902     * @return The first repetition of repeating field {@link #endpoint}, creating it if it does not already exist {3}
1903     */
1904    public Reference getEndpointFirstRep() { 
1905      if (getEndpoint().isEmpty()) {
1906        addEndpoint();
1907      }
1908      return getEndpoint().get(0);
1909    }
1910
1911    /**
1912     * @return {@link #seriesUid} (The Series Instance UID for the DICOM Series from which the images were selected.). This is the underlying object with id, value and extensions. The accessor "getSeriesUid" gives direct access to the value
1913     */
1914    public OidType getSeriesUidElement() { 
1915      if (this.seriesUid == null)
1916        if (Configuration.errorOnAutoCreate())
1917          throw new Error("Attempt to auto-create ImagingSelection.seriesUid");
1918        else if (Configuration.doAutoCreate())
1919          this.seriesUid = new OidType(); // bb
1920      return this.seriesUid;
1921    }
1922
1923    public boolean hasSeriesUidElement() { 
1924      return this.seriesUid != null && !this.seriesUid.isEmpty();
1925    }
1926
1927    public boolean hasSeriesUid() { 
1928      return this.seriesUid != null && !this.seriesUid.isEmpty();
1929    }
1930
1931    /**
1932     * @param value {@link #seriesUid} (The Series Instance UID for the DICOM Series from which the images were selected.). This is the underlying object with id, value and extensions. The accessor "getSeriesUid" gives direct access to the value
1933     */
1934    public ImagingSelection setSeriesUidElement(OidType value) { 
1935      this.seriesUid = value;
1936      return this;
1937    }
1938
1939    /**
1940     * @return The Series Instance UID for the DICOM Series from which the images were selected.
1941     */
1942    public String getSeriesUid() { 
1943      return this.seriesUid == null ? null : this.seriesUid.getValue();
1944    }
1945
1946    /**
1947     * @param value The Series Instance UID for the DICOM Series from which the images were selected.
1948     */
1949    public ImagingSelection setSeriesUid(String value) { 
1950      if (Utilities.noString(value))
1951        this.seriesUid = null;
1952      else {
1953        if (this.seriesUid == null)
1954          this.seriesUid = new OidType();
1955        this.seriesUid.setValue(value);
1956      }
1957      return this;
1958    }
1959
1960    /**
1961     * @return {@link #frameOfReferenceUid} (The Frame of Reference UID identifying the coordinate system that conveys spatial and/or temporal information for the selected images or frames.). This is the underlying object with id, value and extensions. The accessor "getFrameOfReferenceUid" gives direct access to the value
1962     */
1963    public OidType getFrameOfReferenceUidElement() { 
1964      if (this.frameOfReferenceUid == null)
1965        if (Configuration.errorOnAutoCreate())
1966          throw new Error("Attempt to auto-create ImagingSelection.frameOfReferenceUid");
1967        else if (Configuration.doAutoCreate())
1968          this.frameOfReferenceUid = new OidType(); // bb
1969      return this.frameOfReferenceUid;
1970    }
1971
1972    public boolean hasFrameOfReferenceUidElement() { 
1973      return this.frameOfReferenceUid != null && !this.frameOfReferenceUid.isEmpty();
1974    }
1975
1976    public boolean hasFrameOfReferenceUid() { 
1977      return this.frameOfReferenceUid != null && !this.frameOfReferenceUid.isEmpty();
1978    }
1979
1980    /**
1981     * @param value {@link #frameOfReferenceUid} (The Frame of Reference UID identifying the coordinate system that conveys spatial and/or temporal information for the selected images or frames.). This is the underlying object with id, value and extensions. The accessor "getFrameOfReferenceUid" gives direct access to the value
1982     */
1983    public ImagingSelection setFrameOfReferenceUidElement(OidType value) { 
1984      this.frameOfReferenceUid = value;
1985      return this;
1986    }
1987
1988    /**
1989     * @return The Frame of Reference UID identifying the coordinate system that conveys spatial and/or temporal information for the selected images or frames.
1990     */
1991    public String getFrameOfReferenceUid() { 
1992      return this.frameOfReferenceUid == null ? null : this.frameOfReferenceUid.getValue();
1993    }
1994
1995    /**
1996     * @param value The Frame of Reference UID identifying the coordinate system that conveys spatial and/or temporal information for the selected images or frames.
1997     */
1998    public ImagingSelection setFrameOfReferenceUid(String value) { 
1999      if (Utilities.noString(value))
2000        this.frameOfReferenceUid = null;
2001      else {
2002        if (this.frameOfReferenceUid == null)
2003          this.frameOfReferenceUid = new OidType();
2004        this.frameOfReferenceUid.setValue(value);
2005      }
2006      return this;
2007    }
2008
2009    /**
2010     * @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.)
2011     */
2012    public Coding getBodySite() { 
2013      if (this.bodySite == null)
2014        if (Configuration.errorOnAutoCreate())
2015          throw new Error("Attempt to auto-create ImagingSelection.bodySite");
2016        else if (Configuration.doAutoCreate())
2017          this.bodySite = new Coding(); // cc
2018      return this.bodySite;
2019    }
2020
2021    public boolean hasBodySite() { 
2022      return this.bodySite != null && !this.bodySite.isEmpty();
2023    }
2024
2025    /**
2026     * @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.)
2027     */
2028    public ImagingSelection setBodySite(Coding value) { 
2029      this.bodySite = value;
2030      return this;
2031    }
2032
2033    /**
2034     * @return {@link #instance} (Each imaging selection includes one or more selected DICOM SOP instances.)
2035     */
2036    public List<ImagingSelectionInstanceComponent> getInstance() { 
2037      if (this.instance == null)
2038        this.instance = new ArrayList<ImagingSelectionInstanceComponent>();
2039      return this.instance;
2040    }
2041
2042    /**
2043     * @return Returns a reference to <code>this</code> for easy method chaining
2044     */
2045    public ImagingSelection setInstance(List<ImagingSelectionInstanceComponent> theInstance) { 
2046      this.instance = theInstance;
2047      return this;
2048    }
2049
2050    public boolean hasInstance() { 
2051      if (this.instance == null)
2052        return false;
2053      for (ImagingSelectionInstanceComponent item : this.instance)
2054        if (!item.isEmpty())
2055          return true;
2056      return false;
2057    }
2058
2059    public ImagingSelectionInstanceComponent addInstance() { //3
2060      ImagingSelectionInstanceComponent t = new ImagingSelectionInstanceComponent();
2061      if (this.instance == null)
2062        this.instance = new ArrayList<ImagingSelectionInstanceComponent>();
2063      this.instance.add(t);
2064      return t;
2065    }
2066
2067    public ImagingSelection addInstance(ImagingSelectionInstanceComponent t) { //3
2068      if (t == null)
2069        return this;
2070      if (this.instance == null)
2071        this.instance = new ArrayList<ImagingSelectionInstanceComponent>();
2072      this.instance.add(t);
2073      return this;
2074    }
2075
2076    /**
2077     * @return The first repetition of repeating field {@link #instance}, creating it if it does not already exist {3}
2078     */
2079    public ImagingSelectionInstanceComponent getInstanceFirstRep() { 
2080      if (getInstance().isEmpty()) {
2081        addInstance();
2082      }
2083      return getInstance().get(0);
2084    }
2085
2086    /**
2087     * @return {@link #imageRegion} (Each imaging selection might includes one or more image regions. Image regions are specified by a region type and a set of 2D or 3D coordinates.)
2088     */
2089    public ImagingSelectionImageRegionComponent getImageRegion() { 
2090      if (this.imageRegion == null)
2091        if (Configuration.errorOnAutoCreate())
2092          throw new Error("Attempt to auto-create ImagingSelection.imageRegion");
2093        else if (Configuration.doAutoCreate())
2094          this.imageRegion = new ImagingSelectionImageRegionComponent(); // cc
2095      return this.imageRegion;
2096    }
2097
2098    public boolean hasImageRegion() { 
2099      return this.imageRegion != null && !this.imageRegion.isEmpty();
2100    }
2101
2102    /**
2103     * @param value {@link #imageRegion} (Each imaging selection might includes one or more image regions. Image regions are specified by a region type and a set of 2D or 3D coordinates.)
2104     */
2105    public ImagingSelection setImageRegion(ImagingSelectionImageRegionComponent value) { 
2106      this.imageRegion = value;
2107      return this;
2108    }
2109
2110      protected void listChildren(List<Property> children) {
2111        super.listChildren(children);
2112        children.add(new Property("identifier", "Identifier", "A unique identifier assigned to this imaging selection.", 0, java.lang.Integer.MAX_VALUE, identifier));
2113        children.add(new Property("basedOn", "Reference(CarePlan|ServiceRequest|Appointment|AppointmentResponse|Task)", "A list of the diagnostic requests that resulted in this imaging selection being performed.", 0, java.lang.Integer.MAX_VALUE, basedOn));
2114        children.add(new Property("subject", "Reference(Patient|Group|Device|Location|Organization|Procedure|Practitioner|Medication|Substance|Specimen)", "The patient, or group of patients, location, device, organization, procedure or practitioner this imaging selection is about and into whose or what record the imaging selection is placed.", 0, 1, subject));
2115        children.add(new Property("issued", "instant", "The date and time this imaging selection was created.", 0, 1, issued));
2116        children.add(new Property("performer", "", "Author ? human or machine.", 0, java.lang.Integer.MAX_VALUE, performer));
2117        children.add(new Property("code", "CodeableConcept", "Describes the imaging selection.", 0, 1, code));
2118        children.add(new Property("studyUid", "oid", "The Study Instance UID for the DICOM Study from which the images were selected.", 0, 1, studyUid));
2119        children.add(new Property("derivedFrom", "Reference(ImagingStudy)", "The imaging study from which the imaging selection is made.", 0, java.lang.Integer.MAX_VALUE, derivedFrom));
2120        children.add(new Property("endpoint", "Reference(Endpoint)", "The network service providing retrieval access to the selected images, frames, etc. See implementation notes for information about using DICOM endpoints.", 0, java.lang.Integer.MAX_VALUE, endpoint));
2121        children.add(new Property("seriesUid", "oid", "The Series Instance UID for the DICOM Series from which the images were selected.", 0, 1, seriesUid));
2122        children.add(new Property("frameOfReferenceUid", "oid", "The Frame of Reference UID identifying the coordinate system that conveys spatial and/or temporal information for the selected images or frames.", 0, 1, frameOfReferenceUid));
2123        children.add(new Property("bodySite", "Coding", "The anatomic structures examined. See DICOM Part 16 Annex L (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html) for DICOM to SNOMED-CT mappings.", 0, 1, bodySite));
2124        children.add(new Property("instance", "", "Each imaging selection includes one or more selected DICOM SOP instances.", 0, java.lang.Integer.MAX_VALUE, instance));
2125        children.add(new Property("imageRegion", "", "Each imaging selection might includes one or more image regions. Image regions are specified by a region type and a set of 2D or 3D coordinates.", 0, 1, imageRegion));
2126      }
2127
2128      @Override
2129      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2130        switch (_hash) {
2131        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier assigned to this imaging selection.", 0, java.lang.Integer.MAX_VALUE, identifier);
2132        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(CarePlan|ServiceRequest|Appointment|AppointmentResponse|Task)", "A list of the diagnostic requests that resulted in this imaging selection being performed.", 0, java.lang.Integer.MAX_VALUE, basedOn);
2133        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group|Device|Location|Organization|Procedure|Practitioner|Medication|Substance|Specimen)", "The patient, or group of patients, location, device, organization, procedure or practitioner this imaging selection is about and into whose or what record the imaging selection is placed.", 0, 1, subject);
2134        case -1179159893: /*issued*/  return new Property("issued", "instant", "The date and time this imaging selection was created.", 0, 1, issued);
2135        case 481140686: /*performer*/  return new Property("performer", "", "Author ? human or machine.", 0, java.lang.Integer.MAX_VALUE, performer);
2136        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Describes the imaging selection.", 0, 1, code);
2137        case 1876590023: /*studyUid*/  return new Property("studyUid", "oid", "The Study Instance UID for the DICOM Study from which the images were selected.", 0, 1, studyUid);
2138        case 1077922663: /*derivedFrom*/  return new Property("derivedFrom", "Reference(ImagingStudy)", "The imaging study from which the imaging selection is made.", 0, java.lang.Integer.MAX_VALUE, derivedFrom);
2139        case 1741102485: /*endpoint*/  return new Property("endpoint", "Reference(Endpoint)", "The network service providing retrieval access to the selected images, frames, etc. See implementation notes for information about using DICOM endpoints.", 0, java.lang.Integer.MAX_VALUE, endpoint);
2140        case -569596327: /*seriesUid*/  return new Property("seriesUid", "oid", "The Series Instance UID for the DICOM Series from which the images were selected.", 0, 1, seriesUid);
2141        case 828378953: /*frameOfReferenceUid*/  return new Property("frameOfReferenceUid", "oid", "The Frame of Reference UID identifying the coordinate system that conveys spatial and/or temporal information for the selected images or frames.", 0, 1, frameOfReferenceUid);
2142        case 1702620169: /*bodySite*/  return new Property("bodySite", "Coding", "The anatomic structures examined. See DICOM Part 16 Annex L (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html) for DICOM to SNOMED-CT mappings.", 0, 1, bodySite);
2143        case 555127957: /*instance*/  return new Property("instance", "", "Each imaging selection includes one or more selected DICOM SOP instances.", 0, java.lang.Integer.MAX_VALUE, instance);
2144        case 2132544559: /*imageRegion*/  return new Property("imageRegion", "", "Each imaging selection might includes one or more image regions. Image regions are specified by a region type and a set of 2D or 3D coordinates.", 0, 1, imageRegion);
2145        default: return super.getNamedProperty(_hash, _name, _checkValid);
2146        }
2147
2148      }
2149
2150      @Override
2151      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2152        switch (hash) {
2153        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2154        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2155        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2156        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // InstantType
2157        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // ImagingSelectionPerformerComponent
2158        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
2159        case 1876590023: /*studyUid*/ return this.studyUid == null ? new Base[0] : new Base[] {this.studyUid}; // OidType
2160        case 1077922663: /*derivedFrom*/ return this.derivedFrom == null ? new Base[0] : this.derivedFrom.toArray(new Base[this.derivedFrom.size()]); // Reference
2161        case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // Reference
2162        case -569596327: /*seriesUid*/ return this.seriesUid == null ? new Base[0] : new Base[] {this.seriesUid}; // OidType
2163        case 828378953: /*frameOfReferenceUid*/ return this.frameOfReferenceUid == null ? new Base[0] : new Base[] {this.frameOfReferenceUid}; // OidType
2164        case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Coding
2165        case 555127957: /*instance*/ return this.instance == null ? new Base[0] : this.instance.toArray(new Base[this.instance.size()]); // ImagingSelectionInstanceComponent
2166        case 2132544559: /*imageRegion*/ return this.imageRegion == null ? new Base[0] : new Base[] {this.imageRegion}; // ImagingSelectionImageRegionComponent
2167        default: return super.getProperty(hash, name, checkValid);
2168        }
2169
2170      }
2171
2172      @Override
2173      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2174        switch (hash) {
2175        case -1618432855: // identifier
2176          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2177          return value;
2178        case -332612366: // basedOn
2179          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
2180          return value;
2181        case -1867885268: // subject
2182          this.subject = TypeConvertor.castToReference(value); // Reference
2183          return value;
2184        case -1179159893: // issued
2185          this.issued = TypeConvertor.castToInstant(value); // InstantType
2186          return value;
2187        case 481140686: // performer
2188          this.getPerformer().add((ImagingSelectionPerformerComponent) value); // ImagingSelectionPerformerComponent
2189          return value;
2190        case 3059181: // code
2191          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2192          return value;
2193        case 1876590023: // studyUid
2194          this.studyUid = TypeConvertor.castToOid(value); // OidType
2195          return value;
2196        case 1077922663: // derivedFrom
2197          this.getDerivedFrom().add(TypeConvertor.castToReference(value)); // Reference
2198          return value;
2199        case 1741102485: // endpoint
2200          this.getEndpoint().add(TypeConvertor.castToReference(value)); // Reference
2201          return value;
2202        case -569596327: // seriesUid
2203          this.seriesUid = TypeConvertor.castToOid(value); // OidType
2204          return value;
2205        case 828378953: // frameOfReferenceUid
2206          this.frameOfReferenceUid = TypeConvertor.castToOid(value); // OidType
2207          return value;
2208        case 1702620169: // bodySite
2209          this.bodySite = TypeConvertor.castToCoding(value); // Coding
2210          return value;
2211        case 555127957: // instance
2212          this.getInstance().add((ImagingSelectionInstanceComponent) value); // ImagingSelectionInstanceComponent
2213          return value;
2214        case 2132544559: // imageRegion
2215          this.imageRegion = (ImagingSelectionImageRegionComponent) value; // ImagingSelectionImageRegionComponent
2216          return value;
2217        default: return super.setProperty(hash, name, value);
2218        }
2219
2220      }
2221
2222      @Override
2223      public Base setProperty(String name, Base value) throws FHIRException {
2224        if (name.equals("identifier")) {
2225          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2226        } else if (name.equals("basedOn")) {
2227          this.getBasedOn().add(TypeConvertor.castToReference(value));
2228        } else if (name.equals("subject")) {
2229          this.subject = TypeConvertor.castToReference(value); // Reference
2230        } else if (name.equals("issued")) {
2231          this.issued = TypeConvertor.castToInstant(value); // InstantType
2232        } else if (name.equals("performer")) {
2233          this.getPerformer().add((ImagingSelectionPerformerComponent) value);
2234        } else if (name.equals("code")) {
2235          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2236        } else if (name.equals("studyUid")) {
2237          this.studyUid = TypeConvertor.castToOid(value); // OidType
2238        } else if (name.equals("derivedFrom")) {
2239          this.getDerivedFrom().add(TypeConvertor.castToReference(value));
2240        } else if (name.equals("endpoint")) {
2241          this.getEndpoint().add(TypeConvertor.castToReference(value));
2242        } else if (name.equals("seriesUid")) {
2243          this.seriesUid = TypeConvertor.castToOid(value); // OidType
2244        } else if (name.equals("frameOfReferenceUid")) {
2245          this.frameOfReferenceUid = TypeConvertor.castToOid(value); // OidType
2246        } else if (name.equals("bodySite")) {
2247          this.bodySite = TypeConvertor.castToCoding(value); // Coding
2248        } else if (name.equals("instance")) {
2249          this.getInstance().add((ImagingSelectionInstanceComponent) value);
2250        } else if (name.equals("imageRegion")) {
2251          this.imageRegion = (ImagingSelectionImageRegionComponent) value; // ImagingSelectionImageRegionComponent
2252        } else
2253          return super.setProperty(name, value);
2254        return value;
2255      }
2256
2257      @Override
2258      public Base makeProperty(int hash, String name) throws FHIRException {
2259        switch (hash) {
2260        case -1618432855:  return addIdentifier(); 
2261        case -332612366:  return addBasedOn(); 
2262        case -1867885268:  return getSubject();
2263        case -1179159893:  return getIssuedElement();
2264        case 481140686:  return addPerformer(); 
2265        case 3059181:  return getCode();
2266        case 1876590023:  return getStudyUidElement();
2267        case 1077922663:  return addDerivedFrom(); 
2268        case 1741102485:  return addEndpoint(); 
2269        case -569596327:  return getSeriesUidElement();
2270        case 828378953:  return getFrameOfReferenceUidElement();
2271        case 1702620169:  return getBodySite();
2272        case 555127957:  return addInstance(); 
2273        case 2132544559:  return getImageRegion();
2274        default: return super.makeProperty(hash, name);
2275        }
2276
2277      }
2278
2279      @Override
2280      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2281        switch (hash) {
2282        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2283        case -332612366: /*basedOn*/ return new String[] {"Reference"};
2284        case -1867885268: /*subject*/ return new String[] {"Reference"};
2285        case -1179159893: /*issued*/ return new String[] {"instant"};
2286        case 481140686: /*performer*/ return new String[] {};
2287        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2288        case 1876590023: /*studyUid*/ return new String[] {"oid"};
2289        case 1077922663: /*derivedFrom*/ return new String[] {"Reference"};
2290        case 1741102485: /*endpoint*/ return new String[] {"Reference"};
2291        case -569596327: /*seriesUid*/ return new String[] {"oid"};
2292        case 828378953: /*frameOfReferenceUid*/ return new String[] {"oid"};
2293        case 1702620169: /*bodySite*/ return new String[] {"Coding"};
2294        case 555127957: /*instance*/ return new String[] {};
2295        case 2132544559: /*imageRegion*/ return new String[] {};
2296        default: return super.getTypesForProperty(hash, name);
2297        }
2298
2299      }
2300
2301      @Override
2302      public Base addChild(String name) throws FHIRException {
2303        if (name.equals("identifier")) {
2304          return addIdentifier();
2305        }
2306        else if (name.equals("basedOn")) {
2307          return addBasedOn();
2308        }
2309        else if (name.equals("subject")) {
2310          this.subject = new Reference();
2311          return this.subject;
2312        }
2313        else if (name.equals("issued")) {
2314          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.issued");
2315        }
2316        else if (name.equals("performer")) {
2317          return addPerformer();
2318        }
2319        else if (name.equals("code")) {
2320          this.code = new CodeableConcept();
2321          return this.code;
2322        }
2323        else if (name.equals("studyUid")) {
2324          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.studyUid");
2325        }
2326        else if (name.equals("derivedFrom")) {
2327          return addDerivedFrom();
2328        }
2329        else if (name.equals("endpoint")) {
2330          return addEndpoint();
2331        }
2332        else if (name.equals("seriesUid")) {
2333          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.seriesUid");
2334        }
2335        else if (name.equals("frameOfReferenceUid")) {
2336          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.frameOfReferenceUid");
2337        }
2338        else if (name.equals("bodySite")) {
2339          this.bodySite = new Coding();
2340          return this.bodySite;
2341        }
2342        else if (name.equals("instance")) {
2343          return addInstance();
2344        }
2345        else if (name.equals("imageRegion")) {
2346          this.imageRegion = new ImagingSelectionImageRegionComponent();
2347          return this.imageRegion;
2348        }
2349        else
2350          return super.addChild(name);
2351      }
2352
2353  public String fhirType() {
2354    return "ImagingSelection";
2355
2356  }
2357
2358      public ImagingSelection copy() {
2359        ImagingSelection dst = new ImagingSelection();
2360        copyValues(dst);
2361        return dst;
2362      }
2363
2364      public void copyValues(ImagingSelection dst) {
2365        super.copyValues(dst);
2366        if (identifier != null) {
2367          dst.identifier = new ArrayList<Identifier>();
2368          for (Identifier i : identifier)
2369            dst.identifier.add(i.copy());
2370        };
2371        if (basedOn != null) {
2372          dst.basedOn = new ArrayList<Reference>();
2373          for (Reference i : basedOn)
2374            dst.basedOn.add(i.copy());
2375        };
2376        dst.subject = subject == null ? null : subject.copy();
2377        dst.issued = issued == null ? null : issued.copy();
2378        if (performer != null) {
2379          dst.performer = new ArrayList<ImagingSelectionPerformerComponent>();
2380          for (ImagingSelectionPerformerComponent i : performer)
2381            dst.performer.add(i.copy());
2382        };
2383        dst.code = code == null ? null : code.copy();
2384        dst.studyUid = studyUid == null ? null : studyUid.copy();
2385        if (derivedFrom != null) {
2386          dst.derivedFrom = new ArrayList<Reference>();
2387          for (Reference i : derivedFrom)
2388            dst.derivedFrom.add(i.copy());
2389        };
2390        if (endpoint != null) {
2391          dst.endpoint = new ArrayList<Reference>();
2392          for (Reference i : endpoint)
2393            dst.endpoint.add(i.copy());
2394        };
2395        dst.seriesUid = seriesUid == null ? null : seriesUid.copy();
2396        dst.frameOfReferenceUid = frameOfReferenceUid == null ? null : frameOfReferenceUid.copy();
2397        dst.bodySite = bodySite == null ? null : bodySite.copy();
2398        if (instance != null) {
2399          dst.instance = new ArrayList<ImagingSelectionInstanceComponent>();
2400          for (ImagingSelectionInstanceComponent i : instance)
2401            dst.instance.add(i.copy());
2402        };
2403        dst.imageRegion = imageRegion == null ? null : imageRegion.copy();
2404      }
2405
2406      protected ImagingSelection typedCopy() {
2407        return copy();
2408      }
2409
2410      @Override
2411      public boolean equalsDeep(Base other_) {
2412        if (!super.equalsDeep(other_))
2413          return false;
2414        if (!(other_ instanceof ImagingSelection))
2415          return false;
2416        ImagingSelection o = (ImagingSelection) other_;
2417        return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(subject, o.subject, true)
2418           && compareDeep(issued, o.issued, true) && compareDeep(performer, o.performer, true) && compareDeep(code, o.code, true)
2419           && compareDeep(studyUid, o.studyUid, true) && compareDeep(derivedFrom, o.derivedFrom, true) && compareDeep(endpoint, o.endpoint, true)
2420           && compareDeep(seriesUid, o.seriesUid, true) && compareDeep(frameOfReferenceUid, o.frameOfReferenceUid, true)
2421           && compareDeep(bodySite, o.bodySite, true) && compareDeep(instance, o.instance, true) && compareDeep(imageRegion, o.imageRegion, true)
2422          ;
2423      }
2424
2425      @Override
2426      public boolean equalsShallow(Base other_) {
2427        if (!super.equalsShallow(other_))
2428          return false;
2429        if (!(other_ instanceof ImagingSelection))
2430          return false;
2431        ImagingSelection o = (ImagingSelection) other_;
2432        return compareValues(issued, o.issued, true) && compareValues(studyUid, o.studyUid, true) && compareValues(seriesUid, o.seriesUid, true)
2433           && compareValues(frameOfReferenceUid, o.frameOfReferenceUid, true);
2434      }
2435
2436      public boolean isEmpty() {
2437        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, subject
2438          , issued, performer, code, studyUid, derivedFrom, endpoint, seriesUid, frameOfReferenceUid
2439          , bodySite, instance, imageRegion);
2440      }
2441
2442  @Override
2443  public ResourceType getResourceType() {
2444    return ResourceType.ImagingSelection;
2445   }
2446
2447 /**
2448   * Search parameter: <b>based-on</b>
2449   * <p>
2450   * Description: <b>The request associated with an imaging selection</b><br>
2451   * Type: <b>reference</b><br>
2452   * Path: <b>ImagingSelection.basedOn</b><br>
2453   * </p>
2454   */
2455  @SearchParamDefinition(name="based-on", path="ImagingSelection.basedOn", description="The request associated with an imaging selection", type="reference", target={Appointment.class, AppointmentResponse.class, CarePlan.class, ServiceRequest.class, Task.class } )
2456  public static final String SP_BASED_ON = "based-on";
2457 /**
2458   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
2459   * <p>
2460   * Description: <b>The request associated with an imaging selection</b><br>
2461   * Type: <b>reference</b><br>
2462   * Path: <b>ImagingSelection.basedOn</b><br>
2463   * </p>
2464   */
2465  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
2466
2467/**
2468   * Constant for fluent queries to be used to add include statements. Specifies
2469   * the path value of "<b>ImagingSelection:based-on</b>".
2470   */
2471  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("ImagingSelection:based-on").toLocked();
2472
2473 /**
2474   * Search parameter: <b>body-site</b>
2475   * <p>
2476   * Description: <b>The body site associated with the imaging selection</b><br>
2477   * Type: <b>token</b><br>
2478   * Path: <b>ImagingSelection.bodySite</b><br>
2479   * </p>
2480   */
2481  @SearchParamDefinition(name="body-site", path="ImagingSelection.bodySite", description="The body site associated with the imaging selection", type="token" )
2482  public static final String SP_BODY_SITE = "body-site";
2483 /**
2484   * <b>Fluent Client</b> search parameter constant for <b>body-site</b>
2485   * <p>
2486   * Description: <b>The body site associated with the imaging selection</b><br>
2487   * Type: <b>token</b><br>
2488   * Path: <b>ImagingSelection.bodySite</b><br>
2489   * </p>
2490   */
2491  public static final ca.uhn.fhir.rest.gclient.TokenClientParam BODY_SITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BODY_SITE);
2492
2493 /**
2494   * Search parameter: <b>code</b>
2495   * <p>
2496   * Description: <b>The imaging selection description text or code</b><br>
2497   * Type: <b>token</b><br>
2498   * Path: <b>ImagingSelection.code</b><br>
2499   * </p>
2500   */
2501  @SearchParamDefinition(name="code", path="ImagingSelection.code", description="The imaging selection description text or code", type="token" )
2502  public static final String SP_CODE = "code";
2503 /**
2504   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2505   * <p>
2506   * Description: <b>The imaging selection description text or code</b><br>
2507   * Type: <b>token</b><br>
2508   * Path: <b>ImagingSelection.code</b><br>
2509   * </p>
2510   */
2511  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2512
2513 /**
2514   * Search parameter: <b>derived-from</b>
2515   * <p>
2516   * Description: <b>The imaging study from which the imaging selection was derived</b><br>
2517   * Type: <b>reference</b><br>
2518   * Path: <b>ImagingSelection.derivedFrom</b><br>
2519   * </p>
2520   */
2521  @SearchParamDefinition(name="derived-from", path="ImagingSelection.derivedFrom", description="The imaging study from which the imaging selection was derived", type="reference", target={ImagingStudy.class } )
2522  public static final String SP_DERIVED_FROM = "derived-from";
2523 /**
2524   * <b>Fluent Client</b> search parameter constant for <b>derived-from</b>
2525   * <p>
2526   * Description: <b>The imaging study from which the imaging selection was derived</b><br>
2527   * Type: <b>reference</b><br>
2528   * Path: <b>ImagingSelection.derivedFrom</b><br>
2529   * </p>
2530   */
2531  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DERIVED_FROM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DERIVED_FROM);
2532
2533/**
2534   * Constant for fluent queries to be used to add include statements. Specifies
2535   * the path value of "<b>ImagingSelection:derived-from</b>".
2536   */
2537  public static final ca.uhn.fhir.model.api.Include INCLUDE_DERIVED_FROM = new ca.uhn.fhir.model.api.Include("ImagingSelection:derived-from").toLocked();
2538
2539 /**
2540   * Search parameter: <b>identifier</b>
2541   * <p>
2542   * Description: <b>Identifiers for the imaging selection</b><br>
2543   * Type: <b>token</b><br>
2544   * Path: <b>ImagingSelection.identifier</b><br>
2545   * </p>
2546   */
2547  @SearchParamDefinition(name="identifier", path="ImagingSelection.identifier", description="Identifiers for the imaging selection", type="token" )
2548  public static final String SP_IDENTIFIER = "identifier";
2549 /**
2550   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2551   * <p>
2552   * Description: <b>Identifiers for the imaging selection</b><br>
2553   * Type: <b>token</b><br>
2554   * Path: <b>ImagingSelection.identifier</b><br>
2555   * </p>
2556   */
2557  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2558
2559 /**
2560   * Search parameter: <b>issued</b>
2561   * <p>
2562   * Description: <b>The date / time the imaging selection was created</b><br>
2563   * Type: <b>date</b><br>
2564   * Path: <b>ImagingSelection.issued</b><br>
2565   * </p>
2566   */
2567  @SearchParamDefinition(name="issued", path="ImagingSelection.issued", description="The date / time the imaging selection was created", type="date" )
2568  public static final String SP_ISSUED = "issued";
2569 /**
2570   * <b>Fluent Client</b> search parameter constant for <b>issued</b>
2571   * <p>
2572   * Description: <b>The date / time the imaging selection was created</b><br>
2573   * Type: <b>date</b><br>
2574   * Path: <b>ImagingSelection.issued</b><br>
2575   * </p>
2576   */
2577  public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED);
2578
2579 /**
2580   * Search parameter: <b>patient</b>
2581   * <p>
2582   * Description: <b>Who the study is about</b><br>
2583   * Type: <b>reference</b><br>
2584   * Path: <b>ImagingSelection.subject.where(resolve() is Patient)</b><br>
2585   * </p>
2586   */
2587  @SearchParamDefinition(name="patient", path="ImagingSelection.subject.where(resolve() is Patient)", description="Who the study is about", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Device.class, Group.class, Location.class, Medication.class, Organization.class, Patient.class, Practitioner.class, Procedure.class, Specimen.class, Substance.class } )
2588  public static final String SP_PATIENT = "patient";
2589 /**
2590   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2591   * <p>
2592   * Description: <b>Who the study is about</b><br>
2593   * Type: <b>reference</b><br>
2594   * Path: <b>ImagingSelection.subject.where(resolve() is Patient)</b><br>
2595   * </p>
2596   */
2597  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2598
2599/**
2600   * Constant for fluent queries to be used to add include statements. Specifies
2601   * the path value of "<b>ImagingSelection:patient</b>".
2602   */
2603  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ImagingSelection:patient").toLocked();
2604
2605 /**
2606   * Search parameter: <b>study-uid</b>
2607   * <p>
2608   * Description: <b>The DICOM Study Instance UID from which the images were selected</b><br>
2609   * Type: <b>uri</b><br>
2610   * Path: <b>ImagingSelection.studyUid</b><br>
2611   * </p>
2612   */
2613  @SearchParamDefinition(name="study-uid", path="ImagingSelection.studyUid", description="The DICOM Study Instance UID from which the images were selected", type="uri" )
2614  public static final String SP_STUDY_UID = "study-uid";
2615 /**
2616   * <b>Fluent Client</b> search parameter constant for <b>study-uid</b>
2617   * <p>
2618   * Description: <b>The DICOM Study Instance UID from which the images were selected</b><br>
2619   * Type: <b>uri</b><br>
2620   * Path: <b>ImagingSelection.studyUid</b><br>
2621   * </p>
2622   */
2623  public static final ca.uhn.fhir.rest.gclient.UriClientParam STUDY_UID = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_STUDY_UID);
2624
2625 /**
2626   * Search parameter: <b>subject</b>
2627   * <p>
2628   * Description: <b>The subject of the Imaging Selection, such as the associated Patient</b><br>
2629   * Type: <b>reference</b><br>
2630   * Path: <b>ImagingSelection.subject</b><br>
2631   * </p>
2632   */
2633  @SearchParamDefinition(name="subject", path="ImagingSelection.subject", description="The subject of the Imaging Selection, such as the associated Patient", type="reference", target={Device.class, Group.class, Location.class, Medication.class, Organization.class, Patient.class, Practitioner.class, Procedure.class, Specimen.class, Substance.class } )
2634  public static final String SP_SUBJECT = "subject";
2635 /**
2636   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2637   * <p>
2638   * Description: <b>The subject of the Imaging Selection, such as the associated Patient</b><br>
2639   * Type: <b>reference</b><br>
2640   * Path: <b>ImagingSelection.subject</b><br>
2641   * </p>
2642   */
2643  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2644
2645/**
2646   * Constant for fluent queries to be used to add include statements. Specifies
2647   * the path value of "<b>ImagingSelection:subject</b>".
2648   */
2649  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("ImagingSelection:subject").toLocked();
2650
2651
2652}
2653