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 13, 2022 17:53+1100 for FHIR vcurrent
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 ImagingSelection2DGraphicType {
058        /**
059         * A single location denoted by a single (x,y) pair.
060         */
061        POINT, 
062        /**
063         * A series of connected line segments with ordered vertices denoted by (x,y) triplets; the points need not be coplanar.
064         */
065        POLYLINE, 
066        /**
067         * An n-tuple list of (x,y) pair end points between which some form of implementation dependent curved lines are to be drawn. The rendered line shall pass through all the specified points.
068         */
069        INTERPOLATED, 
070        /**
071         * Two points shall be present; the first point is to be interpreted as the center and the second point as a point on the circumference of a circle, some form of implementation dependent representation of which is to be drawn.
072         */
073        CIRCLE, 
074        /**
075         * An ellipse defined by four (x,y) pairs, the first two pairs specifying the endpoints of the major axis and the second two pairs specifying the endpoints of the minor axis.
076         */
077        ELLIPSE, 
078        /**
079         * added to help the parsers with the generic types
080         */
081        NULL;
082        public static ImagingSelection2DGraphicType fromCode(String codeString) throws FHIRException {
083            if (codeString == null || "".equals(codeString))
084                return null;
085        if ("point".equals(codeString))
086          return POINT;
087        if ("polyline".equals(codeString))
088          return POLYLINE;
089        if ("interpolated".equals(codeString))
090          return INTERPOLATED;
091        if ("circle".equals(codeString))
092          return CIRCLE;
093        if ("ellipse".equals(codeString))
094          return ELLIPSE;
095        if (Configuration.isAcceptInvalidEnums())
096          return null;
097        else
098          throw new FHIRException("Unknown ImagingSelection2DGraphicType code '"+codeString+"'");
099        }
100        public String toCode() {
101          switch (this) {
102            case POINT: return "point";
103            case POLYLINE: return "polyline";
104            case INTERPOLATED: return "interpolated";
105            case CIRCLE: return "circle";
106            case ELLIPSE: return "ellipse";
107            case NULL: return null;
108            default: return "?";
109          }
110        }
111        public String getSystem() {
112          switch (this) {
113            case POINT: return "http://hl7.org/fhir/imagingselection-2dgraphictype";
114            case POLYLINE: return "http://hl7.org/fhir/imagingselection-2dgraphictype";
115            case INTERPOLATED: return "http://hl7.org/fhir/imagingselection-2dgraphictype";
116            case CIRCLE: return "http://hl7.org/fhir/imagingselection-2dgraphictype";
117            case ELLIPSE: return "http://hl7.org/fhir/imagingselection-2dgraphictype";
118            case NULL: return null;
119            default: return "?";
120          }
121        }
122        public String getDefinition() {
123          switch (this) {
124            case POINT: return "A single location denoted by a single (x,y) pair.";
125            case POLYLINE: return "A series of connected line segments with ordered vertices denoted by (x,y) triplets; the points need not be coplanar.";
126            case INTERPOLATED: return "An n-tuple list of (x,y) pair end points between which some form of implementation dependent curved lines are to be drawn. The rendered line shall pass through all the specified points.";
127            case CIRCLE: return "Two points shall be present; the first point is to be interpreted as the center and the second point as a point on the circumference of a circle, some form of implementation dependent representation of which is to be drawn.";
128            case ELLIPSE: return "An ellipse defined by four (x,y) pairs, the first two pairs specifying the endpoints of the major axis and the second two pairs specifying the endpoints of the minor axis.";
129            case NULL: return null;
130            default: return "?";
131          }
132        }
133        public String getDisplay() {
134          switch (this) {
135            case POINT: return "POINT";
136            case POLYLINE: return "POLYLINE";
137            case INTERPOLATED: return "INTERPOLATED";
138            case CIRCLE: return "CIRCLE";
139            case ELLIPSE: return "ELLIPSE";
140            case NULL: return null;
141            default: return "?";
142          }
143        }
144    }
145
146  public static class ImagingSelection2DGraphicTypeEnumFactory implements EnumFactory<ImagingSelection2DGraphicType> {
147    public ImagingSelection2DGraphicType fromCode(String codeString) throws IllegalArgumentException {
148      if (codeString == null || "".equals(codeString))
149            if (codeString == null || "".equals(codeString))
150                return null;
151        if ("point".equals(codeString))
152          return ImagingSelection2DGraphicType.POINT;
153        if ("polyline".equals(codeString))
154          return ImagingSelection2DGraphicType.POLYLINE;
155        if ("interpolated".equals(codeString))
156          return ImagingSelection2DGraphicType.INTERPOLATED;
157        if ("circle".equals(codeString))
158          return ImagingSelection2DGraphicType.CIRCLE;
159        if ("ellipse".equals(codeString))
160          return ImagingSelection2DGraphicType.ELLIPSE;
161        throw new IllegalArgumentException("Unknown ImagingSelection2DGraphicType code '"+codeString+"'");
162        }
163        public Enumeration<ImagingSelection2DGraphicType> fromType(PrimitiveType<?> code) throws FHIRException {
164          if (code == null)
165            return null;
166          if (code.isEmpty())
167            return new Enumeration<ImagingSelection2DGraphicType>(this, ImagingSelection2DGraphicType.NULL, code);
168          String codeString = ((PrimitiveType) code).asStringValue();
169          if (codeString == null || "".equals(codeString))
170            return new Enumeration<ImagingSelection2DGraphicType>(this, ImagingSelection2DGraphicType.NULL, code);
171        if ("point".equals(codeString))
172          return new Enumeration<ImagingSelection2DGraphicType>(this, ImagingSelection2DGraphicType.POINT, code);
173        if ("polyline".equals(codeString))
174          return new Enumeration<ImagingSelection2DGraphicType>(this, ImagingSelection2DGraphicType.POLYLINE, code);
175        if ("interpolated".equals(codeString))
176          return new Enumeration<ImagingSelection2DGraphicType>(this, ImagingSelection2DGraphicType.INTERPOLATED, code);
177        if ("circle".equals(codeString))
178          return new Enumeration<ImagingSelection2DGraphicType>(this, ImagingSelection2DGraphicType.CIRCLE, code);
179        if ("ellipse".equals(codeString))
180          return new Enumeration<ImagingSelection2DGraphicType>(this, ImagingSelection2DGraphicType.ELLIPSE, code);
181        throw new FHIRException("Unknown ImagingSelection2DGraphicType code '"+codeString+"'");
182        }
183    public String toCode(ImagingSelection2DGraphicType code) {
184      if (code == ImagingSelection2DGraphicType.POINT)
185        return "point";
186      if (code == ImagingSelection2DGraphicType.POLYLINE)
187        return "polyline";
188      if (code == ImagingSelection2DGraphicType.INTERPOLATED)
189        return "interpolated";
190      if (code == ImagingSelection2DGraphicType.CIRCLE)
191        return "circle";
192      if (code == ImagingSelection2DGraphicType.ELLIPSE)
193        return "ellipse";
194      return "?";
195      }
196    public String toSystem(ImagingSelection2DGraphicType code) {
197      return code.getSystem();
198      }
199    }
200
201    public enum ImagingSelection3DGraphicType {
202        /**
203         * A single location denoted by a single (x,y,z) triplet.
204         */
205        POINT, 
206        /**
207         * multiple locations each denoted by an (x,y,z) triplet; the points need not be coplanar.
208         */
209        MULTIPOINT, 
210        /**
211         * a series of connected line segments with ordered vertices denoted by (x,y,z) triplets; the points need not be coplanar.
212         */
213        POLYLINE, 
214        /**
215         * 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.
216         */
217        POLYGON, 
218        /**
219         * 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.
220         */
221        ELLIPSE, 
222        /**
223         * 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\".
224         */
225        ELLIPSOID, 
226        /**
227         * added to help the parsers with the generic types
228         */
229        NULL;
230        public static ImagingSelection3DGraphicType fromCode(String codeString) throws FHIRException {
231            if (codeString == null || "".equals(codeString))
232                return null;
233        if ("point".equals(codeString))
234          return POINT;
235        if ("multipoint".equals(codeString))
236          return MULTIPOINT;
237        if ("polyline".equals(codeString))
238          return POLYLINE;
239        if ("polygon".equals(codeString))
240          return POLYGON;
241        if ("ellipse".equals(codeString))
242          return ELLIPSE;
243        if ("ellipsoid".equals(codeString))
244          return ELLIPSOID;
245        if (Configuration.isAcceptInvalidEnums())
246          return null;
247        else
248          throw new FHIRException("Unknown ImagingSelection3DGraphicType code '"+codeString+"'");
249        }
250        public String toCode() {
251          switch (this) {
252            case POINT: return "point";
253            case MULTIPOINT: return "multipoint";
254            case POLYLINE: return "polyline";
255            case POLYGON: return "polygon";
256            case ELLIPSE: return "ellipse";
257            case ELLIPSOID: return "ellipsoid";
258            case NULL: return null;
259            default: return "?";
260          }
261        }
262        public String getSystem() {
263          switch (this) {
264            case POINT: return "http://hl7.org/fhir/imagingselection-3dgraphictype";
265            case MULTIPOINT: return "http://hl7.org/fhir/imagingselection-3dgraphictype";
266            case POLYLINE: return "http://hl7.org/fhir/imagingselection-3dgraphictype";
267            case POLYGON: return "http://hl7.org/fhir/imagingselection-3dgraphictype";
268            case ELLIPSE: return "http://hl7.org/fhir/imagingselection-3dgraphictype";
269            case ELLIPSOID: return "http://hl7.org/fhir/imagingselection-3dgraphictype";
270            case NULL: return null;
271            default: return "?";
272          }
273        }
274        public String getDefinition() {
275          switch (this) {
276            case POINT: return "A single location denoted by a single (x,y,z) triplet.";
277            case MULTIPOINT: return "multiple locations each denoted by an (x,y,z) triplet; the points need not be coplanar.";
278            case POLYLINE: return "a series of connected line segments with ordered vertices denoted by (x,y,z) triplets; the points need not be coplanar.";
279            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.";
280            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.";
281            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\".";
282            case NULL: return null;
283            default: return "?";
284          }
285        }
286        public String getDisplay() {
287          switch (this) {
288            case POINT: return "POINT";
289            case MULTIPOINT: return "MULTIPOINT";
290            case POLYLINE: return "POLYLINE";
291            case POLYGON: return "POLYGON";
292            case ELLIPSE: return "ELLIPSE";
293            case ELLIPSOID: return "ELLIPSOID";
294            case NULL: return null;
295            default: return "?";
296          }
297        }
298    }
299
300  public static class ImagingSelection3DGraphicTypeEnumFactory implements EnumFactory<ImagingSelection3DGraphicType> {
301    public ImagingSelection3DGraphicType fromCode(String codeString) throws IllegalArgumentException {
302      if (codeString == null || "".equals(codeString))
303            if (codeString == null || "".equals(codeString))
304                return null;
305        if ("point".equals(codeString))
306          return ImagingSelection3DGraphicType.POINT;
307        if ("multipoint".equals(codeString))
308          return ImagingSelection3DGraphicType.MULTIPOINT;
309        if ("polyline".equals(codeString))
310          return ImagingSelection3DGraphicType.POLYLINE;
311        if ("polygon".equals(codeString))
312          return ImagingSelection3DGraphicType.POLYGON;
313        if ("ellipse".equals(codeString))
314          return ImagingSelection3DGraphicType.ELLIPSE;
315        if ("ellipsoid".equals(codeString))
316          return ImagingSelection3DGraphicType.ELLIPSOID;
317        throw new IllegalArgumentException("Unknown ImagingSelection3DGraphicType code '"+codeString+"'");
318        }
319        public Enumeration<ImagingSelection3DGraphicType> fromType(PrimitiveType<?> code) throws FHIRException {
320          if (code == null)
321            return null;
322          if (code.isEmpty())
323            return new Enumeration<ImagingSelection3DGraphicType>(this, ImagingSelection3DGraphicType.NULL, code);
324          String codeString = ((PrimitiveType) code).asStringValue();
325          if (codeString == null || "".equals(codeString))
326            return new Enumeration<ImagingSelection3DGraphicType>(this, ImagingSelection3DGraphicType.NULL, code);
327        if ("point".equals(codeString))
328          return new Enumeration<ImagingSelection3DGraphicType>(this, ImagingSelection3DGraphicType.POINT, code);
329        if ("multipoint".equals(codeString))
330          return new Enumeration<ImagingSelection3DGraphicType>(this, ImagingSelection3DGraphicType.MULTIPOINT, code);
331        if ("polyline".equals(codeString))
332          return new Enumeration<ImagingSelection3DGraphicType>(this, ImagingSelection3DGraphicType.POLYLINE, code);
333        if ("polygon".equals(codeString))
334          return new Enumeration<ImagingSelection3DGraphicType>(this, ImagingSelection3DGraphicType.POLYGON, code);
335        if ("ellipse".equals(codeString))
336          return new Enumeration<ImagingSelection3DGraphicType>(this, ImagingSelection3DGraphicType.ELLIPSE, code);
337        if ("ellipsoid".equals(codeString))
338          return new Enumeration<ImagingSelection3DGraphicType>(this, ImagingSelection3DGraphicType.ELLIPSOID, code);
339        throw new FHIRException("Unknown ImagingSelection3DGraphicType code '"+codeString+"'");
340        }
341    public String toCode(ImagingSelection3DGraphicType code) {
342      if (code == ImagingSelection3DGraphicType.POINT)
343        return "point";
344      if (code == ImagingSelection3DGraphicType.MULTIPOINT)
345        return "multipoint";
346      if (code == ImagingSelection3DGraphicType.POLYLINE)
347        return "polyline";
348      if (code == ImagingSelection3DGraphicType.POLYGON)
349        return "polygon";
350      if (code == ImagingSelection3DGraphicType.ELLIPSE)
351        return "ellipse";
352      if (code == ImagingSelection3DGraphicType.ELLIPSOID)
353        return "ellipsoid";
354      return "?";
355      }
356    public String toSystem(ImagingSelection3DGraphicType code) {
357      return code.getSystem();
358      }
359    }
360
361    public enum ImagingSelectionStatus {
362        /**
363         * The selected resources are available..
364         */
365        AVAILABLE, 
366        /**
367         * The imaging selection has been withdrawn following a release.  This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be \"cancelled\" rather than \"entered-in-error\".).
368         */
369        ENTEREDINERROR, 
370        /**
371         * The system does not know which of the status values currently applies for this request. Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, it's just not known which one.
372         */
373        UNKNOWN, 
374        /**
375         * added to help the parsers with the generic types
376         */
377        NULL;
378        public static ImagingSelectionStatus fromCode(String codeString) throws FHIRException {
379            if (codeString == null || "".equals(codeString))
380                return null;
381        if ("available".equals(codeString))
382          return AVAILABLE;
383        if ("entered-in-error".equals(codeString))
384          return ENTEREDINERROR;
385        if ("unknown".equals(codeString))
386          return UNKNOWN;
387        if (Configuration.isAcceptInvalidEnums())
388          return null;
389        else
390          throw new FHIRException("Unknown ImagingSelectionStatus code '"+codeString+"'");
391        }
392        public String toCode() {
393          switch (this) {
394            case AVAILABLE: return "available";
395            case ENTEREDINERROR: return "entered-in-error";
396            case UNKNOWN: return "unknown";
397            case NULL: return null;
398            default: return "?";
399          }
400        }
401        public String getSystem() {
402          switch (this) {
403            case AVAILABLE: return "http://hl7.org/fhir/imagingselection-status";
404            case ENTEREDINERROR: return "http://hl7.org/fhir/imagingselection-status";
405            case UNKNOWN: return "http://hl7.org/fhir/imagingselection-status";
406            case NULL: return null;
407            default: return "?";
408          }
409        }
410        public String getDefinition() {
411          switch (this) {
412            case AVAILABLE: return "The selected resources are available..";
413            case ENTEREDINERROR: return "The imaging selection has been withdrawn following a release.  This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be \"cancelled\" rather than \"entered-in-error\".).";
414            case UNKNOWN: return "The system does not know which of the status values currently applies for this request. Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, it's just not known which one.";
415            case NULL: return null;
416            default: return "?";
417          }
418        }
419        public String getDisplay() {
420          switch (this) {
421            case AVAILABLE: return "Available";
422            case ENTEREDINERROR: return "Entered in Error";
423            case UNKNOWN: return "Unknown";
424            case NULL: return null;
425            default: return "?";
426          }
427        }
428    }
429
430  public static class ImagingSelectionStatusEnumFactory implements EnumFactory<ImagingSelectionStatus> {
431    public ImagingSelectionStatus fromCode(String codeString) throws IllegalArgumentException {
432      if (codeString == null || "".equals(codeString))
433            if (codeString == null || "".equals(codeString))
434                return null;
435        if ("available".equals(codeString))
436          return ImagingSelectionStatus.AVAILABLE;
437        if ("entered-in-error".equals(codeString))
438          return ImagingSelectionStatus.ENTEREDINERROR;
439        if ("unknown".equals(codeString))
440          return ImagingSelectionStatus.UNKNOWN;
441        throw new IllegalArgumentException("Unknown ImagingSelectionStatus code '"+codeString+"'");
442        }
443        public Enumeration<ImagingSelectionStatus> fromType(PrimitiveType<?> code) throws FHIRException {
444          if (code == null)
445            return null;
446          if (code.isEmpty())
447            return new Enumeration<ImagingSelectionStatus>(this, ImagingSelectionStatus.NULL, code);
448          String codeString = ((PrimitiveType) code).asStringValue();
449          if (codeString == null || "".equals(codeString))
450            return new Enumeration<ImagingSelectionStatus>(this, ImagingSelectionStatus.NULL, code);
451        if ("available".equals(codeString))
452          return new Enumeration<ImagingSelectionStatus>(this, ImagingSelectionStatus.AVAILABLE, code);
453        if ("entered-in-error".equals(codeString))
454          return new Enumeration<ImagingSelectionStatus>(this, ImagingSelectionStatus.ENTEREDINERROR, code);
455        if ("unknown".equals(codeString))
456          return new Enumeration<ImagingSelectionStatus>(this, ImagingSelectionStatus.UNKNOWN, code);
457        throw new FHIRException("Unknown ImagingSelectionStatus code '"+codeString+"'");
458        }
459    public String toCode(ImagingSelectionStatus code) {
460      if (code == ImagingSelectionStatus.AVAILABLE)
461        return "available";
462      if (code == ImagingSelectionStatus.ENTEREDINERROR)
463        return "entered-in-error";
464      if (code == ImagingSelectionStatus.UNKNOWN)
465        return "unknown";
466      return "?";
467      }
468    public String toSystem(ImagingSelectionStatus code) {
469      return code.getSystem();
470      }
471    }
472
473    @Block()
474    public static class ImagingSelectionPerformerComponent extends BackboneElement implements IBaseBackboneElement {
475        /**
476         * Distinguishes the type of involvement of the performer.
477         */
478        @Child(name = "function", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
479        @Description(shortDefinition="Type of performer", formalDefinition="Distinguishes the type of involvement of the performer." )
480        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/series-performer-function")
481        protected CodeableConcept function;
482
483        /**
484         * Author – human or machine.
485         */
486        @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)
487        @Description(shortDefinition="Author (human or machine)", formalDefinition="Author – human or machine." )
488        protected Reference actor;
489
490        private static final long serialVersionUID = -576943815L;
491
492    /**
493     * Constructor
494     */
495      public ImagingSelectionPerformerComponent() {
496        super();
497      }
498
499        /**
500         * @return {@link #function} (Distinguishes the type of involvement of the performer.)
501         */
502        public CodeableConcept getFunction() { 
503          if (this.function == null)
504            if (Configuration.errorOnAutoCreate())
505              throw new Error("Attempt to auto-create ImagingSelectionPerformerComponent.function");
506            else if (Configuration.doAutoCreate())
507              this.function = new CodeableConcept(); // cc
508          return this.function;
509        }
510
511        public boolean hasFunction() { 
512          return this.function != null && !this.function.isEmpty();
513        }
514
515        /**
516         * @param value {@link #function} (Distinguishes the type of involvement of the performer.)
517         */
518        public ImagingSelectionPerformerComponent setFunction(CodeableConcept value) { 
519          this.function = value;
520          return this;
521        }
522
523        /**
524         * @return {@link #actor} (Author – human or machine.)
525         */
526        public Reference getActor() { 
527          if (this.actor == null)
528            if (Configuration.errorOnAutoCreate())
529              throw new Error("Attempt to auto-create ImagingSelectionPerformerComponent.actor");
530            else if (Configuration.doAutoCreate())
531              this.actor = new Reference(); // cc
532          return this.actor;
533        }
534
535        public boolean hasActor() { 
536          return this.actor != null && !this.actor.isEmpty();
537        }
538
539        /**
540         * @param value {@link #actor} (Author – human or machine.)
541         */
542        public ImagingSelectionPerformerComponent setActor(Reference value) { 
543          this.actor = value;
544          return this;
545        }
546
547        protected void listChildren(List<Property> children) {
548          super.listChildren(children);
549          children.add(new Property("function", "CodeableConcept", "Distinguishes the type of involvement of the performer.", 0, 1, function));
550          children.add(new Property("actor", "Reference(Practitioner|PractitionerRole|Device|Organization|CareTeam|Patient|RelatedPerson|HealthcareService)", "Author – human or machine.", 0, 1, actor));
551        }
552
553        @Override
554        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
555          switch (_hash) {
556          case 1380938712: /*function*/  return new Property("function", "CodeableConcept", "Distinguishes the type of involvement of the performer.", 0, 1, function);
557          case 92645877: /*actor*/  return new Property("actor", "Reference(Practitioner|PractitionerRole|Device|Organization|CareTeam|Patient|RelatedPerson|HealthcareService)", "Author – human or machine.", 0, 1, actor);
558          default: return super.getNamedProperty(_hash, _name, _checkValid);
559          }
560
561        }
562
563      @Override
564      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
565        switch (hash) {
566        case 1380938712: /*function*/ return this.function == null ? new Base[0] : new Base[] {this.function}; // CodeableConcept
567        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
568        default: return super.getProperty(hash, name, checkValid);
569        }
570
571      }
572
573      @Override
574      public Base setProperty(int hash, String name, Base value) throws FHIRException {
575        switch (hash) {
576        case 1380938712: // function
577          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
578          return value;
579        case 92645877: // actor
580          this.actor = TypeConvertor.castToReference(value); // Reference
581          return value;
582        default: return super.setProperty(hash, name, value);
583        }
584
585      }
586
587      @Override
588      public Base setProperty(String name, Base value) throws FHIRException {
589        if (name.equals("function")) {
590          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
591        } else if (name.equals("actor")) {
592          this.actor = TypeConvertor.castToReference(value); // Reference
593        } else
594          return super.setProperty(name, value);
595        return value;
596      }
597
598      @Override
599      public Base makeProperty(int hash, String name) throws FHIRException {
600        switch (hash) {
601        case 1380938712:  return getFunction();
602        case 92645877:  return getActor();
603        default: return super.makeProperty(hash, name);
604        }
605
606      }
607
608      @Override
609      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
610        switch (hash) {
611        case 1380938712: /*function*/ return new String[] {"CodeableConcept"};
612        case 92645877: /*actor*/ return new String[] {"Reference"};
613        default: return super.getTypesForProperty(hash, name);
614        }
615
616      }
617
618      @Override
619      public Base addChild(String name) throws FHIRException {
620        if (name.equals("function")) {
621          this.function = new CodeableConcept();
622          return this.function;
623        }
624        else if (name.equals("actor")) {
625          this.actor = new Reference();
626          return this.actor;
627        }
628        else
629          return super.addChild(name);
630      }
631
632      public ImagingSelectionPerformerComponent copy() {
633        ImagingSelectionPerformerComponent dst = new ImagingSelectionPerformerComponent();
634        copyValues(dst);
635        return dst;
636      }
637
638      public void copyValues(ImagingSelectionPerformerComponent dst) {
639        super.copyValues(dst);
640        dst.function = function == null ? null : function.copy();
641        dst.actor = actor == null ? null : actor.copy();
642      }
643
644      @Override
645      public boolean equalsDeep(Base other_) {
646        if (!super.equalsDeep(other_))
647          return false;
648        if (!(other_ instanceof ImagingSelectionPerformerComponent))
649          return false;
650        ImagingSelectionPerformerComponent o = (ImagingSelectionPerformerComponent) other_;
651        return compareDeep(function, o.function, true) && compareDeep(actor, o.actor, true);
652      }
653
654      @Override
655      public boolean equalsShallow(Base other_) {
656        if (!super.equalsShallow(other_))
657          return false;
658        if (!(other_ instanceof ImagingSelectionPerformerComponent))
659          return false;
660        ImagingSelectionPerformerComponent o = (ImagingSelectionPerformerComponent) other_;
661        return true;
662      }
663
664      public boolean isEmpty() {
665        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(function, actor);
666      }
667
668  public String fhirType() {
669    return "ImagingSelection.performer";
670
671  }
672
673  }
674
675    @Block()
676    public static class ImagingSelectionInstanceComponent extends BackboneElement implements IBaseBackboneElement {
677        /**
678         * The SOP Instance UID for the selected DICOM instance.
679         */
680        @Child(name = "uid", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true)
681        @Description(shortDefinition="DICOM SOP Instance UID", formalDefinition="The SOP Instance UID for the selected DICOM instance." )
682        protected IdType uid;
683
684        /**
685         * The Instance Number for the selected DICOM instance.
686         */
687        @Child(name = "number", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=true)
688        @Description(shortDefinition="DICOM Instance Number", formalDefinition="The Instance Number for the selected DICOM instance." )
689        protected UnsignedIntType number;
690
691        /**
692         * The SOP Class UID for the selected DICOM instance.
693         */
694        @Child(name = "sopClass", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false)
695        @Description(shortDefinition="DICOM SOP Class UID", formalDefinition="The SOP Class UID for the selected DICOM instance." )
696        @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")
697        protected Coding sopClass;
698
699        /**
700         * Selected subset of the SOP Instance. The content and format of the subset item is determined by the SOP Class of the selected instance.
701       May be one of:
702       - A list of frame numbers selected from a multiframe SOP Instance.
703       - A list of Content Item Observation UID values selected from a DICOM SR or other structured document SOP Instance.
704       - A list of segment numbers selected from a segmentation SOP Instance.
705       - A list of Region of Interest (ROI) numbers selected from a radiotherapy structure set SOP Instance.
706         */
707        @Child(name = "subset", type = {StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
708        @Description(shortDefinition="The selected subset of the SOP Instance", formalDefinition="Selected subset of the SOP Instance. The content and format of the subset item is determined by the SOP Class of the selected instance.\n       May be one of:\n       - A list of frame numbers selected from a multiframe SOP Instance.\n       - A list of Content Item Observation UID values selected from a DICOM SR or other structured document SOP Instance.\n       - A list of segment numbers selected from a segmentation SOP Instance.\n       - A list of Region of Interest (ROI) numbers selected from a radiotherapy structure set SOP Instance." )
709        protected List<StringType> subset;
710
711        /**
712         * Each imaging selection instance or frame list might includes an image region, specified by a region type and a set of 2D coordinates.
713       If the parent imagingSelection.instance contains a subset element of type frame, the image region applies to all frames in the subset list.
714         */
715        @Child(name = "imageRegion", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
716        @Description(shortDefinition="A specific 2D region in a DICOM image / frame", formalDefinition="Each imaging selection instance or frame list might includes an image region, specified by a region type and a set of 2D coordinates.\n       If the parent imagingSelection.instance contains a subset element of type frame, the image region applies to all frames in the subset list." )
717        protected List<ImageRegion2DComponent> imageRegion;
718
719        private static final long serialVersionUID = -1352866506L;
720
721    /**
722     * Constructor
723     */
724      public ImagingSelectionInstanceComponent() {
725        super();
726      }
727
728    /**
729     * Constructor
730     */
731      public ImagingSelectionInstanceComponent(String uid) {
732        super();
733        this.setUid(uid);
734      }
735
736        /**
737         * @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
738         */
739        public IdType getUidElement() { 
740          if (this.uid == null)
741            if (Configuration.errorOnAutoCreate())
742              throw new Error("Attempt to auto-create ImagingSelectionInstanceComponent.uid");
743            else if (Configuration.doAutoCreate())
744              this.uid = new IdType(); // bb
745          return this.uid;
746        }
747
748        public boolean hasUidElement() { 
749          return this.uid != null && !this.uid.isEmpty();
750        }
751
752        public boolean hasUid() { 
753          return this.uid != null && !this.uid.isEmpty();
754        }
755
756        /**
757         * @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
758         */
759        public ImagingSelectionInstanceComponent setUidElement(IdType value) { 
760          this.uid = value;
761          return this;
762        }
763
764        /**
765         * @return The SOP Instance UID for the selected DICOM instance.
766         */
767        public String getUid() { 
768          return this.uid == null ? null : this.uid.getValue();
769        }
770
771        /**
772         * @param value The SOP Instance UID for the selected DICOM instance.
773         */
774        public ImagingSelectionInstanceComponent setUid(String value) { 
775            if (this.uid == null)
776              this.uid = new IdType();
777            this.uid.setValue(value);
778          return this;
779        }
780
781        /**
782         * @return {@link #number} (The Instance Number for the selected DICOM instance.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value
783         */
784        public UnsignedIntType getNumberElement() { 
785          if (this.number == null)
786            if (Configuration.errorOnAutoCreate())
787              throw new Error("Attempt to auto-create ImagingSelectionInstanceComponent.number");
788            else if (Configuration.doAutoCreate())
789              this.number = new UnsignedIntType(); // bb
790          return this.number;
791        }
792
793        public boolean hasNumberElement() { 
794          return this.number != null && !this.number.isEmpty();
795        }
796
797        public boolean hasNumber() { 
798          return this.number != null && !this.number.isEmpty();
799        }
800
801        /**
802         * @param value {@link #number} (The Instance Number for the selected DICOM instance.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value
803         */
804        public ImagingSelectionInstanceComponent setNumberElement(UnsignedIntType value) { 
805          this.number = value;
806          return this;
807        }
808
809        /**
810         * @return The Instance Number for the selected DICOM instance.
811         */
812        public int getNumber() { 
813          return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue();
814        }
815
816        /**
817         * @param value The Instance Number for the selected DICOM instance.
818         */
819        public ImagingSelectionInstanceComponent setNumber(int value) { 
820            if (this.number == null)
821              this.number = new UnsignedIntType();
822            this.number.setValue(value);
823          return this;
824        }
825
826        /**
827         * @return {@link #sopClass} (The SOP Class UID for the selected DICOM instance.)
828         */
829        public Coding getSopClass() { 
830          if (this.sopClass == null)
831            if (Configuration.errorOnAutoCreate())
832              throw new Error("Attempt to auto-create ImagingSelectionInstanceComponent.sopClass");
833            else if (Configuration.doAutoCreate())
834              this.sopClass = new Coding(); // cc
835          return this.sopClass;
836        }
837
838        public boolean hasSopClass() { 
839          return this.sopClass != null && !this.sopClass.isEmpty();
840        }
841
842        /**
843         * @param value {@link #sopClass} (The SOP Class UID for the selected DICOM instance.)
844         */
845        public ImagingSelectionInstanceComponent setSopClass(Coding value) { 
846          this.sopClass = value;
847          return this;
848        }
849
850        /**
851         * @return {@link #subset} (Selected subset of the SOP Instance. The content and format of the subset item is determined by the SOP Class of the selected instance.
852       May be one of:
853       - A list of frame numbers selected from a multiframe SOP Instance.
854       - A list of Content Item Observation UID values selected from a DICOM SR or other structured document SOP Instance.
855       - A list of segment numbers selected from a segmentation SOP Instance.
856       - A list of Region of Interest (ROI) numbers selected from a radiotherapy structure set SOP Instance.)
857         */
858        public List<StringType> getSubset() { 
859          if (this.subset == null)
860            this.subset = new ArrayList<StringType>();
861          return this.subset;
862        }
863
864        /**
865         * @return Returns a reference to <code>this</code> for easy method chaining
866         */
867        public ImagingSelectionInstanceComponent setSubset(List<StringType> theSubset) { 
868          this.subset = theSubset;
869          return this;
870        }
871
872        public boolean hasSubset() { 
873          if (this.subset == null)
874            return false;
875          for (StringType item : this.subset)
876            if (!item.isEmpty())
877              return true;
878          return false;
879        }
880
881        /**
882         * @return {@link #subset} (Selected subset of the SOP Instance. The content and format of the subset item is determined by the SOP Class of the selected instance.
883       May be one of:
884       - A list of frame numbers selected from a multiframe SOP Instance.
885       - A list of Content Item Observation UID values selected from a DICOM SR or other structured document SOP Instance.
886       - A list of segment numbers selected from a segmentation SOP Instance.
887       - A list of Region of Interest (ROI) numbers selected from a radiotherapy structure set SOP Instance.)
888         */
889        public StringType addSubsetElement() {//2 
890          StringType t = new StringType();
891          if (this.subset == null)
892            this.subset = new ArrayList<StringType>();
893          this.subset.add(t);
894          return t;
895        }
896
897        /**
898         * @param value {@link #subset} (Selected subset of the SOP Instance. The content and format of the subset item is determined by the SOP Class of the selected instance.
899       May be one of:
900       - A list of frame numbers selected from a multiframe SOP Instance.
901       - A list of Content Item Observation UID values selected from a DICOM SR or other structured document SOP Instance.
902       - A list of segment numbers selected from a segmentation SOP Instance.
903       - A list of Region of Interest (ROI) numbers selected from a radiotherapy structure set SOP Instance.)
904         */
905        public ImagingSelectionInstanceComponent addSubset(String value) { //1
906          StringType t = new StringType();
907          t.setValue(value);
908          if (this.subset == null)
909            this.subset = new ArrayList<StringType>();
910          this.subset.add(t);
911          return this;
912        }
913
914        /**
915         * @param value {@link #subset} (Selected subset of the SOP Instance. The content and format of the subset item is determined by the SOP Class of the selected instance.
916       May be one of:
917       - A list of frame numbers selected from a multiframe SOP Instance.
918       - A list of Content Item Observation UID values selected from a DICOM SR or other structured document SOP Instance.
919       - A list of segment numbers selected from a segmentation SOP Instance.
920       - A list of Region of Interest (ROI) numbers selected from a radiotherapy structure set SOP Instance.)
921         */
922        public boolean hasSubset(String value) { 
923          if (this.subset == null)
924            return false;
925          for (StringType v : this.subset)
926            if (v.getValue().equals(value)) // string
927              return true;
928          return false;
929        }
930
931        /**
932         * @return {@link #imageRegion} (Each imaging selection instance or frame list might includes an image region, specified by a region type and a set of 2D coordinates.
933       If the parent imagingSelection.instance contains a subset element of type frame, the image region applies to all frames in the subset list.)
934         */
935        public List<ImageRegion2DComponent> getImageRegion() { 
936          if (this.imageRegion == null)
937            this.imageRegion = new ArrayList<ImageRegion2DComponent>();
938          return this.imageRegion;
939        }
940
941        /**
942         * @return Returns a reference to <code>this</code> for easy method chaining
943         */
944        public ImagingSelectionInstanceComponent setImageRegion(List<ImageRegion2DComponent> theImageRegion) { 
945          this.imageRegion = theImageRegion;
946          return this;
947        }
948
949        public boolean hasImageRegion() { 
950          if (this.imageRegion == null)
951            return false;
952          for (ImageRegion2DComponent item : this.imageRegion)
953            if (!item.isEmpty())
954              return true;
955          return false;
956        }
957
958        public ImageRegion2DComponent addImageRegion() { //3
959          ImageRegion2DComponent t = new ImageRegion2DComponent();
960          if (this.imageRegion == null)
961            this.imageRegion = new ArrayList<ImageRegion2DComponent>();
962          this.imageRegion.add(t);
963          return t;
964        }
965
966        public ImagingSelectionInstanceComponent addImageRegion(ImageRegion2DComponent t) { //3
967          if (t == null)
968            return this;
969          if (this.imageRegion == null)
970            this.imageRegion = new ArrayList<ImageRegion2DComponent>();
971          this.imageRegion.add(t);
972          return this;
973        }
974
975        /**
976         * @return The first repetition of repeating field {@link #imageRegion}, creating it if it does not already exist {3}
977         */
978        public ImageRegion2DComponent getImageRegionFirstRep() { 
979          if (getImageRegion().isEmpty()) {
980            addImageRegion();
981          }
982          return getImageRegion().get(0);
983        }
984
985        protected void listChildren(List<Property> children) {
986          super.listChildren(children);
987          children.add(new Property("uid", "id", "The SOP Instance UID for the selected DICOM instance.", 0, 1, uid));
988          children.add(new Property("number", "unsignedInt", "The Instance Number for the selected DICOM instance.", 0, 1, number));
989          children.add(new Property("sopClass", "Coding", "The SOP Class UID for the selected DICOM instance.", 0, 1, sopClass));
990          children.add(new Property("subset", "string", "Selected subset of the SOP Instance. The content and format of the subset item is determined by the SOP Class of the selected instance.\n       May be one of:\n       - A list of frame numbers selected from a multiframe SOP Instance.\n       - A list of Content Item Observation UID values selected from a DICOM SR or other structured document SOP Instance.\n       - A list of segment numbers selected from a segmentation SOP Instance.\n       - A list of Region of Interest (ROI) numbers selected from a radiotherapy structure set SOP Instance.", 0, java.lang.Integer.MAX_VALUE, subset));
991          children.add(new Property("imageRegion", "", "Each imaging selection instance or frame list might includes an image region, specified by a region type and a set of 2D coordinates.\n       If the parent imagingSelection.instance contains a subset element of type frame, the image region applies to all frames in the subset list.", 0, java.lang.Integer.MAX_VALUE, imageRegion));
992        }
993
994        @Override
995        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
996          switch (_hash) {
997          case 115792: /*uid*/  return new Property("uid", "id", "The SOP Instance UID for the selected DICOM instance.", 0, 1, uid);
998          case -1034364087: /*number*/  return new Property("number", "unsignedInt", "The Instance Number for the selected DICOM instance.", 0, 1, number);
999          case 1560041540: /*sopClass*/  return new Property("sopClass", "Coding", "The SOP Class UID for the selected DICOM instance.", 0, 1, sopClass);
1000          case -891529694: /*subset*/  return new Property("subset", "string", "Selected subset of the SOP Instance. The content and format of the subset item is determined by the SOP Class of the selected instance.\n       May be one of:\n       - A list of frame numbers selected from a multiframe SOP Instance.\n       - A list of Content Item Observation UID values selected from a DICOM SR or other structured document SOP Instance.\n       - A list of segment numbers selected from a segmentation SOP Instance.\n       - A list of Region of Interest (ROI) numbers selected from a radiotherapy structure set SOP Instance.", 0, java.lang.Integer.MAX_VALUE, subset);
1001          case 2132544559: /*imageRegion*/  return new Property("imageRegion", "", "Each imaging selection instance or frame list might includes an image region, specified by a region type and a set of 2D coordinates.\n       If the parent imagingSelection.instance contains a subset element of type frame, the image region applies to all frames in the subset list.", 0, java.lang.Integer.MAX_VALUE, imageRegion);
1002          default: return super.getNamedProperty(_hash, _name, _checkValid);
1003          }
1004
1005        }
1006
1007      @Override
1008      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1009        switch (hash) {
1010        case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // IdType
1011        case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // UnsignedIntType
1012        case 1560041540: /*sopClass*/ return this.sopClass == null ? new Base[0] : new Base[] {this.sopClass}; // Coding
1013        case -891529694: /*subset*/ return this.subset == null ? new Base[0] : this.subset.toArray(new Base[this.subset.size()]); // StringType
1014        case 2132544559: /*imageRegion*/ return this.imageRegion == null ? new Base[0] : this.imageRegion.toArray(new Base[this.imageRegion.size()]); // ImageRegion2DComponent
1015        default: return super.getProperty(hash, name, checkValid);
1016        }
1017
1018      }
1019
1020      @Override
1021      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1022        switch (hash) {
1023        case 115792: // uid
1024          this.uid = TypeConvertor.castToId(value); // IdType
1025          return value;
1026        case -1034364087: // number
1027          this.number = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1028          return value;
1029        case 1560041540: // sopClass
1030          this.sopClass = TypeConvertor.castToCoding(value); // Coding
1031          return value;
1032        case -891529694: // subset
1033          this.getSubset().add(TypeConvertor.castToString(value)); // StringType
1034          return value;
1035        case 2132544559: // imageRegion
1036          this.getImageRegion().add((ImageRegion2DComponent) value); // ImageRegion2DComponent
1037          return value;
1038        default: return super.setProperty(hash, name, value);
1039        }
1040
1041      }
1042
1043      @Override
1044      public Base setProperty(String name, Base value) throws FHIRException {
1045        if (name.equals("uid")) {
1046          this.uid = TypeConvertor.castToId(value); // IdType
1047        } else if (name.equals("number")) {
1048          this.number = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1049        } else if (name.equals("sopClass")) {
1050          this.sopClass = TypeConvertor.castToCoding(value); // Coding
1051        } else if (name.equals("subset")) {
1052          this.getSubset().add(TypeConvertor.castToString(value));
1053        } else if (name.equals("imageRegion")) {
1054          this.getImageRegion().add((ImageRegion2DComponent) value);
1055        } else
1056          return super.setProperty(name, value);
1057        return value;
1058      }
1059
1060      @Override
1061      public Base makeProperty(int hash, String name) throws FHIRException {
1062        switch (hash) {
1063        case 115792:  return getUidElement();
1064        case -1034364087:  return getNumberElement();
1065        case 1560041540:  return getSopClass();
1066        case -891529694:  return addSubsetElement();
1067        case 2132544559:  return addImageRegion(); 
1068        default: return super.makeProperty(hash, name);
1069        }
1070
1071      }
1072
1073      @Override
1074      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1075        switch (hash) {
1076        case 115792: /*uid*/ return new String[] {"id"};
1077        case -1034364087: /*number*/ return new String[] {"unsignedInt"};
1078        case 1560041540: /*sopClass*/ return new String[] {"Coding"};
1079        case -891529694: /*subset*/ return new String[] {"string"};
1080        case 2132544559: /*imageRegion*/ return new String[] {};
1081        default: return super.getTypesForProperty(hash, name);
1082        }
1083
1084      }
1085
1086      @Override
1087      public Base addChild(String name) throws FHIRException {
1088        if (name.equals("uid")) {
1089          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.instance.uid");
1090        }
1091        else if (name.equals("number")) {
1092          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.instance.number");
1093        }
1094        else if (name.equals("sopClass")) {
1095          this.sopClass = new Coding();
1096          return this.sopClass;
1097        }
1098        else if (name.equals("subset")) {
1099          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.instance.subset");
1100        }
1101        else if (name.equals("imageRegion")) {
1102          return addImageRegion();
1103        }
1104        else
1105          return super.addChild(name);
1106      }
1107
1108      public ImagingSelectionInstanceComponent copy() {
1109        ImagingSelectionInstanceComponent dst = new ImagingSelectionInstanceComponent();
1110        copyValues(dst);
1111        return dst;
1112      }
1113
1114      public void copyValues(ImagingSelectionInstanceComponent dst) {
1115        super.copyValues(dst);
1116        dst.uid = uid == null ? null : uid.copy();
1117        dst.number = number == null ? null : number.copy();
1118        dst.sopClass = sopClass == null ? null : sopClass.copy();
1119        if (subset != null) {
1120          dst.subset = new ArrayList<StringType>();
1121          for (StringType i : subset)
1122            dst.subset.add(i.copy());
1123        };
1124        if (imageRegion != null) {
1125          dst.imageRegion = new ArrayList<ImageRegion2DComponent>();
1126          for (ImageRegion2DComponent i : imageRegion)
1127            dst.imageRegion.add(i.copy());
1128        };
1129      }
1130
1131      @Override
1132      public boolean equalsDeep(Base other_) {
1133        if (!super.equalsDeep(other_))
1134          return false;
1135        if (!(other_ instanceof ImagingSelectionInstanceComponent))
1136          return false;
1137        ImagingSelectionInstanceComponent o = (ImagingSelectionInstanceComponent) other_;
1138        return compareDeep(uid, o.uid, true) && compareDeep(number, o.number, true) && compareDeep(sopClass, o.sopClass, true)
1139           && compareDeep(subset, o.subset, true) && compareDeep(imageRegion, o.imageRegion, true);
1140      }
1141
1142      @Override
1143      public boolean equalsShallow(Base other_) {
1144        if (!super.equalsShallow(other_))
1145          return false;
1146        if (!(other_ instanceof ImagingSelectionInstanceComponent))
1147          return false;
1148        ImagingSelectionInstanceComponent o = (ImagingSelectionInstanceComponent) other_;
1149        return compareValues(uid, o.uid, true) && compareValues(number, o.number, true) && compareValues(subset, o.subset, true)
1150          ;
1151      }
1152
1153      public boolean isEmpty() {
1154        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(uid, number, sopClass, subset
1155          , imageRegion);
1156      }
1157
1158  public String fhirType() {
1159    return "ImagingSelection.instance";
1160
1161  }
1162
1163  }
1164
1165    @Block()
1166    public static class ImageRegion2DComponent extends BackboneElement implements IBaseBackboneElement {
1167        /**
1168         * Specifies the type of image region.
1169         */
1170        @Child(name = "regionType", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1171        @Description(shortDefinition="point | polyline | interpolated | circle | ellipse", formalDefinition="Specifies the type of image region." )
1172        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/imagingselection-2dgraphictype")
1173        protected Enumeration<ImagingSelection2DGraphicType> regionType;
1174
1175        /**
1176         * The coordinates describing the image region. Encoded as a set of (column, row) pairs that denote positions in the selected image / frames specified with sub-pixel resolution.
1177       The origin at the TLHC of the TLHC pixel is 0.0\0.0, the BRHC of the TLHC pixel is 1.0\1.0, and the BRHC of the BRHC pixel is the number of columns\rows in the image / frames. The values must be within the range 0\0 to the number of columns\rows in the image / frames.
1178         */
1179        @Child(name = "coordinate", type = {DecimalType.class}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1180        @Description(shortDefinition="Specifies the coordinates that define the image region", formalDefinition="The coordinates describing the image region. Encoded as a set of (column, row) pairs that denote positions in the selected image / frames specified with sub-pixel resolution.\n       The origin at the TLHC of the TLHC pixel is 0.0\\0.0, the BRHC of the TLHC pixel is 1.0\\1.0, and the BRHC of the BRHC pixel is the number of columns\\rows in the image / frames. The values must be within the range 0\\0 to the number of columns\\rows in the image / frames." )
1181        protected List<DecimalType> coordinate;
1182
1183        private static final long serialVersionUID = 1518695052L;
1184
1185    /**
1186     * Constructor
1187     */
1188      public ImageRegion2DComponent() {
1189        super();
1190      }
1191
1192    /**
1193     * Constructor
1194     */
1195      public ImageRegion2DComponent(ImagingSelection2DGraphicType regionType, BigDecimal coordinate) {
1196        super();
1197        this.setRegionType(regionType);
1198        this.addCoordinate(coordinate);
1199      }
1200
1201        /**
1202         * @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
1203         */
1204        public Enumeration<ImagingSelection2DGraphicType> getRegionTypeElement() { 
1205          if (this.regionType == null)
1206            if (Configuration.errorOnAutoCreate())
1207              throw new Error("Attempt to auto-create ImageRegion2DComponent.regionType");
1208            else if (Configuration.doAutoCreate())
1209              this.regionType = new Enumeration<ImagingSelection2DGraphicType>(new ImagingSelection2DGraphicTypeEnumFactory()); // bb
1210          return this.regionType;
1211        }
1212
1213        public boolean hasRegionTypeElement() { 
1214          return this.regionType != null && !this.regionType.isEmpty();
1215        }
1216
1217        public boolean hasRegionType() { 
1218          return this.regionType != null && !this.regionType.isEmpty();
1219        }
1220
1221        /**
1222         * @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
1223         */
1224        public ImageRegion2DComponent setRegionTypeElement(Enumeration<ImagingSelection2DGraphicType> value) { 
1225          this.regionType = value;
1226          return this;
1227        }
1228
1229        /**
1230         * @return Specifies the type of image region.
1231         */
1232        public ImagingSelection2DGraphicType getRegionType() { 
1233          return this.regionType == null ? null : this.regionType.getValue();
1234        }
1235
1236        /**
1237         * @param value Specifies the type of image region.
1238         */
1239        public ImageRegion2DComponent setRegionType(ImagingSelection2DGraphicType value) { 
1240            if (this.regionType == null)
1241              this.regionType = new Enumeration<ImagingSelection2DGraphicType>(new ImagingSelection2DGraphicTypeEnumFactory());
1242            this.regionType.setValue(value);
1243          return this;
1244        }
1245
1246        /**
1247         * @return {@link #coordinate} (The coordinates describing the image region. Encoded as a set of (column, row) pairs that denote positions in the selected image / frames specified with sub-pixel resolution.
1248       The origin at the TLHC of the TLHC pixel is 0.0\0.0, the BRHC of the TLHC pixel is 1.0\1.0, and the BRHC of the BRHC pixel is the number of columns\rows in the image / frames. The values must be within the range 0\0 to the number of columns\rows in the image / frames.)
1249         */
1250        public List<DecimalType> getCoordinate() { 
1251          if (this.coordinate == null)
1252            this.coordinate = new ArrayList<DecimalType>();
1253          return this.coordinate;
1254        }
1255
1256        /**
1257         * @return Returns a reference to <code>this</code> for easy method chaining
1258         */
1259        public ImageRegion2DComponent setCoordinate(List<DecimalType> theCoordinate) { 
1260          this.coordinate = theCoordinate;
1261          return this;
1262        }
1263
1264        public boolean hasCoordinate() { 
1265          if (this.coordinate == null)
1266            return false;
1267          for (DecimalType item : this.coordinate)
1268            if (!item.isEmpty())
1269              return true;
1270          return false;
1271        }
1272
1273        /**
1274         * @return {@link #coordinate} (The coordinates describing the image region. Encoded as a set of (column, row) pairs that denote positions in the selected image / frames specified with sub-pixel resolution.
1275       The origin at the TLHC of the TLHC pixel is 0.0\0.0, the BRHC of the TLHC pixel is 1.0\1.0, and the BRHC of the BRHC pixel is the number of columns\rows in the image / frames. The values must be within the range 0\0 to the number of columns\rows in the image / frames.)
1276         */
1277        public DecimalType addCoordinateElement() {//2 
1278          DecimalType t = new DecimalType();
1279          if (this.coordinate == null)
1280            this.coordinate = new ArrayList<DecimalType>();
1281          this.coordinate.add(t);
1282          return t;
1283        }
1284
1285        /**
1286         * @param value {@link #coordinate} (The coordinates describing the image region. Encoded as a set of (column, row) pairs that denote positions in the selected image / frames specified with sub-pixel resolution.
1287       The origin at the TLHC of the TLHC pixel is 0.0\0.0, the BRHC of the TLHC pixel is 1.0\1.0, and the BRHC of the BRHC pixel is the number of columns\rows in the image / frames. The values must be within the range 0\0 to the number of columns\rows in the image / frames.)
1288         */
1289        public ImageRegion2DComponent addCoordinate(BigDecimal value) { //1
1290          DecimalType t = new DecimalType();
1291          t.setValue(value);
1292          if (this.coordinate == null)
1293            this.coordinate = new ArrayList<DecimalType>();
1294          this.coordinate.add(t);
1295          return this;
1296        }
1297
1298        /**
1299         * @param value {@link #coordinate} (The coordinates describing the image region. Encoded as a set of (column, row) pairs that denote positions in the selected image / frames specified with sub-pixel resolution.
1300       The origin at the TLHC of the TLHC pixel is 0.0\0.0, the BRHC of the TLHC pixel is 1.0\1.0, and the BRHC of the BRHC pixel is the number of columns\rows in the image / frames. The values must be within the range 0\0 to the number of columns\rows in the image / frames.)
1301         */
1302        public boolean hasCoordinate(BigDecimal value) { 
1303          if (this.coordinate == null)
1304            return false;
1305          for (DecimalType v : this.coordinate)
1306            if (v.getValue().equals(value)) // decimal
1307              return true;
1308          return false;
1309        }
1310
1311        protected void listChildren(List<Property> children) {
1312          super.listChildren(children);
1313          children.add(new Property("regionType", "code", "Specifies the type of image region.", 0, 1, regionType));
1314          children.add(new Property("coordinate", "decimal", "The coordinates describing the image region. Encoded as a set of (column, row) pairs that denote positions in the selected image / frames specified with sub-pixel resolution.\n       The origin at the TLHC of the TLHC pixel is 0.0\\0.0, the BRHC of the TLHC pixel is 1.0\\1.0, and the BRHC of the BRHC pixel is the number of columns\\rows in the image / frames. The values must be within the range 0\\0 to the number of columns\\rows in the image / frames.", 0, java.lang.Integer.MAX_VALUE, coordinate));
1315        }
1316
1317        @Override
1318        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1319          switch (_hash) {
1320          case -1990487986: /*regionType*/  return new Property("regionType", "code", "Specifies the type of image region.", 0, 1, regionType);
1321          case 198931832: /*coordinate*/  return new Property("coordinate", "decimal", "The coordinates describing the image region. Encoded as a set of (column, row) pairs that denote positions in the selected image / frames specified with sub-pixel resolution.\n       The origin at the TLHC of the TLHC pixel is 0.0\\0.0, the BRHC of the TLHC pixel is 1.0\\1.0, and the BRHC of the BRHC pixel is the number of columns\\rows in the image / frames. The values must be within the range 0\\0 to the number of columns\\rows in the image / frames.", 0, java.lang.Integer.MAX_VALUE, coordinate);
1322          default: return super.getNamedProperty(_hash, _name, _checkValid);
1323          }
1324
1325        }
1326
1327      @Override
1328      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1329        switch (hash) {
1330        case -1990487986: /*regionType*/ return this.regionType == null ? new Base[0] : new Base[] {this.regionType}; // Enumeration<ImagingSelection2DGraphicType>
1331        case 198931832: /*coordinate*/ return this.coordinate == null ? new Base[0] : this.coordinate.toArray(new Base[this.coordinate.size()]); // DecimalType
1332        default: return super.getProperty(hash, name, checkValid);
1333        }
1334
1335      }
1336
1337      @Override
1338      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1339        switch (hash) {
1340        case -1990487986: // regionType
1341          value = new ImagingSelection2DGraphicTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1342          this.regionType = (Enumeration) value; // Enumeration<ImagingSelection2DGraphicType>
1343          return value;
1344        case 198931832: // coordinate
1345          this.getCoordinate().add(TypeConvertor.castToDecimal(value)); // DecimalType
1346          return value;
1347        default: return super.setProperty(hash, name, value);
1348        }
1349
1350      }
1351
1352      @Override
1353      public Base setProperty(String name, Base value) throws FHIRException {
1354        if (name.equals("regionType")) {
1355          value = new ImagingSelection2DGraphicTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1356          this.regionType = (Enumeration) value; // Enumeration<ImagingSelection2DGraphicType>
1357        } else if (name.equals("coordinate")) {
1358          this.getCoordinate().add(TypeConvertor.castToDecimal(value));
1359        } else
1360          return super.setProperty(name, value);
1361        return value;
1362      }
1363
1364      @Override
1365      public Base makeProperty(int hash, String name) throws FHIRException {
1366        switch (hash) {
1367        case -1990487986:  return getRegionTypeElement();
1368        case 198931832:  return addCoordinateElement();
1369        default: return super.makeProperty(hash, name);
1370        }
1371
1372      }
1373
1374      @Override
1375      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1376        switch (hash) {
1377        case -1990487986: /*regionType*/ return new String[] {"code"};
1378        case 198931832: /*coordinate*/ return new String[] {"decimal"};
1379        default: return super.getTypesForProperty(hash, name);
1380        }
1381
1382      }
1383
1384      @Override
1385      public Base addChild(String name) throws FHIRException {
1386        if (name.equals("regionType")) {
1387          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.instance.imageRegion.regionType");
1388        }
1389        else if (name.equals("coordinate")) {
1390          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.instance.imageRegion.coordinate");
1391        }
1392        else
1393          return super.addChild(name);
1394      }
1395
1396      public ImageRegion2DComponent copy() {
1397        ImageRegion2DComponent dst = new ImageRegion2DComponent();
1398        copyValues(dst);
1399        return dst;
1400      }
1401
1402      public void copyValues(ImageRegion2DComponent dst) {
1403        super.copyValues(dst);
1404        dst.regionType = regionType == null ? null : regionType.copy();
1405        if (coordinate != null) {
1406          dst.coordinate = new ArrayList<DecimalType>();
1407          for (DecimalType i : coordinate)
1408            dst.coordinate.add(i.copy());
1409        };
1410      }
1411
1412      @Override
1413      public boolean equalsDeep(Base other_) {
1414        if (!super.equalsDeep(other_))
1415          return false;
1416        if (!(other_ instanceof ImageRegion2DComponent))
1417          return false;
1418        ImageRegion2DComponent o = (ImageRegion2DComponent) other_;
1419        return compareDeep(regionType, o.regionType, true) && compareDeep(coordinate, o.coordinate, true)
1420          ;
1421      }
1422
1423      @Override
1424      public boolean equalsShallow(Base other_) {
1425        if (!super.equalsShallow(other_))
1426          return false;
1427        if (!(other_ instanceof ImageRegion2DComponent))
1428          return false;
1429        ImageRegion2DComponent o = (ImageRegion2DComponent) other_;
1430        return compareValues(regionType, o.regionType, true) && compareValues(coordinate, o.coordinate, true)
1431          ;
1432      }
1433
1434      public boolean isEmpty() {
1435        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(regionType, coordinate);
1436      }
1437
1438  public String fhirType() {
1439    return "ImagingSelection.instance.imageRegion";
1440
1441  }
1442
1443  }
1444
1445    @Block()
1446    public static class ImageRegion3DComponent extends BackboneElement implements IBaseBackboneElement {
1447        /**
1448         * Specifies the type of image region.
1449         */
1450        @Child(name = "regionType", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1451        @Description(shortDefinition="point | multipoint | polyline | polygon | ellipse | ellipsoid", formalDefinition="Specifies the type of image region." )
1452        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/imagingselection-3dgraphictype")
1453        protected Enumeration<ImagingSelection3DGraphicType> regionType;
1454
1455        /**
1456         * The coordinates describing the image region. Encoded as an ordered set of (x,y,z) triplets (in mm and may be negative) that define a region of interest in the patient-relative Reference Coordinate System defined by ImagingSelection.frameOfReferenceUid element.
1457         */
1458        @Child(name = "coordinate", type = {DecimalType.class}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1459        @Description(shortDefinition="Specifies the coordinates that define the image region", formalDefinition="The coordinates describing the image region. Encoded as an ordered set of (x,y,z) triplets (in mm and may be negative) that define a region of interest in the patient-relative Reference Coordinate System defined by ImagingSelection.frameOfReferenceUid element." )
1460        protected List<DecimalType> coordinate;
1461
1462        private static final long serialVersionUID = 1532227853L;
1463
1464    /**
1465     * Constructor
1466     */
1467      public ImageRegion3DComponent() {
1468        super();
1469      }
1470
1471    /**
1472     * Constructor
1473     */
1474      public ImageRegion3DComponent(ImagingSelection3DGraphicType regionType, BigDecimal coordinate) {
1475        super();
1476        this.setRegionType(regionType);
1477        this.addCoordinate(coordinate);
1478      }
1479
1480        /**
1481         * @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
1482         */
1483        public Enumeration<ImagingSelection3DGraphicType> getRegionTypeElement() { 
1484          if (this.regionType == null)
1485            if (Configuration.errorOnAutoCreate())
1486              throw new Error("Attempt to auto-create ImageRegion3DComponent.regionType");
1487            else if (Configuration.doAutoCreate())
1488              this.regionType = new Enumeration<ImagingSelection3DGraphicType>(new ImagingSelection3DGraphicTypeEnumFactory()); // bb
1489          return this.regionType;
1490        }
1491
1492        public boolean hasRegionTypeElement() { 
1493          return this.regionType != null && !this.regionType.isEmpty();
1494        }
1495
1496        public boolean hasRegionType() { 
1497          return this.regionType != null && !this.regionType.isEmpty();
1498        }
1499
1500        /**
1501         * @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
1502         */
1503        public ImageRegion3DComponent setRegionTypeElement(Enumeration<ImagingSelection3DGraphicType> value) { 
1504          this.regionType = value;
1505          return this;
1506        }
1507
1508        /**
1509         * @return Specifies the type of image region.
1510         */
1511        public ImagingSelection3DGraphicType getRegionType() { 
1512          return this.regionType == null ? null : this.regionType.getValue();
1513        }
1514
1515        /**
1516         * @param value Specifies the type of image region.
1517         */
1518        public ImageRegion3DComponent setRegionType(ImagingSelection3DGraphicType value) { 
1519            if (this.regionType == null)
1520              this.regionType = new Enumeration<ImagingSelection3DGraphicType>(new ImagingSelection3DGraphicTypeEnumFactory());
1521            this.regionType.setValue(value);
1522          return this;
1523        }
1524
1525        /**
1526         * @return {@link #coordinate} (The coordinates describing the image region. Encoded as an ordered set of (x,y,z) triplets (in mm and may be negative) that define a region of interest in the patient-relative Reference Coordinate System defined by ImagingSelection.frameOfReferenceUid element.)
1527         */
1528        public List<DecimalType> getCoordinate() { 
1529          if (this.coordinate == null)
1530            this.coordinate = new ArrayList<DecimalType>();
1531          return this.coordinate;
1532        }
1533
1534        /**
1535         * @return Returns a reference to <code>this</code> for easy method chaining
1536         */
1537        public ImageRegion3DComponent setCoordinate(List<DecimalType> theCoordinate) { 
1538          this.coordinate = theCoordinate;
1539          return this;
1540        }
1541
1542        public boolean hasCoordinate() { 
1543          if (this.coordinate == null)
1544            return false;
1545          for (DecimalType item : this.coordinate)
1546            if (!item.isEmpty())
1547              return true;
1548          return false;
1549        }
1550
1551        /**
1552         * @return {@link #coordinate} (The coordinates describing the image region. Encoded as an ordered set of (x,y,z) triplets (in mm and may be negative) that define a region of interest in the patient-relative Reference Coordinate System defined by ImagingSelection.frameOfReferenceUid element.)
1553         */
1554        public DecimalType addCoordinateElement() {//2 
1555          DecimalType t = new DecimalType();
1556          if (this.coordinate == null)
1557            this.coordinate = new ArrayList<DecimalType>();
1558          this.coordinate.add(t);
1559          return t;
1560        }
1561
1562        /**
1563         * @param value {@link #coordinate} (The coordinates describing the image region. Encoded as an ordered set of (x,y,z) triplets (in mm and may be negative) that define a region of interest in the patient-relative Reference Coordinate System defined by ImagingSelection.frameOfReferenceUid element.)
1564         */
1565        public ImageRegion3DComponent addCoordinate(BigDecimal value) { //1
1566          DecimalType t = new DecimalType();
1567          t.setValue(value);
1568          if (this.coordinate == null)
1569            this.coordinate = new ArrayList<DecimalType>();
1570          this.coordinate.add(t);
1571          return this;
1572        }
1573
1574        /**
1575         * @param value {@link #coordinate} (The coordinates describing the image region. Encoded as an ordered set of (x,y,z) triplets (in mm and may be negative) that define a region of interest in the patient-relative Reference Coordinate System defined by ImagingSelection.frameOfReferenceUid element.)
1576         */
1577        public boolean hasCoordinate(BigDecimal value) { 
1578          if (this.coordinate == null)
1579            return false;
1580          for (DecimalType v : this.coordinate)
1581            if (v.getValue().equals(value)) // decimal
1582              return true;
1583          return false;
1584        }
1585
1586        protected void listChildren(List<Property> children) {
1587          super.listChildren(children);
1588          children.add(new Property("regionType", "code", "Specifies the type of image region.", 0, 1, regionType));
1589          children.add(new Property("coordinate", "decimal", "The coordinates describing the image region. Encoded as an ordered set of (x,y,z) triplets (in mm and may be negative) that define a region of interest in the patient-relative Reference Coordinate System defined by ImagingSelection.frameOfReferenceUid element.", 0, java.lang.Integer.MAX_VALUE, coordinate));
1590        }
1591
1592        @Override
1593        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1594          switch (_hash) {
1595          case -1990487986: /*regionType*/  return new Property("regionType", "code", "Specifies the type of image region.", 0, 1, regionType);
1596          case 198931832: /*coordinate*/  return new Property("coordinate", "decimal", "The coordinates describing the image region. Encoded as an ordered set of (x,y,z) triplets (in mm and may be negative) that define a region of interest in the patient-relative Reference Coordinate System defined by ImagingSelection.frameOfReferenceUid element.", 0, java.lang.Integer.MAX_VALUE, coordinate);
1597          default: return super.getNamedProperty(_hash, _name, _checkValid);
1598          }
1599
1600        }
1601
1602      @Override
1603      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1604        switch (hash) {
1605        case -1990487986: /*regionType*/ return this.regionType == null ? new Base[0] : new Base[] {this.regionType}; // Enumeration<ImagingSelection3DGraphicType>
1606        case 198931832: /*coordinate*/ return this.coordinate == null ? new Base[0] : this.coordinate.toArray(new Base[this.coordinate.size()]); // DecimalType
1607        default: return super.getProperty(hash, name, checkValid);
1608        }
1609
1610      }
1611
1612      @Override
1613      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1614        switch (hash) {
1615        case -1990487986: // regionType
1616          value = new ImagingSelection3DGraphicTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1617          this.regionType = (Enumeration) value; // Enumeration<ImagingSelection3DGraphicType>
1618          return value;
1619        case 198931832: // coordinate
1620          this.getCoordinate().add(TypeConvertor.castToDecimal(value)); // DecimalType
1621          return value;
1622        default: return super.setProperty(hash, name, value);
1623        }
1624
1625      }
1626
1627      @Override
1628      public Base setProperty(String name, Base value) throws FHIRException {
1629        if (name.equals("regionType")) {
1630          value = new ImagingSelection3DGraphicTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1631          this.regionType = (Enumeration) value; // Enumeration<ImagingSelection3DGraphicType>
1632        } else if (name.equals("coordinate")) {
1633          this.getCoordinate().add(TypeConvertor.castToDecimal(value));
1634        } else
1635          return super.setProperty(name, value);
1636        return value;
1637      }
1638
1639      @Override
1640      public Base makeProperty(int hash, String name) throws FHIRException {
1641        switch (hash) {
1642        case -1990487986:  return getRegionTypeElement();
1643        case 198931832:  return addCoordinateElement();
1644        default: return super.makeProperty(hash, name);
1645        }
1646
1647      }
1648
1649      @Override
1650      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1651        switch (hash) {
1652        case -1990487986: /*regionType*/ return new String[] {"code"};
1653        case 198931832: /*coordinate*/ return new String[] {"decimal"};
1654        default: return super.getTypesForProperty(hash, name);
1655        }
1656
1657      }
1658
1659      @Override
1660      public Base addChild(String name) throws FHIRException {
1661        if (name.equals("regionType")) {
1662          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.imageRegion.regionType");
1663        }
1664        else if (name.equals("coordinate")) {
1665          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.imageRegion.coordinate");
1666        }
1667        else
1668          return super.addChild(name);
1669      }
1670
1671      public ImageRegion3DComponent copy() {
1672        ImageRegion3DComponent dst = new ImageRegion3DComponent();
1673        copyValues(dst);
1674        return dst;
1675      }
1676
1677      public void copyValues(ImageRegion3DComponent dst) {
1678        super.copyValues(dst);
1679        dst.regionType = regionType == null ? null : regionType.copy();
1680        if (coordinate != null) {
1681          dst.coordinate = new ArrayList<DecimalType>();
1682          for (DecimalType i : coordinate)
1683            dst.coordinate.add(i.copy());
1684        };
1685      }
1686
1687      @Override
1688      public boolean equalsDeep(Base other_) {
1689        if (!super.equalsDeep(other_))
1690          return false;
1691        if (!(other_ instanceof ImageRegion3DComponent))
1692          return false;
1693        ImageRegion3DComponent o = (ImageRegion3DComponent) other_;
1694        return compareDeep(regionType, o.regionType, true) && compareDeep(coordinate, o.coordinate, true)
1695          ;
1696      }
1697
1698      @Override
1699      public boolean equalsShallow(Base other_) {
1700        if (!super.equalsShallow(other_))
1701          return false;
1702        if (!(other_ instanceof ImageRegion3DComponent))
1703          return false;
1704        ImageRegion3DComponent o = (ImageRegion3DComponent) other_;
1705        return compareValues(regionType, o.regionType, true) && compareValues(coordinate, o.coordinate, true)
1706          ;
1707      }
1708
1709      public boolean isEmpty() {
1710        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(regionType, coordinate);
1711      }
1712
1713  public String fhirType() {
1714    return "ImagingSelection.imageRegion";
1715
1716  }
1717
1718  }
1719
1720    /**
1721     * A unique identifier assigned to this imaging selection.
1722     */
1723    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1724    @Description(shortDefinition="Business Identifier for Imaging Selection", formalDefinition="A unique identifier assigned to this imaging selection." )
1725    protected List<Identifier> identifier;
1726
1727    /**
1728     * The current state of the ImagingSelection resource. This is not the status of any ImagingStudy, ServiceRequest, or Task resources associated with the ImagingSelection.
1729     */
1730    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
1731    @Description(shortDefinition="available | entered-in-error | unknown", formalDefinition="The current state of the ImagingSelection resource. This is not the status of any ImagingStudy, ServiceRequest, or Task resources associated with the ImagingSelection." )
1732    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/imagingselection-status")
1733    protected Enumeration<ImagingSelectionStatus> status;
1734
1735    /**
1736     * 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.
1737     */
1738    @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)
1739    @Description(shortDefinition="Subject of the selected instances", 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." )
1740    protected Reference subject;
1741
1742    /**
1743     * The date and time this imaging selection was created.
1744     */
1745    @Child(name = "issued", type = {InstantType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1746    @Description(shortDefinition="Date / Time when this imaging selection was created", formalDefinition="The date and time this imaging selection was created." )
1747    protected InstantType issued;
1748
1749    /**
1750     * Selector of the instances – human or machine.
1751     */
1752    @Child(name = "performer", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1753    @Description(shortDefinition="Selector of the instances (human or machine)", formalDefinition="Selector of the instances – human or machine." )
1754    protected List<ImagingSelectionPerformerComponent> performer;
1755
1756    /**
1757     * A list of the diagnostic requests that resulted in this imaging selection being performed.
1758     */
1759    @Child(name = "basedOn", type = {CarePlan.class, ServiceRequest.class, Appointment.class, AppointmentResponse.class, Task.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1760    @Description(shortDefinition="Associated request", formalDefinition="A list of the diagnostic requests that resulted in this imaging selection being performed." )
1761    protected List<Reference> basedOn;
1762
1763    /**
1764     * Classifies the imaging selection.
1765     */
1766    @Child(name = "category", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1767    @Description(shortDefinition="Classifies the imaging selection", formalDefinition="Classifies the imaging selection." )
1768    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://dicom.nema.org/medical/dicom/current/output/chtml/part16/sect_CID_7010.html")
1769    protected List<CodeableConcept> category;
1770
1771    /**
1772     * Reason for referencing the selected content.
1773     */
1774    @Child(name = "code", type = {CodeableConcept.class}, order=7, min=1, max=1, modifier=false, summary=true)
1775    @Description(shortDefinition="Imaging Selection purpose text or code", formalDefinition="Reason for referencing the selected content." )
1776    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://dicom.nema.org/medical/dicom/current/output/chtml/part16/sect_CID_7010.html")
1777    protected CodeableConcept code;
1778
1779    /**
1780     * The Study Instance UID for the DICOM Study from which the images were selected.
1781     */
1782    @Child(name = "studyUid", type = {IdType.class}, order=8, min=0, max=1, modifier=false, summary=true)
1783    @Description(shortDefinition="DICOM Study Instance UID", formalDefinition="The Study Instance UID for the DICOM Study from which the images were selected." )
1784    protected IdType studyUid;
1785
1786    /**
1787     * The imaging study from which the imaging selection is made.
1788     */
1789    @Child(name = "derivedFrom", type = {ImagingStudy.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1790    @Description(shortDefinition="The imaging study from which the imaging selection is derived", formalDefinition="The imaging study from which the imaging selection is made." )
1791    protected List<Reference> derivedFrom;
1792
1793    /**
1794     * The network service providing retrieval access to the selected images, frames, etc. See implementation notes for information about using DICOM endpoints.
1795     */
1796    @Child(name = "endpoint", type = {Endpoint.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1797    @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." )
1798    protected List<Reference> endpoint;
1799
1800    /**
1801     * The Series Instance UID for the DICOM Series from which the images were selected.
1802     */
1803    @Child(name = "seriesUid", type = {IdType.class}, order=11, min=0, max=1, modifier=false, summary=true)
1804    @Description(shortDefinition="DICOM Series Instance UID", formalDefinition="The Series Instance UID for the DICOM Series from which the images were selected." )
1805    protected IdType seriesUid;
1806
1807    /**
1808     * The Series Number for the DICOM Series from which the images were selected.
1809     */
1810    @Child(name = "seriesNumber", type = {UnsignedIntType.class}, order=12, min=0, max=1, modifier=false, summary=true)
1811    @Description(shortDefinition="DICOM Series Number", formalDefinition="The Series Number for the DICOM Series from which the images were selected." )
1812    protected UnsignedIntType seriesNumber;
1813
1814    /**
1815     * The Frame of Reference UID identifying the coordinate system that conveys spatial and/or temporal information for the selected images or frames.
1816     */
1817    @Child(name = "frameOfReferenceUid", type = {IdType.class}, order=13, min=0, max=1, modifier=false, summary=true)
1818    @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." )
1819    protected IdType frameOfReferenceUid;
1820
1821    /**
1822     * 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.
1823     */
1824    @Child(name = "bodySite", type = {CodeableReference.class}, order=14, min=0, max=1, modifier=false, summary=true)
1825    @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." )
1826    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/body-site")
1827    protected CodeableReference bodySite;
1828
1829    /**
1830     * The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record.  The focus of an observation could also be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.
1831     */
1832    @Child(name = "focus", type = {ImagingSelection.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1833    @Description(shortDefinition="Related resource that is the focus for the imaging selection", formalDefinition="The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record.  The focus of an observation could also be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus." )
1834    protected List<Reference> focus;
1835
1836    /**
1837     * Each imaging selection includes one or more selected DICOM SOP instances.
1838     */
1839    @Child(name = "instance", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1840    @Description(shortDefinition="The selected instances", formalDefinition="Each imaging selection includes one or more selected DICOM SOP instances." )
1841    protected List<ImagingSelectionInstanceComponent> instance;
1842
1843    /**
1844     * Each imaging selection might includes a 3D image region, specified by a region type and a set of 3D coordinates.
1845     */
1846    @Child(name = "imageRegion", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1847    @Description(shortDefinition="A specific 3D region in a DICOM frame of reference", formalDefinition="Each imaging selection might includes a 3D image region, specified by a region type and a set of 3D coordinates." )
1848    protected List<ImageRegion3DComponent> imageRegion;
1849
1850    private static final long serialVersionUID = 1594179578L;
1851
1852  /**
1853   * Constructor
1854   */
1855    public ImagingSelection() {
1856      super();
1857    }
1858
1859  /**
1860   * Constructor
1861   */
1862    public ImagingSelection(ImagingSelectionStatus status, CodeableConcept code) {
1863      super();
1864      this.setStatus(status);
1865      this.setCode(code);
1866    }
1867
1868    /**
1869     * @return {@link #identifier} (A unique identifier assigned to this imaging selection.)
1870     */
1871    public List<Identifier> getIdentifier() { 
1872      if (this.identifier == null)
1873        this.identifier = new ArrayList<Identifier>();
1874      return this.identifier;
1875    }
1876
1877    /**
1878     * @return Returns a reference to <code>this</code> for easy method chaining
1879     */
1880    public ImagingSelection setIdentifier(List<Identifier> theIdentifier) { 
1881      this.identifier = theIdentifier;
1882      return this;
1883    }
1884
1885    public boolean hasIdentifier() { 
1886      if (this.identifier == null)
1887        return false;
1888      for (Identifier item : this.identifier)
1889        if (!item.isEmpty())
1890          return true;
1891      return false;
1892    }
1893
1894    public Identifier addIdentifier() { //3
1895      Identifier t = new Identifier();
1896      if (this.identifier == null)
1897        this.identifier = new ArrayList<Identifier>();
1898      this.identifier.add(t);
1899      return t;
1900    }
1901
1902    public ImagingSelection addIdentifier(Identifier t) { //3
1903      if (t == null)
1904        return this;
1905      if (this.identifier == null)
1906        this.identifier = new ArrayList<Identifier>();
1907      this.identifier.add(t);
1908      return this;
1909    }
1910
1911    /**
1912     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1913     */
1914    public Identifier getIdentifierFirstRep() { 
1915      if (getIdentifier().isEmpty()) {
1916        addIdentifier();
1917      }
1918      return getIdentifier().get(0);
1919    }
1920
1921    /**
1922     * @return {@link #status} (The current state of the ImagingSelection resource. This is not the status of any ImagingStudy, ServiceRequest, or Task resources associated with the ImagingSelection.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1923     */
1924    public Enumeration<ImagingSelectionStatus> getStatusElement() { 
1925      if (this.status == null)
1926        if (Configuration.errorOnAutoCreate())
1927          throw new Error("Attempt to auto-create ImagingSelection.status");
1928        else if (Configuration.doAutoCreate())
1929          this.status = new Enumeration<ImagingSelectionStatus>(new ImagingSelectionStatusEnumFactory()); // bb
1930      return this.status;
1931    }
1932
1933    public boolean hasStatusElement() { 
1934      return this.status != null && !this.status.isEmpty();
1935    }
1936
1937    public boolean hasStatus() { 
1938      return this.status != null && !this.status.isEmpty();
1939    }
1940
1941    /**
1942     * @param value {@link #status} (The current state of the ImagingSelection resource. This is not the status of any ImagingStudy, ServiceRequest, or Task resources associated with the ImagingSelection.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1943     */
1944    public ImagingSelection setStatusElement(Enumeration<ImagingSelectionStatus> value) { 
1945      this.status = value;
1946      return this;
1947    }
1948
1949    /**
1950     * @return The current state of the ImagingSelection resource. This is not the status of any ImagingStudy, ServiceRequest, or Task resources associated with the ImagingSelection.
1951     */
1952    public ImagingSelectionStatus getStatus() { 
1953      return this.status == null ? null : this.status.getValue();
1954    }
1955
1956    /**
1957     * @param value The current state of the ImagingSelection resource. This is not the status of any ImagingStudy, ServiceRequest, or Task resources associated with the ImagingSelection.
1958     */
1959    public ImagingSelection setStatus(ImagingSelectionStatus value) { 
1960        if (this.status == null)
1961          this.status = new Enumeration<ImagingSelectionStatus>(new ImagingSelectionStatusEnumFactory());
1962        this.status.setValue(value);
1963      return this;
1964    }
1965
1966    /**
1967     * @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.)
1968     */
1969    public Reference getSubject() { 
1970      if (this.subject == null)
1971        if (Configuration.errorOnAutoCreate())
1972          throw new Error("Attempt to auto-create ImagingSelection.subject");
1973        else if (Configuration.doAutoCreate())
1974          this.subject = new Reference(); // cc
1975      return this.subject;
1976    }
1977
1978    public boolean hasSubject() { 
1979      return this.subject != null && !this.subject.isEmpty();
1980    }
1981
1982    /**
1983     * @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.)
1984     */
1985    public ImagingSelection setSubject(Reference value) { 
1986      this.subject = value;
1987      return this;
1988    }
1989
1990    /**
1991     * @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
1992     */
1993    public InstantType getIssuedElement() { 
1994      if (this.issued == null)
1995        if (Configuration.errorOnAutoCreate())
1996          throw new Error("Attempt to auto-create ImagingSelection.issued");
1997        else if (Configuration.doAutoCreate())
1998          this.issued = new InstantType(); // bb
1999      return this.issued;
2000    }
2001
2002    public boolean hasIssuedElement() { 
2003      return this.issued != null && !this.issued.isEmpty();
2004    }
2005
2006    public boolean hasIssued() { 
2007      return this.issued != null && !this.issued.isEmpty();
2008    }
2009
2010    /**
2011     * @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
2012     */
2013    public ImagingSelection setIssuedElement(InstantType value) { 
2014      this.issued = value;
2015      return this;
2016    }
2017
2018    /**
2019     * @return The date and time this imaging selection was created.
2020     */
2021    public Date getIssued() { 
2022      return this.issued == null ? null : this.issued.getValue();
2023    }
2024
2025    /**
2026     * @param value The date and time this imaging selection was created.
2027     */
2028    public ImagingSelection setIssued(Date value) { 
2029      if (value == null)
2030        this.issued = null;
2031      else {
2032        if (this.issued == null)
2033          this.issued = new InstantType();
2034        this.issued.setValue(value);
2035      }
2036      return this;
2037    }
2038
2039    /**
2040     * @return {@link #performer} (Selector of the instances – human or machine.)
2041     */
2042    public List<ImagingSelectionPerformerComponent> getPerformer() { 
2043      if (this.performer == null)
2044        this.performer = new ArrayList<ImagingSelectionPerformerComponent>();
2045      return this.performer;
2046    }
2047
2048    /**
2049     * @return Returns a reference to <code>this</code> for easy method chaining
2050     */
2051    public ImagingSelection setPerformer(List<ImagingSelectionPerformerComponent> thePerformer) { 
2052      this.performer = thePerformer;
2053      return this;
2054    }
2055
2056    public boolean hasPerformer() { 
2057      if (this.performer == null)
2058        return false;
2059      for (ImagingSelectionPerformerComponent item : this.performer)
2060        if (!item.isEmpty())
2061          return true;
2062      return false;
2063    }
2064
2065    public ImagingSelectionPerformerComponent addPerformer() { //3
2066      ImagingSelectionPerformerComponent t = new ImagingSelectionPerformerComponent();
2067      if (this.performer == null)
2068        this.performer = new ArrayList<ImagingSelectionPerformerComponent>();
2069      this.performer.add(t);
2070      return t;
2071    }
2072
2073    public ImagingSelection addPerformer(ImagingSelectionPerformerComponent t) { //3
2074      if (t == null)
2075        return this;
2076      if (this.performer == null)
2077        this.performer = new ArrayList<ImagingSelectionPerformerComponent>();
2078      this.performer.add(t);
2079      return this;
2080    }
2081
2082    /**
2083     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist {3}
2084     */
2085    public ImagingSelectionPerformerComponent getPerformerFirstRep() { 
2086      if (getPerformer().isEmpty()) {
2087        addPerformer();
2088      }
2089      return getPerformer().get(0);
2090    }
2091
2092    /**
2093     * @return {@link #basedOn} (A list of the diagnostic requests that resulted in this imaging selection being performed.)
2094     */
2095    public List<Reference> getBasedOn() { 
2096      if (this.basedOn == null)
2097        this.basedOn = new ArrayList<Reference>();
2098      return this.basedOn;
2099    }
2100
2101    /**
2102     * @return Returns a reference to <code>this</code> for easy method chaining
2103     */
2104    public ImagingSelection setBasedOn(List<Reference> theBasedOn) { 
2105      this.basedOn = theBasedOn;
2106      return this;
2107    }
2108
2109    public boolean hasBasedOn() { 
2110      if (this.basedOn == null)
2111        return false;
2112      for (Reference item : this.basedOn)
2113        if (!item.isEmpty())
2114          return true;
2115      return false;
2116    }
2117
2118    public Reference addBasedOn() { //3
2119      Reference t = new Reference();
2120      if (this.basedOn == null)
2121        this.basedOn = new ArrayList<Reference>();
2122      this.basedOn.add(t);
2123      return t;
2124    }
2125
2126    public ImagingSelection addBasedOn(Reference t) { //3
2127      if (t == null)
2128        return this;
2129      if (this.basedOn == null)
2130        this.basedOn = new ArrayList<Reference>();
2131      this.basedOn.add(t);
2132      return this;
2133    }
2134
2135    /**
2136     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
2137     */
2138    public Reference getBasedOnFirstRep() { 
2139      if (getBasedOn().isEmpty()) {
2140        addBasedOn();
2141      }
2142      return getBasedOn().get(0);
2143    }
2144
2145    /**
2146     * @return {@link #category} (Classifies the imaging selection.)
2147     */
2148    public List<CodeableConcept> getCategory() { 
2149      if (this.category == null)
2150        this.category = new ArrayList<CodeableConcept>();
2151      return this.category;
2152    }
2153
2154    /**
2155     * @return Returns a reference to <code>this</code> for easy method chaining
2156     */
2157    public ImagingSelection setCategory(List<CodeableConcept> theCategory) { 
2158      this.category = theCategory;
2159      return this;
2160    }
2161
2162    public boolean hasCategory() { 
2163      if (this.category == null)
2164        return false;
2165      for (CodeableConcept item : this.category)
2166        if (!item.isEmpty())
2167          return true;
2168      return false;
2169    }
2170
2171    public CodeableConcept addCategory() { //3
2172      CodeableConcept t = new CodeableConcept();
2173      if (this.category == null)
2174        this.category = new ArrayList<CodeableConcept>();
2175      this.category.add(t);
2176      return t;
2177    }
2178
2179    public ImagingSelection addCategory(CodeableConcept t) { //3
2180      if (t == null)
2181        return this;
2182      if (this.category == null)
2183        this.category = new ArrayList<CodeableConcept>();
2184      this.category.add(t);
2185      return this;
2186    }
2187
2188    /**
2189     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
2190     */
2191    public CodeableConcept getCategoryFirstRep() { 
2192      if (getCategory().isEmpty()) {
2193        addCategory();
2194      }
2195      return getCategory().get(0);
2196    }
2197
2198    /**
2199     * @return {@link #code} (Reason for referencing the selected content.)
2200     */
2201    public CodeableConcept getCode() { 
2202      if (this.code == null)
2203        if (Configuration.errorOnAutoCreate())
2204          throw new Error("Attempt to auto-create ImagingSelection.code");
2205        else if (Configuration.doAutoCreate())
2206          this.code = new CodeableConcept(); // cc
2207      return this.code;
2208    }
2209
2210    public boolean hasCode() { 
2211      return this.code != null && !this.code.isEmpty();
2212    }
2213
2214    /**
2215     * @param value {@link #code} (Reason for referencing the selected content.)
2216     */
2217    public ImagingSelection setCode(CodeableConcept value) { 
2218      this.code = value;
2219      return this;
2220    }
2221
2222    /**
2223     * @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
2224     */
2225    public IdType getStudyUidElement() { 
2226      if (this.studyUid == null)
2227        if (Configuration.errorOnAutoCreate())
2228          throw new Error("Attempt to auto-create ImagingSelection.studyUid");
2229        else if (Configuration.doAutoCreate())
2230          this.studyUid = new IdType(); // bb
2231      return this.studyUid;
2232    }
2233
2234    public boolean hasStudyUidElement() { 
2235      return this.studyUid != null && !this.studyUid.isEmpty();
2236    }
2237
2238    public boolean hasStudyUid() { 
2239      return this.studyUid != null && !this.studyUid.isEmpty();
2240    }
2241
2242    /**
2243     * @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
2244     */
2245    public ImagingSelection setStudyUidElement(IdType value) { 
2246      this.studyUid = value;
2247      return this;
2248    }
2249
2250    /**
2251     * @return The Study Instance UID for the DICOM Study from which the images were selected.
2252     */
2253    public String getStudyUid() { 
2254      return this.studyUid == null ? null : this.studyUid.getValue();
2255    }
2256
2257    /**
2258     * @param value The Study Instance UID for the DICOM Study from which the images were selected.
2259     */
2260    public ImagingSelection setStudyUid(String value) { 
2261      if (Utilities.noString(value))
2262        this.studyUid = null;
2263      else {
2264        if (this.studyUid == null)
2265          this.studyUid = new IdType();
2266        this.studyUid.setValue(value);
2267      }
2268      return this;
2269    }
2270
2271    /**
2272     * @return {@link #derivedFrom} (The imaging study from which the imaging selection is made.)
2273     */
2274    public List<Reference> getDerivedFrom() { 
2275      if (this.derivedFrom == null)
2276        this.derivedFrom = new ArrayList<Reference>();
2277      return this.derivedFrom;
2278    }
2279
2280    /**
2281     * @return Returns a reference to <code>this</code> for easy method chaining
2282     */
2283    public ImagingSelection setDerivedFrom(List<Reference> theDerivedFrom) { 
2284      this.derivedFrom = theDerivedFrom;
2285      return this;
2286    }
2287
2288    public boolean hasDerivedFrom() { 
2289      if (this.derivedFrom == null)
2290        return false;
2291      for (Reference item : this.derivedFrom)
2292        if (!item.isEmpty())
2293          return true;
2294      return false;
2295    }
2296
2297    public Reference addDerivedFrom() { //3
2298      Reference t = new Reference();
2299      if (this.derivedFrom == null)
2300        this.derivedFrom = new ArrayList<Reference>();
2301      this.derivedFrom.add(t);
2302      return t;
2303    }
2304
2305    public ImagingSelection addDerivedFrom(Reference t) { //3
2306      if (t == null)
2307        return this;
2308      if (this.derivedFrom == null)
2309        this.derivedFrom = new ArrayList<Reference>();
2310      this.derivedFrom.add(t);
2311      return this;
2312    }
2313
2314    /**
2315     * @return The first repetition of repeating field {@link #derivedFrom}, creating it if it does not already exist {3}
2316     */
2317    public Reference getDerivedFromFirstRep() { 
2318      if (getDerivedFrom().isEmpty()) {
2319        addDerivedFrom();
2320      }
2321      return getDerivedFrom().get(0);
2322    }
2323
2324    /**
2325     * @return {@link #endpoint} (The network service providing retrieval access to the selected images, frames, etc. See implementation notes for information about using DICOM endpoints.)
2326     */
2327    public List<Reference> getEndpoint() { 
2328      if (this.endpoint == null)
2329        this.endpoint = new ArrayList<Reference>();
2330      return this.endpoint;
2331    }
2332
2333    /**
2334     * @return Returns a reference to <code>this</code> for easy method chaining
2335     */
2336    public ImagingSelection setEndpoint(List<Reference> theEndpoint) { 
2337      this.endpoint = theEndpoint;
2338      return this;
2339    }
2340
2341    public boolean hasEndpoint() { 
2342      if (this.endpoint == null)
2343        return false;
2344      for (Reference item : this.endpoint)
2345        if (!item.isEmpty())
2346          return true;
2347      return false;
2348    }
2349
2350    public Reference addEndpoint() { //3
2351      Reference t = new Reference();
2352      if (this.endpoint == null)
2353        this.endpoint = new ArrayList<Reference>();
2354      this.endpoint.add(t);
2355      return t;
2356    }
2357
2358    public ImagingSelection addEndpoint(Reference t) { //3
2359      if (t == null)
2360        return this;
2361      if (this.endpoint == null)
2362        this.endpoint = new ArrayList<Reference>();
2363      this.endpoint.add(t);
2364      return this;
2365    }
2366
2367    /**
2368     * @return The first repetition of repeating field {@link #endpoint}, creating it if it does not already exist {3}
2369     */
2370    public Reference getEndpointFirstRep() { 
2371      if (getEndpoint().isEmpty()) {
2372        addEndpoint();
2373      }
2374      return getEndpoint().get(0);
2375    }
2376
2377    /**
2378     * @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
2379     */
2380    public IdType getSeriesUidElement() { 
2381      if (this.seriesUid == null)
2382        if (Configuration.errorOnAutoCreate())
2383          throw new Error("Attempt to auto-create ImagingSelection.seriesUid");
2384        else if (Configuration.doAutoCreate())
2385          this.seriesUid = new IdType(); // bb
2386      return this.seriesUid;
2387    }
2388
2389    public boolean hasSeriesUidElement() { 
2390      return this.seriesUid != null && !this.seriesUid.isEmpty();
2391    }
2392
2393    public boolean hasSeriesUid() { 
2394      return this.seriesUid != null && !this.seriesUid.isEmpty();
2395    }
2396
2397    /**
2398     * @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
2399     */
2400    public ImagingSelection setSeriesUidElement(IdType value) { 
2401      this.seriesUid = value;
2402      return this;
2403    }
2404
2405    /**
2406     * @return The Series Instance UID for the DICOM Series from which the images were selected.
2407     */
2408    public String getSeriesUid() { 
2409      return this.seriesUid == null ? null : this.seriesUid.getValue();
2410    }
2411
2412    /**
2413     * @param value The Series Instance UID for the DICOM Series from which the images were selected.
2414     */
2415    public ImagingSelection setSeriesUid(String value) { 
2416      if (Utilities.noString(value))
2417        this.seriesUid = null;
2418      else {
2419        if (this.seriesUid == null)
2420          this.seriesUid = new IdType();
2421        this.seriesUid.setValue(value);
2422      }
2423      return this;
2424    }
2425
2426    /**
2427     * @return {@link #seriesNumber} (The Series Number for the DICOM Series from which the images were selected.). This is the underlying object with id, value and extensions. The accessor "getSeriesNumber" gives direct access to the value
2428     */
2429    public UnsignedIntType getSeriesNumberElement() { 
2430      if (this.seriesNumber == null)
2431        if (Configuration.errorOnAutoCreate())
2432          throw new Error("Attempt to auto-create ImagingSelection.seriesNumber");
2433        else if (Configuration.doAutoCreate())
2434          this.seriesNumber = new UnsignedIntType(); // bb
2435      return this.seriesNumber;
2436    }
2437
2438    public boolean hasSeriesNumberElement() { 
2439      return this.seriesNumber != null && !this.seriesNumber.isEmpty();
2440    }
2441
2442    public boolean hasSeriesNumber() { 
2443      return this.seriesNumber != null && !this.seriesNumber.isEmpty();
2444    }
2445
2446    /**
2447     * @param value {@link #seriesNumber} (The Series Number for the DICOM Series from which the images were selected.). This is the underlying object with id, value and extensions. The accessor "getSeriesNumber" gives direct access to the value
2448     */
2449    public ImagingSelection setSeriesNumberElement(UnsignedIntType value) { 
2450      this.seriesNumber = value;
2451      return this;
2452    }
2453
2454    /**
2455     * @return The Series Number for the DICOM Series from which the images were selected.
2456     */
2457    public int getSeriesNumber() { 
2458      return this.seriesNumber == null || this.seriesNumber.isEmpty() ? 0 : this.seriesNumber.getValue();
2459    }
2460
2461    /**
2462     * @param value The Series Number for the DICOM Series from which the images were selected.
2463     */
2464    public ImagingSelection setSeriesNumber(int value) { 
2465        if (this.seriesNumber == null)
2466          this.seriesNumber = new UnsignedIntType();
2467        this.seriesNumber.setValue(value);
2468      return this;
2469    }
2470
2471    /**
2472     * @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
2473     */
2474    public IdType getFrameOfReferenceUidElement() { 
2475      if (this.frameOfReferenceUid == null)
2476        if (Configuration.errorOnAutoCreate())
2477          throw new Error("Attempt to auto-create ImagingSelection.frameOfReferenceUid");
2478        else if (Configuration.doAutoCreate())
2479          this.frameOfReferenceUid = new IdType(); // bb
2480      return this.frameOfReferenceUid;
2481    }
2482
2483    public boolean hasFrameOfReferenceUidElement() { 
2484      return this.frameOfReferenceUid != null && !this.frameOfReferenceUid.isEmpty();
2485    }
2486
2487    public boolean hasFrameOfReferenceUid() { 
2488      return this.frameOfReferenceUid != null && !this.frameOfReferenceUid.isEmpty();
2489    }
2490
2491    /**
2492     * @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
2493     */
2494    public ImagingSelection setFrameOfReferenceUidElement(IdType value) { 
2495      this.frameOfReferenceUid = value;
2496      return this;
2497    }
2498
2499    /**
2500     * @return The Frame of Reference UID identifying the coordinate system that conveys spatial and/or temporal information for the selected images or frames.
2501     */
2502    public String getFrameOfReferenceUid() { 
2503      return this.frameOfReferenceUid == null ? null : this.frameOfReferenceUid.getValue();
2504    }
2505
2506    /**
2507     * @param value The Frame of Reference UID identifying the coordinate system that conveys spatial and/or temporal information for the selected images or frames.
2508     */
2509    public ImagingSelection setFrameOfReferenceUid(String value) { 
2510      if (Utilities.noString(value))
2511        this.frameOfReferenceUid = null;
2512      else {
2513        if (this.frameOfReferenceUid == null)
2514          this.frameOfReferenceUid = new IdType();
2515        this.frameOfReferenceUid.setValue(value);
2516      }
2517      return this;
2518    }
2519
2520    /**
2521     * @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.)
2522     */
2523    public CodeableReference getBodySite() { 
2524      if (this.bodySite == null)
2525        if (Configuration.errorOnAutoCreate())
2526          throw new Error("Attempt to auto-create ImagingSelection.bodySite");
2527        else if (Configuration.doAutoCreate())
2528          this.bodySite = new CodeableReference(); // cc
2529      return this.bodySite;
2530    }
2531
2532    public boolean hasBodySite() { 
2533      return this.bodySite != null && !this.bodySite.isEmpty();
2534    }
2535
2536    /**
2537     * @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.)
2538     */
2539    public ImagingSelection setBodySite(CodeableReference value) { 
2540      this.bodySite = value;
2541      return this;
2542    }
2543
2544    /**
2545     * @return {@link #focus} (The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record.  The focus of an observation could also be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.)
2546     */
2547    public List<Reference> getFocus() { 
2548      if (this.focus == null)
2549        this.focus = new ArrayList<Reference>();
2550      return this.focus;
2551    }
2552
2553    /**
2554     * @return Returns a reference to <code>this</code> for easy method chaining
2555     */
2556    public ImagingSelection setFocus(List<Reference> theFocus) { 
2557      this.focus = theFocus;
2558      return this;
2559    }
2560
2561    public boolean hasFocus() { 
2562      if (this.focus == null)
2563        return false;
2564      for (Reference item : this.focus)
2565        if (!item.isEmpty())
2566          return true;
2567      return false;
2568    }
2569
2570    public Reference addFocus() { //3
2571      Reference t = new Reference();
2572      if (this.focus == null)
2573        this.focus = new ArrayList<Reference>();
2574      this.focus.add(t);
2575      return t;
2576    }
2577
2578    public ImagingSelection addFocus(Reference t) { //3
2579      if (t == null)
2580        return this;
2581      if (this.focus == null)
2582        this.focus = new ArrayList<Reference>();
2583      this.focus.add(t);
2584      return this;
2585    }
2586
2587    /**
2588     * @return The first repetition of repeating field {@link #focus}, creating it if it does not already exist {3}
2589     */
2590    public Reference getFocusFirstRep() { 
2591      if (getFocus().isEmpty()) {
2592        addFocus();
2593      }
2594      return getFocus().get(0);
2595    }
2596
2597    /**
2598     * @return {@link #instance} (Each imaging selection includes one or more selected DICOM SOP instances.)
2599     */
2600    public List<ImagingSelectionInstanceComponent> getInstance() { 
2601      if (this.instance == null)
2602        this.instance = new ArrayList<ImagingSelectionInstanceComponent>();
2603      return this.instance;
2604    }
2605
2606    /**
2607     * @return Returns a reference to <code>this</code> for easy method chaining
2608     */
2609    public ImagingSelection setInstance(List<ImagingSelectionInstanceComponent> theInstance) { 
2610      this.instance = theInstance;
2611      return this;
2612    }
2613
2614    public boolean hasInstance() { 
2615      if (this.instance == null)
2616        return false;
2617      for (ImagingSelectionInstanceComponent item : this.instance)
2618        if (!item.isEmpty())
2619          return true;
2620      return false;
2621    }
2622
2623    public ImagingSelectionInstanceComponent addInstance() { //3
2624      ImagingSelectionInstanceComponent t = new ImagingSelectionInstanceComponent();
2625      if (this.instance == null)
2626        this.instance = new ArrayList<ImagingSelectionInstanceComponent>();
2627      this.instance.add(t);
2628      return t;
2629    }
2630
2631    public ImagingSelection addInstance(ImagingSelectionInstanceComponent t) { //3
2632      if (t == null)
2633        return this;
2634      if (this.instance == null)
2635        this.instance = new ArrayList<ImagingSelectionInstanceComponent>();
2636      this.instance.add(t);
2637      return this;
2638    }
2639
2640    /**
2641     * @return The first repetition of repeating field {@link #instance}, creating it if it does not already exist {3}
2642     */
2643    public ImagingSelectionInstanceComponent getInstanceFirstRep() { 
2644      if (getInstance().isEmpty()) {
2645        addInstance();
2646      }
2647      return getInstance().get(0);
2648    }
2649
2650    /**
2651     * @return {@link #imageRegion} (Each imaging selection might includes a 3D image region, specified by a region type and a set of 3D coordinates.)
2652     */
2653    public List<ImageRegion3DComponent> getImageRegion() { 
2654      if (this.imageRegion == null)
2655        this.imageRegion = new ArrayList<ImageRegion3DComponent>();
2656      return this.imageRegion;
2657    }
2658
2659    /**
2660     * @return Returns a reference to <code>this</code> for easy method chaining
2661     */
2662    public ImagingSelection setImageRegion(List<ImageRegion3DComponent> theImageRegion) { 
2663      this.imageRegion = theImageRegion;
2664      return this;
2665    }
2666
2667    public boolean hasImageRegion() { 
2668      if (this.imageRegion == null)
2669        return false;
2670      for (ImageRegion3DComponent item : this.imageRegion)
2671        if (!item.isEmpty())
2672          return true;
2673      return false;
2674    }
2675
2676    public ImageRegion3DComponent addImageRegion() { //3
2677      ImageRegion3DComponent t = new ImageRegion3DComponent();
2678      if (this.imageRegion == null)
2679        this.imageRegion = new ArrayList<ImageRegion3DComponent>();
2680      this.imageRegion.add(t);
2681      return t;
2682    }
2683
2684    public ImagingSelection addImageRegion(ImageRegion3DComponent t) { //3
2685      if (t == null)
2686        return this;
2687      if (this.imageRegion == null)
2688        this.imageRegion = new ArrayList<ImageRegion3DComponent>();
2689      this.imageRegion.add(t);
2690      return this;
2691    }
2692
2693    /**
2694     * @return The first repetition of repeating field {@link #imageRegion}, creating it if it does not already exist {3}
2695     */
2696    public ImageRegion3DComponent getImageRegionFirstRep() { 
2697      if (getImageRegion().isEmpty()) {
2698        addImageRegion();
2699      }
2700      return getImageRegion().get(0);
2701    }
2702
2703      protected void listChildren(List<Property> children) {
2704        super.listChildren(children);
2705        children.add(new Property("identifier", "Identifier", "A unique identifier assigned to this imaging selection.", 0, java.lang.Integer.MAX_VALUE, identifier));
2706        children.add(new Property("status", "code", "The current state of the ImagingSelection resource. This is not the status of any ImagingStudy, ServiceRequest, or Task resources associated with the ImagingSelection.", 0, 1, status));
2707        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));
2708        children.add(new Property("issued", "instant", "The date and time this imaging selection was created.", 0, 1, issued));
2709        children.add(new Property("performer", "", "Selector of the instances – human or machine.", 0, java.lang.Integer.MAX_VALUE, performer));
2710        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));
2711        children.add(new Property("category", "CodeableConcept", "Classifies the imaging selection.", 0, java.lang.Integer.MAX_VALUE, category));
2712        children.add(new Property("code", "CodeableConcept", "Reason for referencing the selected content.", 0, 1, code));
2713        children.add(new Property("studyUid", "id", "The Study Instance UID for the DICOM Study from which the images were selected.", 0, 1, studyUid));
2714        children.add(new Property("derivedFrom", "Reference(ImagingStudy)", "The imaging study from which the imaging selection is made.", 0, java.lang.Integer.MAX_VALUE, derivedFrom));
2715        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));
2716        children.add(new Property("seriesUid", "id", "The Series Instance UID for the DICOM Series from which the images were selected.", 0, 1, seriesUid));
2717        children.add(new Property("seriesNumber", "unsignedInt", "The Series Number for the DICOM Series from which the images were selected.", 0, 1, seriesNumber));
2718        children.add(new Property("frameOfReferenceUid", "id", "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));
2719        children.add(new Property("bodySite", "CodeableReference(BodyStructure)", "The anatomic structures examined. See DICOM Part 16 Annex L (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html) for DICOM to SNOMED-CT mappings.", 0, 1, bodySite));
2720        children.add(new Property("focus", "Reference(ImagingSelection)", "The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record.  The focus of an observation could also be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.", 0, java.lang.Integer.MAX_VALUE, focus));
2721        children.add(new Property("instance", "", "Each imaging selection includes one or more selected DICOM SOP instances.", 0, java.lang.Integer.MAX_VALUE, instance));
2722        children.add(new Property("imageRegion", "", "Each imaging selection might includes a 3D image region, specified by a region type and a set of 3D coordinates.", 0, java.lang.Integer.MAX_VALUE, imageRegion));
2723      }
2724
2725      @Override
2726      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2727        switch (_hash) {
2728        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier assigned to this imaging selection.", 0, java.lang.Integer.MAX_VALUE, identifier);
2729        case -892481550: /*status*/  return new Property("status", "code", "The current state of the ImagingSelection resource. This is not the status of any ImagingStudy, ServiceRequest, or Task resources associated with the ImagingSelection.", 0, 1, status);
2730        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);
2731        case -1179159893: /*issued*/  return new Property("issued", "instant", "The date and time this imaging selection was created.", 0, 1, issued);
2732        case 481140686: /*performer*/  return new Property("performer", "", "Selector of the instances – human or machine.", 0, java.lang.Integer.MAX_VALUE, performer);
2733        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);
2734        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "Classifies the imaging selection.", 0, java.lang.Integer.MAX_VALUE, category);
2735        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Reason for referencing the selected content.", 0, 1, code);
2736        case 1876590023: /*studyUid*/  return new Property("studyUid", "id", "The Study Instance UID for the DICOM Study from which the images were selected.", 0, 1, studyUid);
2737        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);
2738        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);
2739        case -569596327: /*seriesUid*/  return new Property("seriesUid", "id", "The Series Instance UID for the DICOM Series from which the images were selected.", 0, 1, seriesUid);
2740        case 382652576: /*seriesNumber*/  return new Property("seriesNumber", "unsignedInt", "The Series Number for the DICOM Series from which the images were selected.", 0, 1, seriesNumber);
2741        case 828378953: /*frameOfReferenceUid*/  return new Property("frameOfReferenceUid", "id", "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);
2742        case 1702620169: /*bodySite*/  return new Property("bodySite", "CodeableReference(BodyStructure)", "The anatomic structures examined. See DICOM Part 16 Annex L (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html) for DICOM to SNOMED-CT mappings.", 0, 1, bodySite);
2743        case 97604824: /*focus*/  return new Property("focus", "Reference(ImagingSelection)", "The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record.  The focus of an observation could also be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.", 0, java.lang.Integer.MAX_VALUE, focus);
2744        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);
2745        case 2132544559: /*imageRegion*/  return new Property("imageRegion", "", "Each imaging selection might includes a 3D image region, specified by a region type and a set of 3D coordinates.", 0, java.lang.Integer.MAX_VALUE, imageRegion);
2746        default: return super.getNamedProperty(_hash, _name, _checkValid);
2747        }
2748
2749      }
2750
2751      @Override
2752      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2753        switch (hash) {
2754        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2755        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ImagingSelectionStatus>
2756        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2757        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // InstantType
2758        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // ImagingSelectionPerformerComponent
2759        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
2760        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
2761        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
2762        case 1876590023: /*studyUid*/ return this.studyUid == null ? new Base[0] : new Base[] {this.studyUid}; // IdType
2763        case 1077922663: /*derivedFrom*/ return this.derivedFrom == null ? new Base[0] : this.derivedFrom.toArray(new Base[this.derivedFrom.size()]); // Reference
2764        case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // Reference
2765        case -569596327: /*seriesUid*/ return this.seriesUid == null ? new Base[0] : new Base[] {this.seriesUid}; // IdType
2766        case 382652576: /*seriesNumber*/ return this.seriesNumber == null ? new Base[0] : new Base[] {this.seriesNumber}; // UnsignedIntType
2767        case 828378953: /*frameOfReferenceUid*/ return this.frameOfReferenceUid == null ? new Base[0] : new Base[] {this.frameOfReferenceUid}; // IdType
2768        case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableReference
2769        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : this.focus.toArray(new Base[this.focus.size()]); // Reference
2770        case 555127957: /*instance*/ return this.instance == null ? new Base[0] : this.instance.toArray(new Base[this.instance.size()]); // ImagingSelectionInstanceComponent
2771        case 2132544559: /*imageRegion*/ return this.imageRegion == null ? new Base[0] : this.imageRegion.toArray(new Base[this.imageRegion.size()]); // ImageRegion3DComponent
2772        default: return super.getProperty(hash, name, checkValid);
2773        }
2774
2775      }
2776
2777      @Override
2778      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2779        switch (hash) {
2780        case -1618432855: // identifier
2781          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2782          return value;
2783        case -892481550: // status
2784          value = new ImagingSelectionStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2785          this.status = (Enumeration) value; // Enumeration<ImagingSelectionStatus>
2786          return value;
2787        case -1867885268: // subject
2788          this.subject = TypeConvertor.castToReference(value); // Reference
2789          return value;
2790        case -1179159893: // issued
2791          this.issued = TypeConvertor.castToInstant(value); // InstantType
2792          return value;
2793        case 481140686: // performer
2794          this.getPerformer().add((ImagingSelectionPerformerComponent) value); // ImagingSelectionPerformerComponent
2795          return value;
2796        case -332612366: // basedOn
2797          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
2798          return value;
2799        case 50511102: // category
2800          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2801          return value;
2802        case 3059181: // code
2803          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2804          return value;
2805        case 1876590023: // studyUid
2806          this.studyUid = TypeConvertor.castToId(value); // IdType
2807          return value;
2808        case 1077922663: // derivedFrom
2809          this.getDerivedFrom().add(TypeConvertor.castToReference(value)); // Reference
2810          return value;
2811        case 1741102485: // endpoint
2812          this.getEndpoint().add(TypeConvertor.castToReference(value)); // Reference
2813          return value;
2814        case -569596327: // seriesUid
2815          this.seriesUid = TypeConvertor.castToId(value); // IdType
2816          return value;
2817        case 382652576: // seriesNumber
2818          this.seriesNumber = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
2819          return value;
2820        case 828378953: // frameOfReferenceUid
2821          this.frameOfReferenceUid = TypeConvertor.castToId(value); // IdType
2822          return value;
2823        case 1702620169: // bodySite
2824          this.bodySite = TypeConvertor.castToCodeableReference(value); // CodeableReference
2825          return value;
2826        case 97604824: // focus
2827          this.getFocus().add(TypeConvertor.castToReference(value)); // Reference
2828          return value;
2829        case 555127957: // instance
2830          this.getInstance().add((ImagingSelectionInstanceComponent) value); // ImagingSelectionInstanceComponent
2831          return value;
2832        case 2132544559: // imageRegion
2833          this.getImageRegion().add((ImageRegion3DComponent) value); // ImageRegion3DComponent
2834          return value;
2835        default: return super.setProperty(hash, name, value);
2836        }
2837
2838      }
2839
2840      @Override
2841      public Base setProperty(String name, Base value) throws FHIRException {
2842        if (name.equals("identifier")) {
2843          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2844        } else if (name.equals("status")) {
2845          value = new ImagingSelectionStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2846          this.status = (Enumeration) value; // Enumeration<ImagingSelectionStatus>
2847        } else if (name.equals("subject")) {
2848          this.subject = TypeConvertor.castToReference(value); // Reference
2849        } else if (name.equals("issued")) {
2850          this.issued = TypeConvertor.castToInstant(value); // InstantType
2851        } else if (name.equals("performer")) {
2852          this.getPerformer().add((ImagingSelectionPerformerComponent) value);
2853        } else if (name.equals("basedOn")) {
2854          this.getBasedOn().add(TypeConvertor.castToReference(value));
2855        } else if (name.equals("category")) {
2856          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
2857        } else if (name.equals("code")) {
2858          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2859        } else if (name.equals("studyUid")) {
2860          this.studyUid = TypeConvertor.castToId(value); // IdType
2861        } else if (name.equals("derivedFrom")) {
2862          this.getDerivedFrom().add(TypeConvertor.castToReference(value));
2863        } else if (name.equals("endpoint")) {
2864          this.getEndpoint().add(TypeConvertor.castToReference(value));
2865        } else if (name.equals("seriesUid")) {
2866          this.seriesUid = TypeConvertor.castToId(value); // IdType
2867        } else if (name.equals("seriesNumber")) {
2868          this.seriesNumber = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
2869        } else if (name.equals("frameOfReferenceUid")) {
2870          this.frameOfReferenceUid = TypeConvertor.castToId(value); // IdType
2871        } else if (name.equals("bodySite")) {
2872          this.bodySite = TypeConvertor.castToCodeableReference(value); // CodeableReference
2873        } else if (name.equals("focus")) {
2874          this.getFocus().add(TypeConvertor.castToReference(value));
2875        } else if (name.equals("instance")) {
2876          this.getInstance().add((ImagingSelectionInstanceComponent) value);
2877        } else if (name.equals("imageRegion")) {
2878          this.getImageRegion().add((ImageRegion3DComponent) value);
2879        } else
2880          return super.setProperty(name, value);
2881        return value;
2882      }
2883
2884      @Override
2885      public Base makeProperty(int hash, String name) throws FHIRException {
2886        switch (hash) {
2887        case -1618432855:  return addIdentifier(); 
2888        case -892481550:  return getStatusElement();
2889        case -1867885268:  return getSubject();
2890        case -1179159893:  return getIssuedElement();
2891        case 481140686:  return addPerformer(); 
2892        case -332612366:  return addBasedOn(); 
2893        case 50511102:  return addCategory(); 
2894        case 3059181:  return getCode();
2895        case 1876590023:  return getStudyUidElement();
2896        case 1077922663:  return addDerivedFrom(); 
2897        case 1741102485:  return addEndpoint(); 
2898        case -569596327:  return getSeriesUidElement();
2899        case 382652576:  return getSeriesNumberElement();
2900        case 828378953:  return getFrameOfReferenceUidElement();
2901        case 1702620169:  return getBodySite();
2902        case 97604824:  return addFocus(); 
2903        case 555127957:  return addInstance(); 
2904        case 2132544559:  return addImageRegion(); 
2905        default: return super.makeProperty(hash, name);
2906        }
2907
2908      }
2909
2910      @Override
2911      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2912        switch (hash) {
2913        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2914        case -892481550: /*status*/ return new String[] {"code"};
2915        case -1867885268: /*subject*/ return new String[] {"Reference"};
2916        case -1179159893: /*issued*/ return new String[] {"instant"};
2917        case 481140686: /*performer*/ return new String[] {};
2918        case -332612366: /*basedOn*/ return new String[] {"Reference"};
2919        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2920        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2921        case 1876590023: /*studyUid*/ return new String[] {"id"};
2922        case 1077922663: /*derivedFrom*/ return new String[] {"Reference"};
2923        case 1741102485: /*endpoint*/ return new String[] {"Reference"};
2924        case -569596327: /*seriesUid*/ return new String[] {"id"};
2925        case 382652576: /*seriesNumber*/ return new String[] {"unsignedInt"};
2926        case 828378953: /*frameOfReferenceUid*/ return new String[] {"id"};
2927        case 1702620169: /*bodySite*/ return new String[] {"CodeableReference"};
2928        case 97604824: /*focus*/ return new String[] {"Reference"};
2929        case 555127957: /*instance*/ return new String[] {};
2930        case 2132544559: /*imageRegion*/ return new String[] {};
2931        default: return super.getTypesForProperty(hash, name);
2932        }
2933
2934      }
2935
2936      @Override
2937      public Base addChild(String name) throws FHIRException {
2938        if (name.equals("identifier")) {
2939          return addIdentifier();
2940        }
2941        else if (name.equals("status")) {
2942          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.status");
2943        }
2944        else if (name.equals("subject")) {
2945          this.subject = new Reference();
2946          return this.subject;
2947        }
2948        else if (name.equals("issued")) {
2949          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.issued");
2950        }
2951        else if (name.equals("performer")) {
2952          return addPerformer();
2953        }
2954        else if (name.equals("basedOn")) {
2955          return addBasedOn();
2956        }
2957        else if (name.equals("category")) {
2958          return addCategory();
2959        }
2960        else if (name.equals("code")) {
2961          this.code = new CodeableConcept();
2962          return this.code;
2963        }
2964        else if (name.equals("studyUid")) {
2965          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.studyUid");
2966        }
2967        else if (name.equals("derivedFrom")) {
2968          return addDerivedFrom();
2969        }
2970        else if (name.equals("endpoint")) {
2971          return addEndpoint();
2972        }
2973        else if (name.equals("seriesUid")) {
2974          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.seriesUid");
2975        }
2976        else if (name.equals("seriesNumber")) {
2977          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.seriesNumber");
2978        }
2979        else if (name.equals("frameOfReferenceUid")) {
2980          throw new FHIRException("Cannot call addChild on a primitive type ImagingSelection.frameOfReferenceUid");
2981        }
2982        else if (name.equals("bodySite")) {
2983          this.bodySite = new CodeableReference();
2984          return this.bodySite;
2985        }
2986        else if (name.equals("focus")) {
2987          return addFocus();
2988        }
2989        else if (name.equals("instance")) {
2990          return addInstance();
2991        }
2992        else if (name.equals("imageRegion")) {
2993          return addImageRegion();
2994        }
2995        else
2996          return super.addChild(name);
2997      }
2998
2999  public String fhirType() {
3000    return "ImagingSelection";
3001
3002  }
3003
3004      public ImagingSelection copy() {
3005        ImagingSelection dst = new ImagingSelection();
3006        copyValues(dst);
3007        return dst;
3008      }
3009
3010      public void copyValues(ImagingSelection dst) {
3011        super.copyValues(dst);
3012        if (identifier != null) {
3013          dst.identifier = new ArrayList<Identifier>();
3014          for (Identifier i : identifier)
3015            dst.identifier.add(i.copy());
3016        };
3017        dst.status = status == null ? null : status.copy();
3018        dst.subject = subject == null ? null : subject.copy();
3019        dst.issued = issued == null ? null : issued.copy();
3020        if (performer != null) {
3021          dst.performer = new ArrayList<ImagingSelectionPerformerComponent>();
3022          for (ImagingSelectionPerformerComponent i : performer)
3023            dst.performer.add(i.copy());
3024        };
3025        if (basedOn != null) {
3026          dst.basedOn = new ArrayList<Reference>();
3027          for (Reference i : basedOn)
3028            dst.basedOn.add(i.copy());
3029        };
3030        if (category != null) {
3031          dst.category = new ArrayList<CodeableConcept>();
3032          for (CodeableConcept i : category)
3033            dst.category.add(i.copy());
3034        };
3035        dst.code = code == null ? null : code.copy();
3036        dst.studyUid = studyUid == null ? null : studyUid.copy();
3037        if (derivedFrom != null) {
3038          dst.derivedFrom = new ArrayList<Reference>();
3039          for (Reference i : derivedFrom)
3040            dst.derivedFrom.add(i.copy());
3041        };
3042        if (endpoint != null) {
3043          dst.endpoint = new ArrayList<Reference>();
3044          for (Reference i : endpoint)
3045            dst.endpoint.add(i.copy());
3046        };
3047        dst.seriesUid = seriesUid == null ? null : seriesUid.copy();
3048        dst.seriesNumber = seriesNumber == null ? null : seriesNumber.copy();
3049        dst.frameOfReferenceUid = frameOfReferenceUid == null ? null : frameOfReferenceUid.copy();
3050        dst.bodySite = bodySite == null ? null : bodySite.copy();
3051        if (focus != null) {
3052          dst.focus = new ArrayList<Reference>();
3053          for (Reference i : focus)
3054            dst.focus.add(i.copy());
3055        };
3056        if (instance != null) {
3057          dst.instance = new ArrayList<ImagingSelectionInstanceComponent>();
3058          for (ImagingSelectionInstanceComponent i : instance)
3059            dst.instance.add(i.copy());
3060        };
3061        if (imageRegion != null) {
3062          dst.imageRegion = new ArrayList<ImageRegion3DComponent>();
3063          for (ImageRegion3DComponent i : imageRegion)
3064            dst.imageRegion.add(i.copy());
3065        };
3066      }
3067
3068      protected ImagingSelection typedCopy() {
3069        return copy();
3070      }
3071
3072      @Override
3073      public boolean equalsDeep(Base other_) {
3074        if (!super.equalsDeep(other_))
3075          return false;
3076        if (!(other_ instanceof ImagingSelection))
3077          return false;
3078        ImagingSelection o = (ImagingSelection) other_;
3079        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(subject, o.subject, true)
3080           && compareDeep(issued, o.issued, true) && compareDeep(performer, o.performer, true) && compareDeep(basedOn, o.basedOn, true)
3081           && compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(studyUid, o.studyUid, true)
3082           && compareDeep(derivedFrom, o.derivedFrom, true) && compareDeep(endpoint, o.endpoint, true) && compareDeep(seriesUid, o.seriesUid, true)
3083           && compareDeep(seriesNumber, o.seriesNumber, true) && compareDeep(frameOfReferenceUid, o.frameOfReferenceUid, true)
3084           && compareDeep(bodySite, o.bodySite, true) && compareDeep(focus, o.focus, true) && compareDeep(instance, o.instance, true)
3085           && compareDeep(imageRegion, o.imageRegion, true);
3086      }
3087
3088      @Override
3089      public boolean equalsShallow(Base other_) {
3090        if (!super.equalsShallow(other_))
3091          return false;
3092        if (!(other_ instanceof ImagingSelection))
3093          return false;
3094        ImagingSelection o = (ImagingSelection) other_;
3095        return compareValues(status, o.status, true) && compareValues(issued, o.issued, true) && compareValues(studyUid, o.studyUid, true)
3096           && compareValues(seriesUid, o.seriesUid, true) && compareValues(seriesNumber, o.seriesNumber, true)
3097           && compareValues(frameOfReferenceUid, o.frameOfReferenceUid, true);
3098      }
3099
3100      public boolean isEmpty() {
3101        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, subject
3102          , issued, performer, basedOn, category, code, studyUid, derivedFrom, endpoint
3103          , seriesUid, seriesNumber, frameOfReferenceUid, bodySite, focus, instance, imageRegion
3104          );
3105      }
3106
3107  @Override
3108  public ResourceType getResourceType() {
3109    return ResourceType.ImagingSelection;
3110   }
3111
3112 /**
3113   * Search parameter: <b>based-on</b>
3114   * <p>
3115   * Description: <b>The request associated with an imaging selection</b><br>
3116   * Type: <b>reference</b><br>
3117   * Path: <b>ImagingSelection.basedOn</b><br>
3118   * </p>
3119   */
3120  @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 } )
3121  public static final String SP_BASED_ON = "based-on";
3122 /**
3123   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
3124   * <p>
3125   * Description: <b>The request associated with an imaging selection</b><br>
3126   * Type: <b>reference</b><br>
3127   * Path: <b>ImagingSelection.basedOn</b><br>
3128   * </p>
3129   */
3130  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
3131
3132/**
3133   * Constant for fluent queries to be used to add include statements. Specifies
3134   * the path value of "<b>ImagingSelection:based-on</b>".
3135   */
3136  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("ImagingSelection:based-on").toLocked();
3137
3138 /**
3139   * Search parameter: <b>body-site</b>
3140   * <p>
3141   * Description: <b>The body site associated with the imaging selection</b><br>
3142   * Type: <b>token</b><br>
3143   * Path: <b>ImagingSelection.bodySite.concept</b><br>
3144   * </p>
3145   */
3146  @SearchParamDefinition(name="body-site", path="ImagingSelection.bodySite.concept", description="The body site associated with the imaging selection", type="token" )
3147  public static final String SP_BODY_SITE = "body-site";
3148 /**
3149   * <b>Fluent Client</b> search parameter constant for <b>body-site</b>
3150   * <p>
3151   * Description: <b>The body site associated with the imaging selection</b><br>
3152   * Type: <b>token</b><br>
3153   * Path: <b>ImagingSelection.bodySite.concept</b><br>
3154   * </p>
3155   */
3156  public static final ca.uhn.fhir.rest.gclient.TokenClientParam BODY_SITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BODY_SITE);
3157
3158 /**
3159   * Search parameter: <b>code</b>
3160   * <p>
3161   * Description: <b>The imaging selection status</b><br>
3162   * Type: <b>token</b><br>
3163   * Path: <b>ImagingSelection.status</b><br>
3164   * </p>
3165   */
3166  @SearchParamDefinition(name="code", path="ImagingSelection.status", description="The imaging selection status", type="token" )
3167  public static final String SP_CODE = "code";
3168 /**
3169   * <b>Fluent Client</b> search parameter constant for <b>code</b>
3170   * <p>
3171   * Description: <b>The imaging selection status</b><br>
3172   * Type: <b>token</b><br>
3173   * Path: <b>ImagingSelection.status</b><br>
3174   * </p>
3175   */
3176  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
3177
3178 /**
3179   * Search parameter: <b>derived-from</b>
3180   * <p>
3181   * Description: <b>The imaging study from which the imaging selection was derived</b><br>
3182   * Type: <b>reference</b><br>
3183   * Path: <b>ImagingSelection.derivedFrom</b><br>
3184   * </p>
3185   */
3186  @SearchParamDefinition(name="derived-from", path="ImagingSelection.derivedFrom", description="The imaging study from which the imaging selection was derived", type="reference", target={ImagingStudy.class } )
3187  public static final String SP_DERIVED_FROM = "derived-from";
3188 /**
3189   * <b>Fluent Client</b> search parameter constant for <b>derived-from</b>
3190   * <p>
3191   * Description: <b>The imaging study from which the imaging selection was derived</b><br>
3192   * Type: <b>reference</b><br>
3193   * Path: <b>ImagingSelection.derivedFrom</b><br>
3194   * </p>
3195   */
3196  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DERIVED_FROM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DERIVED_FROM);
3197
3198/**
3199   * Constant for fluent queries to be used to add include statements. Specifies
3200   * the path value of "<b>ImagingSelection:derived-from</b>".
3201   */
3202  public static final ca.uhn.fhir.model.api.Include INCLUDE_DERIVED_FROM = new ca.uhn.fhir.model.api.Include("ImagingSelection:derived-from").toLocked();
3203
3204 /**
3205   * Search parameter: <b>identifier</b>
3206   * <p>
3207   * Description: <b>Identifiers for the imaging selection</b><br>
3208   * Type: <b>token</b><br>
3209   * Path: <b>ImagingSelection.identifier</b><br>
3210   * </p>
3211   */
3212  @SearchParamDefinition(name="identifier", path="ImagingSelection.identifier", description="Identifiers for the imaging selection", type="token" )
3213  public static final String SP_IDENTIFIER = "identifier";
3214 /**
3215   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3216   * <p>
3217   * Description: <b>Identifiers for the imaging selection</b><br>
3218   * Type: <b>token</b><br>
3219   * Path: <b>ImagingSelection.identifier</b><br>
3220   * </p>
3221   */
3222  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3223
3224 /**
3225   * Search parameter: <b>issued</b>
3226   * <p>
3227   * Description: <b>The date / time the imaging selection was created</b><br>
3228   * Type: <b>date</b><br>
3229   * Path: <b>ImagingSelection.issued</b><br>
3230   * </p>
3231   */
3232  @SearchParamDefinition(name="issued", path="ImagingSelection.issued", description="The date / time the imaging selection was created", type="date" )
3233  public static final String SP_ISSUED = "issued";
3234 /**
3235   * <b>Fluent Client</b> search parameter constant for <b>issued</b>
3236   * <p>
3237   * Description: <b>The date / time the imaging selection was created</b><br>
3238   * Type: <b>date</b><br>
3239   * Path: <b>ImagingSelection.issued</b><br>
3240   * </p>
3241   */
3242  public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED);
3243
3244 /**
3245   * Search parameter: <b>patient</b>
3246   * <p>
3247   * Description: <b>Who the study is about</b><br>
3248   * Type: <b>reference</b><br>
3249   * Path: <b>ImagingSelection.subject.where(resolve() is Patient)</b><br>
3250   * </p>
3251   */
3252  @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={Patient.class } )
3253  public static final String SP_PATIENT = "patient";
3254 /**
3255   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3256   * <p>
3257   * Description: <b>Who the study is about</b><br>
3258   * Type: <b>reference</b><br>
3259   * Path: <b>ImagingSelection.subject.where(resolve() is Patient)</b><br>
3260   * </p>
3261   */
3262  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3263
3264/**
3265   * Constant for fluent queries to be used to add include statements. Specifies
3266   * the path value of "<b>ImagingSelection:patient</b>".
3267   */
3268  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ImagingSelection:patient").toLocked();
3269
3270 /**
3271   * Search parameter: <b>study-uid</b>
3272   * <p>
3273   * Description: <b>The DICOM Study Instance UID from which the images were selected</b><br>
3274   * Type: <b>token</b><br>
3275   * Path: <b>ImagingSelection.studyUid</b><br>
3276   * </p>
3277   */
3278  @SearchParamDefinition(name="study-uid", path="ImagingSelection.studyUid", description="The DICOM Study Instance UID from which the images were selected", type="token" )
3279  public static final String SP_STUDY_UID = "study-uid";
3280 /**
3281   * <b>Fluent Client</b> search parameter constant for <b>study-uid</b>
3282   * <p>
3283   * Description: <b>The DICOM Study Instance UID from which the images were selected</b><br>
3284   * Type: <b>token</b><br>
3285   * Path: <b>ImagingSelection.studyUid</b><br>
3286   * </p>
3287   */
3288  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STUDY_UID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STUDY_UID);
3289
3290 /**
3291   * Search parameter: <b>subject</b>
3292   * <p>
3293   * Description: <b>The subject of the Imaging Selection, such as the associated Patient</b><br>
3294   * Type: <b>reference</b><br>
3295   * Path: <b>ImagingSelection.subject</b><br>
3296   * </p>
3297   */
3298  @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 } )
3299  public static final String SP_SUBJECT = "subject";
3300 /**
3301   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
3302   * <p>
3303   * Description: <b>The subject of the Imaging Selection, such as the associated Patient</b><br>
3304   * Type: <b>reference</b><br>
3305   * Path: <b>ImagingSelection.subject</b><br>
3306   * </p>
3307   */
3308  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
3309
3310/**
3311   * Constant for fluent queries to be used to add include statements. Specifies
3312   * the path value of "<b>ImagingSelection:subject</b>".
3313   */
3314  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("ImagingSelection:subject").toLocked();
3315
3316
3317}