001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import java.math.*;
038import org.hl7.fhir.utilities.Utilities;
039import org.hl7.fhir.r5.model.Enumerations.*;
040import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
041import org.hl7.fhir.exceptions.FHIRException;
042import org.hl7.fhir.instance.model.api.ICompositeType;
043import ca.uhn.fhir.model.api.annotation.ResourceDef;
044import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
045import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.ChildOrder;
048import ca.uhn.fhir.model.api.annotation.Description;
049import ca.uhn.fhir.model.api.annotation.Block;
050
051/**
052 * An authorization for the provision of glasses and/or contact lenses to a patient.
053 */
054@ResourceDef(name="VisionPrescription", profile="http://hl7.org/fhir/StructureDefinition/VisionPrescription")
055public class VisionPrescription extends DomainResource {
056
057    public enum VisionBase {
058        /**
059         * top.
060         */
061        UP, 
062        /**
063         * bottom.
064         */
065        DOWN, 
066        /**
067         * inner edge.
068         */
069        IN, 
070        /**
071         * outer edge.
072         */
073        OUT, 
074        /**
075         * added to help the parsers with the generic types
076         */
077        NULL;
078        public static VisionBase fromCode(String codeString) throws FHIRException {
079            if (codeString == null || "".equals(codeString))
080                return null;
081        if ("up".equals(codeString))
082          return UP;
083        if ("down".equals(codeString))
084          return DOWN;
085        if ("in".equals(codeString))
086          return IN;
087        if ("out".equals(codeString))
088          return OUT;
089        if (Configuration.isAcceptInvalidEnums())
090          return null;
091        else
092          throw new FHIRException("Unknown VisionBase code '"+codeString+"'");
093        }
094        public String toCode() {
095          switch (this) {
096            case UP: return "up";
097            case DOWN: return "down";
098            case IN: return "in";
099            case OUT: return "out";
100            default: return "?";
101          }
102        }
103        public String getSystem() {
104          switch (this) {
105            case UP: return "http://hl7.org/fhir/vision-base-codes";
106            case DOWN: return "http://hl7.org/fhir/vision-base-codes";
107            case IN: return "http://hl7.org/fhir/vision-base-codes";
108            case OUT: return "http://hl7.org/fhir/vision-base-codes";
109            default: return "?";
110          }
111        }
112        public String getDefinition() {
113          switch (this) {
114            case UP: return "top.";
115            case DOWN: return "bottom.";
116            case IN: return "inner edge.";
117            case OUT: return "outer edge.";
118            default: return "?";
119          }
120        }
121        public String getDisplay() {
122          switch (this) {
123            case UP: return "Up";
124            case DOWN: return "Down";
125            case IN: return "In";
126            case OUT: return "Out";
127            default: return "?";
128          }
129        }
130    }
131
132  public static class VisionBaseEnumFactory implements EnumFactory<VisionBase> {
133    public VisionBase fromCode(String codeString) throws IllegalArgumentException {
134      if (codeString == null || "".equals(codeString))
135            if (codeString == null || "".equals(codeString))
136                return null;
137        if ("up".equals(codeString))
138          return VisionBase.UP;
139        if ("down".equals(codeString))
140          return VisionBase.DOWN;
141        if ("in".equals(codeString))
142          return VisionBase.IN;
143        if ("out".equals(codeString))
144          return VisionBase.OUT;
145        throw new IllegalArgumentException("Unknown VisionBase code '"+codeString+"'");
146        }
147        public Enumeration<VisionBase> fromType(Base code) throws FHIRException {
148          if (code == null)
149            return null;
150          if (code.isEmpty())
151            return new Enumeration<VisionBase>(this);
152          String codeString = ((PrimitiveType) code).asStringValue();
153          if (codeString == null || "".equals(codeString))
154            return null;
155        if ("up".equals(codeString))
156          return new Enumeration<VisionBase>(this, VisionBase.UP);
157        if ("down".equals(codeString))
158          return new Enumeration<VisionBase>(this, VisionBase.DOWN);
159        if ("in".equals(codeString))
160          return new Enumeration<VisionBase>(this, VisionBase.IN);
161        if ("out".equals(codeString))
162          return new Enumeration<VisionBase>(this, VisionBase.OUT);
163        throw new FHIRException("Unknown VisionBase code '"+codeString+"'");
164        }
165    public String toCode(VisionBase code) {
166      if (code == VisionBase.UP)
167        return "up";
168      if (code == VisionBase.DOWN)
169        return "down";
170      if (code == VisionBase.IN)
171        return "in";
172      if (code == VisionBase.OUT)
173        return "out";
174      return "?";
175      }
176    public String toSystem(VisionBase code) {
177      return code.getSystem();
178      }
179    }
180
181    public enum VisionEyes {
182        /**
183         * Right Eye.
184         */
185        RIGHT, 
186        /**
187         * Left Eye.
188         */
189        LEFT, 
190        /**
191         * added to help the parsers with the generic types
192         */
193        NULL;
194        public static VisionEyes fromCode(String codeString) throws FHIRException {
195            if (codeString == null || "".equals(codeString))
196                return null;
197        if ("right".equals(codeString))
198          return RIGHT;
199        if ("left".equals(codeString))
200          return LEFT;
201        if (Configuration.isAcceptInvalidEnums())
202          return null;
203        else
204          throw new FHIRException("Unknown VisionEyes code '"+codeString+"'");
205        }
206        public String toCode() {
207          switch (this) {
208            case RIGHT: return "right";
209            case LEFT: return "left";
210            default: return "?";
211          }
212        }
213        public String getSystem() {
214          switch (this) {
215            case RIGHT: return "http://hl7.org/fhir/vision-eye-codes";
216            case LEFT: return "http://hl7.org/fhir/vision-eye-codes";
217            default: return "?";
218          }
219        }
220        public String getDefinition() {
221          switch (this) {
222            case RIGHT: return "Right Eye.";
223            case LEFT: return "Left Eye.";
224            default: return "?";
225          }
226        }
227        public String getDisplay() {
228          switch (this) {
229            case RIGHT: return "Right Eye";
230            case LEFT: return "Left Eye";
231            default: return "?";
232          }
233        }
234    }
235
236  public static class VisionEyesEnumFactory implements EnumFactory<VisionEyes> {
237    public VisionEyes fromCode(String codeString) throws IllegalArgumentException {
238      if (codeString == null || "".equals(codeString))
239            if (codeString == null || "".equals(codeString))
240                return null;
241        if ("right".equals(codeString))
242          return VisionEyes.RIGHT;
243        if ("left".equals(codeString))
244          return VisionEyes.LEFT;
245        throw new IllegalArgumentException("Unknown VisionEyes code '"+codeString+"'");
246        }
247        public Enumeration<VisionEyes> fromType(Base code) throws FHIRException {
248          if (code == null)
249            return null;
250          if (code.isEmpty())
251            return new Enumeration<VisionEyes>(this);
252          String codeString = ((PrimitiveType) code).asStringValue();
253          if (codeString == null || "".equals(codeString))
254            return null;
255        if ("right".equals(codeString))
256          return new Enumeration<VisionEyes>(this, VisionEyes.RIGHT);
257        if ("left".equals(codeString))
258          return new Enumeration<VisionEyes>(this, VisionEyes.LEFT);
259        throw new FHIRException("Unknown VisionEyes code '"+codeString+"'");
260        }
261    public String toCode(VisionEyes code) {
262      if (code == VisionEyes.RIGHT)
263        return "right";
264      if (code == VisionEyes.LEFT)
265        return "left";
266      return "?";
267      }
268    public String toSystem(VisionEyes code) {
269      return code.getSystem();
270      }
271    }
272
273    @Block()
274    public static class VisionPrescriptionLensSpecificationComponent extends BackboneElement implements IBaseBackboneElement {
275        /**
276         * Identifies the type of vision correction product which is required for the patient.
277         */
278        @Child(name = "product", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
279        @Description(shortDefinition="Product to be supplied", formalDefinition="Identifies the type of vision correction product which is required for the patient." )
280        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/vision-product")
281        protected CodeableConcept product;
282
283        /**
284         * The eye for which the lens specification applies.
285         */
286        @Child(name = "eye", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
287        @Description(shortDefinition="right | left", formalDefinition="The eye for which the lens specification applies." )
288        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/vision-eye-codes")
289        protected Enumeration<VisionEyes> eye;
290
291        /**
292         * Lens power measured in dioptres (0.25 units).
293         */
294        @Child(name = "sphere", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=false)
295        @Description(shortDefinition="Power of the lens", formalDefinition="Lens power measured in dioptres (0.25 units)." )
296        protected DecimalType sphere;
297
298        /**
299         * Power adjustment for astigmatism measured in dioptres (0.25 units).
300         */
301        @Child(name = "cylinder", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=false)
302        @Description(shortDefinition="Lens power for astigmatism", formalDefinition="Power adjustment for astigmatism measured in dioptres (0.25 units)." )
303        protected DecimalType cylinder;
304
305        /**
306         * Adjustment for astigmatism measured in integer degrees.
307         */
308        @Child(name = "axis", type = {IntegerType.class}, order=5, min=0, max=1, modifier=false, summary=false)
309        @Description(shortDefinition="Lens meridian which contain no power for astigmatism", formalDefinition="Adjustment for astigmatism measured in integer degrees." )
310        protected IntegerType axis;
311
312        /**
313         * Allows for adjustment on two axis.
314         */
315        @Child(name = "prism", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
316        @Description(shortDefinition="Eye alignment compensation", formalDefinition="Allows for adjustment on two axis." )
317        protected List<PrismComponent> prism;
318
319        /**
320         * Power adjustment for multifocal lenses measured in dioptres (0.25 units).
321         */
322        @Child(name = "add", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=false)
323        @Description(shortDefinition="Added power for multifocal levels", formalDefinition="Power adjustment for multifocal lenses measured in dioptres (0.25 units)." )
324        protected DecimalType add;
325
326        /**
327         * Contact lens power measured in dioptres (0.25 units).
328         */
329        @Child(name = "power", type = {DecimalType.class}, order=8, min=0, max=1, modifier=false, summary=false)
330        @Description(shortDefinition="Contact lens power", formalDefinition="Contact lens power measured in dioptres (0.25 units)." )
331        protected DecimalType power;
332
333        /**
334         * Back curvature measured in millimetres.
335         */
336        @Child(name = "backCurve", type = {DecimalType.class}, order=9, min=0, max=1, modifier=false, summary=false)
337        @Description(shortDefinition="Contact lens back curvature", formalDefinition="Back curvature measured in millimetres." )
338        protected DecimalType backCurve;
339
340        /**
341         * Contact lens diameter measured in millimetres.
342         */
343        @Child(name = "diameter", type = {DecimalType.class}, order=10, min=0, max=1, modifier=false, summary=false)
344        @Description(shortDefinition="Contact lens diameter", formalDefinition="Contact lens diameter measured in millimetres." )
345        protected DecimalType diameter;
346
347        /**
348         * The recommended maximum wear period for the lens.
349         */
350        @Child(name = "duration", type = {Quantity.class}, order=11, min=0, max=1, modifier=false, summary=false)
351        @Description(shortDefinition="Lens wear duration", formalDefinition="The recommended maximum wear period for the lens." )
352        protected Quantity duration;
353
354        /**
355         * Special color or pattern.
356         */
357        @Child(name = "color", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false)
358        @Description(shortDefinition="Color required", formalDefinition="Special color or pattern." )
359        protected StringType color;
360
361        /**
362         * Brand recommendations or restrictions.
363         */
364        @Child(name = "brand", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false)
365        @Description(shortDefinition="Brand required", formalDefinition="Brand recommendations or restrictions." )
366        protected StringType brand;
367
368        /**
369         * Notes for special requirements such as coatings and lens materials.
370         */
371        @Child(name = "note", type = {Annotation.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
372        @Description(shortDefinition="Notes for coatings", formalDefinition="Notes for special requirements such as coatings and lens materials." )
373        protected List<Annotation> note;
374
375        private static final long serialVersionUID = 688924460L;
376
377    /**
378     * Constructor
379     */
380      public VisionPrescriptionLensSpecificationComponent() {
381        super();
382      }
383
384    /**
385     * Constructor
386     */
387      public VisionPrescriptionLensSpecificationComponent(CodeableConcept product, VisionEyes eye) {
388        super();
389        this.setProduct(product);
390        this.setEye(eye);
391      }
392
393        /**
394         * @return {@link #product} (Identifies the type of vision correction product which is required for the patient.)
395         */
396        public CodeableConcept getProduct() { 
397          if (this.product == null)
398            if (Configuration.errorOnAutoCreate())
399              throw new Error("Attempt to auto-create VisionPrescriptionLensSpecificationComponent.product");
400            else if (Configuration.doAutoCreate())
401              this.product = new CodeableConcept(); // cc
402          return this.product;
403        }
404
405        public boolean hasProduct() { 
406          return this.product != null && !this.product.isEmpty();
407        }
408
409        /**
410         * @param value {@link #product} (Identifies the type of vision correction product which is required for the patient.)
411         */
412        public VisionPrescriptionLensSpecificationComponent setProduct(CodeableConcept value) { 
413          this.product = value;
414          return this;
415        }
416
417        /**
418         * @return {@link #eye} (The eye for which the lens specification applies.). This is the underlying object with id, value and extensions. The accessor "getEye" gives direct access to the value
419         */
420        public Enumeration<VisionEyes> getEyeElement() { 
421          if (this.eye == null)
422            if (Configuration.errorOnAutoCreate())
423              throw new Error("Attempt to auto-create VisionPrescriptionLensSpecificationComponent.eye");
424            else if (Configuration.doAutoCreate())
425              this.eye = new Enumeration<VisionEyes>(new VisionEyesEnumFactory()); // bb
426          return this.eye;
427        }
428
429        public boolean hasEyeElement() { 
430          return this.eye != null && !this.eye.isEmpty();
431        }
432
433        public boolean hasEye() { 
434          return this.eye != null && !this.eye.isEmpty();
435        }
436
437        /**
438         * @param value {@link #eye} (The eye for which the lens specification applies.). This is the underlying object with id, value and extensions. The accessor "getEye" gives direct access to the value
439         */
440        public VisionPrescriptionLensSpecificationComponent setEyeElement(Enumeration<VisionEyes> value) { 
441          this.eye = value;
442          return this;
443        }
444
445        /**
446         * @return The eye for which the lens specification applies.
447         */
448        public VisionEyes getEye() { 
449          return this.eye == null ? null : this.eye.getValue();
450        }
451
452        /**
453         * @param value The eye for which the lens specification applies.
454         */
455        public VisionPrescriptionLensSpecificationComponent setEye(VisionEyes value) { 
456            if (this.eye == null)
457              this.eye = new Enumeration<VisionEyes>(new VisionEyesEnumFactory());
458            this.eye.setValue(value);
459          return this;
460        }
461
462        /**
463         * @return {@link #sphere} (Lens power measured in dioptres (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getSphere" gives direct access to the value
464         */
465        public DecimalType getSphereElement() { 
466          if (this.sphere == null)
467            if (Configuration.errorOnAutoCreate())
468              throw new Error("Attempt to auto-create VisionPrescriptionLensSpecificationComponent.sphere");
469            else if (Configuration.doAutoCreate())
470              this.sphere = new DecimalType(); // bb
471          return this.sphere;
472        }
473
474        public boolean hasSphereElement() { 
475          return this.sphere != null && !this.sphere.isEmpty();
476        }
477
478        public boolean hasSphere() { 
479          return this.sphere != null && !this.sphere.isEmpty();
480        }
481
482        /**
483         * @param value {@link #sphere} (Lens power measured in dioptres (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getSphere" gives direct access to the value
484         */
485        public VisionPrescriptionLensSpecificationComponent setSphereElement(DecimalType value) { 
486          this.sphere = value;
487          return this;
488        }
489
490        /**
491         * @return Lens power measured in dioptres (0.25 units).
492         */
493        public BigDecimal getSphere() { 
494          return this.sphere == null ? null : this.sphere.getValue();
495        }
496
497        /**
498         * @param value Lens power measured in dioptres (0.25 units).
499         */
500        public VisionPrescriptionLensSpecificationComponent setSphere(BigDecimal value) { 
501          if (value == null)
502            this.sphere = null;
503          else {
504            if (this.sphere == null)
505              this.sphere = new DecimalType();
506            this.sphere.setValue(value);
507          }
508          return this;
509        }
510
511        /**
512         * @param value Lens power measured in dioptres (0.25 units).
513         */
514        public VisionPrescriptionLensSpecificationComponent setSphere(long value) { 
515              this.sphere = new DecimalType();
516            this.sphere.setValue(value);
517          return this;
518        }
519
520        /**
521         * @param value Lens power measured in dioptres (0.25 units).
522         */
523        public VisionPrescriptionLensSpecificationComponent setSphere(double value) { 
524              this.sphere = new DecimalType();
525            this.sphere.setValue(value);
526          return this;
527        }
528
529        /**
530         * @return {@link #cylinder} (Power adjustment for astigmatism measured in dioptres (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getCylinder" gives direct access to the value
531         */
532        public DecimalType getCylinderElement() { 
533          if (this.cylinder == null)
534            if (Configuration.errorOnAutoCreate())
535              throw new Error("Attempt to auto-create VisionPrescriptionLensSpecificationComponent.cylinder");
536            else if (Configuration.doAutoCreate())
537              this.cylinder = new DecimalType(); // bb
538          return this.cylinder;
539        }
540
541        public boolean hasCylinderElement() { 
542          return this.cylinder != null && !this.cylinder.isEmpty();
543        }
544
545        public boolean hasCylinder() { 
546          return this.cylinder != null && !this.cylinder.isEmpty();
547        }
548
549        /**
550         * @param value {@link #cylinder} (Power adjustment for astigmatism measured in dioptres (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getCylinder" gives direct access to the value
551         */
552        public VisionPrescriptionLensSpecificationComponent setCylinderElement(DecimalType value) { 
553          this.cylinder = value;
554          return this;
555        }
556
557        /**
558         * @return Power adjustment for astigmatism measured in dioptres (0.25 units).
559         */
560        public BigDecimal getCylinder() { 
561          return this.cylinder == null ? null : this.cylinder.getValue();
562        }
563
564        /**
565         * @param value Power adjustment for astigmatism measured in dioptres (0.25 units).
566         */
567        public VisionPrescriptionLensSpecificationComponent setCylinder(BigDecimal value) { 
568          if (value == null)
569            this.cylinder = null;
570          else {
571            if (this.cylinder == null)
572              this.cylinder = new DecimalType();
573            this.cylinder.setValue(value);
574          }
575          return this;
576        }
577
578        /**
579         * @param value Power adjustment for astigmatism measured in dioptres (0.25 units).
580         */
581        public VisionPrescriptionLensSpecificationComponent setCylinder(long value) { 
582              this.cylinder = new DecimalType();
583            this.cylinder.setValue(value);
584          return this;
585        }
586
587        /**
588         * @param value Power adjustment for astigmatism measured in dioptres (0.25 units).
589         */
590        public VisionPrescriptionLensSpecificationComponent setCylinder(double value) { 
591              this.cylinder = new DecimalType();
592            this.cylinder.setValue(value);
593          return this;
594        }
595
596        /**
597         * @return {@link #axis} (Adjustment for astigmatism measured in integer degrees.). This is the underlying object with id, value and extensions. The accessor "getAxis" gives direct access to the value
598         */
599        public IntegerType getAxisElement() { 
600          if (this.axis == null)
601            if (Configuration.errorOnAutoCreate())
602              throw new Error("Attempt to auto-create VisionPrescriptionLensSpecificationComponent.axis");
603            else if (Configuration.doAutoCreate())
604              this.axis = new IntegerType(); // bb
605          return this.axis;
606        }
607
608        public boolean hasAxisElement() { 
609          return this.axis != null && !this.axis.isEmpty();
610        }
611
612        public boolean hasAxis() { 
613          return this.axis != null && !this.axis.isEmpty();
614        }
615
616        /**
617         * @param value {@link #axis} (Adjustment for astigmatism measured in integer degrees.). This is the underlying object with id, value and extensions. The accessor "getAxis" gives direct access to the value
618         */
619        public VisionPrescriptionLensSpecificationComponent setAxisElement(IntegerType value) { 
620          this.axis = value;
621          return this;
622        }
623
624        /**
625         * @return Adjustment for astigmatism measured in integer degrees.
626         */
627        public int getAxis() { 
628          return this.axis == null || this.axis.isEmpty() ? 0 : this.axis.getValue();
629        }
630
631        /**
632         * @param value Adjustment for astigmatism measured in integer degrees.
633         */
634        public VisionPrescriptionLensSpecificationComponent setAxis(int value) { 
635            if (this.axis == null)
636              this.axis = new IntegerType();
637            this.axis.setValue(value);
638          return this;
639        }
640
641        /**
642         * @return {@link #prism} (Allows for adjustment on two axis.)
643         */
644        public List<PrismComponent> getPrism() { 
645          if (this.prism == null)
646            this.prism = new ArrayList<PrismComponent>();
647          return this.prism;
648        }
649
650        /**
651         * @return Returns a reference to <code>this</code> for easy method chaining
652         */
653        public VisionPrescriptionLensSpecificationComponent setPrism(List<PrismComponent> thePrism) { 
654          this.prism = thePrism;
655          return this;
656        }
657
658        public boolean hasPrism() { 
659          if (this.prism == null)
660            return false;
661          for (PrismComponent item : this.prism)
662            if (!item.isEmpty())
663              return true;
664          return false;
665        }
666
667        public PrismComponent addPrism() { //3
668          PrismComponent t = new PrismComponent();
669          if (this.prism == null)
670            this.prism = new ArrayList<PrismComponent>();
671          this.prism.add(t);
672          return t;
673        }
674
675        public VisionPrescriptionLensSpecificationComponent addPrism(PrismComponent t) { //3
676          if (t == null)
677            return this;
678          if (this.prism == null)
679            this.prism = new ArrayList<PrismComponent>();
680          this.prism.add(t);
681          return this;
682        }
683
684        /**
685         * @return The first repetition of repeating field {@link #prism}, creating it if it does not already exist {3}
686         */
687        public PrismComponent getPrismFirstRep() { 
688          if (getPrism().isEmpty()) {
689            addPrism();
690          }
691          return getPrism().get(0);
692        }
693
694        /**
695         * @return {@link #add} (Power adjustment for multifocal lenses measured in dioptres (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getAdd" gives direct access to the value
696         */
697        public DecimalType getAddElement() { 
698          if (this.add == null)
699            if (Configuration.errorOnAutoCreate())
700              throw new Error("Attempt to auto-create VisionPrescriptionLensSpecificationComponent.add");
701            else if (Configuration.doAutoCreate())
702              this.add = new DecimalType(); // bb
703          return this.add;
704        }
705
706        public boolean hasAddElement() { 
707          return this.add != null && !this.add.isEmpty();
708        }
709
710        public boolean hasAdd() { 
711          return this.add != null && !this.add.isEmpty();
712        }
713
714        /**
715         * @param value {@link #add} (Power adjustment for multifocal lenses measured in dioptres (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getAdd" gives direct access to the value
716         */
717        public VisionPrescriptionLensSpecificationComponent setAddElement(DecimalType value) { 
718          this.add = value;
719          return this;
720        }
721
722        /**
723         * @return Power adjustment for multifocal lenses measured in dioptres (0.25 units).
724         */
725        public BigDecimal getAdd() { 
726          return this.add == null ? null : this.add.getValue();
727        }
728
729        /**
730         * @param value Power adjustment for multifocal lenses measured in dioptres (0.25 units).
731         */
732        public VisionPrescriptionLensSpecificationComponent setAdd(BigDecimal value) { 
733          if (value == null)
734            this.add = null;
735          else {
736            if (this.add == null)
737              this.add = new DecimalType();
738            this.add.setValue(value);
739          }
740          return this;
741        }
742
743        /**
744         * @param value Power adjustment for multifocal lenses measured in dioptres (0.25 units).
745         */
746        public VisionPrescriptionLensSpecificationComponent setAdd(long value) { 
747              this.add = new DecimalType();
748            this.add.setValue(value);
749          return this;
750        }
751
752        /**
753         * @param value Power adjustment for multifocal lenses measured in dioptres (0.25 units).
754         */
755        public VisionPrescriptionLensSpecificationComponent setAdd(double value) { 
756              this.add = new DecimalType();
757            this.add.setValue(value);
758          return this;
759        }
760
761        /**
762         * @return {@link #power} (Contact lens power measured in dioptres (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getPower" gives direct access to the value
763         */
764        public DecimalType getPowerElement() { 
765          if (this.power == null)
766            if (Configuration.errorOnAutoCreate())
767              throw new Error("Attempt to auto-create VisionPrescriptionLensSpecificationComponent.power");
768            else if (Configuration.doAutoCreate())
769              this.power = new DecimalType(); // bb
770          return this.power;
771        }
772
773        public boolean hasPowerElement() { 
774          return this.power != null && !this.power.isEmpty();
775        }
776
777        public boolean hasPower() { 
778          return this.power != null && !this.power.isEmpty();
779        }
780
781        /**
782         * @param value {@link #power} (Contact lens power measured in dioptres (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getPower" gives direct access to the value
783         */
784        public VisionPrescriptionLensSpecificationComponent setPowerElement(DecimalType value) { 
785          this.power = value;
786          return this;
787        }
788
789        /**
790         * @return Contact lens power measured in dioptres (0.25 units).
791         */
792        public BigDecimal getPower() { 
793          return this.power == null ? null : this.power.getValue();
794        }
795
796        /**
797         * @param value Contact lens power measured in dioptres (0.25 units).
798         */
799        public VisionPrescriptionLensSpecificationComponent setPower(BigDecimal value) { 
800          if (value == null)
801            this.power = null;
802          else {
803            if (this.power == null)
804              this.power = new DecimalType();
805            this.power.setValue(value);
806          }
807          return this;
808        }
809
810        /**
811         * @param value Contact lens power measured in dioptres (0.25 units).
812         */
813        public VisionPrescriptionLensSpecificationComponent setPower(long value) { 
814              this.power = new DecimalType();
815            this.power.setValue(value);
816          return this;
817        }
818
819        /**
820         * @param value Contact lens power measured in dioptres (0.25 units).
821         */
822        public VisionPrescriptionLensSpecificationComponent setPower(double value) { 
823              this.power = new DecimalType();
824            this.power.setValue(value);
825          return this;
826        }
827
828        /**
829         * @return {@link #backCurve} (Back curvature measured in millimetres.). This is the underlying object with id, value and extensions. The accessor "getBackCurve" gives direct access to the value
830         */
831        public DecimalType getBackCurveElement() { 
832          if (this.backCurve == null)
833            if (Configuration.errorOnAutoCreate())
834              throw new Error("Attempt to auto-create VisionPrescriptionLensSpecificationComponent.backCurve");
835            else if (Configuration.doAutoCreate())
836              this.backCurve = new DecimalType(); // bb
837          return this.backCurve;
838        }
839
840        public boolean hasBackCurveElement() { 
841          return this.backCurve != null && !this.backCurve.isEmpty();
842        }
843
844        public boolean hasBackCurve() { 
845          return this.backCurve != null && !this.backCurve.isEmpty();
846        }
847
848        /**
849         * @param value {@link #backCurve} (Back curvature measured in millimetres.). This is the underlying object with id, value and extensions. The accessor "getBackCurve" gives direct access to the value
850         */
851        public VisionPrescriptionLensSpecificationComponent setBackCurveElement(DecimalType value) { 
852          this.backCurve = value;
853          return this;
854        }
855
856        /**
857         * @return Back curvature measured in millimetres.
858         */
859        public BigDecimal getBackCurve() { 
860          return this.backCurve == null ? null : this.backCurve.getValue();
861        }
862
863        /**
864         * @param value Back curvature measured in millimetres.
865         */
866        public VisionPrescriptionLensSpecificationComponent setBackCurve(BigDecimal value) { 
867          if (value == null)
868            this.backCurve = null;
869          else {
870            if (this.backCurve == null)
871              this.backCurve = new DecimalType();
872            this.backCurve.setValue(value);
873          }
874          return this;
875        }
876
877        /**
878         * @param value Back curvature measured in millimetres.
879         */
880        public VisionPrescriptionLensSpecificationComponent setBackCurve(long value) { 
881              this.backCurve = new DecimalType();
882            this.backCurve.setValue(value);
883          return this;
884        }
885
886        /**
887         * @param value Back curvature measured in millimetres.
888         */
889        public VisionPrescriptionLensSpecificationComponent setBackCurve(double value) { 
890              this.backCurve = new DecimalType();
891            this.backCurve.setValue(value);
892          return this;
893        }
894
895        /**
896         * @return {@link #diameter} (Contact lens diameter measured in millimetres.). This is the underlying object with id, value and extensions. The accessor "getDiameter" gives direct access to the value
897         */
898        public DecimalType getDiameterElement() { 
899          if (this.diameter == null)
900            if (Configuration.errorOnAutoCreate())
901              throw new Error("Attempt to auto-create VisionPrescriptionLensSpecificationComponent.diameter");
902            else if (Configuration.doAutoCreate())
903              this.diameter = new DecimalType(); // bb
904          return this.diameter;
905        }
906
907        public boolean hasDiameterElement() { 
908          return this.diameter != null && !this.diameter.isEmpty();
909        }
910
911        public boolean hasDiameter() { 
912          return this.diameter != null && !this.diameter.isEmpty();
913        }
914
915        /**
916         * @param value {@link #diameter} (Contact lens diameter measured in millimetres.). This is the underlying object with id, value and extensions. The accessor "getDiameter" gives direct access to the value
917         */
918        public VisionPrescriptionLensSpecificationComponent setDiameterElement(DecimalType value) { 
919          this.diameter = value;
920          return this;
921        }
922
923        /**
924         * @return Contact lens diameter measured in millimetres.
925         */
926        public BigDecimal getDiameter() { 
927          return this.diameter == null ? null : this.diameter.getValue();
928        }
929
930        /**
931         * @param value Contact lens diameter measured in millimetres.
932         */
933        public VisionPrescriptionLensSpecificationComponent setDiameter(BigDecimal value) { 
934          if (value == null)
935            this.diameter = null;
936          else {
937            if (this.diameter == null)
938              this.diameter = new DecimalType();
939            this.diameter.setValue(value);
940          }
941          return this;
942        }
943
944        /**
945         * @param value Contact lens diameter measured in millimetres.
946         */
947        public VisionPrescriptionLensSpecificationComponent setDiameter(long value) { 
948              this.diameter = new DecimalType();
949            this.diameter.setValue(value);
950          return this;
951        }
952
953        /**
954         * @param value Contact lens diameter measured in millimetres.
955         */
956        public VisionPrescriptionLensSpecificationComponent setDiameter(double value) { 
957              this.diameter = new DecimalType();
958            this.diameter.setValue(value);
959          return this;
960        }
961
962        /**
963         * @return {@link #duration} (The recommended maximum wear period for the lens.)
964         */
965        public Quantity getDuration() { 
966          if (this.duration == null)
967            if (Configuration.errorOnAutoCreate())
968              throw new Error("Attempt to auto-create VisionPrescriptionLensSpecificationComponent.duration");
969            else if (Configuration.doAutoCreate())
970              this.duration = new Quantity(); // cc
971          return this.duration;
972        }
973
974        public boolean hasDuration() { 
975          return this.duration != null && !this.duration.isEmpty();
976        }
977
978        /**
979         * @param value {@link #duration} (The recommended maximum wear period for the lens.)
980         */
981        public VisionPrescriptionLensSpecificationComponent setDuration(Quantity value) { 
982          this.duration = value;
983          return this;
984        }
985
986        /**
987         * @return {@link #color} (Special color or pattern.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value
988         */
989        public StringType getColorElement() { 
990          if (this.color == null)
991            if (Configuration.errorOnAutoCreate())
992              throw new Error("Attempt to auto-create VisionPrescriptionLensSpecificationComponent.color");
993            else if (Configuration.doAutoCreate())
994              this.color = new StringType(); // bb
995          return this.color;
996        }
997
998        public boolean hasColorElement() { 
999          return this.color != null && !this.color.isEmpty();
1000        }
1001
1002        public boolean hasColor() { 
1003          return this.color != null && !this.color.isEmpty();
1004        }
1005
1006        /**
1007         * @param value {@link #color} (Special color or pattern.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value
1008         */
1009        public VisionPrescriptionLensSpecificationComponent setColorElement(StringType value) { 
1010          this.color = value;
1011          return this;
1012        }
1013
1014        /**
1015         * @return Special color or pattern.
1016         */
1017        public String getColor() { 
1018          return this.color == null ? null : this.color.getValue();
1019        }
1020
1021        /**
1022         * @param value Special color or pattern.
1023         */
1024        public VisionPrescriptionLensSpecificationComponent setColor(String value) { 
1025          if (Utilities.noString(value))
1026            this.color = null;
1027          else {
1028            if (this.color == null)
1029              this.color = new StringType();
1030            this.color.setValue(value);
1031          }
1032          return this;
1033        }
1034
1035        /**
1036         * @return {@link #brand} (Brand recommendations or restrictions.). This is the underlying object with id, value and extensions. The accessor "getBrand" gives direct access to the value
1037         */
1038        public StringType getBrandElement() { 
1039          if (this.brand == null)
1040            if (Configuration.errorOnAutoCreate())
1041              throw new Error("Attempt to auto-create VisionPrescriptionLensSpecificationComponent.brand");
1042            else if (Configuration.doAutoCreate())
1043              this.brand = new StringType(); // bb
1044          return this.brand;
1045        }
1046
1047        public boolean hasBrandElement() { 
1048          return this.brand != null && !this.brand.isEmpty();
1049        }
1050
1051        public boolean hasBrand() { 
1052          return this.brand != null && !this.brand.isEmpty();
1053        }
1054
1055        /**
1056         * @param value {@link #brand} (Brand recommendations or restrictions.). This is the underlying object with id, value and extensions. The accessor "getBrand" gives direct access to the value
1057         */
1058        public VisionPrescriptionLensSpecificationComponent setBrandElement(StringType value) { 
1059          this.brand = value;
1060          return this;
1061        }
1062
1063        /**
1064         * @return Brand recommendations or restrictions.
1065         */
1066        public String getBrand() { 
1067          return this.brand == null ? null : this.brand.getValue();
1068        }
1069
1070        /**
1071         * @param value Brand recommendations or restrictions.
1072         */
1073        public VisionPrescriptionLensSpecificationComponent setBrand(String value) { 
1074          if (Utilities.noString(value))
1075            this.brand = null;
1076          else {
1077            if (this.brand == null)
1078              this.brand = new StringType();
1079            this.brand.setValue(value);
1080          }
1081          return this;
1082        }
1083
1084        /**
1085         * @return {@link #note} (Notes for special requirements such as coatings and lens materials.)
1086         */
1087        public List<Annotation> getNote() { 
1088          if (this.note == null)
1089            this.note = new ArrayList<Annotation>();
1090          return this.note;
1091        }
1092
1093        /**
1094         * @return Returns a reference to <code>this</code> for easy method chaining
1095         */
1096        public VisionPrescriptionLensSpecificationComponent setNote(List<Annotation> theNote) { 
1097          this.note = theNote;
1098          return this;
1099        }
1100
1101        public boolean hasNote() { 
1102          if (this.note == null)
1103            return false;
1104          for (Annotation item : this.note)
1105            if (!item.isEmpty())
1106              return true;
1107          return false;
1108        }
1109
1110        public Annotation addNote() { //3
1111          Annotation t = new Annotation();
1112          if (this.note == null)
1113            this.note = new ArrayList<Annotation>();
1114          this.note.add(t);
1115          return t;
1116        }
1117
1118        public VisionPrescriptionLensSpecificationComponent addNote(Annotation t) { //3
1119          if (t == null)
1120            return this;
1121          if (this.note == null)
1122            this.note = new ArrayList<Annotation>();
1123          this.note.add(t);
1124          return this;
1125        }
1126
1127        /**
1128         * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
1129         */
1130        public Annotation getNoteFirstRep() { 
1131          if (getNote().isEmpty()) {
1132            addNote();
1133          }
1134          return getNote().get(0);
1135        }
1136
1137        protected void listChildren(List<Property> children) {
1138          super.listChildren(children);
1139          children.add(new Property("product", "CodeableConcept", "Identifies the type of vision correction product which is required for the patient.", 0, 1, product));
1140          children.add(new Property("eye", "code", "The eye for which the lens specification applies.", 0, 1, eye));
1141          children.add(new Property("sphere", "decimal", "Lens power measured in dioptres (0.25 units).", 0, 1, sphere));
1142          children.add(new Property("cylinder", "decimal", "Power adjustment for astigmatism measured in dioptres (0.25 units).", 0, 1, cylinder));
1143          children.add(new Property("axis", "integer", "Adjustment for astigmatism measured in integer degrees.", 0, 1, axis));
1144          children.add(new Property("prism", "", "Allows for adjustment on two axis.", 0, java.lang.Integer.MAX_VALUE, prism));
1145          children.add(new Property("add", "decimal", "Power adjustment for multifocal lenses measured in dioptres (0.25 units).", 0, 1, add));
1146          children.add(new Property("power", "decimal", "Contact lens power measured in dioptres (0.25 units).", 0, 1, power));
1147          children.add(new Property("backCurve", "decimal", "Back curvature measured in millimetres.", 0, 1, backCurve));
1148          children.add(new Property("diameter", "decimal", "Contact lens diameter measured in millimetres.", 0, 1, diameter));
1149          children.add(new Property("duration", "Quantity", "The recommended maximum wear period for the lens.", 0, 1, duration));
1150          children.add(new Property("color", "string", "Special color or pattern.", 0, 1, color));
1151          children.add(new Property("brand", "string", "Brand recommendations or restrictions.", 0, 1, brand));
1152          children.add(new Property("note", "Annotation", "Notes for special requirements such as coatings and lens materials.", 0, java.lang.Integer.MAX_VALUE, note));
1153        }
1154
1155        @Override
1156        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1157          switch (_hash) {
1158          case -309474065: /*product*/  return new Property("product", "CodeableConcept", "Identifies the type of vision correction product which is required for the patient.", 0, 1, product);
1159          case 100913: /*eye*/  return new Property("eye", "code", "The eye for which the lens specification applies.", 0, 1, eye);
1160          case -895981619: /*sphere*/  return new Property("sphere", "decimal", "Lens power measured in dioptres (0.25 units).", 0, 1, sphere);
1161          case -349378602: /*cylinder*/  return new Property("cylinder", "decimal", "Power adjustment for astigmatism measured in dioptres (0.25 units).", 0, 1, cylinder);
1162          case 3008417: /*axis*/  return new Property("axis", "integer", "Adjustment for astigmatism measured in integer degrees.", 0, 1, axis);
1163          case 106935105: /*prism*/  return new Property("prism", "", "Allows for adjustment on two axis.", 0, java.lang.Integer.MAX_VALUE, prism);
1164          case 96417: /*add*/  return new Property("add", "decimal", "Power adjustment for multifocal lenses measured in dioptres (0.25 units).", 0, 1, add);
1165          case 106858757: /*power*/  return new Property("power", "decimal", "Contact lens power measured in dioptres (0.25 units).", 0, 1, power);
1166          case 1309344840: /*backCurve*/  return new Property("backCurve", "decimal", "Back curvature measured in millimetres.", 0, 1, backCurve);
1167          case -233204595: /*diameter*/  return new Property("diameter", "decimal", "Contact lens diameter measured in millimetres.", 0, 1, diameter);
1168          case -1992012396: /*duration*/  return new Property("duration", "Quantity", "The recommended maximum wear period for the lens.", 0, 1, duration);
1169          case 94842723: /*color*/  return new Property("color", "string", "Special color or pattern.", 0, 1, color);
1170          case 93997959: /*brand*/  return new Property("brand", "string", "Brand recommendations or restrictions.", 0, 1, brand);
1171          case 3387378: /*note*/  return new Property("note", "Annotation", "Notes for special requirements such as coatings and lens materials.", 0, java.lang.Integer.MAX_VALUE, note);
1172          default: return super.getNamedProperty(_hash, _name, _checkValid);
1173          }
1174
1175        }
1176
1177      @Override
1178      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1179        switch (hash) {
1180        case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // CodeableConcept
1181        case 100913: /*eye*/ return this.eye == null ? new Base[0] : new Base[] {this.eye}; // Enumeration<VisionEyes>
1182        case -895981619: /*sphere*/ return this.sphere == null ? new Base[0] : new Base[] {this.sphere}; // DecimalType
1183        case -349378602: /*cylinder*/ return this.cylinder == null ? new Base[0] : new Base[] {this.cylinder}; // DecimalType
1184        case 3008417: /*axis*/ return this.axis == null ? new Base[0] : new Base[] {this.axis}; // IntegerType
1185        case 106935105: /*prism*/ return this.prism == null ? new Base[0] : this.prism.toArray(new Base[this.prism.size()]); // PrismComponent
1186        case 96417: /*add*/ return this.add == null ? new Base[0] : new Base[] {this.add}; // DecimalType
1187        case 106858757: /*power*/ return this.power == null ? new Base[0] : new Base[] {this.power}; // DecimalType
1188        case 1309344840: /*backCurve*/ return this.backCurve == null ? new Base[0] : new Base[] {this.backCurve}; // DecimalType
1189        case -233204595: /*diameter*/ return this.diameter == null ? new Base[0] : new Base[] {this.diameter}; // DecimalType
1190        case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // Quantity
1191        case 94842723: /*color*/ return this.color == null ? new Base[0] : new Base[] {this.color}; // StringType
1192        case 93997959: /*brand*/ return this.brand == null ? new Base[0] : new Base[] {this.brand}; // StringType
1193        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1194        default: return super.getProperty(hash, name, checkValid);
1195        }
1196
1197      }
1198
1199      @Override
1200      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1201        switch (hash) {
1202        case -309474065: // product
1203          this.product = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1204          return value;
1205        case 100913: // eye
1206          value = new VisionEyesEnumFactory().fromType(TypeConvertor.castToCode(value));
1207          this.eye = (Enumeration) value; // Enumeration<VisionEyes>
1208          return value;
1209        case -895981619: // sphere
1210          this.sphere = TypeConvertor.castToDecimal(value); // DecimalType
1211          return value;
1212        case -349378602: // cylinder
1213          this.cylinder = TypeConvertor.castToDecimal(value); // DecimalType
1214          return value;
1215        case 3008417: // axis
1216          this.axis = TypeConvertor.castToInteger(value); // IntegerType
1217          return value;
1218        case 106935105: // prism
1219          this.getPrism().add((PrismComponent) value); // PrismComponent
1220          return value;
1221        case 96417: // add
1222          this.add = TypeConvertor.castToDecimal(value); // DecimalType
1223          return value;
1224        case 106858757: // power
1225          this.power = TypeConvertor.castToDecimal(value); // DecimalType
1226          return value;
1227        case 1309344840: // backCurve
1228          this.backCurve = TypeConvertor.castToDecimal(value); // DecimalType
1229          return value;
1230        case -233204595: // diameter
1231          this.diameter = TypeConvertor.castToDecimal(value); // DecimalType
1232          return value;
1233        case -1992012396: // duration
1234          this.duration = TypeConvertor.castToQuantity(value); // Quantity
1235          return value;
1236        case 94842723: // color
1237          this.color = TypeConvertor.castToString(value); // StringType
1238          return value;
1239        case 93997959: // brand
1240          this.brand = TypeConvertor.castToString(value); // StringType
1241          return value;
1242        case 3387378: // note
1243          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
1244          return value;
1245        default: return super.setProperty(hash, name, value);
1246        }
1247
1248      }
1249
1250      @Override
1251      public Base setProperty(String name, Base value) throws FHIRException {
1252        if (name.equals("product")) {
1253          this.product = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1254        } else if (name.equals("eye")) {
1255          value = new VisionEyesEnumFactory().fromType(TypeConvertor.castToCode(value));
1256          this.eye = (Enumeration) value; // Enumeration<VisionEyes>
1257        } else if (name.equals("sphere")) {
1258          this.sphere = TypeConvertor.castToDecimal(value); // DecimalType
1259        } else if (name.equals("cylinder")) {
1260          this.cylinder = TypeConvertor.castToDecimal(value); // DecimalType
1261        } else if (name.equals("axis")) {
1262          this.axis = TypeConvertor.castToInteger(value); // IntegerType
1263        } else if (name.equals("prism")) {
1264          this.getPrism().add((PrismComponent) value);
1265        } else if (name.equals("add")) {
1266          this.add = TypeConvertor.castToDecimal(value); // DecimalType
1267        } else if (name.equals("power")) {
1268          this.power = TypeConvertor.castToDecimal(value); // DecimalType
1269        } else if (name.equals("backCurve")) {
1270          this.backCurve = TypeConvertor.castToDecimal(value); // DecimalType
1271        } else if (name.equals("diameter")) {
1272          this.diameter = TypeConvertor.castToDecimal(value); // DecimalType
1273        } else if (name.equals("duration")) {
1274          this.duration = TypeConvertor.castToQuantity(value); // Quantity
1275        } else if (name.equals("color")) {
1276          this.color = TypeConvertor.castToString(value); // StringType
1277        } else if (name.equals("brand")) {
1278          this.brand = TypeConvertor.castToString(value); // StringType
1279        } else if (name.equals("note")) {
1280          this.getNote().add(TypeConvertor.castToAnnotation(value));
1281        } else
1282          return super.setProperty(name, value);
1283        return value;
1284      }
1285
1286      @Override
1287      public Base makeProperty(int hash, String name) throws FHIRException {
1288        switch (hash) {
1289        case -309474065:  return getProduct();
1290        case 100913:  return getEyeElement();
1291        case -895981619:  return getSphereElement();
1292        case -349378602:  return getCylinderElement();
1293        case 3008417:  return getAxisElement();
1294        case 106935105:  return addPrism(); 
1295        case 96417:  return getAddElement();
1296        case 106858757:  return getPowerElement();
1297        case 1309344840:  return getBackCurveElement();
1298        case -233204595:  return getDiameterElement();
1299        case -1992012396:  return getDuration();
1300        case 94842723:  return getColorElement();
1301        case 93997959:  return getBrandElement();
1302        case 3387378:  return addNote(); 
1303        default: return super.makeProperty(hash, name);
1304        }
1305
1306      }
1307
1308      @Override
1309      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1310        switch (hash) {
1311        case -309474065: /*product*/ return new String[] {"CodeableConcept"};
1312        case 100913: /*eye*/ return new String[] {"code"};
1313        case -895981619: /*sphere*/ return new String[] {"decimal"};
1314        case -349378602: /*cylinder*/ return new String[] {"decimal"};
1315        case 3008417: /*axis*/ return new String[] {"integer"};
1316        case 106935105: /*prism*/ return new String[] {};
1317        case 96417: /*add*/ return new String[] {"decimal"};
1318        case 106858757: /*power*/ return new String[] {"decimal"};
1319        case 1309344840: /*backCurve*/ return new String[] {"decimal"};
1320        case -233204595: /*diameter*/ return new String[] {"decimal"};
1321        case -1992012396: /*duration*/ return new String[] {"Quantity"};
1322        case 94842723: /*color*/ return new String[] {"string"};
1323        case 93997959: /*brand*/ return new String[] {"string"};
1324        case 3387378: /*note*/ return new String[] {"Annotation"};
1325        default: return super.getTypesForProperty(hash, name);
1326        }
1327
1328      }
1329
1330      @Override
1331      public Base addChild(String name) throws FHIRException {
1332        if (name.equals("product")) {
1333          this.product = new CodeableConcept();
1334          return this.product;
1335        }
1336        else if (name.equals("eye")) {
1337          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.lensSpecification.eye");
1338        }
1339        else if (name.equals("sphere")) {
1340          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.lensSpecification.sphere");
1341        }
1342        else if (name.equals("cylinder")) {
1343          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.lensSpecification.cylinder");
1344        }
1345        else if (name.equals("axis")) {
1346          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.lensSpecification.axis");
1347        }
1348        else if (name.equals("prism")) {
1349          return addPrism();
1350        }
1351        else if (name.equals("add")) {
1352          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.lensSpecification.add");
1353        }
1354        else if (name.equals("power")) {
1355          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.lensSpecification.power");
1356        }
1357        else if (name.equals("backCurve")) {
1358          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.lensSpecification.backCurve");
1359        }
1360        else if (name.equals("diameter")) {
1361          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.lensSpecification.diameter");
1362        }
1363        else if (name.equals("duration")) {
1364          this.duration = new Quantity();
1365          return this.duration;
1366        }
1367        else if (name.equals("color")) {
1368          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.lensSpecification.color");
1369        }
1370        else if (name.equals("brand")) {
1371          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.lensSpecification.brand");
1372        }
1373        else if (name.equals("note")) {
1374          return addNote();
1375        }
1376        else
1377          return super.addChild(name);
1378      }
1379
1380      public VisionPrescriptionLensSpecificationComponent copy() {
1381        VisionPrescriptionLensSpecificationComponent dst = new VisionPrescriptionLensSpecificationComponent();
1382        copyValues(dst);
1383        return dst;
1384      }
1385
1386      public void copyValues(VisionPrescriptionLensSpecificationComponent dst) {
1387        super.copyValues(dst);
1388        dst.product = product == null ? null : product.copy();
1389        dst.eye = eye == null ? null : eye.copy();
1390        dst.sphere = sphere == null ? null : sphere.copy();
1391        dst.cylinder = cylinder == null ? null : cylinder.copy();
1392        dst.axis = axis == null ? null : axis.copy();
1393        if (prism != null) {
1394          dst.prism = new ArrayList<PrismComponent>();
1395          for (PrismComponent i : prism)
1396            dst.prism.add(i.copy());
1397        };
1398        dst.add = add == null ? null : add.copy();
1399        dst.power = power == null ? null : power.copy();
1400        dst.backCurve = backCurve == null ? null : backCurve.copy();
1401        dst.diameter = diameter == null ? null : diameter.copy();
1402        dst.duration = duration == null ? null : duration.copy();
1403        dst.color = color == null ? null : color.copy();
1404        dst.brand = brand == null ? null : brand.copy();
1405        if (note != null) {
1406          dst.note = new ArrayList<Annotation>();
1407          for (Annotation i : note)
1408            dst.note.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 VisionPrescriptionLensSpecificationComponent))
1417          return false;
1418        VisionPrescriptionLensSpecificationComponent o = (VisionPrescriptionLensSpecificationComponent) other_;
1419        return compareDeep(product, o.product, true) && compareDeep(eye, o.eye, true) && compareDeep(sphere, o.sphere, true)
1420           && compareDeep(cylinder, o.cylinder, true) && compareDeep(axis, o.axis, true) && compareDeep(prism, o.prism, true)
1421           && compareDeep(add, o.add, true) && compareDeep(power, o.power, true) && compareDeep(backCurve, o.backCurve, true)
1422           && compareDeep(diameter, o.diameter, true) && compareDeep(duration, o.duration, true) && compareDeep(color, o.color, true)
1423           && compareDeep(brand, o.brand, true) && compareDeep(note, o.note, true);
1424      }
1425
1426      @Override
1427      public boolean equalsShallow(Base other_) {
1428        if (!super.equalsShallow(other_))
1429          return false;
1430        if (!(other_ instanceof VisionPrescriptionLensSpecificationComponent))
1431          return false;
1432        VisionPrescriptionLensSpecificationComponent o = (VisionPrescriptionLensSpecificationComponent) other_;
1433        return compareValues(eye, o.eye, true) && compareValues(sphere, o.sphere, true) && compareValues(cylinder, o.cylinder, true)
1434           && compareValues(axis, o.axis, true) && compareValues(add, o.add, true) && compareValues(power, o.power, true)
1435           && compareValues(backCurve, o.backCurve, true) && compareValues(diameter, o.diameter, true) && compareValues(color, o.color, true)
1436           && compareValues(brand, o.brand, true);
1437      }
1438
1439      public boolean isEmpty() {
1440        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(product, eye, sphere, cylinder
1441          , axis, prism, add, power, backCurve, diameter, duration, color, brand, note
1442          );
1443      }
1444
1445  public String fhirType() {
1446    return "VisionPrescription.lensSpecification";
1447
1448  }
1449
1450  }
1451
1452    @Block()
1453    public static class PrismComponent extends BackboneElement implements IBaseBackboneElement {
1454        /**
1455         * Amount of prism to compensate for eye alignment in fractional units.
1456         */
1457        @Child(name = "amount", type = {DecimalType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1458        @Description(shortDefinition="Amount of adjustment", formalDefinition="Amount of prism to compensate for eye alignment in fractional units." )
1459        protected DecimalType amount;
1460
1461        /**
1462         * The relative base, or reference lens edge, for the prism.
1463         */
1464        @Child(name = "base", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false)
1465        @Description(shortDefinition="up | down | in | out", formalDefinition="The relative base, or reference lens edge, for the prism." )
1466        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/vision-base-codes")
1467        protected Enumeration<VisionBase> base;
1468
1469        private static final long serialVersionUID = 1677247628L;
1470
1471    /**
1472     * Constructor
1473     */
1474      public PrismComponent() {
1475        super();
1476      }
1477
1478    /**
1479     * Constructor
1480     */
1481      public PrismComponent(BigDecimal amount, VisionBase base) {
1482        super();
1483        this.setAmount(amount);
1484        this.setBase(base);
1485      }
1486
1487        /**
1488         * @return {@link #amount} (Amount of prism to compensate for eye alignment in fractional units.). This is the underlying object with id, value and extensions. The accessor "getAmount" gives direct access to the value
1489         */
1490        public DecimalType getAmountElement() { 
1491          if (this.amount == null)
1492            if (Configuration.errorOnAutoCreate())
1493              throw new Error("Attempt to auto-create PrismComponent.amount");
1494            else if (Configuration.doAutoCreate())
1495              this.amount = new DecimalType(); // bb
1496          return this.amount;
1497        }
1498
1499        public boolean hasAmountElement() { 
1500          return this.amount != null && !this.amount.isEmpty();
1501        }
1502
1503        public boolean hasAmount() { 
1504          return this.amount != null && !this.amount.isEmpty();
1505        }
1506
1507        /**
1508         * @param value {@link #amount} (Amount of prism to compensate for eye alignment in fractional units.). This is the underlying object with id, value and extensions. The accessor "getAmount" gives direct access to the value
1509         */
1510        public PrismComponent setAmountElement(DecimalType value) { 
1511          this.amount = value;
1512          return this;
1513        }
1514
1515        /**
1516         * @return Amount of prism to compensate for eye alignment in fractional units.
1517         */
1518        public BigDecimal getAmount() { 
1519          return this.amount == null ? null : this.amount.getValue();
1520        }
1521
1522        /**
1523         * @param value Amount of prism to compensate for eye alignment in fractional units.
1524         */
1525        public PrismComponent setAmount(BigDecimal value) { 
1526            if (this.amount == null)
1527              this.amount = new DecimalType();
1528            this.amount.setValue(value);
1529          return this;
1530        }
1531
1532        /**
1533         * @param value Amount of prism to compensate for eye alignment in fractional units.
1534         */
1535        public PrismComponent setAmount(long value) { 
1536              this.amount = new DecimalType();
1537            this.amount.setValue(value);
1538          return this;
1539        }
1540
1541        /**
1542         * @param value Amount of prism to compensate for eye alignment in fractional units.
1543         */
1544        public PrismComponent setAmount(double value) { 
1545              this.amount = new DecimalType();
1546            this.amount.setValue(value);
1547          return this;
1548        }
1549
1550        /**
1551         * @return {@link #base} (The relative base, or reference lens edge, for the prism.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value
1552         */
1553        public Enumeration<VisionBase> getBaseElement() { 
1554          if (this.base == null)
1555            if (Configuration.errorOnAutoCreate())
1556              throw new Error("Attempt to auto-create PrismComponent.base");
1557            else if (Configuration.doAutoCreate())
1558              this.base = new Enumeration<VisionBase>(new VisionBaseEnumFactory()); // bb
1559          return this.base;
1560        }
1561
1562        public boolean hasBaseElement() { 
1563          return this.base != null && !this.base.isEmpty();
1564        }
1565
1566        public boolean hasBase() { 
1567          return this.base != null && !this.base.isEmpty();
1568        }
1569
1570        /**
1571         * @param value {@link #base} (The relative base, or reference lens edge, for the prism.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value
1572         */
1573        public PrismComponent setBaseElement(Enumeration<VisionBase> value) { 
1574          this.base = value;
1575          return this;
1576        }
1577
1578        /**
1579         * @return The relative base, or reference lens edge, for the prism.
1580         */
1581        public VisionBase getBase() { 
1582          return this.base == null ? null : this.base.getValue();
1583        }
1584
1585        /**
1586         * @param value The relative base, or reference lens edge, for the prism.
1587         */
1588        public PrismComponent setBase(VisionBase value) { 
1589            if (this.base == null)
1590              this.base = new Enumeration<VisionBase>(new VisionBaseEnumFactory());
1591            this.base.setValue(value);
1592          return this;
1593        }
1594
1595        protected void listChildren(List<Property> children) {
1596          super.listChildren(children);
1597          children.add(new Property("amount", "decimal", "Amount of prism to compensate for eye alignment in fractional units.", 0, 1, amount));
1598          children.add(new Property("base", "code", "The relative base, or reference lens edge, for the prism.", 0, 1, base));
1599        }
1600
1601        @Override
1602        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1603          switch (_hash) {
1604          case -1413853096: /*amount*/  return new Property("amount", "decimal", "Amount of prism to compensate for eye alignment in fractional units.", 0, 1, amount);
1605          case 3016401: /*base*/  return new Property("base", "code", "The relative base, or reference lens edge, for the prism.", 0, 1, base);
1606          default: return super.getNamedProperty(_hash, _name, _checkValid);
1607          }
1608
1609        }
1610
1611      @Override
1612      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1613        switch (hash) {
1614        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // DecimalType
1615        case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // Enumeration<VisionBase>
1616        default: return super.getProperty(hash, name, checkValid);
1617        }
1618
1619      }
1620
1621      @Override
1622      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1623        switch (hash) {
1624        case -1413853096: // amount
1625          this.amount = TypeConvertor.castToDecimal(value); // DecimalType
1626          return value;
1627        case 3016401: // base
1628          value = new VisionBaseEnumFactory().fromType(TypeConvertor.castToCode(value));
1629          this.base = (Enumeration) value; // Enumeration<VisionBase>
1630          return value;
1631        default: return super.setProperty(hash, name, value);
1632        }
1633
1634      }
1635
1636      @Override
1637      public Base setProperty(String name, Base value) throws FHIRException {
1638        if (name.equals("amount")) {
1639          this.amount = TypeConvertor.castToDecimal(value); // DecimalType
1640        } else if (name.equals("base")) {
1641          value = new VisionBaseEnumFactory().fromType(TypeConvertor.castToCode(value));
1642          this.base = (Enumeration) value; // Enumeration<VisionBase>
1643        } else
1644          return super.setProperty(name, value);
1645        return value;
1646      }
1647
1648      @Override
1649      public Base makeProperty(int hash, String name) throws FHIRException {
1650        switch (hash) {
1651        case -1413853096:  return getAmountElement();
1652        case 3016401:  return getBaseElement();
1653        default: return super.makeProperty(hash, name);
1654        }
1655
1656      }
1657
1658      @Override
1659      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1660        switch (hash) {
1661        case -1413853096: /*amount*/ return new String[] {"decimal"};
1662        case 3016401: /*base*/ return new String[] {"code"};
1663        default: return super.getTypesForProperty(hash, name);
1664        }
1665
1666      }
1667
1668      @Override
1669      public Base addChild(String name) throws FHIRException {
1670        if (name.equals("amount")) {
1671          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.lensSpecification.prism.amount");
1672        }
1673        else if (name.equals("base")) {
1674          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.lensSpecification.prism.base");
1675        }
1676        else
1677          return super.addChild(name);
1678      }
1679
1680      public PrismComponent copy() {
1681        PrismComponent dst = new PrismComponent();
1682        copyValues(dst);
1683        return dst;
1684      }
1685
1686      public void copyValues(PrismComponent dst) {
1687        super.copyValues(dst);
1688        dst.amount = amount == null ? null : amount.copy();
1689        dst.base = base == null ? null : base.copy();
1690      }
1691
1692      @Override
1693      public boolean equalsDeep(Base other_) {
1694        if (!super.equalsDeep(other_))
1695          return false;
1696        if (!(other_ instanceof PrismComponent))
1697          return false;
1698        PrismComponent o = (PrismComponent) other_;
1699        return compareDeep(amount, o.amount, true) && compareDeep(base, o.base, true);
1700      }
1701
1702      @Override
1703      public boolean equalsShallow(Base other_) {
1704        if (!super.equalsShallow(other_))
1705          return false;
1706        if (!(other_ instanceof PrismComponent))
1707          return false;
1708        PrismComponent o = (PrismComponent) other_;
1709        return compareValues(amount, o.amount, true) && compareValues(base, o.base, true);
1710      }
1711
1712      public boolean isEmpty() {
1713        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(amount, base);
1714      }
1715
1716  public String fhirType() {
1717    return "VisionPrescription.lensSpecification.prism";
1718
1719  }
1720
1721  }
1722
1723    /**
1724     * A unique identifier assigned to this vision prescription.
1725     */
1726    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1727    @Description(shortDefinition="Business Identifier for vision prescription", formalDefinition="A unique identifier assigned to this vision prescription." )
1728    protected List<Identifier> identifier;
1729
1730    /**
1731     * The status of the resource instance.
1732     */
1733    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
1734    @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." )
1735    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status")
1736    protected Enumeration<FinancialResourceStatusCodes> status;
1737
1738    /**
1739     * The date this resource was created.
1740     */
1741    @Child(name = "created", type = {DateTimeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
1742    @Description(shortDefinition="Response creation date", formalDefinition="The date this resource was created." )
1743    protected DateTimeType created;
1744
1745    /**
1746     * A resource reference to the person to whom the vision prescription applies.
1747     */
1748    @Child(name = "patient", type = {Patient.class}, order=3, min=1, max=1, modifier=false, summary=true)
1749    @Description(shortDefinition="Who prescription is for", formalDefinition="A resource reference to the person to whom the vision prescription applies." )
1750    protected Reference patient;
1751
1752    /**
1753     * A reference to a resource that identifies the particular occurrence of contact between patient and health care provider during which the prescription was issued.
1754     */
1755    @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1, modifier=false, summary=false)
1756    @Description(shortDefinition="Created during encounter / admission / stay", formalDefinition="A reference to a resource that identifies the particular occurrence of contact between patient and health care provider during which the prescription was issued." )
1757    protected Reference encounter;
1758
1759    /**
1760     * The date (and perhaps time) when the prescription was written.
1761     */
1762    @Child(name = "dateWritten", type = {DateTimeType.class}, order=5, min=1, max=1, modifier=false, summary=true)
1763    @Description(shortDefinition="When prescription was authorized", formalDefinition="The date (and perhaps time) when the prescription was written." )
1764    protected DateTimeType dateWritten;
1765
1766    /**
1767     * The healthcare professional responsible for authorizing the prescription.
1768     */
1769    @Child(name = "prescriber", type = {Practitioner.class, PractitionerRole.class}, order=6, min=1, max=1, modifier=false, summary=true)
1770    @Description(shortDefinition="Who authorized the vision prescription", formalDefinition="The healthcare professional responsible for authorizing the prescription." )
1771    protected Reference prescriber;
1772
1773    /**
1774     * Contain the details of  the individual lens specifications and serves as the authorization for the fullfillment by certified professionals.
1775     */
1776    @Child(name = "lensSpecification", type = {}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1777    @Description(shortDefinition="Vision lens authorization", formalDefinition="Contain the details of  the individual lens specifications and serves as the authorization for the fullfillment by certified professionals." )
1778    protected List<VisionPrescriptionLensSpecificationComponent> lensSpecification;
1779
1780    private static final long serialVersionUID = -194296688L;
1781
1782  /**
1783   * Constructor
1784   */
1785    public VisionPrescription() {
1786      super();
1787    }
1788
1789  /**
1790   * Constructor
1791   */
1792    public VisionPrescription(FinancialResourceStatusCodes status, Date created, Reference patient, Date dateWritten, Reference prescriber, VisionPrescriptionLensSpecificationComponent lensSpecification) {
1793      super();
1794      this.setStatus(status);
1795      this.setCreated(created);
1796      this.setPatient(patient);
1797      this.setDateWritten(dateWritten);
1798      this.setPrescriber(prescriber);
1799      this.addLensSpecification(lensSpecification);
1800    }
1801
1802    /**
1803     * @return {@link #identifier} (A unique identifier assigned to this vision prescription.)
1804     */
1805    public List<Identifier> getIdentifier() { 
1806      if (this.identifier == null)
1807        this.identifier = new ArrayList<Identifier>();
1808      return this.identifier;
1809    }
1810
1811    /**
1812     * @return Returns a reference to <code>this</code> for easy method chaining
1813     */
1814    public VisionPrescription setIdentifier(List<Identifier> theIdentifier) { 
1815      this.identifier = theIdentifier;
1816      return this;
1817    }
1818
1819    public boolean hasIdentifier() { 
1820      if (this.identifier == null)
1821        return false;
1822      for (Identifier item : this.identifier)
1823        if (!item.isEmpty())
1824          return true;
1825      return false;
1826    }
1827
1828    public Identifier addIdentifier() { //3
1829      Identifier t = new Identifier();
1830      if (this.identifier == null)
1831        this.identifier = new ArrayList<Identifier>();
1832      this.identifier.add(t);
1833      return t;
1834    }
1835
1836    public VisionPrescription addIdentifier(Identifier t) { //3
1837      if (t == null)
1838        return this;
1839      if (this.identifier == null)
1840        this.identifier = new ArrayList<Identifier>();
1841      this.identifier.add(t);
1842      return this;
1843    }
1844
1845    /**
1846     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1847     */
1848    public Identifier getIdentifierFirstRep() { 
1849      if (getIdentifier().isEmpty()) {
1850        addIdentifier();
1851      }
1852      return getIdentifier().get(0);
1853    }
1854
1855    /**
1856     * @return {@link #status} (The status of the resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1857     */
1858    public Enumeration<FinancialResourceStatusCodes> getStatusElement() { 
1859      if (this.status == null)
1860        if (Configuration.errorOnAutoCreate())
1861          throw new Error("Attempt to auto-create VisionPrescription.status");
1862        else if (Configuration.doAutoCreate())
1863          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory()); // bb
1864      return this.status;
1865    }
1866
1867    public boolean hasStatusElement() { 
1868      return this.status != null && !this.status.isEmpty();
1869    }
1870
1871    public boolean hasStatus() { 
1872      return this.status != null && !this.status.isEmpty();
1873    }
1874
1875    /**
1876     * @param value {@link #status} (The status of the resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1877     */
1878    public VisionPrescription setStatusElement(Enumeration<FinancialResourceStatusCodes> value) { 
1879      this.status = value;
1880      return this;
1881    }
1882
1883    /**
1884     * @return The status of the resource instance.
1885     */
1886    public FinancialResourceStatusCodes getStatus() { 
1887      return this.status == null ? null : this.status.getValue();
1888    }
1889
1890    /**
1891     * @param value The status of the resource instance.
1892     */
1893    public VisionPrescription setStatus(FinancialResourceStatusCodes value) { 
1894        if (this.status == null)
1895          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory());
1896        this.status.setValue(value);
1897      return this;
1898    }
1899
1900    /**
1901     * @return {@link #created} (The date this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
1902     */
1903    public DateTimeType getCreatedElement() { 
1904      if (this.created == null)
1905        if (Configuration.errorOnAutoCreate())
1906          throw new Error("Attempt to auto-create VisionPrescription.created");
1907        else if (Configuration.doAutoCreate())
1908          this.created = new DateTimeType(); // bb
1909      return this.created;
1910    }
1911
1912    public boolean hasCreatedElement() { 
1913      return this.created != null && !this.created.isEmpty();
1914    }
1915
1916    public boolean hasCreated() { 
1917      return this.created != null && !this.created.isEmpty();
1918    }
1919
1920    /**
1921     * @param value {@link #created} (The date this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
1922     */
1923    public VisionPrescription setCreatedElement(DateTimeType value) { 
1924      this.created = value;
1925      return this;
1926    }
1927
1928    /**
1929     * @return The date this resource was created.
1930     */
1931    public Date getCreated() { 
1932      return this.created == null ? null : this.created.getValue();
1933    }
1934
1935    /**
1936     * @param value The date this resource was created.
1937     */
1938    public VisionPrescription setCreated(Date value) { 
1939        if (this.created == null)
1940          this.created = new DateTimeType();
1941        this.created.setValue(value);
1942      return this;
1943    }
1944
1945    /**
1946     * @return {@link #patient} (A resource reference to the person to whom the vision prescription applies.)
1947     */
1948    public Reference getPatient() { 
1949      if (this.patient == null)
1950        if (Configuration.errorOnAutoCreate())
1951          throw new Error("Attempt to auto-create VisionPrescription.patient");
1952        else if (Configuration.doAutoCreate())
1953          this.patient = new Reference(); // cc
1954      return this.patient;
1955    }
1956
1957    public boolean hasPatient() { 
1958      return this.patient != null && !this.patient.isEmpty();
1959    }
1960
1961    /**
1962     * @param value {@link #patient} (A resource reference to the person to whom the vision prescription applies.)
1963     */
1964    public VisionPrescription setPatient(Reference value) { 
1965      this.patient = value;
1966      return this;
1967    }
1968
1969    /**
1970     * @return {@link #encounter} (A reference to a resource that identifies the particular occurrence of contact between patient and health care provider during which the prescription was issued.)
1971     */
1972    public Reference getEncounter() { 
1973      if (this.encounter == null)
1974        if (Configuration.errorOnAutoCreate())
1975          throw new Error("Attempt to auto-create VisionPrescription.encounter");
1976        else if (Configuration.doAutoCreate())
1977          this.encounter = new Reference(); // cc
1978      return this.encounter;
1979    }
1980
1981    public boolean hasEncounter() { 
1982      return this.encounter != null && !this.encounter.isEmpty();
1983    }
1984
1985    /**
1986     * @param value {@link #encounter} (A reference to a resource that identifies the particular occurrence of contact between patient and health care provider during which the prescription was issued.)
1987     */
1988    public VisionPrescription setEncounter(Reference value) { 
1989      this.encounter = value;
1990      return this;
1991    }
1992
1993    /**
1994     * @return {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value
1995     */
1996    public DateTimeType getDateWrittenElement() { 
1997      if (this.dateWritten == null)
1998        if (Configuration.errorOnAutoCreate())
1999          throw new Error("Attempt to auto-create VisionPrescription.dateWritten");
2000        else if (Configuration.doAutoCreate())
2001          this.dateWritten = new DateTimeType(); // bb
2002      return this.dateWritten;
2003    }
2004
2005    public boolean hasDateWrittenElement() { 
2006      return this.dateWritten != null && !this.dateWritten.isEmpty();
2007    }
2008
2009    public boolean hasDateWritten() { 
2010      return this.dateWritten != null && !this.dateWritten.isEmpty();
2011    }
2012
2013    /**
2014     * @param value {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value
2015     */
2016    public VisionPrescription setDateWrittenElement(DateTimeType value) { 
2017      this.dateWritten = value;
2018      return this;
2019    }
2020
2021    /**
2022     * @return The date (and perhaps time) when the prescription was written.
2023     */
2024    public Date getDateWritten() { 
2025      return this.dateWritten == null ? null : this.dateWritten.getValue();
2026    }
2027
2028    /**
2029     * @param value The date (and perhaps time) when the prescription was written.
2030     */
2031    public VisionPrescription setDateWritten(Date value) { 
2032        if (this.dateWritten == null)
2033          this.dateWritten = new DateTimeType();
2034        this.dateWritten.setValue(value);
2035      return this;
2036    }
2037
2038    /**
2039     * @return {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.)
2040     */
2041    public Reference getPrescriber() { 
2042      if (this.prescriber == null)
2043        if (Configuration.errorOnAutoCreate())
2044          throw new Error("Attempt to auto-create VisionPrescription.prescriber");
2045        else if (Configuration.doAutoCreate())
2046          this.prescriber = new Reference(); // cc
2047      return this.prescriber;
2048    }
2049
2050    public boolean hasPrescriber() { 
2051      return this.prescriber != null && !this.prescriber.isEmpty();
2052    }
2053
2054    /**
2055     * @param value {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.)
2056     */
2057    public VisionPrescription setPrescriber(Reference value) { 
2058      this.prescriber = value;
2059      return this;
2060    }
2061
2062    /**
2063     * @return {@link #lensSpecification} (Contain the details of  the individual lens specifications and serves as the authorization for the fullfillment by certified professionals.)
2064     */
2065    public List<VisionPrescriptionLensSpecificationComponent> getLensSpecification() { 
2066      if (this.lensSpecification == null)
2067        this.lensSpecification = new ArrayList<VisionPrescriptionLensSpecificationComponent>();
2068      return this.lensSpecification;
2069    }
2070
2071    /**
2072     * @return Returns a reference to <code>this</code> for easy method chaining
2073     */
2074    public VisionPrescription setLensSpecification(List<VisionPrescriptionLensSpecificationComponent> theLensSpecification) { 
2075      this.lensSpecification = theLensSpecification;
2076      return this;
2077    }
2078
2079    public boolean hasLensSpecification() { 
2080      if (this.lensSpecification == null)
2081        return false;
2082      for (VisionPrescriptionLensSpecificationComponent item : this.lensSpecification)
2083        if (!item.isEmpty())
2084          return true;
2085      return false;
2086    }
2087
2088    public VisionPrescriptionLensSpecificationComponent addLensSpecification() { //3
2089      VisionPrescriptionLensSpecificationComponent t = new VisionPrescriptionLensSpecificationComponent();
2090      if (this.lensSpecification == null)
2091        this.lensSpecification = new ArrayList<VisionPrescriptionLensSpecificationComponent>();
2092      this.lensSpecification.add(t);
2093      return t;
2094    }
2095
2096    public VisionPrescription addLensSpecification(VisionPrescriptionLensSpecificationComponent t) { //3
2097      if (t == null)
2098        return this;
2099      if (this.lensSpecification == null)
2100        this.lensSpecification = new ArrayList<VisionPrescriptionLensSpecificationComponent>();
2101      this.lensSpecification.add(t);
2102      return this;
2103    }
2104
2105    /**
2106     * @return The first repetition of repeating field {@link #lensSpecification}, creating it if it does not already exist {3}
2107     */
2108    public VisionPrescriptionLensSpecificationComponent getLensSpecificationFirstRep() { 
2109      if (getLensSpecification().isEmpty()) {
2110        addLensSpecification();
2111      }
2112      return getLensSpecification().get(0);
2113    }
2114
2115      protected void listChildren(List<Property> children) {
2116        super.listChildren(children);
2117        children.add(new Property("identifier", "Identifier", "A unique identifier assigned to this vision prescription.", 0, java.lang.Integer.MAX_VALUE, identifier));
2118        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
2119        children.add(new Property("created", "dateTime", "The date this resource was created.", 0, 1, created));
2120        children.add(new Property("patient", "Reference(Patient)", "A resource reference to the person to whom the vision prescription applies.", 0, 1, patient));
2121        children.add(new Property("encounter", "Reference(Encounter)", "A reference to a resource that identifies the particular occurrence of contact between patient and health care provider during which the prescription was issued.", 0, 1, encounter));
2122        children.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, 1, dateWritten));
2123        children.add(new Property("prescriber", "Reference(Practitioner|PractitionerRole)", "The healthcare professional responsible for authorizing the prescription.", 0, 1, prescriber));
2124        children.add(new Property("lensSpecification", "", "Contain the details of  the individual lens specifications and serves as the authorization for the fullfillment by certified professionals.", 0, java.lang.Integer.MAX_VALUE, lensSpecification));
2125      }
2126
2127      @Override
2128      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2129        switch (_hash) {
2130        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier assigned to this vision prescription.", 0, java.lang.Integer.MAX_VALUE, identifier);
2131        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
2132        case 1028554472: /*created*/  return new Property("created", "dateTime", "The date this resource was created.", 0, 1, created);
2133        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "A resource reference to the person to whom the vision prescription applies.", 0, 1, patient);
2134        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "A reference to a resource that identifies the particular occurrence of contact between patient and health care provider during which the prescription was issued.", 0, 1, encounter);
2135        case -1496880759: /*dateWritten*/  return new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, 1, dateWritten);
2136        case 1430631077: /*prescriber*/  return new Property("prescriber", "Reference(Practitioner|PractitionerRole)", "The healthcare professional responsible for authorizing the prescription.", 0, 1, prescriber);
2137        case -1767318363: /*lensSpecification*/  return new Property("lensSpecification", "", "Contain the details of  the individual lens specifications and serves as the authorization for the fullfillment by certified professionals.", 0, java.lang.Integer.MAX_VALUE, lensSpecification);
2138        default: return super.getNamedProperty(_hash, _name, _checkValid);
2139        }
2140
2141      }
2142
2143      @Override
2144      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2145        switch (hash) {
2146        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2147        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FinancialResourceStatusCodes>
2148        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
2149        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
2150        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
2151        case -1496880759: /*dateWritten*/ return this.dateWritten == null ? new Base[0] : new Base[] {this.dateWritten}; // DateTimeType
2152        case 1430631077: /*prescriber*/ return this.prescriber == null ? new Base[0] : new Base[] {this.prescriber}; // Reference
2153        case -1767318363: /*lensSpecification*/ return this.lensSpecification == null ? new Base[0] : this.lensSpecification.toArray(new Base[this.lensSpecification.size()]); // VisionPrescriptionLensSpecificationComponent
2154        default: return super.getProperty(hash, name, checkValid);
2155        }
2156
2157      }
2158
2159      @Override
2160      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2161        switch (hash) {
2162        case -1618432855: // identifier
2163          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2164          return value;
2165        case -892481550: // status
2166          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2167          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
2168          return value;
2169        case 1028554472: // created
2170          this.created = TypeConvertor.castToDateTime(value); // DateTimeType
2171          return value;
2172        case -791418107: // patient
2173          this.patient = TypeConvertor.castToReference(value); // Reference
2174          return value;
2175        case 1524132147: // encounter
2176          this.encounter = TypeConvertor.castToReference(value); // Reference
2177          return value;
2178        case -1496880759: // dateWritten
2179          this.dateWritten = TypeConvertor.castToDateTime(value); // DateTimeType
2180          return value;
2181        case 1430631077: // prescriber
2182          this.prescriber = TypeConvertor.castToReference(value); // Reference
2183          return value;
2184        case -1767318363: // lensSpecification
2185          this.getLensSpecification().add((VisionPrescriptionLensSpecificationComponent) value); // VisionPrescriptionLensSpecificationComponent
2186          return value;
2187        default: return super.setProperty(hash, name, value);
2188        }
2189
2190      }
2191
2192      @Override
2193      public Base setProperty(String name, Base value) throws FHIRException {
2194        if (name.equals("identifier")) {
2195          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2196        } else if (name.equals("status")) {
2197          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2198          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
2199        } else if (name.equals("created")) {
2200          this.created = TypeConvertor.castToDateTime(value); // DateTimeType
2201        } else if (name.equals("patient")) {
2202          this.patient = TypeConvertor.castToReference(value); // Reference
2203        } else if (name.equals("encounter")) {
2204          this.encounter = TypeConvertor.castToReference(value); // Reference
2205        } else if (name.equals("dateWritten")) {
2206          this.dateWritten = TypeConvertor.castToDateTime(value); // DateTimeType
2207        } else if (name.equals("prescriber")) {
2208          this.prescriber = TypeConvertor.castToReference(value); // Reference
2209        } else if (name.equals("lensSpecification")) {
2210          this.getLensSpecification().add((VisionPrescriptionLensSpecificationComponent) value);
2211        } else
2212          return super.setProperty(name, value);
2213        return value;
2214      }
2215
2216      @Override
2217      public Base makeProperty(int hash, String name) throws FHIRException {
2218        switch (hash) {
2219        case -1618432855:  return addIdentifier(); 
2220        case -892481550:  return getStatusElement();
2221        case 1028554472:  return getCreatedElement();
2222        case -791418107:  return getPatient();
2223        case 1524132147:  return getEncounter();
2224        case -1496880759:  return getDateWrittenElement();
2225        case 1430631077:  return getPrescriber();
2226        case -1767318363:  return addLensSpecification(); 
2227        default: return super.makeProperty(hash, name);
2228        }
2229
2230      }
2231
2232      @Override
2233      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2234        switch (hash) {
2235        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2236        case -892481550: /*status*/ return new String[] {"code"};
2237        case 1028554472: /*created*/ return new String[] {"dateTime"};
2238        case -791418107: /*patient*/ return new String[] {"Reference"};
2239        case 1524132147: /*encounter*/ return new String[] {"Reference"};
2240        case -1496880759: /*dateWritten*/ return new String[] {"dateTime"};
2241        case 1430631077: /*prescriber*/ return new String[] {"Reference"};
2242        case -1767318363: /*lensSpecification*/ return new String[] {};
2243        default: return super.getTypesForProperty(hash, name);
2244        }
2245
2246      }
2247
2248      @Override
2249      public Base addChild(String name) throws FHIRException {
2250        if (name.equals("identifier")) {
2251          return addIdentifier();
2252        }
2253        else if (name.equals("status")) {
2254          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.status");
2255        }
2256        else if (name.equals("created")) {
2257          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.created");
2258        }
2259        else if (name.equals("patient")) {
2260          this.patient = new Reference();
2261          return this.patient;
2262        }
2263        else if (name.equals("encounter")) {
2264          this.encounter = new Reference();
2265          return this.encounter;
2266        }
2267        else if (name.equals("dateWritten")) {
2268          throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.dateWritten");
2269        }
2270        else if (name.equals("prescriber")) {
2271          this.prescriber = new Reference();
2272          return this.prescriber;
2273        }
2274        else if (name.equals("lensSpecification")) {
2275          return addLensSpecification();
2276        }
2277        else
2278          return super.addChild(name);
2279      }
2280
2281  public String fhirType() {
2282    return "VisionPrescription";
2283
2284  }
2285
2286      public VisionPrescription copy() {
2287        VisionPrescription dst = new VisionPrescription();
2288        copyValues(dst);
2289        return dst;
2290      }
2291
2292      public void copyValues(VisionPrescription dst) {
2293        super.copyValues(dst);
2294        if (identifier != null) {
2295          dst.identifier = new ArrayList<Identifier>();
2296          for (Identifier i : identifier)
2297            dst.identifier.add(i.copy());
2298        };
2299        dst.status = status == null ? null : status.copy();
2300        dst.created = created == null ? null : created.copy();
2301        dst.patient = patient == null ? null : patient.copy();
2302        dst.encounter = encounter == null ? null : encounter.copy();
2303        dst.dateWritten = dateWritten == null ? null : dateWritten.copy();
2304        dst.prescriber = prescriber == null ? null : prescriber.copy();
2305        if (lensSpecification != null) {
2306          dst.lensSpecification = new ArrayList<VisionPrescriptionLensSpecificationComponent>();
2307          for (VisionPrescriptionLensSpecificationComponent i : lensSpecification)
2308            dst.lensSpecification.add(i.copy());
2309        };
2310      }
2311
2312      protected VisionPrescription typedCopy() {
2313        return copy();
2314      }
2315
2316      @Override
2317      public boolean equalsDeep(Base other_) {
2318        if (!super.equalsDeep(other_))
2319          return false;
2320        if (!(other_ instanceof VisionPrescription))
2321          return false;
2322        VisionPrescription o = (VisionPrescription) other_;
2323        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(created, o.created, true)
2324           && compareDeep(patient, o.patient, true) && compareDeep(encounter, o.encounter, true) && compareDeep(dateWritten, o.dateWritten, true)
2325           && compareDeep(prescriber, o.prescriber, true) && compareDeep(lensSpecification, o.lensSpecification, true)
2326          ;
2327      }
2328
2329      @Override
2330      public boolean equalsShallow(Base other_) {
2331        if (!super.equalsShallow(other_))
2332          return false;
2333        if (!(other_ instanceof VisionPrescription))
2334          return false;
2335        VisionPrescription o = (VisionPrescription) other_;
2336        return compareValues(status, o.status, true) && compareValues(created, o.created, true) && compareValues(dateWritten, o.dateWritten, true)
2337          ;
2338      }
2339
2340      public boolean isEmpty() {
2341        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, created
2342          , patient, encounter, dateWritten, prescriber, lensSpecification);
2343      }
2344
2345  @Override
2346  public ResourceType getResourceType() {
2347    return ResourceType.VisionPrescription;
2348   }
2349
2350 /**
2351   * Search parameter: <b>datewritten</b>
2352   * <p>
2353   * Description: <b>Return prescriptions written on this date</b><br>
2354   * Type: <b>date</b><br>
2355   * Path: <b>VisionPrescription.dateWritten</b><br>
2356   * </p>
2357   */
2358  @SearchParamDefinition(name="datewritten", path="VisionPrescription.dateWritten", description="Return prescriptions written on this date", type="date" )
2359  public static final String SP_DATEWRITTEN = "datewritten";
2360 /**
2361   * <b>Fluent Client</b> search parameter constant for <b>datewritten</b>
2362   * <p>
2363   * Description: <b>Return prescriptions written on this date</b><br>
2364   * Type: <b>date</b><br>
2365   * Path: <b>VisionPrescription.dateWritten</b><br>
2366   * </p>
2367   */
2368  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATEWRITTEN = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATEWRITTEN);
2369
2370 /**
2371   * Search parameter: <b>prescriber</b>
2372   * <p>
2373   * Description: <b>Who authorized the vision prescription</b><br>
2374   * Type: <b>reference</b><br>
2375   * Path: <b>VisionPrescription.prescriber</b><br>
2376   * </p>
2377   */
2378  @SearchParamDefinition(name="prescriber", path="VisionPrescription.prescriber", description="Who authorized the vision prescription", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Practitioner.class, PractitionerRole.class } )
2379  public static final String SP_PRESCRIBER = "prescriber";
2380 /**
2381   * <b>Fluent Client</b> search parameter constant for <b>prescriber</b>
2382   * <p>
2383   * Description: <b>Who authorized the vision prescription</b><br>
2384   * Type: <b>reference</b><br>
2385   * Path: <b>VisionPrescription.prescriber</b><br>
2386   * </p>
2387   */
2388  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRESCRIBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRESCRIBER);
2389
2390/**
2391   * Constant for fluent queries to be used to add include statements. Specifies
2392   * the path value of "<b>VisionPrescription:prescriber</b>".
2393   */
2394  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRESCRIBER = new ca.uhn.fhir.model.api.Include("VisionPrescription:prescriber").toLocked();
2395
2396 /**
2397   * Search parameter: <b>status</b>
2398   * <p>
2399   * Description: <b>The status of the vision prescription</b><br>
2400   * Type: <b>token</b><br>
2401   * Path: <b>VisionPrescription.status</b><br>
2402   * </p>
2403   */
2404  @SearchParamDefinition(name="status", path="VisionPrescription.status", description="The status of the vision prescription", type="token" )
2405  public static final String SP_STATUS = "status";
2406 /**
2407   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2408   * <p>
2409   * Description: <b>The status of the vision prescription</b><br>
2410   * Type: <b>token</b><br>
2411   * Path: <b>VisionPrescription.status</b><br>
2412   * </p>
2413   */
2414  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2415
2416 /**
2417   * Search parameter: <b>encounter</b>
2418   * <p>
2419   * Description: <b>Multiple Resources: 
2420
2421* [Composition](composition.html): Context of the Composition
2422* [DeviceRequest](devicerequest.html): Encounter during which request was created
2423* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made
2424* [DocumentReference](documentreference.html): Context of the document  content
2425* [Flag](flag.html): Alert relevant during encounter
2426* [List](list.html): Context in which list created
2427* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier
2428* [Observation](observation.html): Encounter related to the observation
2429* [Procedure](procedure.html): The Encounter during which this Procedure was created
2430* [RiskAssessment](riskassessment.html): Where was assessment performed?
2431* [ServiceRequest](servicerequest.html): An encounter in which this request is made
2432* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier
2433</b><br>
2434   * Type: <b>reference</b><br>
2435   * Path: <b>Composition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | DocumentReference.encounter | Flag.encounter | List.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | RiskAssessment.encounter | ServiceRequest.encounter | VisionPrescription.encounter</b><br>
2436   * </p>
2437   */
2438  @SearchParamDefinition(name="encounter", path="Composition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | DocumentReference.encounter | Flag.encounter | List.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | RiskAssessment.encounter | ServiceRequest.encounter | VisionPrescription.encounter", description="Multiple Resources: \r\n\r\n* [Composition](composition.html): Context of the Composition\r\n* [DeviceRequest](devicerequest.html): Encounter during which request was created\r\n* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made\r\n* [DocumentReference](documentreference.html): Context of the document  content\r\n* [Flag](flag.html): Alert relevant during encounter\r\n* [List](list.html): Context in which list created\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier\r\n* [Observation](observation.html): Encounter related to the observation\r\n* [Procedure](procedure.html): The Encounter during which this Procedure was created\r\n* [RiskAssessment](riskassessment.html): Where was assessment performed?\r\n* [ServiceRequest](servicerequest.html): An encounter in which this request is made\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier\r\n", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Encounter") }, target={Encounter.class } )
2439  public static final String SP_ENCOUNTER = "encounter";
2440 /**
2441   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
2442   * <p>
2443   * Description: <b>Multiple Resources: 
2444
2445* [Composition](composition.html): Context of the Composition
2446* [DeviceRequest](devicerequest.html): Encounter during which request was created
2447* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made
2448* [DocumentReference](documentreference.html): Context of the document  content
2449* [Flag](flag.html): Alert relevant during encounter
2450* [List](list.html): Context in which list created
2451* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier
2452* [Observation](observation.html): Encounter related to the observation
2453* [Procedure](procedure.html): The Encounter during which this Procedure was created
2454* [RiskAssessment](riskassessment.html): Where was assessment performed?
2455* [ServiceRequest](servicerequest.html): An encounter in which this request is made
2456* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier
2457</b><br>
2458   * Type: <b>reference</b><br>
2459   * Path: <b>Composition.encounter | DeviceRequest.encounter | DiagnosticReport.encounter | DocumentReference.encounter | Flag.encounter | List.encounter | NutritionOrder.encounter | Observation.encounter | Procedure.encounter | RiskAssessment.encounter | ServiceRequest.encounter | VisionPrescription.encounter</b><br>
2460   * </p>
2461   */
2462  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
2463
2464/**
2465   * Constant for fluent queries to be used to add include statements. Specifies
2466   * the path value of "<b>VisionPrescription:encounter</b>".
2467   */
2468  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("VisionPrescription:encounter").toLocked();
2469
2470 /**
2471   * Search parameter: <b>identifier</b>
2472   * <p>
2473   * Description: <b>Multiple Resources: 
2474
2475* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2476* [CarePlan](careplan.html): External Ids for this plan
2477* [CareTeam](careteam.html): External Ids for this team
2478* [Composition](composition.html): Version-independent identifier for the Composition
2479* [Condition](condition.html): A unique identifier of the condition record
2480* [Consent](consent.html): Identifier for this record (external references)
2481* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2482* [DeviceRequest](devicerequest.html): Business identifier for request/order
2483* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2484* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2485* [DocumentReference](documentreference.html): Identifier of the attachment binary
2486* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2487* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2488* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2489* [Goal](goal.html): External Ids for this goal
2490* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2491* [Immunization](immunization.html): Business identifier
2492* [List](list.html): Business identifier
2493* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2494* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2495* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2496* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2497* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2498* [Observation](observation.html): The unique id for a particular observation
2499* [Procedure](procedure.html): A unique identifier for a procedure
2500* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2501* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2502* [SupplyDelivery](supplydelivery.html): External identifier
2503* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2504* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2505</b><br>
2506   * Type: <b>token</b><br>
2507   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.content.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
2508   * </p>
2509   */
2510  @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.content.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [List](list.html): Business identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationUsage](medicationusage.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
2511  public static final String SP_IDENTIFIER = "identifier";
2512 /**
2513   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2514   * <p>
2515   * Description: <b>Multiple Resources: 
2516
2517* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2518* [CarePlan](careplan.html): External Ids for this plan
2519* [CareTeam](careteam.html): External Ids for this team
2520* [Composition](composition.html): Version-independent identifier for the Composition
2521* [Condition](condition.html): A unique identifier of the condition record
2522* [Consent](consent.html): Identifier for this record (external references)
2523* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2524* [DeviceRequest](devicerequest.html): Business identifier for request/order
2525* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2526* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2527* [DocumentReference](documentreference.html): Identifier of the attachment binary
2528* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2529* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2530* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2531* [Goal](goal.html): External Ids for this goal
2532* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2533* [Immunization](immunization.html): Business identifier
2534* [List](list.html): Business identifier
2535* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2536* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2537* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2538* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2539* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2540* [Observation](observation.html): The unique id for a particular observation
2541* [Procedure](procedure.html): A unique identifier for a procedure
2542* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2543* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2544* [SupplyDelivery](supplydelivery.html): External identifier
2545* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2546* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2547</b><br>
2548   * Type: <b>token</b><br>
2549   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.content.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
2550   * </p>
2551   */
2552  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2553
2554 /**
2555   * Search parameter: <b>patient</b>
2556   * <p>
2557   * Description: <b>Multiple Resources: 
2558
2559* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2560* [CarePlan](careplan.html): Who the care plan is for
2561* [CareTeam](careteam.html): Who care team is for
2562* [ClinicalImpression](clinicalimpression.html): Patient assessed
2563* [Composition](composition.html): Who and/or what the composition is about
2564* [Condition](condition.html): Who has the condition?
2565* [Consent](consent.html): Who the consent applies to
2566* [DetectedIssue](detectedissue.html): Associated patient
2567* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2568* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2569* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2570* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2571* [DocumentReference](documentreference.html): Who/what is the subject of the document
2572* [Encounter](encounter.html): The patient present at the encounter
2573* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2574* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2575* [Flag](flag.html): The identity of a subject to list flags for
2576* [Goal](goal.html): Who this goal is intended for
2577* [ImagingStudy](imagingstudy.html): Who the study is about
2578* [Immunization](immunization.html): The patient for the vaccination record
2579* [List](list.html): If all resources have the same subject
2580* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2581* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2582* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2583* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2584* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
2585* [Observation](observation.html): The subject that the observation is about (if patient)
2586* [Procedure](procedure.html): Search by subject - a patient
2587* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2588* [ServiceRequest](servicerequest.html): Search by subject - a patient
2589* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2590* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2591</b><br>
2592   * Type: <b>reference</b><br>
2593   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
2594   * </p>
2595   */
2596  @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentManifest](documentmanifest.html): The subject of the set of documents\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [List](list.html): If all resources have the same subject\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, ArtifactAssessment.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CapabilityStatement2.class, CarePlan.class, CareTeam.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, ClinicalUseIssue.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, ConceptMap2.class, Condition.class, ConditionDefinition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceDispense.class, DeviceMetric.class, DeviceRequest.class, DeviceUsage.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceReport.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingSelection.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, InventoryReport.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationUsage.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionIntake.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Permission.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SubstanceNucleicAcid.class, SubstancePolymer.class, SubstanceProtein.class, SubstanceReferenceInformation.class, SubstanceSourceMaterial.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
2597  public static final String SP_PATIENT = "patient";
2598 /**
2599   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2600   * <p>
2601   * Description: <b>Multiple Resources: 
2602
2603* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2604* [CarePlan](careplan.html): Who the care plan is for
2605* [CareTeam](careteam.html): Who care team is for
2606* [ClinicalImpression](clinicalimpression.html): Patient assessed
2607* [Composition](composition.html): Who and/or what the composition is about
2608* [Condition](condition.html): Who has the condition?
2609* [Consent](consent.html): Who the consent applies to
2610* [DetectedIssue](detectedissue.html): Associated patient
2611* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2612* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2613* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2614* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2615* [DocumentReference](documentreference.html): Who/what is the subject of the document
2616* [Encounter](encounter.html): The patient present at the encounter
2617* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2618* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2619* [Flag](flag.html): The identity of a subject to list flags for
2620* [Goal](goal.html): Who this goal is intended for
2621* [ImagingStudy](imagingstudy.html): Who the study is about
2622* [Immunization](immunization.html): The patient for the vaccination record
2623* [List](list.html): If all resources have the same subject
2624* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2625* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2626* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2627* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2628* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
2629* [Observation](observation.html): The subject that the observation is about (if patient)
2630* [Procedure](procedure.html): Search by subject - a patient
2631* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2632* [ServiceRequest](servicerequest.html): Search by subject - a patient
2633* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2634* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2635</b><br>
2636   * Type: <b>reference</b><br>
2637   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.patient | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.patient | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
2638   * </p>
2639   */
2640  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2641
2642/**
2643   * Constant for fluent queries to be used to add include statements. Specifies
2644   * the path value of "<b>VisionPrescription:patient</b>".
2645   */
2646  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("VisionPrescription:patient").toLocked();
2647
2648
2649}
2650