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