001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Thu, Dec 27, 2018 10:06-0500 for FHIR v4.0.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import ca.uhn.fhir.model.api.annotation.ResourceDef;
038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
039import ca.uhn.fhir.model.api.annotation.Child;
040import ca.uhn.fhir.model.api.annotation.ChildOrder;
041import ca.uhn.fhir.model.api.annotation.Description;
042import ca.uhn.fhir.model.api.annotation.Block;
043import org.hl7.fhir.instance.model.api.*;
044import org.hl7.fhir.exceptions.FHIRException;
045/**
046 * Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.
047 */
048@ResourceDef(name="Immunization", profile="http://hl7.org/fhir/StructureDefinition/Immunization")
049public class Immunization extends DomainResource {
050
051    public enum ImmunizationStatus {
052        /**
053         * null
054         */
055        COMPLETED, 
056        /**
057         * null
058         */
059        ENTEREDINERROR, 
060        /**
061         * null
062         */
063        NOTDONE, 
064        /**
065         * added to help the parsers with the generic types
066         */
067        NULL;
068        public static ImmunizationStatus fromCode(String codeString) throws FHIRException {
069            if (codeString == null || "".equals(codeString))
070                return null;
071        if ("completed".equals(codeString))
072          return COMPLETED;
073        if ("entered-in-error".equals(codeString))
074          return ENTEREDINERROR;
075        if ("not-done".equals(codeString))
076          return NOTDONE;
077        if (Configuration.isAcceptInvalidEnums())
078          return null;
079        else
080          throw new FHIRException("Unknown ImmunizationStatus code '"+codeString+"'");
081        }
082        public String toCode() {
083          switch (this) {
084            case COMPLETED: return "completed";
085            case ENTEREDINERROR: return "entered-in-error";
086            case NOTDONE: return "not-done";
087            default: return "?";
088          }
089        }
090        public String getSystem() {
091          switch (this) {
092            case COMPLETED: return "http://hl7.org/fhir/event-status";
093            case ENTEREDINERROR: return "http://hl7.org/fhir/event-status";
094            case NOTDONE: return "http://hl7.org/fhir/event-status";
095            default: return "?";
096          }
097        }
098        public String getDefinition() {
099          switch (this) {
100            case COMPLETED: return "";
101            case ENTEREDINERROR: return "";
102            case NOTDONE: return "";
103            default: return "?";
104          }
105        }
106        public String getDisplay() {
107          switch (this) {
108            case COMPLETED: return "completed";
109            case ENTEREDINERROR: return "entered-in-error";
110            case NOTDONE: return "not-done";
111            default: return "?";
112          }
113        }
114    }
115
116  public static class ImmunizationStatusEnumFactory implements EnumFactory<ImmunizationStatus> {
117    public ImmunizationStatus fromCode(String codeString) throws IllegalArgumentException {
118      if (codeString == null || "".equals(codeString))
119            if (codeString == null || "".equals(codeString))
120                return null;
121        if ("completed".equals(codeString))
122          return ImmunizationStatus.COMPLETED;
123        if ("entered-in-error".equals(codeString))
124          return ImmunizationStatus.ENTEREDINERROR;
125        if ("not-done".equals(codeString))
126          return ImmunizationStatus.NOTDONE;
127        throw new IllegalArgumentException("Unknown ImmunizationStatus code '"+codeString+"'");
128        }
129        public Enumeration<ImmunizationStatus> fromType(Base code) throws FHIRException {
130          if (code == null)
131            return null;
132          if (code.isEmpty())
133            return new Enumeration<ImmunizationStatus>(this);
134          String codeString = ((PrimitiveType) code).asStringValue();
135          if (codeString == null || "".equals(codeString))
136            return null;
137        if ("completed".equals(codeString))
138          return new Enumeration<ImmunizationStatus>(this, ImmunizationStatus.COMPLETED);
139        if ("entered-in-error".equals(codeString))
140          return new Enumeration<ImmunizationStatus>(this, ImmunizationStatus.ENTEREDINERROR);
141        if ("not-done".equals(codeString))
142          return new Enumeration<ImmunizationStatus>(this, ImmunizationStatus.NOTDONE);
143        throw new FHIRException("Unknown ImmunizationStatus code '"+codeString+"'");
144        }
145    public String toCode(ImmunizationStatus code) {
146      if (code == ImmunizationStatus.COMPLETED)
147        return "completed";
148      if (code == ImmunizationStatus.ENTEREDINERROR)
149        return "entered-in-error";
150      if (code == ImmunizationStatus.NOTDONE)
151        return "not-done";
152      return "?";
153      }
154    public String toSystem(ImmunizationStatus code) {
155      return code.getSystem();
156      }
157    }
158
159    @Block()
160    public static class ImmunizationPerformerComponent extends BackboneElement implements IBaseBackboneElement {
161        /**
162         * Describes the type of performance (e.g. ordering provider, administering provider, etc.).
163         */
164        @Child(name = "function", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
165        @Description(shortDefinition="What type of performance was done", formalDefinition="Describes the type of performance (e.g. ordering provider, administering provider, etc.)." )
166        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-function")
167        protected CodeableConcept function;
168
169        /**
170         * The practitioner or organization who performed the action.
171         */
172        @Child(name = "actor", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=2, min=1, max=1, modifier=false, summary=true)
173        @Description(shortDefinition="Individual or organization who was performing", formalDefinition="The practitioner or organization who performed the action." )
174        protected Reference actor;
175
176        /**
177         * The actual object that is the target of the reference (The practitioner or organization who performed the action.)
178         */
179        protected Resource actorTarget;
180
181        private static final long serialVersionUID = 1424001049L;
182
183    /**
184     * Constructor
185     */
186      public ImmunizationPerformerComponent() {
187        super();
188      }
189
190    /**
191     * Constructor
192     */
193      public ImmunizationPerformerComponent(Reference actor) {
194        super();
195        this.actor = actor;
196      }
197
198        /**
199         * @return {@link #function} (Describes the type of performance (e.g. ordering provider, administering provider, etc.).)
200         */
201        public CodeableConcept getFunction() { 
202          if (this.function == null)
203            if (Configuration.errorOnAutoCreate())
204              throw new Error("Attempt to auto-create ImmunizationPerformerComponent.function");
205            else if (Configuration.doAutoCreate())
206              this.function = new CodeableConcept(); // cc
207          return this.function;
208        }
209
210        public boolean hasFunction() { 
211          return this.function != null && !this.function.isEmpty();
212        }
213
214        /**
215         * @param value {@link #function} (Describes the type of performance (e.g. ordering provider, administering provider, etc.).)
216         */
217        public ImmunizationPerformerComponent setFunction(CodeableConcept value) { 
218          this.function = value;
219          return this;
220        }
221
222        /**
223         * @return {@link #actor} (The practitioner or organization who performed the action.)
224         */
225        public Reference getActor() { 
226          if (this.actor == null)
227            if (Configuration.errorOnAutoCreate())
228              throw new Error("Attempt to auto-create ImmunizationPerformerComponent.actor");
229            else if (Configuration.doAutoCreate())
230              this.actor = new Reference(); // cc
231          return this.actor;
232        }
233
234        public boolean hasActor() { 
235          return this.actor != null && !this.actor.isEmpty();
236        }
237
238        /**
239         * @param value {@link #actor} (The practitioner or organization who performed the action.)
240         */
241        public ImmunizationPerformerComponent setActor(Reference value) { 
242          this.actor = value;
243          return this;
244        }
245
246        /**
247         * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner or organization who performed the action.)
248         */
249        public Resource getActorTarget() { 
250          return this.actorTarget;
251        }
252
253        /**
254         * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner or organization who performed the action.)
255         */
256        public ImmunizationPerformerComponent setActorTarget(Resource value) { 
257          this.actorTarget = value;
258          return this;
259        }
260
261        protected void listChildren(List<Property> children) {
262          super.listChildren(children);
263          children.add(new Property("function", "CodeableConcept", "Describes the type of performance (e.g. ordering provider, administering provider, etc.).", 0, 1, function));
264          children.add(new Property("actor", "Reference(Practitioner|PractitionerRole|Organization)", "The practitioner or organization who performed the action.", 0, 1, actor));
265        }
266
267        @Override
268        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
269          switch (_hash) {
270          case 1380938712: /*function*/  return new Property("function", "CodeableConcept", "Describes the type of performance (e.g. ordering provider, administering provider, etc.).", 0, 1, function);
271          case 92645877: /*actor*/  return new Property("actor", "Reference(Practitioner|PractitionerRole|Organization)", "The practitioner or organization who performed the action.", 0, 1, actor);
272          default: return super.getNamedProperty(_hash, _name, _checkValid);
273          }
274
275        }
276
277      @Override
278      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
279        switch (hash) {
280        case 1380938712: /*function*/ return this.function == null ? new Base[0] : new Base[] {this.function}; // CodeableConcept
281        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
282        default: return super.getProperty(hash, name, checkValid);
283        }
284
285      }
286
287      @Override
288      public Base setProperty(int hash, String name, Base value) throws FHIRException {
289        switch (hash) {
290        case 1380938712: // function
291          this.function = castToCodeableConcept(value); // CodeableConcept
292          return value;
293        case 92645877: // actor
294          this.actor = castToReference(value); // Reference
295          return value;
296        default: return super.setProperty(hash, name, value);
297        }
298
299      }
300
301      @Override
302      public Base setProperty(String name, Base value) throws FHIRException {
303        if (name.equals("function")) {
304          this.function = castToCodeableConcept(value); // CodeableConcept
305        } else if (name.equals("actor")) {
306          this.actor = castToReference(value); // Reference
307        } else
308          return super.setProperty(name, value);
309        return value;
310      }
311
312      @Override
313      public Base makeProperty(int hash, String name) throws FHIRException {
314        switch (hash) {
315        case 1380938712:  return getFunction(); 
316        case 92645877:  return getActor(); 
317        default: return super.makeProperty(hash, name);
318        }
319
320      }
321
322      @Override
323      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
324        switch (hash) {
325        case 1380938712: /*function*/ return new String[] {"CodeableConcept"};
326        case 92645877: /*actor*/ return new String[] {"Reference"};
327        default: return super.getTypesForProperty(hash, name);
328        }
329
330      }
331
332      @Override
333      public Base addChild(String name) throws FHIRException {
334        if (name.equals("function")) {
335          this.function = new CodeableConcept();
336          return this.function;
337        }
338        else if (name.equals("actor")) {
339          this.actor = new Reference();
340          return this.actor;
341        }
342        else
343          return super.addChild(name);
344      }
345
346      public ImmunizationPerformerComponent copy() {
347        ImmunizationPerformerComponent dst = new ImmunizationPerformerComponent();
348        copyValues(dst);
349        dst.function = function == null ? null : function.copy();
350        dst.actor = actor == null ? null : actor.copy();
351        return dst;
352      }
353
354      @Override
355      public boolean equalsDeep(Base other_) {
356        if (!super.equalsDeep(other_))
357          return false;
358        if (!(other_ instanceof ImmunizationPerformerComponent))
359          return false;
360        ImmunizationPerformerComponent o = (ImmunizationPerformerComponent) other_;
361        return compareDeep(function, o.function, true) && compareDeep(actor, o.actor, true);
362      }
363
364      @Override
365      public boolean equalsShallow(Base other_) {
366        if (!super.equalsShallow(other_))
367          return false;
368        if (!(other_ instanceof ImmunizationPerformerComponent))
369          return false;
370        ImmunizationPerformerComponent o = (ImmunizationPerformerComponent) other_;
371        return true;
372      }
373
374      public boolean isEmpty() {
375        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(function, actor);
376      }
377
378  public String fhirType() {
379    return "Immunization.performer";
380
381  }
382
383  }
384
385    @Block()
386    public static class ImmunizationEducationComponent extends BackboneElement implements IBaseBackboneElement {
387        /**
388         * Identifier of the material presented to the patient.
389         */
390        @Child(name = "documentType", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
391        @Description(shortDefinition="Educational material document identifier", formalDefinition="Identifier of the material presented to the patient." )
392        protected StringType documentType;
393
394        /**
395         * Reference pointer to the educational material given to the patient if the information was on line.
396         */
397        @Child(name = "reference", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false)
398        @Description(shortDefinition="Educational material reference pointer", formalDefinition="Reference pointer to the educational material given to the patient if the information was on line." )
399        protected UriType reference;
400
401        /**
402         * Date the educational material was published.
403         */
404        @Child(name = "publicationDate", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
405        @Description(shortDefinition="Educational material publication date", formalDefinition="Date the educational material was published." )
406        protected DateTimeType publicationDate;
407
408        /**
409         * Date the educational material was given to the patient.
410         */
411        @Child(name = "presentationDate", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false)
412        @Description(shortDefinition="Educational material presentation date", formalDefinition="Date the educational material was given to the patient." )
413        protected DateTimeType presentationDate;
414
415        private static final long serialVersionUID = -1277654827L;
416
417    /**
418     * Constructor
419     */
420      public ImmunizationEducationComponent() {
421        super();
422      }
423
424        /**
425         * @return {@link #documentType} (Identifier of the material presented to the patient.). This is the underlying object with id, value and extensions. The accessor "getDocumentType" gives direct access to the value
426         */
427        public StringType getDocumentTypeElement() { 
428          if (this.documentType == null)
429            if (Configuration.errorOnAutoCreate())
430              throw new Error("Attempt to auto-create ImmunizationEducationComponent.documentType");
431            else if (Configuration.doAutoCreate())
432              this.documentType = new StringType(); // bb
433          return this.documentType;
434        }
435
436        public boolean hasDocumentTypeElement() { 
437          return this.documentType != null && !this.documentType.isEmpty();
438        }
439
440        public boolean hasDocumentType() { 
441          return this.documentType != null && !this.documentType.isEmpty();
442        }
443
444        /**
445         * @param value {@link #documentType} (Identifier of the material presented to the patient.). This is the underlying object with id, value and extensions. The accessor "getDocumentType" gives direct access to the value
446         */
447        public ImmunizationEducationComponent setDocumentTypeElement(StringType value) { 
448          this.documentType = value;
449          return this;
450        }
451
452        /**
453         * @return Identifier of the material presented to the patient.
454         */
455        public String getDocumentType() { 
456          return this.documentType == null ? null : this.documentType.getValue();
457        }
458
459        /**
460         * @param value Identifier of the material presented to the patient.
461         */
462        public ImmunizationEducationComponent setDocumentType(String value) { 
463          if (Utilities.noString(value))
464            this.documentType = null;
465          else {
466            if (this.documentType == null)
467              this.documentType = new StringType();
468            this.documentType.setValue(value);
469          }
470          return this;
471        }
472
473        /**
474         * @return {@link #reference} (Reference pointer to the educational material given to the patient if the information was on line.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value
475         */
476        public UriType getReferenceElement() { 
477          if (this.reference == null)
478            if (Configuration.errorOnAutoCreate())
479              throw new Error("Attempt to auto-create ImmunizationEducationComponent.reference");
480            else if (Configuration.doAutoCreate())
481              this.reference = new UriType(); // bb
482          return this.reference;
483        }
484
485        public boolean hasReferenceElement() { 
486          return this.reference != null && !this.reference.isEmpty();
487        }
488
489        public boolean hasReference() { 
490          return this.reference != null && !this.reference.isEmpty();
491        }
492
493        /**
494         * @param value {@link #reference} (Reference pointer to the educational material given to the patient if the information was on line.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value
495         */
496        public ImmunizationEducationComponent setReferenceElement(UriType value) { 
497          this.reference = value;
498          return this;
499        }
500
501        /**
502         * @return Reference pointer to the educational material given to the patient if the information was on line.
503         */
504        public String getReference() { 
505          return this.reference == null ? null : this.reference.getValue();
506        }
507
508        /**
509         * @param value Reference pointer to the educational material given to the patient if the information was on line.
510         */
511        public ImmunizationEducationComponent setReference(String value) { 
512          if (Utilities.noString(value))
513            this.reference = null;
514          else {
515            if (this.reference == null)
516              this.reference = new UriType();
517            this.reference.setValue(value);
518          }
519          return this;
520        }
521
522        /**
523         * @return {@link #publicationDate} (Date the educational material was published.). This is the underlying object with id, value and extensions. The accessor "getPublicationDate" gives direct access to the value
524         */
525        public DateTimeType getPublicationDateElement() { 
526          if (this.publicationDate == null)
527            if (Configuration.errorOnAutoCreate())
528              throw new Error("Attempt to auto-create ImmunizationEducationComponent.publicationDate");
529            else if (Configuration.doAutoCreate())
530              this.publicationDate = new DateTimeType(); // bb
531          return this.publicationDate;
532        }
533
534        public boolean hasPublicationDateElement() { 
535          return this.publicationDate != null && !this.publicationDate.isEmpty();
536        }
537
538        public boolean hasPublicationDate() { 
539          return this.publicationDate != null && !this.publicationDate.isEmpty();
540        }
541
542        /**
543         * @param value {@link #publicationDate} (Date the educational material was published.). This is the underlying object with id, value and extensions. The accessor "getPublicationDate" gives direct access to the value
544         */
545        public ImmunizationEducationComponent setPublicationDateElement(DateTimeType value) { 
546          this.publicationDate = value;
547          return this;
548        }
549
550        /**
551         * @return Date the educational material was published.
552         */
553        public Date getPublicationDate() { 
554          return this.publicationDate == null ? null : this.publicationDate.getValue();
555        }
556
557        /**
558         * @param value Date the educational material was published.
559         */
560        public ImmunizationEducationComponent setPublicationDate(Date value) { 
561          if (value == null)
562            this.publicationDate = null;
563          else {
564            if (this.publicationDate == null)
565              this.publicationDate = new DateTimeType();
566            this.publicationDate.setValue(value);
567          }
568          return this;
569        }
570
571        /**
572         * @return {@link #presentationDate} (Date the educational material was given to the patient.). This is the underlying object with id, value and extensions. The accessor "getPresentationDate" gives direct access to the value
573         */
574        public DateTimeType getPresentationDateElement() { 
575          if (this.presentationDate == null)
576            if (Configuration.errorOnAutoCreate())
577              throw new Error("Attempt to auto-create ImmunizationEducationComponent.presentationDate");
578            else if (Configuration.doAutoCreate())
579              this.presentationDate = new DateTimeType(); // bb
580          return this.presentationDate;
581        }
582
583        public boolean hasPresentationDateElement() { 
584          return this.presentationDate != null && !this.presentationDate.isEmpty();
585        }
586
587        public boolean hasPresentationDate() { 
588          return this.presentationDate != null && !this.presentationDate.isEmpty();
589        }
590
591        /**
592         * @param value {@link #presentationDate} (Date the educational material was given to the patient.). This is the underlying object with id, value and extensions. The accessor "getPresentationDate" gives direct access to the value
593         */
594        public ImmunizationEducationComponent setPresentationDateElement(DateTimeType value) { 
595          this.presentationDate = value;
596          return this;
597        }
598
599        /**
600         * @return Date the educational material was given to the patient.
601         */
602        public Date getPresentationDate() { 
603          return this.presentationDate == null ? null : this.presentationDate.getValue();
604        }
605
606        /**
607         * @param value Date the educational material was given to the patient.
608         */
609        public ImmunizationEducationComponent setPresentationDate(Date value) { 
610          if (value == null)
611            this.presentationDate = null;
612          else {
613            if (this.presentationDate == null)
614              this.presentationDate = new DateTimeType();
615            this.presentationDate.setValue(value);
616          }
617          return this;
618        }
619
620        protected void listChildren(List<Property> children) {
621          super.listChildren(children);
622          children.add(new Property("documentType", "string", "Identifier of the material presented to the patient.", 0, 1, documentType));
623          children.add(new Property("reference", "uri", "Reference pointer to the educational material given to the patient if the information was on line.", 0, 1, reference));
624          children.add(new Property("publicationDate", "dateTime", "Date the educational material was published.", 0, 1, publicationDate));
625          children.add(new Property("presentationDate", "dateTime", "Date the educational material was given to the patient.", 0, 1, presentationDate));
626        }
627
628        @Override
629        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
630          switch (_hash) {
631          case -1473196299: /*documentType*/  return new Property("documentType", "string", "Identifier of the material presented to the patient.", 0, 1, documentType);
632          case -925155509: /*reference*/  return new Property("reference", "uri", "Reference pointer to the educational material given to the patient if the information was on line.", 0, 1, reference);
633          case 1470566394: /*publicationDate*/  return new Property("publicationDate", "dateTime", "Date the educational material was published.", 0, 1, publicationDate);
634          case 1602373096: /*presentationDate*/  return new Property("presentationDate", "dateTime", "Date the educational material was given to the patient.", 0, 1, presentationDate);
635          default: return super.getNamedProperty(_hash, _name, _checkValid);
636          }
637
638        }
639
640      @Override
641      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
642        switch (hash) {
643        case -1473196299: /*documentType*/ return this.documentType == null ? new Base[0] : new Base[] {this.documentType}; // StringType
644        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // UriType
645        case 1470566394: /*publicationDate*/ return this.publicationDate == null ? new Base[0] : new Base[] {this.publicationDate}; // DateTimeType
646        case 1602373096: /*presentationDate*/ return this.presentationDate == null ? new Base[0] : new Base[] {this.presentationDate}; // DateTimeType
647        default: return super.getProperty(hash, name, checkValid);
648        }
649
650      }
651
652      @Override
653      public Base setProperty(int hash, String name, Base value) throws FHIRException {
654        switch (hash) {
655        case -1473196299: // documentType
656          this.documentType = castToString(value); // StringType
657          return value;
658        case -925155509: // reference
659          this.reference = castToUri(value); // UriType
660          return value;
661        case 1470566394: // publicationDate
662          this.publicationDate = castToDateTime(value); // DateTimeType
663          return value;
664        case 1602373096: // presentationDate
665          this.presentationDate = castToDateTime(value); // DateTimeType
666          return value;
667        default: return super.setProperty(hash, name, value);
668        }
669
670      }
671
672      @Override
673      public Base setProperty(String name, Base value) throws FHIRException {
674        if (name.equals("documentType")) {
675          this.documentType = castToString(value); // StringType
676        } else if (name.equals("reference")) {
677          this.reference = castToUri(value); // UriType
678        } else if (name.equals("publicationDate")) {
679          this.publicationDate = castToDateTime(value); // DateTimeType
680        } else if (name.equals("presentationDate")) {
681          this.presentationDate = castToDateTime(value); // DateTimeType
682        } else
683          return super.setProperty(name, value);
684        return value;
685      }
686
687      @Override
688      public Base makeProperty(int hash, String name) throws FHIRException {
689        switch (hash) {
690        case -1473196299:  return getDocumentTypeElement();
691        case -925155509:  return getReferenceElement();
692        case 1470566394:  return getPublicationDateElement();
693        case 1602373096:  return getPresentationDateElement();
694        default: return super.makeProperty(hash, name);
695        }
696
697      }
698
699      @Override
700      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
701        switch (hash) {
702        case -1473196299: /*documentType*/ return new String[] {"string"};
703        case -925155509: /*reference*/ return new String[] {"uri"};
704        case 1470566394: /*publicationDate*/ return new String[] {"dateTime"};
705        case 1602373096: /*presentationDate*/ return new String[] {"dateTime"};
706        default: return super.getTypesForProperty(hash, name);
707        }
708
709      }
710
711      @Override
712      public Base addChild(String name) throws FHIRException {
713        if (name.equals("documentType")) {
714          throw new FHIRException("Cannot call addChild on a primitive type Immunization.documentType");
715        }
716        else if (name.equals("reference")) {
717          throw new FHIRException("Cannot call addChild on a primitive type Immunization.reference");
718        }
719        else if (name.equals("publicationDate")) {
720          throw new FHIRException("Cannot call addChild on a primitive type Immunization.publicationDate");
721        }
722        else if (name.equals("presentationDate")) {
723          throw new FHIRException("Cannot call addChild on a primitive type Immunization.presentationDate");
724        }
725        else
726          return super.addChild(name);
727      }
728
729      public ImmunizationEducationComponent copy() {
730        ImmunizationEducationComponent dst = new ImmunizationEducationComponent();
731        copyValues(dst);
732        dst.documentType = documentType == null ? null : documentType.copy();
733        dst.reference = reference == null ? null : reference.copy();
734        dst.publicationDate = publicationDate == null ? null : publicationDate.copy();
735        dst.presentationDate = presentationDate == null ? null : presentationDate.copy();
736        return dst;
737      }
738
739      @Override
740      public boolean equalsDeep(Base other_) {
741        if (!super.equalsDeep(other_))
742          return false;
743        if (!(other_ instanceof ImmunizationEducationComponent))
744          return false;
745        ImmunizationEducationComponent o = (ImmunizationEducationComponent) other_;
746        return compareDeep(documentType, o.documentType, true) && compareDeep(reference, o.reference, true)
747           && compareDeep(publicationDate, o.publicationDate, true) && compareDeep(presentationDate, o.presentationDate, true)
748          ;
749      }
750
751      @Override
752      public boolean equalsShallow(Base other_) {
753        if (!super.equalsShallow(other_))
754          return false;
755        if (!(other_ instanceof ImmunizationEducationComponent))
756          return false;
757        ImmunizationEducationComponent o = (ImmunizationEducationComponent) other_;
758        return compareValues(documentType, o.documentType, true) && compareValues(reference, o.reference, true)
759           && compareValues(publicationDate, o.publicationDate, true) && compareValues(presentationDate, o.presentationDate, true)
760          ;
761      }
762
763      public boolean isEmpty() {
764        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(documentType, reference, publicationDate
765          , presentationDate);
766      }
767
768  public String fhirType() {
769    return "Immunization.education";
770
771  }
772
773  }
774
775    @Block()
776    public static class ImmunizationReactionComponent extends BackboneElement implements IBaseBackboneElement {
777        /**
778         * Date of reaction to the immunization.
779         */
780        @Child(name = "date", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=false)
781        @Description(shortDefinition="When reaction started", formalDefinition="Date of reaction to the immunization." )
782        protected DateTimeType date;
783
784        /**
785         * Details of the reaction.
786         */
787        @Child(name = "detail", type = {Observation.class}, order=2, min=0, max=1, modifier=false, summary=false)
788        @Description(shortDefinition="Additional information on reaction", formalDefinition="Details of the reaction." )
789        protected Reference detail;
790
791        /**
792         * The actual object that is the target of the reference (Details of the reaction.)
793         */
794        protected Observation detailTarget;
795
796        /**
797         * Self-reported indicator.
798         */
799        @Child(name = "reported", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false)
800        @Description(shortDefinition="Indicates self-reported reaction", formalDefinition="Self-reported indicator." )
801        protected BooleanType reported;
802
803        private static final long serialVersionUID = -1297668556L;
804
805    /**
806     * Constructor
807     */
808      public ImmunizationReactionComponent() {
809        super();
810      }
811
812        /**
813         * @return {@link #date} (Date of reaction to the immunization.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
814         */
815        public DateTimeType getDateElement() { 
816          if (this.date == null)
817            if (Configuration.errorOnAutoCreate())
818              throw new Error("Attempt to auto-create ImmunizationReactionComponent.date");
819            else if (Configuration.doAutoCreate())
820              this.date = new DateTimeType(); // bb
821          return this.date;
822        }
823
824        public boolean hasDateElement() { 
825          return this.date != null && !this.date.isEmpty();
826        }
827
828        public boolean hasDate() { 
829          return this.date != null && !this.date.isEmpty();
830        }
831
832        /**
833         * @param value {@link #date} (Date of reaction to the immunization.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
834         */
835        public ImmunizationReactionComponent setDateElement(DateTimeType value) { 
836          this.date = value;
837          return this;
838        }
839
840        /**
841         * @return Date of reaction to the immunization.
842         */
843        public Date getDate() { 
844          return this.date == null ? null : this.date.getValue();
845        }
846
847        /**
848         * @param value Date of reaction to the immunization.
849         */
850        public ImmunizationReactionComponent setDate(Date value) { 
851          if (value == null)
852            this.date = null;
853          else {
854            if (this.date == null)
855              this.date = new DateTimeType();
856            this.date.setValue(value);
857          }
858          return this;
859        }
860
861        /**
862         * @return {@link #detail} (Details of the reaction.)
863         */
864        public Reference getDetail() { 
865          if (this.detail == null)
866            if (Configuration.errorOnAutoCreate())
867              throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail");
868            else if (Configuration.doAutoCreate())
869              this.detail = new Reference(); // cc
870          return this.detail;
871        }
872
873        public boolean hasDetail() { 
874          return this.detail != null && !this.detail.isEmpty();
875        }
876
877        /**
878         * @param value {@link #detail} (Details of the reaction.)
879         */
880        public ImmunizationReactionComponent setDetail(Reference value) { 
881          this.detail = value;
882          return this;
883        }
884
885        /**
886         * @return {@link #detail} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Details of the reaction.)
887         */
888        public Observation getDetailTarget() { 
889          if (this.detailTarget == null)
890            if (Configuration.errorOnAutoCreate())
891              throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail");
892            else if (Configuration.doAutoCreate())
893              this.detailTarget = new Observation(); // aa
894          return this.detailTarget;
895        }
896
897        /**
898         * @param value {@link #detail} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Details of the reaction.)
899         */
900        public ImmunizationReactionComponent setDetailTarget(Observation value) { 
901          this.detailTarget = value;
902          return this;
903        }
904
905        /**
906         * @return {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value
907         */
908        public BooleanType getReportedElement() { 
909          if (this.reported == null)
910            if (Configuration.errorOnAutoCreate())
911              throw new Error("Attempt to auto-create ImmunizationReactionComponent.reported");
912            else if (Configuration.doAutoCreate())
913              this.reported = new BooleanType(); // bb
914          return this.reported;
915        }
916
917        public boolean hasReportedElement() { 
918          return this.reported != null && !this.reported.isEmpty();
919        }
920
921        public boolean hasReported() { 
922          return this.reported != null && !this.reported.isEmpty();
923        }
924
925        /**
926         * @param value {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value
927         */
928        public ImmunizationReactionComponent setReportedElement(BooleanType value) { 
929          this.reported = value;
930          return this;
931        }
932
933        /**
934         * @return Self-reported indicator.
935         */
936        public boolean getReported() { 
937          return this.reported == null || this.reported.isEmpty() ? false : this.reported.getValue();
938        }
939
940        /**
941         * @param value Self-reported indicator.
942         */
943        public ImmunizationReactionComponent setReported(boolean value) { 
944            if (this.reported == null)
945              this.reported = new BooleanType();
946            this.reported.setValue(value);
947          return this;
948        }
949
950        protected void listChildren(List<Property> children) {
951          super.listChildren(children);
952          children.add(new Property("date", "dateTime", "Date of reaction to the immunization.", 0, 1, date));
953          children.add(new Property("detail", "Reference(Observation)", "Details of the reaction.", 0, 1, detail));
954          children.add(new Property("reported", "boolean", "Self-reported indicator.", 0, 1, reported));
955        }
956
957        @Override
958        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
959          switch (_hash) {
960          case 3076014: /*date*/  return new Property("date", "dateTime", "Date of reaction to the immunization.", 0, 1, date);
961          case -1335224239: /*detail*/  return new Property("detail", "Reference(Observation)", "Details of the reaction.", 0, 1, detail);
962          case -427039533: /*reported*/  return new Property("reported", "boolean", "Self-reported indicator.", 0, 1, reported);
963          default: return super.getNamedProperty(_hash, _name, _checkValid);
964          }
965
966        }
967
968      @Override
969      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
970        switch (hash) {
971        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
972        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // Reference
973        case -427039533: /*reported*/ return this.reported == null ? new Base[0] : new Base[] {this.reported}; // BooleanType
974        default: return super.getProperty(hash, name, checkValid);
975        }
976
977      }
978
979      @Override
980      public Base setProperty(int hash, String name, Base value) throws FHIRException {
981        switch (hash) {
982        case 3076014: // date
983          this.date = castToDateTime(value); // DateTimeType
984          return value;
985        case -1335224239: // detail
986          this.detail = castToReference(value); // Reference
987          return value;
988        case -427039533: // reported
989          this.reported = castToBoolean(value); // BooleanType
990          return value;
991        default: return super.setProperty(hash, name, value);
992        }
993
994      }
995
996      @Override
997      public Base setProperty(String name, Base value) throws FHIRException {
998        if (name.equals("date")) {
999          this.date = castToDateTime(value); // DateTimeType
1000        } else if (name.equals("detail")) {
1001          this.detail = castToReference(value); // Reference
1002        } else if (name.equals("reported")) {
1003          this.reported = castToBoolean(value); // BooleanType
1004        } else
1005          return super.setProperty(name, value);
1006        return value;
1007      }
1008
1009      @Override
1010      public Base makeProperty(int hash, String name) throws FHIRException {
1011        switch (hash) {
1012        case 3076014:  return getDateElement();
1013        case -1335224239:  return getDetail(); 
1014        case -427039533:  return getReportedElement();
1015        default: return super.makeProperty(hash, name);
1016        }
1017
1018      }
1019
1020      @Override
1021      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1022        switch (hash) {
1023        case 3076014: /*date*/ return new String[] {"dateTime"};
1024        case -1335224239: /*detail*/ return new String[] {"Reference"};
1025        case -427039533: /*reported*/ return new String[] {"boolean"};
1026        default: return super.getTypesForProperty(hash, name);
1027        }
1028
1029      }
1030
1031      @Override
1032      public Base addChild(String name) throws FHIRException {
1033        if (name.equals("date")) {
1034          throw new FHIRException("Cannot call addChild on a primitive type Immunization.date");
1035        }
1036        else if (name.equals("detail")) {
1037          this.detail = new Reference();
1038          return this.detail;
1039        }
1040        else if (name.equals("reported")) {
1041          throw new FHIRException("Cannot call addChild on a primitive type Immunization.reported");
1042        }
1043        else
1044          return super.addChild(name);
1045      }
1046
1047      public ImmunizationReactionComponent copy() {
1048        ImmunizationReactionComponent dst = new ImmunizationReactionComponent();
1049        copyValues(dst);
1050        dst.date = date == null ? null : date.copy();
1051        dst.detail = detail == null ? null : detail.copy();
1052        dst.reported = reported == null ? null : reported.copy();
1053        return dst;
1054      }
1055
1056      @Override
1057      public boolean equalsDeep(Base other_) {
1058        if (!super.equalsDeep(other_))
1059          return false;
1060        if (!(other_ instanceof ImmunizationReactionComponent))
1061          return false;
1062        ImmunizationReactionComponent o = (ImmunizationReactionComponent) other_;
1063        return compareDeep(date, o.date, true) && compareDeep(detail, o.detail, true) && compareDeep(reported, o.reported, true)
1064          ;
1065      }
1066
1067      @Override
1068      public boolean equalsShallow(Base other_) {
1069        if (!super.equalsShallow(other_))
1070          return false;
1071        if (!(other_ instanceof ImmunizationReactionComponent))
1072          return false;
1073        ImmunizationReactionComponent o = (ImmunizationReactionComponent) other_;
1074        return compareValues(date, o.date, true) && compareValues(reported, o.reported, true);
1075      }
1076
1077      public boolean isEmpty() {
1078        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(date, detail, reported);
1079      }
1080
1081  public String fhirType() {
1082    return "Immunization.reaction";
1083
1084  }
1085
1086  }
1087
1088    @Block()
1089    public static class ImmunizationProtocolAppliedComponent extends BackboneElement implements IBaseBackboneElement {
1090        /**
1091         * One possible path to achieve presumed immunity against a disease - within the context of an authority.
1092         */
1093        @Child(name = "series", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1094        @Description(shortDefinition="Name of vaccine series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." )
1095        protected StringType series;
1096
1097        /**
1098         * Indicates the authority who published the protocol (e.g. ACIP) that is being followed.
1099         */
1100        @Child(name = "authority", type = {Organization.class}, order=2, min=0, max=1, modifier=false, summary=false)
1101        @Description(shortDefinition="Who is responsible for publishing the recommendations", formalDefinition="Indicates the authority who published the protocol (e.g. ACIP) that is being followed." )
1102        protected Reference authority;
1103
1104        /**
1105         * The actual object that is the target of the reference (Indicates the authority who published the protocol (e.g. ACIP) that is being followed.)
1106         */
1107        protected Organization authorityTarget;
1108
1109        /**
1110         * The vaccine preventable disease the dose is being administered against.
1111         */
1112        @Child(name = "targetDisease", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1113        @Description(shortDefinition="Vaccine preventatable disease being targetted", formalDefinition="The vaccine preventable disease the dose is being administered against." )
1114        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-target-disease")
1115        protected List<CodeableConcept> targetDisease;
1116
1117        /**
1118         * Nominal position in a series.
1119         */
1120        @Child(name = "doseNumber", type = {PositiveIntType.class, StringType.class}, order=4, min=1, max=1, modifier=false, summary=false)
1121        @Description(shortDefinition="Dose number within series", formalDefinition="Nominal position in a series." )
1122        protected Type doseNumber;
1123
1124        /**
1125         * The recommended number of doses to achieve immunity.
1126         */
1127        @Child(name = "seriesDoses", type = {PositiveIntType.class, StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
1128        @Description(shortDefinition="Recommended number of doses for immunity", formalDefinition="The recommended number of doses to achieve immunity." )
1129        protected Type seriesDoses;
1130
1131        private static final long serialVersionUID = -1022717242L;
1132
1133    /**
1134     * Constructor
1135     */
1136      public ImmunizationProtocolAppliedComponent() {
1137        super();
1138      }
1139
1140    /**
1141     * Constructor
1142     */
1143      public ImmunizationProtocolAppliedComponent(Type doseNumber) {
1144        super();
1145        this.doseNumber = doseNumber;
1146      }
1147
1148        /**
1149         * @return {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value
1150         */
1151        public StringType getSeriesElement() { 
1152          if (this.series == null)
1153            if (Configuration.errorOnAutoCreate())
1154              throw new Error("Attempt to auto-create ImmunizationProtocolAppliedComponent.series");
1155            else if (Configuration.doAutoCreate())
1156              this.series = new StringType(); // bb
1157          return this.series;
1158        }
1159
1160        public boolean hasSeriesElement() { 
1161          return this.series != null && !this.series.isEmpty();
1162        }
1163
1164        public boolean hasSeries() { 
1165          return this.series != null && !this.series.isEmpty();
1166        }
1167
1168        /**
1169         * @param value {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value
1170         */
1171        public ImmunizationProtocolAppliedComponent setSeriesElement(StringType value) { 
1172          this.series = value;
1173          return this;
1174        }
1175
1176        /**
1177         * @return One possible path to achieve presumed immunity against a disease - within the context of an authority.
1178         */
1179        public String getSeries() { 
1180          return this.series == null ? null : this.series.getValue();
1181        }
1182
1183        /**
1184         * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority.
1185         */
1186        public ImmunizationProtocolAppliedComponent setSeries(String value) { 
1187          if (Utilities.noString(value))
1188            this.series = null;
1189          else {
1190            if (this.series == null)
1191              this.series = new StringType();
1192            this.series.setValue(value);
1193          }
1194          return this;
1195        }
1196
1197        /**
1198         * @return {@link #authority} (Indicates the authority who published the protocol (e.g. ACIP) that is being followed.)
1199         */
1200        public Reference getAuthority() { 
1201          if (this.authority == null)
1202            if (Configuration.errorOnAutoCreate())
1203              throw new Error("Attempt to auto-create ImmunizationProtocolAppliedComponent.authority");
1204            else if (Configuration.doAutoCreate())
1205              this.authority = new Reference(); // cc
1206          return this.authority;
1207        }
1208
1209        public boolean hasAuthority() { 
1210          return this.authority != null && !this.authority.isEmpty();
1211        }
1212
1213        /**
1214         * @param value {@link #authority} (Indicates the authority who published the protocol (e.g. ACIP) that is being followed.)
1215         */
1216        public ImmunizationProtocolAppliedComponent setAuthority(Reference value) { 
1217          this.authority = value;
1218          return this;
1219        }
1220
1221        /**
1222         * @return {@link #authority} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol (e.g. ACIP) that is being followed.)
1223         */
1224        public Organization getAuthorityTarget() { 
1225          if (this.authorityTarget == null)
1226            if (Configuration.errorOnAutoCreate())
1227              throw new Error("Attempt to auto-create ImmunizationProtocolAppliedComponent.authority");
1228            else if (Configuration.doAutoCreate())
1229              this.authorityTarget = new Organization(); // aa
1230          return this.authorityTarget;
1231        }
1232
1233        /**
1234         * @param value {@link #authority} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol (e.g. ACIP) that is being followed.)
1235         */
1236        public ImmunizationProtocolAppliedComponent setAuthorityTarget(Organization value) { 
1237          this.authorityTarget = value;
1238          return this;
1239        }
1240
1241        /**
1242         * @return {@link #targetDisease} (The vaccine preventable disease the dose is being administered against.)
1243         */
1244        public List<CodeableConcept> getTargetDisease() { 
1245          if (this.targetDisease == null)
1246            this.targetDisease = new ArrayList<CodeableConcept>();
1247          return this.targetDisease;
1248        }
1249
1250        /**
1251         * @return Returns a reference to <code>this</code> for easy method chaining
1252         */
1253        public ImmunizationProtocolAppliedComponent setTargetDisease(List<CodeableConcept> theTargetDisease) { 
1254          this.targetDisease = theTargetDisease;
1255          return this;
1256        }
1257
1258        public boolean hasTargetDisease() { 
1259          if (this.targetDisease == null)
1260            return false;
1261          for (CodeableConcept item : this.targetDisease)
1262            if (!item.isEmpty())
1263              return true;
1264          return false;
1265        }
1266
1267        public CodeableConcept addTargetDisease() { //3
1268          CodeableConcept t = new CodeableConcept();
1269          if (this.targetDisease == null)
1270            this.targetDisease = new ArrayList<CodeableConcept>();
1271          this.targetDisease.add(t);
1272          return t;
1273        }
1274
1275        public ImmunizationProtocolAppliedComponent addTargetDisease(CodeableConcept t) { //3
1276          if (t == null)
1277            return this;
1278          if (this.targetDisease == null)
1279            this.targetDisease = new ArrayList<CodeableConcept>();
1280          this.targetDisease.add(t);
1281          return this;
1282        }
1283
1284        /**
1285         * @return The first repetition of repeating field {@link #targetDisease}, creating it if it does not already exist
1286         */
1287        public CodeableConcept getTargetDiseaseFirstRep() { 
1288          if (getTargetDisease().isEmpty()) {
1289            addTargetDisease();
1290          }
1291          return getTargetDisease().get(0);
1292        }
1293
1294        /**
1295         * @return {@link #doseNumber} (Nominal position in a series.)
1296         */
1297        public Type getDoseNumber() { 
1298          return this.doseNumber;
1299        }
1300
1301        /**
1302         * @return {@link #doseNumber} (Nominal position in a series.)
1303         */
1304        public PositiveIntType getDoseNumberPositiveIntType() throws FHIRException { 
1305          if (this.doseNumber == null)
1306            this.doseNumber = new PositiveIntType();
1307          if (!(this.doseNumber instanceof PositiveIntType))
1308            throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.doseNumber.getClass().getName()+" was encountered");
1309          return (PositiveIntType) this.doseNumber;
1310        }
1311
1312        public boolean hasDoseNumberPositiveIntType() { 
1313          return this != null && this.doseNumber instanceof PositiveIntType;
1314        }
1315
1316        /**
1317         * @return {@link #doseNumber} (Nominal position in a series.)
1318         */
1319        public StringType getDoseNumberStringType() throws FHIRException { 
1320          if (this.doseNumber == null)
1321            this.doseNumber = new StringType();
1322          if (!(this.doseNumber instanceof StringType))
1323            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.doseNumber.getClass().getName()+" was encountered");
1324          return (StringType) this.doseNumber;
1325        }
1326
1327        public boolean hasDoseNumberStringType() { 
1328          return this != null && this.doseNumber instanceof StringType;
1329        }
1330
1331        public boolean hasDoseNumber() { 
1332          return this.doseNumber != null && !this.doseNumber.isEmpty();
1333        }
1334
1335        /**
1336         * @param value {@link #doseNumber} (Nominal position in a series.)
1337         */
1338        public ImmunizationProtocolAppliedComponent setDoseNumber(Type value) { 
1339          if (value != null && !(value instanceof PositiveIntType || value instanceof StringType))
1340            throw new Error("Not the right type for Immunization.protocolApplied.doseNumber[x]: "+value.fhirType());
1341          this.doseNumber = value;
1342          return this;
1343        }
1344
1345        /**
1346         * @return {@link #seriesDoses} (The recommended number of doses to achieve immunity.)
1347         */
1348        public Type getSeriesDoses() { 
1349          return this.seriesDoses;
1350        }
1351
1352        /**
1353         * @return {@link #seriesDoses} (The recommended number of doses to achieve immunity.)
1354         */
1355        public PositiveIntType getSeriesDosesPositiveIntType() throws FHIRException { 
1356          if (this.seriesDoses == null)
1357            this.seriesDoses = new PositiveIntType();
1358          if (!(this.seriesDoses instanceof PositiveIntType))
1359            throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.seriesDoses.getClass().getName()+" was encountered");
1360          return (PositiveIntType) this.seriesDoses;
1361        }
1362
1363        public boolean hasSeriesDosesPositiveIntType() { 
1364          return this != null && this.seriesDoses instanceof PositiveIntType;
1365        }
1366
1367        /**
1368         * @return {@link #seriesDoses} (The recommended number of doses to achieve immunity.)
1369         */
1370        public StringType getSeriesDosesStringType() throws FHIRException { 
1371          if (this.seriesDoses == null)
1372            this.seriesDoses = new StringType();
1373          if (!(this.seriesDoses instanceof StringType))
1374            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.seriesDoses.getClass().getName()+" was encountered");
1375          return (StringType) this.seriesDoses;
1376        }
1377
1378        public boolean hasSeriesDosesStringType() { 
1379          return this != null && this.seriesDoses instanceof StringType;
1380        }
1381
1382        public boolean hasSeriesDoses() { 
1383          return this.seriesDoses != null && !this.seriesDoses.isEmpty();
1384        }
1385
1386        /**
1387         * @param value {@link #seriesDoses} (The recommended number of doses to achieve immunity.)
1388         */
1389        public ImmunizationProtocolAppliedComponent setSeriesDoses(Type value) { 
1390          if (value != null && !(value instanceof PositiveIntType || value instanceof StringType))
1391            throw new Error("Not the right type for Immunization.protocolApplied.seriesDoses[x]: "+value.fhirType());
1392          this.seriesDoses = value;
1393          return this;
1394        }
1395
1396        protected void listChildren(List<Property> children) {
1397          super.listChildren(children);
1398          children.add(new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, 1, series));
1399          children.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol (e.g. ACIP) that is being followed.", 0, 1, authority));
1400          children.add(new Property("targetDisease", "CodeableConcept", "The vaccine preventable disease the dose is being administered against.", 0, java.lang.Integer.MAX_VALUE, targetDisease));
1401          children.add(new Property("doseNumber[x]", "positiveInt|string", "Nominal position in a series.", 0, 1, doseNumber));
1402          children.add(new Property("seriesDoses[x]", "positiveInt|string", "The recommended number of doses to achieve immunity.", 0, 1, seriesDoses));
1403        }
1404
1405        @Override
1406        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1407          switch (_hash) {
1408          case -905838985: /*series*/  return new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, 1, series);
1409          case 1475610435: /*authority*/  return new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol (e.g. ACIP) that is being followed.", 0, 1, authority);
1410          case -319593813: /*targetDisease*/  return new Property("targetDisease", "CodeableConcept", "The vaccine preventable disease the dose is being administered against.", 0, java.lang.Integer.MAX_VALUE, targetDisease);
1411          case -1632295686: /*doseNumber[x]*/  return new Property("doseNumber[x]", "positiveInt|string", "Nominal position in a series.", 0, 1, doseNumber);
1412          case -887709242: /*doseNumber*/  return new Property("doseNumber[x]", "positiveInt|string", "Nominal position in a series.", 0, 1, doseNumber);
1413          case -1826134640: /*doseNumberPositiveInt*/  return new Property("doseNumber[x]", "positiveInt|string", "Nominal position in a series.", 0, 1, doseNumber);
1414          case -333053577: /*doseNumberString*/  return new Property("doseNumber[x]", "positiveInt|string", "Nominal position in a series.", 0, 1, doseNumber);
1415          case 1553560673: /*seriesDoses[x]*/  return new Property("seriesDoses[x]", "positiveInt|string", "The recommended number of doses to achieve immunity.", 0, 1, seriesDoses);
1416          case -1936727105: /*seriesDoses*/  return new Property("seriesDoses[x]", "positiveInt|string", "The recommended number of doses to achieve immunity.", 0, 1, seriesDoses);
1417          case -220897801: /*seriesDosesPositiveInt*/  return new Property("seriesDoses[x]", "positiveInt|string", "The recommended number of doses to achieve immunity.", 0, 1, seriesDoses);
1418          case -673569616: /*seriesDosesString*/  return new Property("seriesDoses[x]", "positiveInt|string", "The recommended number of doses to achieve immunity.", 0, 1, seriesDoses);
1419          default: return super.getNamedProperty(_hash, _name, _checkValid);
1420          }
1421
1422        }
1423
1424      @Override
1425      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1426        switch (hash) {
1427        case -905838985: /*series*/ return this.series == null ? new Base[0] : new Base[] {this.series}; // StringType
1428        case 1475610435: /*authority*/ return this.authority == null ? new Base[0] : new Base[] {this.authority}; // Reference
1429        case -319593813: /*targetDisease*/ return this.targetDisease == null ? new Base[0] : this.targetDisease.toArray(new Base[this.targetDisease.size()]); // CodeableConcept
1430        case -887709242: /*doseNumber*/ return this.doseNumber == null ? new Base[0] : new Base[] {this.doseNumber}; // Type
1431        case -1936727105: /*seriesDoses*/ return this.seriesDoses == null ? new Base[0] : new Base[] {this.seriesDoses}; // Type
1432        default: return super.getProperty(hash, name, checkValid);
1433        }
1434
1435      }
1436
1437      @Override
1438      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1439        switch (hash) {
1440        case -905838985: // series
1441          this.series = castToString(value); // StringType
1442          return value;
1443        case 1475610435: // authority
1444          this.authority = castToReference(value); // Reference
1445          return value;
1446        case -319593813: // targetDisease
1447          this.getTargetDisease().add(castToCodeableConcept(value)); // CodeableConcept
1448          return value;
1449        case -887709242: // doseNumber
1450          this.doseNumber = castToType(value); // Type
1451          return value;
1452        case -1936727105: // seriesDoses
1453          this.seriesDoses = castToType(value); // Type
1454          return value;
1455        default: return super.setProperty(hash, name, value);
1456        }
1457
1458      }
1459
1460      @Override
1461      public Base setProperty(String name, Base value) throws FHIRException {
1462        if (name.equals("series")) {
1463          this.series = castToString(value); // StringType
1464        } else if (name.equals("authority")) {
1465          this.authority = castToReference(value); // Reference
1466        } else if (name.equals("targetDisease")) {
1467          this.getTargetDisease().add(castToCodeableConcept(value));
1468        } else if (name.equals("doseNumber[x]")) {
1469          this.doseNumber = castToType(value); // Type
1470        } else if (name.equals("seriesDoses[x]")) {
1471          this.seriesDoses = castToType(value); // Type
1472        } else
1473          return super.setProperty(name, value);
1474        return value;
1475      }
1476
1477      @Override
1478      public Base makeProperty(int hash, String name) throws FHIRException {
1479        switch (hash) {
1480        case -905838985:  return getSeriesElement();
1481        case 1475610435:  return getAuthority(); 
1482        case -319593813:  return addTargetDisease(); 
1483        case -1632295686:  return getDoseNumber(); 
1484        case -887709242:  return getDoseNumber(); 
1485        case 1553560673:  return getSeriesDoses(); 
1486        case -1936727105:  return getSeriesDoses(); 
1487        default: return super.makeProperty(hash, name);
1488        }
1489
1490      }
1491
1492      @Override
1493      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1494        switch (hash) {
1495        case -905838985: /*series*/ return new String[] {"string"};
1496        case 1475610435: /*authority*/ return new String[] {"Reference"};
1497        case -319593813: /*targetDisease*/ return new String[] {"CodeableConcept"};
1498        case -887709242: /*doseNumber*/ return new String[] {"positiveInt", "string"};
1499        case -1936727105: /*seriesDoses*/ return new String[] {"positiveInt", "string"};
1500        default: return super.getTypesForProperty(hash, name);
1501        }
1502
1503      }
1504
1505      @Override
1506      public Base addChild(String name) throws FHIRException {
1507        if (name.equals("series")) {
1508          throw new FHIRException("Cannot call addChild on a primitive type Immunization.series");
1509        }
1510        else if (name.equals("authority")) {
1511          this.authority = new Reference();
1512          return this.authority;
1513        }
1514        else if (name.equals("targetDisease")) {
1515          return addTargetDisease();
1516        }
1517        else if (name.equals("doseNumberPositiveInt")) {
1518          this.doseNumber = new PositiveIntType();
1519          return this.doseNumber;
1520        }
1521        else if (name.equals("doseNumberString")) {
1522          this.doseNumber = new StringType();
1523          return this.doseNumber;
1524        }
1525        else if (name.equals("seriesDosesPositiveInt")) {
1526          this.seriesDoses = new PositiveIntType();
1527          return this.seriesDoses;
1528        }
1529        else if (name.equals("seriesDosesString")) {
1530          this.seriesDoses = new StringType();
1531          return this.seriesDoses;
1532        }
1533        else
1534          return super.addChild(name);
1535      }
1536
1537      public ImmunizationProtocolAppliedComponent copy() {
1538        ImmunizationProtocolAppliedComponent dst = new ImmunizationProtocolAppliedComponent();
1539        copyValues(dst);
1540        dst.series = series == null ? null : series.copy();
1541        dst.authority = authority == null ? null : authority.copy();
1542        if (targetDisease != null) {
1543          dst.targetDisease = new ArrayList<CodeableConcept>();
1544          for (CodeableConcept i : targetDisease)
1545            dst.targetDisease.add(i.copy());
1546        };
1547        dst.doseNumber = doseNumber == null ? null : doseNumber.copy();
1548        dst.seriesDoses = seriesDoses == null ? null : seriesDoses.copy();
1549        return dst;
1550      }
1551
1552      @Override
1553      public boolean equalsDeep(Base other_) {
1554        if (!super.equalsDeep(other_))
1555          return false;
1556        if (!(other_ instanceof ImmunizationProtocolAppliedComponent))
1557          return false;
1558        ImmunizationProtocolAppliedComponent o = (ImmunizationProtocolAppliedComponent) other_;
1559        return compareDeep(series, o.series, true) && compareDeep(authority, o.authority, true) && compareDeep(targetDisease, o.targetDisease, true)
1560           && compareDeep(doseNumber, o.doseNumber, true) && compareDeep(seriesDoses, o.seriesDoses, true)
1561          ;
1562      }
1563
1564      @Override
1565      public boolean equalsShallow(Base other_) {
1566        if (!super.equalsShallow(other_))
1567          return false;
1568        if (!(other_ instanceof ImmunizationProtocolAppliedComponent))
1569          return false;
1570        ImmunizationProtocolAppliedComponent o = (ImmunizationProtocolAppliedComponent) other_;
1571        return compareValues(series, o.series, true);
1572      }
1573
1574      public boolean isEmpty() {
1575        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(series, authority, targetDisease
1576          , doseNumber, seriesDoses);
1577      }
1578
1579  public String fhirType() {
1580    return "Immunization.protocolApplied";
1581
1582  }
1583
1584  }
1585
1586    /**
1587     * A unique identifier assigned to this immunization record.
1588     */
1589    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1590    @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this immunization record." )
1591    protected List<Identifier> identifier;
1592
1593    /**
1594     * Indicates the current status of the immunization event.
1595     */
1596    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
1597    @Description(shortDefinition="completed | entered-in-error | not-done", formalDefinition="Indicates the current status of the immunization event." )
1598    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-status")
1599    protected Enumeration<ImmunizationStatus> status;
1600
1601    /**
1602     * Indicates the reason the immunization event was not performed.
1603     */
1604    @Child(name = "statusReason", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
1605    @Description(shortDefinition="Reason not done", formalDefinition="Indicates the reason the immunization event was not performed." )
1606    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-status-reason")
1607    protected CodeableConcept statusReason;
1608
1609    /**
1610     * Vaccine that was administered or was to be administered.
1611     */
1612    @Child(name = "vaccineCode", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true)
1613    @Description(shortDefinition="Vaccine product administered", formalDefinition="Vaccine that was administered or was to be administered." )
1614    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/vaccine-code")
1615    protected CodeableConcept vaccineCode;
1616
1617    /**
1618     * The patient who either received or did not receive the immunization.
1619     */
1620    @Child(name = "patient", type = {Patient.class}, order=4, min=1, max=1, modifier=false, summary=true)
1621    @Description(shortDefinition="Who was immunized", formalDefinition="The patient who either received or did not receive the immunization." )
1622    protected Reference patient;
1623
1624    /**
1625     * The actual object that is the target of the reference (The patient who either received or did not receive the immunization.)
1626     */
1627    protected Patient patientTarget;
1628
1629    /**
1630     * The visit or admission or other contact between patient and health care provider the immunization was performed as part of.
1631     */
1632    @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1, modifier=false, summary=false)
1633    @Description(shortDefinition="Encounter immunization was part of", formalDefinition="The visit or admission or other contact between patient and health care provider the immunization was performed as part of." )
1634    protected Reference encounter;
1635
1636    /**
1637     * The actual object that is the target of the reference (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.)
1638     */
1639    protected Encounter encounterTarget;
1640
1641    /**
1642     * Date vaccine administered or was to be administered.
1643     */
1644    @Child(name = "occurrence", type = {DateTimeType.class, StringType.class}, order=6, min=1, max=1, modifier=false, summary=true)
1645    @Description(shortDefinition="Vaccine administration date", formalDefinition="Date vaccine administered or was to be administered." )
1646    protected Type occurrence;
1647
1648    /**
1649     * The date the occurrence of the immunization was first captured in the record - potentially significantly after the occurrence of the event.
1650     */
1651    @Child(name = "recorded", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=false)
1652    @Description(shortDefinition="When the immunization was first captured in the subject's record", formalDefinition="The date the occurrence of the immunization was first captured in the record - potentially significantly after the occurrence of the event." )
1653    protected DateTimeType recorded;
1654
1655    /**
1656     * An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.
1657     */
1658    @Child(name = "primarySource", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=true)
1659    @Description(shortDefinition="Indicates context the data was recorded in", formalDefinition="An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded." )
1660    protected BooleanType primarySource;
1661
1662    /**
1663     * The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine.
1664     */
1665    @Child(name = "reportOrigin", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false)
1666    @Description(shortDefinition="Indicates the source of a secondarily reported record", formalDefinition="The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine." )
1667    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-origin")
1668    protected CodeableConcept reportOrigin;
1669
1670    /**
1671     * The service delivery location where the vaccine administration occurred.
1672     */
1673    @Child(name = "location", type = {Location.class}, order=10, min=0, max=1, modifier=false, summary=false)
1674    @Description(shortDefinition="Where immunization occurred", formalDefinition="The service delivery location where the vaccine administration occurred." )
1675    protected Reference location;
1676
1677    /**
1678     * The actual object that is the target of the reference (The service delivery location where the vaccine administration occurred.)
1679     */
1680    protected Location locationTarget;
1681
1682    /**
1683     * Name of vaccine manufacturer.
1684     */
1685    @Child(name = "manufacturer", type = {Organization.class}, order=11, min=0, max=1, modifier=false, summary=false)
1686    @Description(shortDefinition="Vaccine manufacturer", formalDefinition="Name of vaccine manufacturer." )
1687    protected Reference manufacturer;
1688
1689    /**
1690     * The actual object that is the target of the reference (Name of vaccine manufacturer.)
1691     */
1692    protected Organization manufacturerTarget;
1693
1694    /**
1695     * Lot number of the  vaccine product.
1696     */
1697    @Child(name = "lotNumber", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false)
1698    @Description(shortDefinition="Vaccine lot number", formalDefinition="Lot number of the  vaccine product." )
1699    protected StringType lotNumber;
1700
1701    /**
1702     * Date vaccine batch expires.
1703     */
1704    @Child(name = "expirationDate", type = {DateType.class}, order=13, min=0, max=1, modifier=false, summary=false)
1705    @Description(shortDefinition="Vaccine expiration date", formalDefinition="Date vaccine batch expires." )
1706    protected DateType expirationDate;
1707
1708    /**
1709     * Body site where vaccine was administered.
1710     */
1711    @Child(name = "site", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=false)
1712    @Description(shortDefinition="Body site vaccine  was administered", formalDefinition="Body site where vaccine was administered." )
1713    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-site")
1714    protected CodeableConcept site;
1715
1716    /**
1717     * The path by which the vaccine product is taken into the body.
1718     */
1719    @Child(name = "route", type = {CodeableConcept.class}, order=15, min=0, max=1, modifier=false, summary=false)
1720    @Description(shortDefinition="How vaccine entered body", formalDefinition="The path by which the vaccine product is taken into the body." )
1721    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-route")
1722    protected CodeableConcept route;
1723
1724    /**
1725     * The quantity of vaccine product that was administered.
1726     */
1727    @Child(name = "doseQuantity", type = {Quantity.class}, order=16, min=0, max=1, modifier=false, summary=false)
1728    @Description(shortDefinition="Amount of vaccine administered", formalDefinition="The quantity of vaccine product that was administered." )
1729    protected Quantity doseQuantity;
1730
1731    /**
1732     * Indicates who performed the immunization event.
1733     */
1734    @Child(name = "performer", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1735    @Description(shortDefinition="Who performed event", formalDefinition="Indicates who performed the immunization event." )
1736    protected List<ImmunizationPerformerComponent> performer;
1737
1738    /**
1739     * Extra information about the immunization that is not conveyed by the other attributes.
1740     */
1741    @Child(name = "note", type = {Annotation.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1742    @Description(shortDefinition="Additional immunization notes", formalDefinition="Extra information about the immunization that is not conveyed by the other attributes." )
1743    protected List<Annotation> note;
1744
1745    /**
1746     * Reasons why the vaccine was administered.
1747     */
1748    @Child(name = "reasonCode", type = {CodeableConcept.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1749    @Description(shortDefinition="Why immunization occurred", formalDefinition="Reasons why the vaccine was administered." )
1750    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-reason")
1751    protected List<CodeableConcept> reasonCode;
1752
1753    /**
1754     * Condition, Observation or DiagnosticReport that supports why the immunization was administered.
1755     */
1756    @Child(name = "reasonReference", type = {Condition.class, Observation.class, DiagnosticReport.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1757    @Description(shortDefinition="Why immunization occurred", formalDefinition="Condition, Observation or DiagnosticReport that supports why the immunization was administered." )
1758    protected List<Reference> reasonReference;
1759    /**
1760     * The actual objects that are the target of the reference (Condition, Observation or DiagnosticReport that supports why the immunization was administered.)
1761     */
1762    protected List<Resource> reasonReferenceTarget;
1763
1764
1765    /**
1766     * Indication if a dose is considered to be subpotent. By default, a dose should be considered to be potent.
1767     */
1768    @Child(name = "isSubpotent", type = {BooleanType.class}, order=21, min=0, max=1, modifier=true, summary=true)
1769    @Description(shortDefinition="Dose potency", formalDefinition="Indication if a dose is considered to be subpotent. By default, a dose should be considered to be potent." )
1770    protected BooleanType isSubpotent;
1771
1772    /**
1773     * Reason why a dose is considered to be subpotent.
1774     */
1775    @Child(name = "subpotentReason", type = {CodeableConcept.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1776    @Description(shortDefinition="Reason for being subpotent", formalDefinition="Reason why a dose is considered to be subpotent." )
1777    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-subpotent-reason")
1778    protected List<CodeableConcept> subpotentReason;
1779
1780    /**
1781     * Educational material presented to the patient (or guardian) at the time of vaccine administration.
1782     */
1783    @Child(name = "education", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1784    @Description(shortDefinition="Educational material presented to patient", formalDefinition="Educational material presented to the patient (or guardian) at the time of vaccine administration." )
1785    protected List<ImmunizationEducationComponent> education;
1786
1787    /**
1788     * Indicates a patient's eligibility for a funding program.
1789     */
1790    @Child(name = "programEligibility", type = {CodeableConcept.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1791    @Description(shortDefinition="Patient eligibility for a vaccination program", formalDefinition="Indicates a patient's eligibility for a funding program." )
1792    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-program-eligibility")
1793    protected List<CodeableConcept> programEligibility;
1794
1795    /**
1796     * Indicates the source of the vaccine actually administered. This may be different than the patient eligibility (e.g. the patient may be eligible for a publically purchased vaccine but due to inventory issues, vaccine purchased with private funds was actually administered).
1797     */
1798    @Child(name = "fundingSource", type = {CodeableConcept.class}, order=25, min=0, max=1, modifier=false, summary=false)
1799    @Description(shortDefinition="Funding source for the vaccine", formalDefinition="Indicates the source of the vaccine actually administered. This may be different than the patient eligibility (e.g. the patient may be eligible for a publically purchased vaccine but due to inventory issues, vaccine purchased with private funds was actually administered)." )
1800    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-funding-source")
1801    protected CodeableConcept fundingSource;
1802
1803    /**
1804     * Categorical data indicating that an adverse event is associated in time to an immunization.
1805     */
1806    @Child(name = "reaction", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1807    @Description(shortDefinition="Details of a reaction that follows immunization", formalDefinition="Categorical data indicating that an adverse event is associated in time to an immunization." )
1808    protected List<ImmunizationReactionComponent> reaction;
1809
1810    /**
1811     * The protocol (set of recommendations) being followed by the provider who administered the dose.
1812     */
1813    @Child(name = "protocolApplied", type = {}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1814    @Description(shortDefinition="Protocol followed by the provider", formalDefinition="The protocol (set of recommendations) being followed by the provider who administered the dose." )
1815    protected List<ImmunizationProtocolAppliedComponent> protocolApplied;
1816
1817    private static final long serialVersionUID = 1946730839L;
1818
1819  /**
1820   * Constructor
1821   */
1822    public Immunization() {
1823      super();
1824    }
1825
1826  /**
1827   * Constructor
1828   */
1829    public Immunization(Enumeration<ImmunizationStatus> status, CodeableConcept vaccineCode, Reference patient, Type occurrence) {
1830      super();
1831      this.status = status;
1832      this.vaccineCode = vaccineCode;
1833      this.patient = patient;
1834      this.occurrence = occurrence;
1835    }
1836
1837    /**
1838     * @return {@link #identifier} (A unique identifier assigned to this immunization record.)
1839     */
1840    public List<Identifier> getIdentifier() { 
1841      if (this.identifier == null)
1842        this.identifier = new ArrayList<Identifier>();
1843      return this.identifier;
1844    }
1845
1846    /**
1847     * @return Returns a reference to <code>this</code> for easy method chaining
1848     */
1849    public Immunization setIdentifier(List<Identifier> theIdentifier) { 
1850      this.identifier = theIdentifier;
1851      return this;
1852    }
1853
1854    public boolean hasIdentifier() { 
1855      if (this.identifier == null)
1856        return false;
1857      for (Identifier item : this.identifier)
1858        if (!item.isEmpty())
1859          return true;
1860      return false;
1861    }
1862
1863    public Identifier addIdentifier() { //3
1864      Identifier t = new Identifier();
1865      if (this.identifier == null)
1866        this.identifier = new ArrayList<Identifier>();
1867      this.identifier.add(t);
1868      return t;
1869    }
1870
1871    public Immunization addIdentifier(Identifier t) { //3
1872      if (t == null)
1873        return this;
1874      if (this.identifier == null)
1875        this.identifier = new ArrayList<Identifier>();
1876      this.identifier.add(t);
1877      return this;
1878    }
1879
1880    /**
1881     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1882     */
1883    public Identifier getIdentifierFirstRep() { 
1884      if (getIdentifier().isEmpty()) {
1885        addIdentifier();
1886      }
1887      return getIdentifier().get(0);
1888    }
1889
1890    /**
1891     * @return {@link #status} (Indicates the current status of the immunization event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1892     */
1893    public Enumeration<ImmunizationStatus> getStatusElement() { 
1894      if (this.status == null)
1895        if (Configuration.errorOnAutoCreate())
1896          throw new Error("Attempt to auto-create Immunization.status");
1897        else if (Configuration.doAutoCreate())
1898          this.status = new Enumeration<ImmunizationStatus>(new ImmunizationStatusEnumFactory()); // bb
1899      return this.status;
1900    }
1901
1902    public boolean hasStatusElement() { 
1903      return this.status != null && !this.status.isEmpty();
1904    }
1905
1906    public boolean hasStatus() { 
1907      return this.status != null && !this.status.isEmpty();
1908    }
1909
1910    /**
1911     * @param value {@link #status} (Indicates the current status of the immunization event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1912     */
1913    public Immunization setStatusElement(Enumeration<ImmunizationStatus> value) { 
1914      this.status = value;
1915      return this;
1916    }
1917
1918    /**
1919     * @return Indicates the current status of the immunization event.
1920     */
1921    public ImmunizationStatus getStatus() { 
1922      return this.status == null ? null : this.status.getValue();
1923    }
1924
1925    /**
1926     * @param value Indicates the current status of the immunization event.
1927     */
1928    public Immunization setStatus(ImmunizationStatus value) { 
1929        if (this.status == null)
1930          this.status = new Enumeration<ImmunizationStatus>(new ImmunizationStatusEnumFactory());
1931        this.status.setValue(value);
1932      return this;
1933    }
1934
1935    /**
1936     * @return {@link #statusReason} (Indicates the reason the immunization event was not performed.)
1937     */
1938    public CodeableConcept getStatusReason() { 
1939      if (this.statusReason == null)
1940        if (Configuration.errorOnAutoCreate())
1941          throw new Error("Attempt to auto-create Immunization.statusReason");
1942        else if (Configuration.doAutoCreate())
1943          this.statusReason = new CodeableConcept(); // cc
1944      return this.statusReason;
1945    }
1946
1947    public boolean hasStatusReason() { 
1948      return this.statusReason != null && !this.statusReason.isEmpty();
1949    }
1950
1951    /**
1952     * @param value {@link #statusReason} (Indicates the reason the immunization event was not performed.)
1953     */
1954    public Immunization setStatusReason(CodeableConcept value) { 
1955      this.statusReason = value;
1956      return this;
1957    }
1958
1959    /**
1960     * @return {@link #vaccineCode} (Vaccine that was administered or was to be administered.)
1961     */
1962    public CodeableConcept getVaccineCode() { 
1963      if (this.vaccineCode == null)
1964        if (Configuration.errorOnAutoCreate())
1965          throw new Error("Attempt to auto-create Immunization.vaccineCode");
1966        else if (Configuration.doAutoCreate())
1967          this.vaccineCode = new CodeableConcept(); // cc
1968      return this.vaccineCode;
1969    }
1970
1971    public boolean hasVaccineCode() { 
1972      return this.vaccineCode != null && !this.vaccineCode.isEmpty();
1973    }
1974
1975    /**
1976     * @param value {@link #vaccineCode} (Vaccine that was administered or was to be administered.)
1977     */
1978    public Immunization setVaccineCode(CodeableConcept value) { 
1979      this.vaccineCode = value;
1980      return this;
1981    }
1982
1983    /**
1984     * @return {@link #patient} (The patient who either received or did not receive the immunization.)
1985     */
1986    public Reference getPatient() { 
1987      if (this.patient == null)
1988        if (Configuration.errorOnAutoCreate())
1989          throw new Error("Attempt to auto-create Immunization.patient");
1990        else if (Configuration.doAutoCreate())
1991          this.patient = new Reference(); // cc
1992      return this.patient;
1993    }
1994
1995    public boolean hasPatient() { 
1996      return this.patient != null && !this.patient.isEmpty();
1997    }
1998
1999    /**
2000     * @param value {@link #patient} (The patient who either received or did not receive the immunization.)
2001     */
2002    public Immunization setPatient(Reference value) { 
2003      this.patient = value;
2004      return this;
2005    }
2006
2007    /**
2008     * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who either received or did not receive the immunization.)
2009     */
2010    public Patient getPatientTarget() { 
2011      if (this.patientTarget == null)
2012        if (Configuration.errorOnAutoCreate())
2013          throw new Error("Attempt to auto-create Immunization.patient");
2014        else if (Configuration.doAutoCreate())
2015          this.patientTarget = new Patient(); // aa
2016      return this.patientTarget;
2017    }
2018
2019    /**
2020     * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who either received or did not receive the immunization.)
2021     */
2022    public Immunization setPatientTarget(Patient value) { 
2023      this.patientTarget = value;
2024      return this;
2025    }
2026
2027    /**
2028     * @return {@link #encounter} (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.)
2029     */
2030    public Reference getEncounter() { 
2031      if (this.encounter == null)
2032        if (Configuration.errorOnAutoCreate())
2033          throw new Error("Attempt to auto-create Immunization.encounter");
2034        else if (Configuration.doAutoCreate())
2035          this.encounter = new Reference(); // cc
2036      return this.encounter;
2037    }
2038
2039    public boolean hasEncounter() { 
2040      return this.encounter != null && !this.encounter.isEmpty();
2041    }
2042
2043    /**
2044     * @param value {@link #encounter} (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.)
2045     */
2046    public Immunization setEncounter(Reference value) { 
2047      this.encounter = value;
2048      return this;
2049    }
2050
2051    /**
2052     * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.)
2053     */
2054    public Encounter getEncounterTarget() { 
2055      if (this.encounterTarget == null)
2056        if (Configuration.errorOnAutoCreate())
2057          throw new Error("Attempt to auto-create Immunization.encounter");
2058        else if (Configuration.doAutoCreate())
2059          this.encounterTarget = new Encounter(); // aa
2060      return this.encounterTarget;
2061    }
2062
2063    /**
2064     * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.)
2065     */
2066    public Immunization setEncounterTarget(Encounter value) { 
2067      this.encounterTarget = value;
2068      return this;
2069    }
2070
2071    /**
2072     * @return {@link #occurrence} (Date vaccine administered or was to be administered.)
2073     */
2074    public Type getOccurrence() { 
2075      return this.occurrence;
2076    }
2077
2078    /**
2079     * @return {@link #occurrence} (Date vaccine administered or was to be administered.)
2080     */
2081    public DateTimeType getOccurrenceDateTimeType() throws FHIRException { 
2082      if (this.occurrence == null)
2083        this.occurrence = new DateTimeType();
2084      if (!(this.occurrence instanceof DateTimeType))
2085        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.occurrence.getClass().getName()+" was encountered");
2086      return (DateTimeType) this.occurrence;
2087    }
2088
2089    public boolean hasOccurrenceDateTimeType() { 
2090      return this != null && this.occurrence instanceof DateTimeType;
2091    }
2092
2093    /**
2094     * @return {@link #occurrence} (Date vaccine administered or was to be administered.)
2095     */
2096    public StringType getOccurrenceStringType() throws FHIRException { 
2097      if (this.occurrence == null)
2098        this.occurrence = new StringType();
2099      if (!(this.occurrence instanceof StringType))
2100        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.occurrence.getClass().getName()+" was encountered");
2101      return (StringType) this.occurrence;
2102    }
2103
2104    public boolean hasOccurrenceStringType() { 
2105      return this != null && this.occurrence instanceof StringType;
2106    }
2107
2108    public boolean hasOccurrence() { 
2109      return this.occurrence != null && !this.occurrence.isEmpty();
2110    }
2111
2112    /**
2113     * @param value {@link #occurrence} (Date vaccine administered or was to be administered.)
2114     */
2115    public Immunization setOccurrence(Type value) { 
2116      if (value != null && !(value instanceof DateTimeType || value instanceof StringType))
2117        throw new Error("Not the right type for Immunization.occurrence[x]: "+value.fhirType());
2118      this.occurrence = value;
2119      return this;
2120    }
2121
2122    /**
2123     * @return {@link #recorded} (The date the occurrence of the immunization was first captured in the record - potentially significantly after the occurrence of the event.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value
2124     */
2125    public DateTimeType getRecordedElement() { 
2126      if (this.recorded == null)
2127        if (Configuration.errorOnAutoCreate())
2128          throw new Error("Attempt to auto-create Immunization.recorded");
2129        else if (Configuration.doAutoCreate())
2130          this.recorded = new DateTimeType(); // bb
2131      return this.recorded;
2132    }
2133
2134    public boolean hasRecordedElement() { 
2135      return this.recorded != null && !this.recorded.isEmpty();
2136    }
2137
2138    public boolean hasRecorded() { 
2139      return this.recorded != null && !this.recorded.isEmpty();
2140    }
2141
2142    /**
2143     * @param value {@link #recorded} (The date the occurrence of the immunization was first captured in the record - potentially significantly after the occurrence of the event.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value
2144     */
2145    public Immunization setRecordedElement(DateTimeType value) { 
2146      this.recorded = value;
2147      return this;
2148    }
2149
2150    /**
2151     * @return The date the occurrence of the immunization was first captured in the record - potentially significantly after the occurrence of the event.
2152     */
2153    public Date getRecorded() { 
2154      return this.recorded == null ? null : this.recorded.getValue();
2155    }
2156
2157    /**
2158     * @param value The date the occurrence of the immunization was first captured in the record - potentially significantly after the occurrence of the event.
2159     */
2160    public Immunization setRecorded(Date value) { 
2161      if (value == null)
2162        this.recorded = null;
2163      else {
2164        if (this.recorded == null)
2165          this.recorded = new DateTimeType();
2166        this.recorded.setValue(value);
2167      }
2168      return this;
2169    }
2170
2171    /**
2172     * @return {@link #primarySource} (An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.). This is the underlying object with id, value and extensions. The accessor "getPrimarySource" gives direct access to the value
2173     */
2174    public BooleanType getPrimarySourceElement() { 
2175      if (this.primarySource == null)
2176        if (Configuration.errorOnAutoCreate())
2177          throw new Error("Attempt to auto-create Immunization.primarySource");
2178        else if (Configuration.doAutoCreate())
2179          this.primarySource = new BooleanType(); // bb
2180      return this.primarySource;
2181    }
2182
2183    public boolean hasPrimarySourceElement() { 
2184      return this.primarySource != null && !this.primarySource.isEmpty();
2185    }
2186
2187    public boolean hasPrimarySource() { 
2188      return this.primarySource != null && !this.primarySource.isEmpty();
2189    }
2190
2191    /**
2192     * @param value {@link #primarySource} (An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.). This is the underlying object with id, value and extensions. The accessor "getPrimarySource" gives direct access to the value
2193     */
2194    public Immunization setPrimarySourceElement(BooleanType value) { 
2195      this.primarySource = value;
2196      return this;
2197    }
2198
2199    /**
2200     * @return An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.
2201     */
2202    public boolean getPrimarySource() { 
2203      return this.primarySource == null || this.primarySource.isEmpty() ? false : this.primarySource.getValue();
2204    }
2205
2206    /**
2207     * @param value An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.
2208     */
2209    public Immunization setPrimarySource(boolean value) { 
2210        if (this.primarySource == null)
2211          this.primarySource = new BooleanType();
2212        this.primarySource.setValue(value);
2213      return this;
2214    }
2215
2216    /**
2217     * @return {@link #reportOrigin} (The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine.)
2218     */
2219    public CodeableConcept getReportOrigin() { 
2220      if (this.reportOrigin == null)
2221        if (Configuration.errorOnAutoCreate())
2222          throw new Error("Attempt to auto-create Immunization.reportOrigin");
2223        else if (Configuration.doAutoCreate())
2224          this.reportOrigin = new CodeableConcept(); // cc
2225      return this.reportOrigin;
2226    }
2227
2228    public boolean hasReportOrigin() { 
2229      return this.reportOrigin != null && !this.reportOrigin.isEmpty();
2230    }
2231
2232    /**
2233     * @param value {@link #reportOrigin} (The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine.)
2234     */
2235    public Immunization setReportOrigin(CodeableConcept value) { 
2236      this.reportOrigin = value;
2237      return this;
2238    }
2239
2240    /**
2241     * @return {@link #location} (The service delivery location where the vaccine administration occurred.)
2242     */
2243    public Reference getLocation() { 
2244      if (this.location == null)
2245        if (Configuration.errorOnAutoCreate())
2246          throw new Error("Attempt to auto-create Immunization.location");
2247        else if (Configuration.doAutoCreate())
2248          this.location = new Reference(); // cc
2249      return this.location;
2250    }
2251
2252    public boolean hasLocation() { 
2253      return this.location != null && !this.location.isEmpty();
2254    }
2255
2256    /**
2257     * @param value {@link #location} (The service delivery location where the vaccine administration occurred.)
2258     */
2259    public Immunization setLocation(Reference value) { 
2260      this.location = value;
2261      return this;
2262    }
2263
2264    /**
2265     * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The service delivery location where the vaccine administration occurred.)
2266     */
2267    public Location getLocationTarget() { 
2268      if (this.locationTarget == null)
2269        if (Configuration.errorOnAutoCreate())
2270          throw new Error("Attempt to auto-create Immunization.location");
2271        else if (Configuration.doAutoCreate())
2272          this.locationTarget = new Location(); // aa
2273      return this.locationTarget;
2274    }
2275
2276    /**
2277     * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The service delivery location where the vaccine administration occurred.)
2278     */
2279    public Immunization setLocationTarget(Location value) { 
2280      this.locationTarget = value;
2281      return this;
2282    }
2283
2284    /**
2285     * @return {@link #manufacturer} (Name of vaccine manufacturer.)
2286     */
2287    public Reference getManufacturer() { 
2288      if (this.manufacturer == null)
2289        if (Configuration.errorOnAutoCreate())
2290          throw new Error("Attempt to auto-create Immunization.manufacturer");
2291        else if (Configuration.doAutoCreate())
2292          this.manufacturer = new Reference(); // cc
2293      return this.manufacturer;
2294    }
2295
2296    public boolean hasManufacturer() { 
2297      return this.manufacturer != null && !this.manufacturer.isEmpty();
2298    }
2299
2300    /**
2301     * @param value {@link #manufacturer} (Name of vaccine manufacturer.)
2302     */
2303    public Immunization setManufacturer(Reference value) { 
2304      this.manufacturer = value;
2305      return this;
2306    }
2307
2308    /**
2309     * @return {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Name of vaccine manufacturer.)
2310     */
2311    public Organization getManufacturerTarget() { 
2312      if (this.manufacturerTarget == null)
2313        if (Configuration.errorOnAutoCreate())
2314          throw new Error("Attempt to auto-create Immunization.manufacturer");
2315        else if (Configuration.doAutoCreate())
2316          this.manufacturerTarget = new Organization(); // aa
2317      return this.manufacturerTarget;
2318    }
2319
2320    /**
2321     * @param value {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Name of vaccine manufacturer.)
2322     */
2323    public Immunization setManufacturerTarget(Organization value) { 
2324      this.manufacturerTarget = value;
2325      return this;
2326    }
2327
2328    /**
2329     * @return {@link #lotNumber} (Lot number of the  vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value
2330     */
2331    public StringType getLotNumberElement() { 
2332      if (this.lotNumber == null)
2333        if (Configuration.errorOnAutoCreate())
2334          throw new Error("Attempt to auto-create Immunization.lotNumber");
2335        else if (Configuration.doAutoCreate())
2336          this.lotNumber = new StringType(); // bb
2337      return this.lotNumber;
2338    }
2339
2340    public boolean hasLotNumberElement() { 
2341      return this.lotNumber != null && !this.lotNumber.isEmpty();
2342    }
2343
2344    public boolean hasLotNumber() { 
2345      return this.lotNumber != null && !this.lotNumber.isEmpty();
2346    }
2347
2348    /**
2349     * @param value {@link #lotNumber} (Lot number of the  vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value
2350     */
2351    public Immunization setLotNumberElement(StringType value) { 
2352      this.lotNumber = value;
2353      return this;
2354    }
2355
2356    /**
2357     * @return Lot number of the  vaccine product.
2358     */
2359    public String getLotNumber() { 
2360      return this.lotNumber == null ? null : this.lotNumber.getValue();
2361    }
2362
2363    /**
2364     * @param value Lot number of the  vaccine product.
2365     */
2366    public Immunization setLotNumber(String value) { 
2367      if (Utilities.noString(value))
2368        this.lotNumber = null;
2369      else {
2370        if (this.lotNumber == null)
2371          this.lotNumber = new StringType();
2372        this.lotNumber.setValue(value);
2373      }
2374      return this;
2375    }
2376
2377    /**
2378     * @return {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value
2379     */
2380    public DateType getExpirationDateElement() { 
2381      if (this.expirationDate == null)
2382        if (Configuration.errorOnAutoCreate())
2383          throw new Error("Attempt to auto-create Immunization.expirationDate");
2384        else if (Configuration.doAutoCreate())
2385          this.expirationDate = new DateType(); // bb
2386      return this.expirationDate;
2387    }
2388
2389    public boolean hasExpirationDateElement() { 
2390      return this.expirationDate != null && !this.expirationDate.isEmpty();
2391    }
2392
2393    public boolean hasExpirationDate() { 
2394      return this.expirationDate != null && !this.expirationDate.isEmpty();
2395    }
2396
2397    /**
2398     * @param value {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value
2399     */
2400    public Immunization setExpirationDateElement(DateType value) { 
2401      this.expirationDate = value;
2402      return this;
2403    }
2404
2405    /**
2406     * @return Date vaccine batch expires.
2407     */
2408    public Date getExpirationDate() { 
2409      return this.expirationDate == null ? null : this.expirationDate.getValue();
2410    }
2411
2412    /**
2413     * @param value Date vaccine batch expires.
2414     */
2415    public Immunization setExpirationDate(Date value) { 
2416      if (value == null)
2417        this.expirationDate = null;
2418      else {
2419        if (this.expirationDate == null)
2420          this.expirationDate = new DateType();
2421        this.expirationDate.setValue(value);
2422      }
2423      return this;
2424    }
2425
2426    /**
2427     * @return {@link #site} (Body site where vaccine was administered.)
2428     */
2429    public CodeableConcept getSite() { 
2430      if (this.site == null)
2431        if (Configuration.errorOnAutoCreate())
2432          throw new Error("Attempt to auto-create Immunization.site");
2433        else if (Configuration.doAutoCreate())
2434          this.site = new CodeableConcept(); // cc
2435      return this.site;
2436    }
2437
2438    public boolean hasSite() { 
2439      return this.site != null && !this.site.isEmpty();
2440    }
2441
2442    /**
2443     * @param value {@link #site} (Body site where vaccine was administered.)
2444     */
2445    public Immunization setSite(CodeableConcept value) { 
2446      this.site = value;
2447      return this;
2448    }
2449
2450    /**
2451     * @return {@link #route} (The path by which the vaccine product is taken into the body.)
2452     */
2453    public CodeableConcept getRoute() { 
2454      if (this.route == null)
2455        if (Configuration.errorOnAutoCreate())
2456          throw new Error("Attempt to auto-create Immunization.route");
2457        else if (Configuration.doAutoCreate())
2458          this.route = new CodeableConcept(); // cc
2459      return this.route;
2460    }
2461
2462    public boolean hasRoute() { 
2463      return this.route != null && !this.route.isEmpty();
2464    }
2465
2466    /**
2467     * @param value {@link #route} (The path by which the vaccine product is taken into the body.)
2468     */
2469    public Immunization setRoute(CodeableConcept value) { 
2470      this.route = value;
2471      return this;
2472    }
2473
2474    /**
2475     * @return {@link #doseQuantity} (The quantity of vaccine product that was administered.)
2476     */
2477    public Quantity getDoseQuantity() { 
2478      if (this.doseQuantity == null)
2479        if (Configuration.errorOnAutoCreate())
2480          throw new Error("Attempt to auto-create Immunization.doseQuantity");
2481        else if (Configuration.doAutoCreate())
2482          this.doseQuantity = new Quantity(); // cc
2483      return this.doseQuantity;
2484    }
2485
2486    public boolean hasDoseQuantity() { 
2487      return this.doseQuantity != null && !this.doseQuantity.isEmpty();
2488    }
2489
2490    /**
2491     * @param value {@link #doseQuantity} (The quantity of vaccine product that was administered.)
2492     */
2493    public Immunization setDoseQuantity(Quantity value) { 
2494      this.doseQuantity = value;
2495      return this;
2496    }
2497
2498    /**
2499     * @return {@link #performer} (Indicates who performed the immunization event.)
2500     */
2501    public List<ImmunizationPerformerComponent> getPerformer() { 
2502      if (this.performer == null)
2503        this.performer = new ArrayList<ImmunizationPerformerComponent>();
2504      return this.performer;
2505    }
2506
2507    /**
2508     * @return Returns a reference to <code>this</code> for easy method chaining
2509     */
2510    public Immunization setPerformer(List<ImmunizationPerformerComponent> thePerformer) { 
2511      this.performer = thePerformer;
2512      return this;
2513    }
2514
2515    public boolean hasPerformer() { 
2516      if (this.performer == null)
2517        return false;
2518      for (ImmunizationPerformerComponent item : this.performer)
2519        if (!item.isEmpty())
2520          return true;
2521      return false;
2522    }
2523
2524    public ImmunizationPerformerComponent addPerformer() { //3
2525      ImmunizationPerformerComponent t = new ImmunizationPerformerComponent();
2526      if (this.performer == null)
2527        this.performer = new ArrayList<ImmunizationPerformerComponent>();
2528      this.performer.add(t);
2529      return t;
2530    }
2531
2532    public Immunization addPerformer(ImmunizationPerformerComponent t) { //3
2533      if (t == null)
2534        return this;
2535      if (this.performer == null)
2536        this.performer = new ArrayList<ImmunizationPerformerComponent>();
2537      this.performer.add(t);
2538      return this;
2539    }
2540
2541    /**
2542     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist
2543     */
2544    public ImmunizationPerformerComponent getPerformerFirstRep() { 
2545      if (getPerformer().isEmpty()) {
2546        addPerformer();
2547      }
2548      return getPerformer().get(0);
2549    }
2550
2551    /**
2552     * @return {@link #note} (Extra information about the immunization that is not conveyed by the other attributes.)
2553     */
2554    public List<Annotation> getNote() { 
2555      if (this.note == null)
2556        this.note = new ArrayList<Annotation>();
2557      return this.note;
2558    }
2559
2560    /**
2561     * @return Returns a reference to <code>this</code> for easy method chaining
2562     */
2563    public Immunization setNote(List<Annotation> theNote) { 
2564      this.note = theNote;
2565      return this;
2566    }
2567
2568    public boolean hasNote() { 
2569      if (this.note == null)
2570        return false;
2571      for (Annotation item : this.note)
2572        if (!item.isEmpty())
2573          return true;
2574      return false;
2575    }
2576
2577    public Annotation addNote() { //3
2578      Annotation t = new Annotation();
2579      if (this.note == null)
2580        this.note = new ArrayList<Annotation>();
2581      this.note.add(t);
2582      return t;
2583    }
2584
2585    public Immunization addNote(Annotation t) { //3
2586      if (t == null)
2587        return this;
2588      if (this.note == null)
2589        this.note = new ArrayList<Annotation>();
2590      this.note.add(t);
2591      return this;
2592    }
2593
2594    /**
2595     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
2596     */
2597    public Annotation getNoteFirstRep() { 
2598      if (getNote().isEmpty()) {
2599        addNote();
2600      }
2601      return getNote().get(0);
2602    }
2603
2604    /**
2605     * @return {@link #reasonCode} (Reasons why the vaccine was administered.)
2606     */
2607    public List<CodeableConcept> getReasonCode() { 
2608      if (this.reasonCode == null)
2609        this.reasonCode = new ArrayList<CodeableConcept>();
2610      return this.reasonCode;
2611    }
2612
2613    /**
2614     * @return Returns a reference to <code>this</code> for easy method chaining
2615     */
2616    public Immunization setReasonCode(List<CodeableConcept> theReasonCode) { 
2617      this.reasonCode = theReasonCode;
2618      return this;
2619    }
2620
2621    public boolean hasReasonCode() { 
2622      if (this.reasonCode == null)
2623        return false;
2624      for (CodeableConcept item : this.reasonCode)
2625        if (!item.isEmpty())
2626          return true;
2627      return false;
2628    }
2629
2630    public CodeableConcept addReasonCode() { //3
2631      CodeableConcept t = new CodeableConcept();
2632      if (this.reasonCode == null)
2633        this.reasonCode = new ArrayList<CodeableConcept>();
2634      this.reasonCode.add(t);
2635      return t;
2636    }
2637
2638    public Immunization addReasonCode(CodeableConcept t) { //3
2639      if (t == null)
2640        return this;
2641      if (this.reasonCode == null)
2642        this.reasonCode = new ArrayList<CodeableConcept>();
2643      this.reasonCode.add(t);
2644      return this;
2645    }
2646
2647    /**
2648     * @return The first repetition of repeating field {@link #reasonCode}, creating it if it does not already exist
2649     */
2650    public CodeableConcept getReasonCodeFirstRep() { 
2651      if (getReasonCode().isEmpty()) {
2652        addReasonCode();
2653      }
2654      return getReasonCode().get(0);
2655    }
2656
2657    /**
2658     * @return {@link #reasonReference} (Condition, Observation or DiagnosticReport that supports why the immunization was administered.)
2659     */
2660    public List<Reference> getReasonReference() { 
2661      if (this.reasonReference == null)
2662        this.reasonReference = new ArrayList<Reference>();
2663      return this.reasonReference;
2664    }
2665
2666    /**
2667     * @return Returns a reference to <code>this</code> for easy method chaining
2668     */
2669    public Immunization setReasonReference(List<Reference> theReasonReference) { 
2670      this.reasonReference = theReasonReference;
2671      return this;
2672    }
2673
2674    public boolean hasReasonReference() { 
2675      if (this.reasonReference == null)
2676        return false;
2677      for (Reference item : this.reasonReference)
2678        if (!item.isEmpty())
2679          return true;
2680      return false;
2681    }
2682
2683    public Reference addReasonReference() { //3
2684      Reference t = new Reference();
2685      if (this.reasonReference == null)
2686        this.reasonReference = new ArrayList<Reference>();
2687      this.reasonReference.add(t);
2688      return t;
2689    }
2690
2691    public Immunization addReasonReference(Reference t) { //3
2692      if (t == null)
2693        return this;
2694      if (this.reasonReference == null)
2695        this.reasonReference = new ArrayList<Reference>();
2696      this.reasonReference.add(t);
2697      return this;
2698    }
2699
2700    /**
2701     * @return The first repetition of repeating field {@link #reasonReference}, creating it if it does not already exist
2702     */
2703    public Reference getReasonReferenceFirstRep() { 
2704      if (getReasonReference().isEmpty()) {
2705        addReasonReference();
2706      }
2707      return getReasonReference().get(0);
2708    }
2709
2710    /**
2711     * @deprecated Use Reference#setResource(IBaseResource) instead
2712     */
2713    @Deprecated
2714    public List<Resource> getReasonReferenceTarget() { 
2715      if (this.reasonReferenceTarget == null)
2716        this.reasonReferenceTarget = new ArrayList<Resource>();
2717      return this.reasonReferenceTarget;
2718    }
2719
2720    /**
2721     * @return {@link #isSubpotent} (Indication if a dose is considered to be subpotent. By default, a dose should be considered to be potent.). This is the underlying object with id, value and extensions. The accessor "getIsSubpotent" gives direct access to the value
2722     */
2723    public BooleanType getIsSubpotentElement() { 
2724      if (this.isSubpotent == null)
2725        if (Configuration.errorOnAutoCreate())
2726          throw new Error("Attempt to auto-create Immunization.isSubpotent");
2727        else if (Configuration.doAutoCreate())
2728          this.isSubpotent = new BooleanType(); // bb
2729      return this.isSubpotent;
2730    }
2731
2732    public boolean hasIsSubpotentElement() { 
2733      return this.isSubpotent != null && !this.isSubpotent.isEmpty();
2734    }
2735
2736    public boolean hasIsSubpotent() { 
2737      return this.isSubpotent != null && !this.isSubpotent.isEmpty();
2738    }
2739
2740    /**
2741     * @param value {@link #isSubpotent} (Indication if a dose is considered to be subpotent. By default, a dose should be considered to be potent.). This is the underlying object with id, value and extensions. The accessor "getIsSubpotent" gives direct access to the value
2742     */
2743    public Immunization setIsSubpotentElement(BooleanType value) { 
2744      this.isSubpotent = value;
2745      return this;
2746    }
2747
2748    /**
2749     * @return Indication if a dose is considered to be subpotent. By default, a dose should be considered to be potent.
2750     */
2751    public boolean getIsSubpotent() { 
2752      return this.isSubpotent == null || this.isSubpotent.isEmpty() ? false : this.isSubpotent.getValue();
2753    }
2754
2755    /**
2756     * @param value Indication if a dose is considered to be subpotent. By default, a dose should be considered to be potent.
2757     */
2758    public Immunization setIsSubpotent(boolean value) { 
2759        if (this.isSubpotent == null)
2760          this.isSubpotent = new BooleanType();
2761        this.isSubpotent.setValue(value);
2762      return this;
2763    }
2764
2765    /**
2766     * @return {@link #subpotentReason} (Reason why a dose is considered to be subpotent.)
2767     */
2768    public List<CodeableConcept> getSubpotentReason() { 
2769      if (this.subpotentReason == null)
2770        this.subpotentReason = new ArrayList<CodeableConcept>();
2771      return this.subpotentReason;
2772    }
2773
2774    /**
2775     * @return Returns a reference to <code>this</code> for easy method chaining
2776     */
2777    public Immunization setSubpotentReason(List<CodeableConcept> theSubpotentReason) { 
2778      this.subpotentReason = theSubpotentReason;
2779      return this;
2780    }
2781
2782    public boolean hasSubpotentReason() { 
2783      if (this.subpotentReason == null)
2784        return false;
2785      for (CodeableConcept item : this.subpotentReason)
2786        if (!item.isEmpty())
2787          return true;
2788      return false;
2789    }
2790
2791    public CodeableConcept addSubpotentReason() { //3
2792      CodeableConcept t = new CodeableConcept();
2793      if (this.subpotentReason == null)
2794        this.subpotentReason = new ArrayList<CodeableConcept>();
2795      this.subpotentReason.add(t);
2796      return t;
2797    }
2798
2799    public Immunization addSubpotentReason(CodeableConcept t) { //3
2800      if (t == null)
2801        return this;
2802      if (this.subpotentReason == null)
2803        this.subpotentReason = new ArrayList<CodeableConcept>();
2804      this.subpotentReason.add(t);
2805      return this;
2806    }
2807
2808    /**
2809     * @return The first repetition of repeating field {@link #subpotentReason}, creating it if it does not already exist
2810     */
2811    public CodeableConcept getSubpotentReasonFirstRep() { 
2812      if (getSubpotentReason().isEmpty()) {
2813        addSubpotentReason();
2814      }
2815      return getSubpotentReason().get(0);
2816    }
2817
2818    /**
2819     * @return {@link #education} (Educational material presented to the patient (or guardian) at the time of vaccine administration.)
2820     */
2821    public List<ImmunizationEducationComponent> getEducation() { 
2822      if (this.education == null)
2823        this.education = new ArrayList<ImmunizationEducationComponent>();
2824      return this.education;
2825    }
2826
2827    /**
2828     * @return Returns a reference to <code>this</code> for easy method chaining
2829     */
2830    public Immunization setEducation(List<ImmunizationEducationComponent> theEducation) { 
2831      this.education = theEducation;
2832      return this;
2833    }
2834
2835    public boolean hasEducation() { 
2836      if (this.education == null)
2837        return false;
2838      for (ImmunizationEducationComponent item : this.education)
2839        if (!item.isEmpty())
2840          return true;
2841      return false;
2842    }
2843
2844    public ImmunizationEducationComponent addEducation() { //3
2845      ImmunizationEducationComponent t = new ImmunizationEducationComponent();
2846      if (this.education == null)
2847        this.education = new ArrayList<ImmunizationEducationComponent>();
2848      this.education.add(t);
2849      return t;
2850    }
2851
2852    public Immunization addEducation(ImmunizationEducationComponent t) { //3
2853      if (t == null)
2854        return this;
2855      if (this.education == null)
2856        this.education = new ArrayList<ImmunizationEducationComponent>();
2857      this.education.add(t);
2858      return this;
2859    }
2860
2861    /**
2862     * @return The first repetition of repeating field {@link #education}, creating it if it does not already exist
2863     */
2864    public ImmunizationEducationComponent getEducationFirstRep() { 
2865      if (getEducation().isEmpty()) {
2866        addEducation();
2867      }
2868      return getEducation().get(0);
2869    }
2870
2871    /**
2872     * @return {@link #programEligibility} (Indicates a patient's eligibility for a funding program.)
2873     */
2874    public List<CodeableConcept> getProgramEligibility() { 
2875      if (this.programEligibility == null)
2876        this.programEligibility = new ArrayList<CodeableConcept>();
2877      return this.programEligibility;
2878    }
2879
2880    /**
2881     * @return Returns a reference to <code>this</code> for easy method chaining
2882     */
2883    public Immunization setProgramEligibility(List<CodeableConcept> theProgramEligibility) { 
2884      this.programEligibility = theProgramEligibility;
2885      return this;
2886    }
2887
2888    public boolean hasProgramEligibility() { 
2889      if (this.programEligibility == null)
2890        return false;
2891      for (CodeableConcept item : this.programEligibility)
2892        if (!item.isEmpty())
2893          return true;
2894      return false;
2895    }
2896
2897    public CodeableConcept addProgramEligibility() { //3
2898      CodeableConcept t = new CodeableConcept();
2899      if (this.programEligibility == null)
2900        this.programEligibility = new ArrayList<CodeableConcept>();
2901      this.programEligibility.add(t);
2902      return t;
2903    }
2904
2905    public Immunization addProgramEligibility(CodeableConcept t) { //3
2906      if (t == null)
2907        return this;
2908      if (this.programEligibility == null)
2909        this.programEligibility = new ArrayList<CodeableConcept>();
2910      this.programEligibility.add(t);
2911      return this;
2912    }
2913
2914    /**
2915     * @return The first repetition of repeating field {@link #programEligibility}, creating it if it does not already exist
2916     */
2917    public CodeableConcept getProgramEligibilityFirstRep() { 
2918      if (getProgramEligibility().isEmpty()) {
2919        addProgramEligibility();
2920      }
2921      return getProgramEligibility().get(0);
2922    }
2923
2924    /**
2925     * @return {@link #fundingSource} (Indicates the source of the vaccine actually administered. This may be different than the patient eligibility (e.g. the patient may be eligible for a publically purchased vaccine but due to inventory issues, vaccine purchased with private funds was actually administered).)
2926     */
2927    public CodeableConcept getFundingSource() { 
2928      if (this.fundingSource == null)
2929        if (Configuration.errorOnAutoCreate())
2930          throw new Error("Attempt to auto-create Immunization.fundingSource");
2931        else if (Configuration.doAutoCreate())
2932          this.fundingSource = new CodeableConcept(); // cc
2933      return this.fundingSource;
2934    }
2935
2936    public boolean hasFundingSource() { 
2937      return this.fundingSource != null && !this.fundingSource.isEmpty();
2938    }
2939
2940    /**
2941     * @param value {@link #fundingSource} (Indicates the source of the vaccine actually administered. This may be different than the patient eligibility (e.g. the patient may be eligible for a publically purchased vaccine but due to inventory issues, vaccine purchased with private funds was actually administered).)
2942     */
2943    public Immunization setFundingSource(CodeableConcept value) { 
2944      this.fundingSource = value;
2945      return this;
2946    }
2947
2948    /**
2949     * @return {@link #reaction} (Categorical data indicating that an adverse event is associated in time to an immunization.)
2950     */
2951    public List<ImmunizationReactionComponent> getReaction() { 
2952      if (this.reaction == null)
2953        this.reaction = new ArrayList<ImmunizationReactionComponent>();
2954      return this.reaction;
2955    }
2956
2957    /**
2958     * @return Returns a reference to <code>this</code> for easy method chaining
2959     */
2960    public Immunization setReaction(List<ImmunizationReactionComponent> theReaction) { 
2961      this.reaction = theReaction;
2962      return this;
2963    }
2964
2965    public boolean hasReaction() { 
2966      if (this.reaction == null)
2967        return false;
2968      for (ImmunizationReactionComponent item : this.reaction)
2969        if (!item.isEmpty())
2970          return true;
2971      return false;
2972    }
2973
2974    public ImmunizationReactionComponent addReaction() { //3
2975      ImmunizationReactionComponent t = new ImmunizationReactionComponent();
2976      if (this.reaction == null)
2977        this.reaction = new ArrayList<ImmunizationReactionComponent>();
2978      this.reaction.add(t);
2979      return t;
2980    }
2981
2982    public Immunization addReaction(ImmunizationReactionComponent t) { //3
2983      if (t == null)
2984        return this;
2985      if (this.reaction == null)
2986        this.reaction = new ArrayList<ImmunizationReactionComponent>();
2987      this.reaction.add(t);
2988      return this;
2989    }
2990
2991    /**
2992     * @return The first repetition of repeating field {@link #reaction}, creating it if it does not already exist
2993     */
2994    public ImmunizationReactionComponent getReactionFirstRep() { 
2995      if (getReaction().isEmpty()) {
2996        addReaction();
2997      }
2998      return getReaction().get(0);
2999    }
3000
3001    /**
3002     * @return {@link #protocolApplied} (The protocol (set of recommendations) being followed by the provider who administered the dose.)
3003     */
3004    public List<ImmunizationProtocolAppliedComponent> getProtocolApplied() { 
3005      if (this.protocolApplied == null)
3006        this.protocolApplied = new ArrayList<ImmunizationProtocolAppliedComponent>();
3007      return this.protocolApplied;
3008    }
3009
3010    /**
3011     * @return Returns a reference to <code>this</code> for easy method chaining
3012     */
3013    public Immunization setProtocolApplied(List<ImmunizationProtocolAppliedComponent> theProtocolApplied) { 
3014      this.protocolApplied = theProtocolApplied;
3015      return this;
3016    }
3017
3018    public boolean hasProtocolApplied() { 
3019      if (this.protocolApplied == null)
3020        return false;
3021      for (ImmunizationProtocolAppliedComponent item : this.protocolApplied)
3022        if (!item.isEmpty())
3023          return true;
3024      return false;
3025    }
3026
3027    public ImmunizationProtocolAppliedComponent addProtocolApplied() { //3
3028      ImmunizationProtocolAppliedComponent t = new ImmunizationProtocolAppliedComponent();
3029      if (this.protocolApplied == null)
3030        this.protocolApplied = new ArrayList<ImmunizationProtocolAppliedComponent>();
3031      this.protocolApplied.add(t);
3032      return t;
3033    }
3034
3035    public Immunization addProtocolApplied(ImmunizationProtocolAppliedComponent t) { //3
3036      if (t == null)
3037        return this;
3038      if (this.protocolApplied == null)
3039        this.protocolApplied = new ArrayList<ImmunizationProtocolAppliedComponent>();
3040      this.protocolApplied.add(t);
3041      return this;
3042    }
3043
3044    /**
3045     * @return The first repetition of repeating field {@link #protocolApplied}, creating it if it does not already exist
3046     */
3047    public ImmunizationProtocolAppliedComponent getProtocolAppliedFirstRep() { 
3048      if (getProtocolApplied().isEmpty()) {
3049        addProtocolApplied();
3050      }
3051      return getProtocolApplied().get(0);
3052    }
3053
3054      protected void listChildren(List<Property> children) {
3055        super.listChildren(children);
3056        children.add(new Property("identifier", "Identifier", "A unique identifier assigned to this immunization record.", 0, java.lang.Integer.MAX_VALUE, identifier));
3057        children.add(new Property("status", "code", "Indicates the current status of the immunization event.", 0, 1, status));
3058        children.add(new Property("statusReason", "CodeableConcept", "Indicates the reason the immunization event was not performed.", 0, 1, statusReason));
3059        children.add(new Property("vaccineCode", "CodeableConcept", "Vaccine that was administered or was to be administered.", 0, 1, vaccineCode));
3060        children.add(new Property("patient", "Reference(Patient)", "The patient who either received or did not receive the immunization.", 0, 1, patient));
3061        children.add(new Property("encounter", "Reference(Encounter)", "The visit or admission or other contact between patient and health care provider the immunization was performed as part of.", 0, 1, encounter));
3062        children.add(new Property("occurrence[x]", "dateTime|string", "Date vaccine administered or was to be administered.", 0, 1, occurrence));
3063        children.add(new Property("recorded", "dateTime", "The date the occurrence of the immunization was first captured in the record - potentially significantly after the occurrence of the event.", 0, 1, recorded));
3064        children.add(new Property("primarySource", "boolean", "An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.", 0, 1, primarySource));
3065        children.add(new Property("reportOrigin", "CodeableConcept", "The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine.", 0, 1, reportOrigin));
3066        children.add(new Property("location", "Reference(Location)", "The service delivery location where the vaccine administration occurred.", 0, 1, location));
3067        children.add(new Property("manufacturer", "Reference(Organization)", "Name of vaccine manufacturer.", 0, 1, manufacturer));
3068        children.add(new Property("lotNumber", "string", "Lot number of the  vaccine product.", 0, 1, lotNumber));
3069        children.add(new Property("expirationDate", "date", "Date vaccine batch expires.", 0, 1, expirationDate));
3070        children.add(new Property("site", "CodeableConcept", "Body site where vaccine was administered.", 0, 1, site));
3071        children.add(new Property("route", "CodeableConcept", "The path by which the vaccine product is taken into the body.", 0, 1, route));
3072        children.add(new Property("doseQuantity", "SimpleQuantity", "The quantity of vaccine product that was administered.", 0, 1, doseQuantity));
3073        children.add(new Property("performer", "", "Indicates who performed the immunization event.", 0, java.lang.Integer.MAX_VALUE, performer));
3074        children.add(new Property("note", "Annotation", "Extra information about the immunization that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note));
3075        children.add(new Property("reasonCode", "CodeableConcept", "Reasons why the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, reasonCode));
3076        children.add(new Property("reasonReference", "Reference(Condition|Observation|DiagnosticReport)", "Condition, Observation or DiagnosticReport that supports why the immunization was administered.", 0, java.lang.Integer.MAX_VALUE, reasonReference));
3077        children.add(new Property("isSubpotent", "boolean", "Indication if a dose is considered to be subpotent. By default, a dose should be considered to be potent.", 0, 1, isSubpotent));
3078        children.add(new Property("subpotentReason", "CodeableConcept", "Reason why a dose is considered to be subpotent.", 0, java.lang.Integer.MAX_VALUE, subpotentReason));
3079        children.add(new Property("education", "", "Educational material presented to the patient (or guardian) at the time of vaccine administration.", 0, java.lang.Integer.MAX_VALUE, education));
3080        children.add(new Property("programEligibility", "CodeableConcept", "Indicates a patient's eligibility for a funding program.", 0, java.lang.Integer.MAX_VALUE, programEligibility));
3081        children.add(new Property("fundingSource", "CodeableConcept", "Indicates the source of the vaccine actually administered. This may be different than the patient eligibility (e.g. the patient may be eligible for a publically purchased vaccine but due to inventory issues, vaccine purchased with private funds was actually administered).", 0, 1, fundingSource));
3082        children.add(new Property("reaction", "", "Categorical data indicating that an adverse event is associated in time to an immunization.", 0, java.lang.Integer.MAX_VALUE, reaction));
3083        children.add(new Property("protocolApplied", "", "The protocol (set of recommendations) being followed by the provider who administered the dose.", 0, java.lang.Integer.MAX_VALUE, protocolApplied));
3084      }
3085
3086      @Override
3087      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3088        switch (_hash) {
3089        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier assigned to this immunization record.", 0, java.lang.Integer.MAX_VALUE, identifier);
3090        case -892481550: /*status*/  return new Property("status", "code", "Indicates the current status of the immunization event.", 0, 1, status);
3091        case 2051346646: /*statusReason*/  return new Property("statusReason", "CodeableConcept", "Indicates the reason the immunization event was not performed.", 0, 1, statusReason);
3092        case 664556354: /*vaccineCode*/  return new Property("vaccineCode", "CodeableConcept", "Vaccine that was administered or was to be administered.", 0, 1, vaccineCode);
3093        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "The patient who either received or did not receive the immunization.", 0, 1, patient);
3094        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The visit or admission or other contact between patient and health care provider the immunization was performed as part of.", 0, 1, encounter);
3095        case -2022646513: /*occurrence[x]*/  return new Property("occurrence[x]", "dateTime|string", "Date vaccine administered or was to be administered.", 0, 1, occurrence);
3096        case 1687874001: /*occurrence*/  return new Property("occurrence[x]", "dateTime|string", "Date vaccine administered or was to be administered.", 0, 1, occurrence);
3097        case -298443636: /*occurrenceDateTime*/  return new Property("occurrence[x]", "dateTime|string", "Date vaccine administered or was to be administered.", 0, 1, occurrence);
3098        case 1496896834: /*occurrenceString*/  return new Property("occurrence[x]", "dateTime|string", "Date vaccine administered or was to be administered.", 0, 1, occurrence);
3099        case -799233872: /*recorded*/  return new Property("recorded", "dateTime", "The date the occurrence of the immunization was first captured in the record - potentially significantly after the occurrence of the event.", 0, 1, recorded);
3100        case -528721731: /*primarySource*/  return new Property("primarySource", "boolean", "An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.", 0, 1, primarySource);
3101        case 486750586: /*reportOrigin*/  return new Property("reportOrigin", "CodeableConcept", "The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine.", 0, 1, reportOrigin);
3102        case 1901043637: /*location*/  return new Property("location", "Reference(Location)", "The service delivery location where the vaccine administration occurred.", 0, 1, location);
3103        case -1969347631: /*manufacturer*/  return new Property("manufacturer", "Reference(Organization)", "Name of vaccine manufacturer.", 0, 1, manufacturer);
3104        case 462547450: /*lotNumber*/  return new Property("lotNumber", "string", "Lot number of the  vaccine product.", 0, 1, lotNumber);
3105        case -668811523: /*expirationDate*/  return new Property("expirationDate", "date", "Date vaccine batch expires.", 0, 1, expirationDate);
3106        case 3530567: /*site*/  return new Property("site", "CodeableConcept", "Body site where vaccine was administered.", 0, 1, site);
3107        case 108704329: /*route*/  return new Property("route", "CodeableConcept", "The path by which the vaccine product is taken into the body.", 0, 1, route);
3108        case -2083618872: /*doseQuantity*/  return new Property("doseQuantity", "SimpleQuantity", "The quantity of vaccine product that was administered.", 0, 1, doseQuantity);
3109        case 481140686: /*performer*/  return new Property("performer", "", "Indicates who performed the immunization event.", 0, java.lang.Integer.MAX_VALUE, performer);
3110        case 3387378: /*note*/  return new Property("note", "Annotation", "Extra information about the immunization that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note);
3111        case 722137681: /*reasonCode*/  return new Property("reasonCode", "CodeableConcept", "Reasons why the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, reasonCode);
3112        case -1146218137: /*reasonReference*/  return new Property("reasonReference", "Reference(Condition|Observation|DiagnosticReport)", "Condition, Observation or DiagnosticReport that supports why the immunization was administered.", 0, java.lang.Integer.MAX_VALUE, reasonReference);
3113        case 1618512556: /*isSubpotent*/  return new Property("isSubpotent", "boolean", "Indication if a dose is considered to be subpotent. By default, a dose should be considered to be potent.", 0, 1, isSubpotent);
3114        case 805168794: /*subpotentReason*/  return new Property("subpotentReason", "CodeableConcept", "Reason why a dose is considered to be subpotent.", 0, java.lang.Integer.MAX_VALUE, subpotentReason);
3115        case -290756696: /*education*/  return new Property("education", "", "Educational material presented to the patient (or guardian) at the time of vaccine administration.", 0, java.lang.Integer.MAX_VALUE, education);
3116        case 1207530089: /*programEligibility*/  return new Property("programEligibility", "CodeableConcept", "Indicates a patient's eligibility for a funding program.", 0, java.lang.Integer.MAX_VALUE, programEligibility);
3117        case 1120150904: /*fundingSource*/  return new Property("fundingSource", "CodeableConcept", "Indicates the source of the vaccine actually administered. This may be different than the patient eligibility (e.g. the patient may be eligible for a publically purchased vaccine but due to inventory issues, vaccine purchased with private funds was actually administered).", 0, 1, fundingSource);
3118        case -867509719: /*reaction*/  return new Property("reaction", "", "Categorical data indicating that an adverse event is associated in time to an immunization.", 0, java.lang.Integer.MAX_VALUE, reaction);
3119        case 607985349: /*protocolApplied*/  return new Property("protocolApplied", "", "The protocol (set of recommendations) being followed by the provider who administered the dose.", 0, java.lang.Integer.MAX_VALUE, protocolApplied);
3120        default: return super.getNamedProperty(_hash, _name, _checkValid);
3121        }
3122
3123      }
3124
3125      @Override
3126      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3127        switch (hash) {
3128        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3129        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ImmunizationStatus>
3130        case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // CodeableConcept
3131        case 664556354: /*vaccineCode*/ return this.vaccineCode == null ? new Base[0] : new Base[] {this.vaccineCode}; // CodeableConcept
3132        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
3133        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
3134        case 1687874001: /*occurrence*/ return this.occurrence == null ? new Base[0] : new Base[] {this.occurrence}; // Type
3135        case -799233872: /*recorded*/ return this.recorded == null ? new Base[0] : new Base[] {this.recorded}; // DateTimeType
3136        case -528721731: /*primarySource*/ return this.primarySource == null ? new Base[0] : new Base[] {this.primarySource}; // BooleanType
3137        case 486750586: /*reportOrigin*/ return this.reportOrigin == null ? new Base[0] : new Base[] {this.reportOrigin}; // CodeableConcept
3138        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
3139        case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : new Base[] {this.manufacturer}; // Reference
3140        case 462547450: /*lotNumber*/ return this.lotNumber == null ? new Base[0] : new Base[] {this.lotNumber}; // StringType
3141        case -668811523: /*expirationDate*/ return this.expirationDate == null ? new Base[0] : new Base[] {this.expirationDate}; // DateType
3142        case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // CodeableConcept
3143        case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept
3144        case -2083618872: /*doseQuantity*/ return this.doseQuantity == null ? new Base[0] : new Base[] {this.doseQuantity}; // Quantity
3145        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // ImmunizationPerformerComponent
3146        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
3147        case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
3148        case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
3149        case 1618512556: /*isSubpotent*/ return this.isSubpotent == null ? new Base[0] : new Base[] {this.isSubpotent}; // BooleanType
3150        case 805168794: /*subpotentReason*/ return this.subpotentReason == null ? new Base[0] : this.subpotentReason.toArray(new Base[this.subpotentReason.size()]); // CodeableConcept
3151        case -290756696: /*education*/ return this.education == null ? new Base[0] : this.education.toArray(new Base[this.education.size()]); // ImmunizationEducationComponent
3152        case 1207530089: /*programEligibility*/ return this.programEligibility == null ? new Base[0] : this.programEligibility.toArray(new Base[this.programEligibility.size()]); // CodeableConcept
3153        case 1120150904: /*fundingSource*/ return this.fundingSource == null ? new Base[0] : new Base[] {this.fundingSource}; // CodeableConcept
3154        case -867509719: /*reaction*/ return this.reaction == null ? new Base[0] : this.reaction.toArray(new Base[this.reaction.size()]); // ImmunizationReactionComponent
3155        case 607985349: /*protocolApplied*/ return this.protocolApplied == null ? new Base[0] : this.protocolApplied.toArray(new Base[this.protocolApplied.size()]); // ImmunizationProtocolAppliedComponent
3156        default: return super.getProperty(hash, name, checkValid);
3157        }
3158
3159      }
3160
3161      @Override
3162      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3163        switch (hash) {
3164        case -1618432855: // identifier
3165          this.getIdentifier().add(castToIdentifier(value)); // Identifier
3166          return value;
3167        case -892481550: // status
3168          value = new ImmunizationStatusEnumFactory().fromType(castToCode(value));
3169          this.status = (Enumeration) value; // Enumeration<ImmunizationStatus>
3170          return value;
3171        case 2051346646: // statusReason
3172          this.statusReason = castToCodeableConcept(value); // CodeableConcept
3173          return value;
3174        case 664556354: // vaccineCode
3175          this.vaccineCode = castToCodeableConcept(value); // CodeableConcept
3176          return value;
3177        case -791418107: // patient
3178          this.patient = castToReference(value); // Reference
3179          return value;
3180        case 1524132147: // encounter
3181          this.encounter = castToReference(value); // Reference
3182          return value;
3183        case 1687874001: // occurrence
3184          this.occurrence = castToType(value); // Type
3185          return value;
3186        case -799233872: // recorded
3187          this.recorded = castToDateTime(value); // DateTimeType
3188          return value;
3189        case -528721731: // primarySource
3190          this.primarySource = castToBoolean(value); // BooleanType
3191          return value;
3192        case 486750586: // reportOrigin
3193          this.reportOrigin = castToCodeableConcept(value); // CodeableConcept
3194          return value;
3195        case 1901043637: // location
3196          this.location = castToReference(value); // Reference
3197          return value;
3198        case -1969347631: // manufacturer
3199          this.manufacturer = castToReference(value); // Reference
3200          return value;
3201        case 462547450: // lotNumber
3202          this.lotNumber = castToString(value); // StringType
3203          return value;
3204        case -668811523: // expirationDate
3205          this.expirationDate = castToDate(value); // DateType
3206          return value;
3207        case 3530567: // site
3208          this.site = castToCodeableConcept(value); // CodeableConcept
3209          return value;
3210        case 108704329: // route
3211          this.route = castToCodeableConcept(value); // CodeableConcept
3212          return value;
3213        case -2083618872: // doseQuantity
3214          this.doseQuantity = castToQuantity(value); // Quantity
3215          return value;
3216        case 481140686: // performer
3217          this.getPerformer().add((ImmunizationPerformerComponent) value); // ImmunizationPerformerComponent
3218          return value;
3219        case 3387378: // note
3220          this.getNote().add(castToAnnotation(value)); // Annotation
3221          return value;
3222        case 722137681: // reasonCode
3223          this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
3224          return value;
3225        case -1146218137: // reasonReference
3226          this.getReasonReference().add(castToReference(value)); // Reference
3227          return value;
3228        case 1618512556: // isSubpotent
3229          this.isSubpotent = castToBoolean(value); // BooleanType
3230          return value;
3231        case 805168794: // subpotentReason
3232          this.getSubpotentReason().add(castToCodeableConcept(value)); // CodeableConcept
3233          return value;
3234        case -290756696: // education
3235          this.getEducation().add((ImmunizationEducationComponent) value); // ImmunizationEducationComponent
3236          return value;
3237        case 1207530089: // programEligibility
3238          this.getProgramEligibility().add(castToCodeableConcept(value)); // CodeableConcept
3239          return value;
3240        case 1120150904: // fundingSource
3241          this.fundingSource = castToCodeableConcept(value); // CodeableConcept
3242          return value;
3243        case -867509719: // reaction
3244          this.getReaction().add((ImmunizationReactionComponent) value); // ImmunizationReactionComponent
3245          return value;
3246        case 607985349: // protocolApplied
3247          this.getProtocolApplied().add((ImmunizationProtocolAppliedComponent) value); // ImmunizationProtocolAppliedComponent
3248          return value;
3249        default: return super.setProperty(hash, name, value);
3250        }
3251
3252      }
3253
3254      @Override
3255      public Base setProperty(String name, Base value) throws FHIRException {
3256        if (name.equals("identifier")) {
3257          this.getIdentifier().add(castToIdentifier(value));
3258        } else if (name.equals("status")) {
3259          value = new ImmunizationStatusEnumFactory().fromType(castToCode(value));
3260          this.status = (Enumeration) value; // Enumeration<ImmunizationStatus>
3261        } else if (name.equals("statusReason")) {
3262          this.statusReason = castToCodeableConcept(value); // CodeableConcept
3263        } else if (name.equals("vaccineCode")) {
3264          this.vaccineCode = castToCodeableConcept(value); // CodeableConcept
3265        } else if (name.equals("patient")) {
3266          this.patient = castToReference(value); // Reference
3267        } else if (name.equals("encounter")) {
3268          this.encounter = castToReference(value); // Reference
3269        } else if (name.equals("occurrence[x]")) {
3270          this.occurrence = castToType(value); // Type
3271        } else if (name.equals("recorded")) {
3272          this.recorded = castToDateTime(value); // DateTimeType
3273        } else if (name.equals("primarySource")) {
3274          this.primarySource = castToBoolean(value); // BooleanType
3275        } else if (name.equals("reportOrigin")) {
3276          this.reportOrigin = castToCodeableConcept(value); // CodeableConcept
3277        } else if (name.equals("location")) {
3278          this.location = castToReference(value); // Reference
3279        } else if (name.equals("manufacturer")) {
3280          this.manufacturer = castToReference(value); // Reference
3281        } else if (name.equals("lotNumber")) {
3282          this.lotNumber = castToString(value); // StringType
3283        } else if (name.equals("expirationDate")) {
3284          this.expirationDate = castToDate(value); // DateType
3285        } else if (name.equals("site")) {
3286          this.site = castToCodeableConcept(value); // CodeableConcept
3287        } else if (name.equals("route")) {
3288          this.route = castToCodeableConcept(value); // CodeableConcept
3289        } else if (name.equals("doseQuantity")) {
3290          this.doseQuantity = castToQuantity(value); // Quantity
3291        } else if (name.equals("performer")) {
3292          this.getPerformer().add((ImmunizationPerformerComponent) value);
3293        } else if (name.equals("note")) {
3294          this.getNote().add(castToAnnotation(value));
3295        } else if (name.equals("reasonCode")) {
3296          this.getReasonCode().add(castToCodeableConcept(value));
3297        } else if (name.equals("reasonReference")) {
3298          this.getReasonReference().add(castToReference(value));
3299        } else if (name.equals("isSubpotent")) {
3300          this.isSubpotent = castToBoolean(value); // BooleanType
3301        } else if (name.equals("subpotentReason")) {
3302          this.getSubpotentReason().add(castToCodeableConcept(value));
3303        } else if (name.equals("education")) {
3304          this.getEducation().add((ImmunizationEducationComponent) value);
3305        } else if (name.equals("programEligibility")) {
3306          this.getProgramEligibility().add(castToCodeableConcept(value));
3307        } else if (name.equals("fundingSource")) {
3308          this.fundingSource = castToCodeableConcept(value); // CodeableConcept
3309        } else if (name.equals("reaction")) {
3310          this.getReaction().add((ImmunizationReactionComponent) value);
3311        } else if (name.equals("protocolApplied")) {
3312          this.getProtocolApplied().add((ImmunizationProtocolAppliedComponent) value);
3313        } else
3314          return super.setProperty(name, value);
3315        return value;
3316      }
3317
3318      @Override
3319      public Base makeProperty(int hash, String name) throws FHIRException {
3320        switch (hash) {
3321        case -1618432855:  return addIdentifier(); 
3322        case -892481550:  return getStatusElement();
3323        case 2051346646:  return getStatusReason(); 
3324        case 664556354:  return getVaccineCode(); 
3325        case -791418107:  return getPatient(); 
3326        case 1524132147:  return getEncounter(); 
3327        case -2022646513:  return getOccurrence(); 
3328        case 1687874001:  return getOccurrence(); 
3329        case -799233872:  return getRecordedElement();
3330        case -528721731:  return getPrimarySourceElement();
3331        case 486750586:  return getReportOrigin(); 
3332        case 1901043637:  return getLocation(); 
3333        case -1969347631:  return getManufacturer(); 
3334        case 462547450:  return getLotNumberElement();
3335        case -668811523:  return getExpirationDateElement();
3336        case 3530567:  return getSite(); 
3337        case 108704329:  return getRoute(); 
3338        case -2083618872:  return getDoseQuantity(); 
3339        case 481140686:  return addPerformer(); 
3340        case 3387378:  return addNote(); 
3341        case 722137681:  return addReasonCode(); 
3342        case -1146218137:  return addReasonReference(); 
3343        case 1618512556:  return getIsSubpotentElement();
3344        case 805168794:  return addSubpotentReason(); 
3345        case -290756696:  return addEducation(); 
3346        case 1207530089:  return addProgramEligibility(); 
3347        case 1120150904:  return getFundingSource(); 
3348        case -867509719:  return addReaction(); 
3349        case 607985349:  return addProtocolApplied(); 
3350        default: return super.makeProperty(hash, name);
3351        }
3352
3353      }
3354
3355      @Override
3356      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3357        switch (hash) {
3358        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3359        case -892481550: /*status*/ return new String[] {"code"};
3360        case 2051346646: /*statusReason*/ return new String[] {"CodeableConcept"};
3361        case 664556354: /*vaccineCode*/ return new String[] {"CodeableConcept"};
3362        case -791418107: /*patient*/ return new String[] {"Reference"};
3363        case 1524132147: /*encounter*/ return new String[] {"Reference"};
3364        case 1687874001: /*occurrence*/ return new String[] {"dateTime", "string"};
3365        case -799233872: /*recorded*/ return new String[] {"dateTime"};
3366        case -528721731: /*primarySource*/ return new String[] {"boolean"};
3367        case 486750586: /*reportOrigin*/ return new String[] {"CodeableConcept"};
3368        case 1901043637: /*location*/ return new String[] {"Reference"};
3369        case -1969347631: /*manufacturer*/ return new String[] {"Reference"};
3370        case 462547450: /*lotNumber*/ return new String[] {"string"};
3371        case -668811523: /*expirationDate*/ return new String[] {"date"};
3372        case 3530567: /*site*/ return new String[] {"CodeableConcept"};
3373        case 108704329: /*route*/ return new String[] {"CodeableConcept"};
3374        case -2083618872: /*doseQuantity*/ return new String[] {"SimpleQuantity"};
3375        case 481140686: /*performer*/ return new String[] {};
3376        case 3387378: /*note*/ return new String[] {"Annotation"};
3377        case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
3378        case -1146218137: /*reasonReference*/ return new String[] {"Reference"};
3379        case 1618512556: /*isSubpotent*/ return new String[] {"boolean"};
3380        case 805168794: /*subpotentReason*/ return new String[] {"CodeableConcept"};
3381        case -290756696: /*education*/ return new String[] {};
3382        case 1207530089: /*programEligibility*/ return new String[] {"CodeableConcept"};
3383        case 1120150904: /*fundingSource*/ return new String[] {"CodeableConcept"};
3384        case -867509719: /*reaction*/ return new String[] {};
3385        case 607985349: /*protocolApplied*/ return new String[] {};
3386        default: return super.getTypesForProperty(hash, name);
3387        }
3388
3389      }
3390
3391      @Override
3392      public Base addChild(String name) throws FHIRException {
3393        if (name.equals("identifier")) {
3394          return addIdentifier();
3395        }
3396        else if (name.equals("status")) {
3397          throw new FHIRException("Cannot call addChild on a primitive type Immunization.status");
3398        }
3399        else if (name.equals("statusReason")) {
3400          this.statusReason = new CodeableConcept();
3401          return this.statusReason;
3402        }
3403        else if (name.equals("vaccineCode")) {
3404          this.vaccineCode = new CodeableConcept();
3405          return this.vaccineCode;
3406        }
3407        else if (name.equals("patient")) {
3408          this.patient = new Reference();
3409          return this.patient;
3410        }
3411        else if (name.equals("encounter")) {
3412          this.encounter = new Reference();
3413          return this.encounter;
3414        }
3415        else if (name.equals("occurrenceDateTime")) {
3416          this.occurrence = new DateTimeType();
3417          return this.occurrence;
3418        }
3419        else if (name.equals("occurrenceString")) {
3420          this.occurrence = new StringType();
3421          return this.occurrence;
3422        }
3423        else if (name.equals("recorded")) {
3424          throw new FHIRException("Cannot call addChild on a primitive type Immunization.recorded");
3425        }
3426        else if (name.equals("primarySource")) {
3427          throw new FHIRException("Cannot call addChild on a primitive type Immunization.primarySource");
3428        }
3429        else if (name.equals("reportOrigin")) {
3430          this.reportOrigin = new CodeableConcept();
3431          return this.reportOrigin;
3432        }
3433        else if (name.equals("location")) {
3434          this.location = new Reference();
3435          return this.location;
3436        }
3437        else if (name.equals("manufacturer")) {
3438          this.manufacturer = new Reference();
3439          return this.manufacturer;
3440        }
3441        else if (name.equals("lotNumber")) {
3442          throw new FHIRException("Cannot call addChild on a primitive type Immunization.lotNumber");
3443        }
3444        else if (name.equals("expirationDate")) {
3445          throw new FHIRException("Cannot call addChild on a primitive type Immunization.expirationDate");
3446        }
3447        else if (name.equals("site")) {
3448          this.site = new CodeableConcept();
3449          return this.site;
3450        }
3451        else if (name.equals("route")) {
3452          this.route = new CodeableConcept();
3453          return this.route;
3454        }
3455        else if (name.equals("doseQuantity")) {
3456          this.doseQuantity = new Quantity();
3457          return this.doseQuantity;
3458        }
3459        else if (name.equals("performer")) {
3460          return addPerformer();
3461        }
3462        else if (name.equals("note")) {
3463          return addNote();
3464        }
3465        else if (name.equals("reasonCode")) {
3466          return addReasonCode();
3467        }
3468        else if (name.equals("reasonReference")) {
3469          return addReasonReference();
3470        }
3471        else if (name.equals("isSubpotent")) {
3472          throw new FHIRException("Cannot call addChild on a primitive type Immunization.isSubpotent");
3473        }
3474        else if (name.equals("subpotentReason")) {
3475          return addSubpotentReason();
3476        }
3477        else if (name.equals("education")) {
3478          return addEducation();
3479        }
3480        else if (name.equals("programEligibility")) {
3481          return addProgramEligibility();
3482        }
3483        else if (name.equals("fundingSource")) {
3484          this.fundingSource = new CodeableConcept();
3485          return this.fundingSource;
3486        }
3487        else if (name.equals("reaction")) {
3488          return addReaction();
3489        }
3490        else if (name.equals("protocolApplied")) {
3491          return addProtocolApplied();
3492        }
3493        else
3494          return super.addChild(name);
3495      }
3496
3497  public String fhirType() {
3498    return "Immunization";
3499
3500  }
3501
3502      public Immunization copy() {
3503        Immunization dst = new Immunization();
3504        copyValues(dst);
3505        if (identifier != null) {
3506          dst.identifier = new ArrayList<Identifier>();
3507          for (Identifier i : identifier)
3508            dst.identifier.add(i.copy());
3509        };
3510        dst.status = status == null ? null : status.copy();
3511        dst.statusReason = statusReason == null ? null : statusReason.copy();
3512        dst.vaccineCode = vaccineCode == null ? null : vaccineCode.copy();
3513        dst.patient = patient == null ? null : patient.copy();
3514        dst.encounter = encounter == null ? null : encounter.copy();
3515        dst.occurrence = occurrence == null ? null : occurrence.copy();
3516        dst.recorded = recorded == null ? null : recorded.copy();
3517        dst.primarySource = primarySource == null ? null : primarySource.copy();
3518        dst.reportOrigin = reportOrigin == null ? null : reportOrigin.copy();
3519        dst.location = location == null ? null : location.copy();
3520        dst.manufacturer = manufacturer == null ? null : manufacturer.copy();
3521        dst.lotNumber = lotNumber == null ? null : lotNumber.copy();
3522        dst.expirationDate = expirationDate == null ? null : expirationDate.copy();
3523        dst.site = site == null ? null : site.copy();
3524        dst.route = route == null ? null : route.copy();
3525        dst.doseQuantity = doseQuantity == null ? null : doseQuantity.copy();
3526        if (performer != null) {
3527          dst.performer = new ArrayList<ImmunizationPerformerComponent>();
3528          for (ImmunizationPerformerComponent i : performer)
3529            dst.performer.add(i.copy());
3530        };
3531        if (note != null) {
3532          dst.note = new ArrayList<Annotation>();
3533          for (Annotation i : note)
3534            dst.note.add(i.copy());
3535        };
3536        if (reasonCode != null) {
3537          dst.reasonCode = new ArrayList<CodeableConcept>();
3538          for (CodeableConcept i : reasonCode)
3539            dst.reasonCode.add(i.copy());
3540        };
3541        if (reasonReference != null) {
3542          dst.reasonReference = new ArrayList<Reference>();
3543          for (Reference i : reasonReference)
3544            dst.reasonReference.add(i.copy());
3545        };
3546        dst.isSubpotent = isSubpotent == null ? null : isSubpotent.copy();
3547        if (subpotentReason != null) {
3548          dst.subpotentReason = new ArrayList<CodeableConcept>();
3549          for (CodeableConcept i : subpotentReason)
3550            dst.subpotentReason.add(i.copy());
3551        };
3552        if (education != null) {
3553          dst.education = new ArrayList<ImmunizationEducationComponent>();
3554          for (ImmunizationEducationComponent i : education)
3555            dst.education.add(i.copy());
3556        };
3557        if (programEligibility != null) {
3558          dst.programEligibility = new ArrayList<CodeableConcept>();
3559          for (CodeableConcept i : programEligibility)
3560            dst.programEligibility.add(i.copy());
3561        };
3562        dst.fundingSource = fundingSource == null ? null : fundingSource.copy();
3563        if (reaction != null) {
3564          dst.reaction = new ArrayList<ImmunizationReactionComponent>();
3565          for (ImmunizationReactionComponent i : reaction)
3566            dst.reaction.add(i.copy());
3567        };
3568        if (protocolApplied != null) {
3569          dst.protocolApplied = new ArrayList<ImmunizationProtocolAppliedComponent>();
3570          for (ImmunizationProtocolAppliedComponent i : protocolApplied)
3571            dst.protocolApplied.add(i.copy());
3572        };
3573        return dst;
3574      }
3575
3576      protected Immunization typedCopy() {
3577        return copy();
3578      }
3579
3580      @Override
3581      public boolean equalsDeep(Base other_) {
3582        if (!super.equalsDeep(other_))
3583          return false;
3584        if (!(other_ instanceof Immunization))
3585          return false;
3586        Immunization o = (Immunization) other_;
3587        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true)
3588           && compareDeep(vaccineCode, o.vaccineCode, true) && compareDeep(patient, o.patient, true) && compareDeep(encounter, o.encounter, true)
3589           && compareDeep(occurrence, o.occurrence, true) && compareDeep(recorded, o.recorded, true) && compareDeep(primarySource, o.primarySource, true)
3590           && compareDeep(reportOrigin, o.reportOrigin, true) && compareDeep(location, o.location, true) && compareDeep(manufacturer, o.manufacturer, true)
3591           && compareDeep(lotNumber, o.lotNumber, true) && compareDeep(expirationDate, o.expirationDate, true)
3592           && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) && compareDeep(doseQuantity, o.doseQuantity, true)
3593           && compareDeep(performer, o.performer, true) && compareDeep(note, o.note, true) && compareDeep(reasonCode, o.reasonCode, true)
3594           && compareDeep(reasonReference, o.reasonReference, true) && compareDeep(isSubpotent, o.isSubpotent, true)
3595           && compareDeep(subpotentReason, o.subpotentReason, true) && compareDeep(education, o.education, true)
3596           && compareDeep(programEligibility, o.programEligibility, true) && compareDeep(fundingSource, o.fundingSource, true)
3597           && compareDeep(reaction, o.reaction, true) && compareDeep(protocolApplied, o.protocolApplied, true)
3598          ;
3599      }
3600
3601      @Override
3602      public boolean equalsShallow(Base other_) {
3603        if (!super.equalsShallow(other_))
3604          return false;
3605        if (!(other_ instanceof Immunization))
3606          return false;
3607        Immunization o = (Immunization) other_;
3608        return compareValues(status, o.status, true) && compareValues(recorded, o.recorded, true) && compareValues(primarySource, o.primarySource, true)
3609           && compareValues(lotNumber, o.lotNumber, true) && compareValues(expirationDate, o.expirationDate, true)
3610           && compareValues(isSubpotent, o.isSubpotent, true);
3611      }
3612
3613      public boolean isEmpty() {
3614        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, statusReason
3615          , vaccineCode, patient, encounter, occurrence, recorded, primarySource, reportOrigin
3616          , location, manufacturer, lotNumber, expirationDate, site, route, doseQuantity
3617          , performer, note, reasonCode, reasonReference, isSubpotent, subpotentReason, education
3618          , programEligibility, fundingSource, reaction, protocolApplied);
3619      }
3620
3621  @Override
3622  public ResourceType getResourceType() {
3623    return ResourceType.Immunization;
3624   }
3625
3626 /**
3627   * Search parameter: <b>date</b>
3628   * <p>
3629   * Description: <b>Vaccination  (non)-Administration Date</b><br>
3630   * Type: <b>date</b><br>
3631   * Path: <b>Immunization.occurrence[x]</b><br>
3632   * </p>
3633   */
3634  @SearchParamDefinition(name="date", path="Immunization.occurrence", description="Vaccination  (non)-Administration Date", type="date" )
3635  public static final String SP_DATE = "date";
3636 /**
3637   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3638   * <p>
3639   * Description: <b>Vaccination  (non)-Administration Date</b><br>
3640   * Type: <b>date</b><br>
3641   * Path: <b>Immunization.occurrence[x]</b><br>
3642   * </p>
3643   */
3644  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
3645
3646 /**
3647   * Search parameter: <b>identifier</b>
3648   * <p>
3649   * Description: <b>Business identifier</b><br>
3650   * Type: <b>token</b><br>
3651   * Path: <b>Immunization.identifier</b><br>
3652   * </p>
3653   */
3654  @SearchParamDefinition(name="identifier", path="Immunization.identifier", description="Business identifier", type="token" )
3655  public static final String SP_IDENTIFIER = "identifier";
3656 /**
3657   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3658   * <p>
3659   * Description: <b>Business identifier</b><br>
3660   * Type: <b>token</b><br>
3661   * Path: <b>Immunization.identifier</b><br>
3662   * </p>
3663   */
3664  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3665
3666 /**
3667   * Search parameter: <b>performer</b>
3668   * <p>
3669   * Description: <b>The practitioner or organization who played a role in the vaccination</b><br>
3670   * Type: <b>reference</b><br>
3671   * Path: <b>Immunization.performer.actor</b><br>
3672   * </p>
3673   */
3674  @SearchParamDefinition(name="performer", path="Immunization.performer.actor", description="The practitioner or organization who played a role in the vaccination", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Organization.class, Practitioner.class, PractitionerRole.class } )
3675  public static final String SP_PERFORMER = "performer";
3676 /**
3677   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
3678   * <p>
3679   * Description: <b>The practitioner or organization who played a role in the vaccination</b><br>
3680   * Type: <b>reference</b><br>
3681   * Path: <b>Immunization.performer.actor</b><br>
3682   * </p>
3683   */
3684  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
3685
3686/**
3687   * Constant for fluent queries to be used to add include statements. Specifies
3688   * the path value of "<b>Immunization:performer</b>".
3689   */
3690  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("Immunization:performer").toLocked();
3691
3692 /**
3693   * Search parameter: <b>reaction</b>
3694   * <p>
3695   * Description: <b>Additional information on reaction</b><br>
3696   * Type: <b>reference</b><br>
3697   * Path: <b>Immunization.reaction.detail</b><br>
3698   * </p>
3699   */
3700  @SearchParamDefinition(name="reaction", path="Immunization.reaction.detail", description="Additional information on reaction", type="reference", target={Observation.class } )
3701  public static final String SP_REACTION = "reaction";
3702 /**
3703   * <b>Fluent Client</b> search parameter constant for <b>reaction</b>
3704   * <p>
3705   * Description: <b>Additional information on reaction</b><br>
3706   * Type: <b>reference</b><br>
3707   * Path: <b>Immunization.reaction.detail</b><br>
3708   * </p>
3709   */
3710  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REACTION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REACTION);
3711
3712/**
3713   * Constant for fluent queries to be used to add include statements. Specifies
3714   * the path value of "<b>Immunization:reaction</b>".
3715   */
3716  public static final ca.uhn.fhir.model.api.Include INCLUDE_REACTION = new ca.uhn.fhir.model.api.Include("Immunization:reaction").toLocked();
3717
3718 /**
3719   * Search parameter: <b>lot-number</b>
3720   * <p>
3721   * Description: <b>Vaccine Lot Number</b><br>
3722   * Type: <b>string</b><br>
3723   * Path: <b>Immunization.lotNumber</b><br>
3724   * </p>
3725   */
3726  @SearchParamDefinition(name="lot-number", path="Immunization.lotNumber", description="Vaccine Lot Number", type="string" )
3727  public static final String SP_LOT_NUMBER = "lot-number";
3728 /**
3729   * <b>Fluent Client</b> search parameter constant for <b>lot-number</b>
3730   * <p>
3731   * Description: <b>Vaccine Lot Number</b><br>
3732   * Type: <b>string</b><br>
3733   * Path: <b>Immunization.lotNumber</b><br>
3734   * </p>
3735   */
3736  public static final ca.uhn.fhir.rest.gclient.StringClientParam LOT_NUMBER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_LOT_NUMBER);
3737
3738 /**
3739   * Search parameter: <b>status-reason</b>
3740   * <p>
3741   * Description: <b>Reason why the vaccine was not administered</b><br>
3742   * Type: <b>token</b><br>
3743   * Path: <b>Immunization.statusReason</b><br>
3744   * </p>
3745   */
3746  @SearchParamDefinition(name="status-reason", path="Immunization.statusReason", description="Reason why the vaccine was not administered", type="token" )
3747  public static final String SP_STATUS_REASON = "status-reason";
3748 /**
3749   * <b>Fluent Client</b> search parameter constant for <b>status-reason</b>
3750   * <p>
3751   * Description: <b>Reason why the vaccine was not administered</b><br>
3752   * Type: <b>token</b><br>
3753   * Path: <b>Immunization.statusReason</b><br>
3754   * </p>
3755   */
3756  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS_REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS_REASON);
3757
3758 /**
3759   * Search parameter: <b>reason-code</b>
3760   * <p>
3761   * Description: <b>Reason why the vaccine was administered</b><br>
3762   * Type: <b>token</b><br>
3763   * Path: <b>Immunization.reasonCode</b><br>
3764   * </p>
3765   */
3766  @SearchParamDefinition(name="reason-code", path="Immunization.reasonCode", description="Reason why the vaccine was administered", type="token" )
3767  public static final String SP_REASON_CODE = "reason-code";
3768 /**
3769   * <b>Fluent Client</b> search parameter constant for <b>reason-code</b>
3770   * <p>
3771   * Description: <b>Reason why the vaccine was administered</b><br>
3772   * Type: <b>token</b><br>
3773   * Path: <b>Immunization.reasonCode</b><br>
3774   * </p>
3775   */
3776  public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REASON_CODE);
3777
3778 /**
3779   * Search parameter: <b>manufacturer</b>
3780   * <p>
3781   * Description: <b>Vaccine Manufacturer</b><br>
3782   * Type: <b>reference</b><br>
3783   * Path: <b>Immunization.manufacturer</b><br>
3784   * </p>
3785   */
3786  @SearchParamDefinition(name="manufacturer", path="Immunization.manufacturer", description="Vaccine Manufacturer", type="reference", target={Organization.class } )
3787  public static final String SP_MANUFACTURER = "manufacturer";
3788 /**
3789   * <b>Fluent Client</b> search parameter constant for <b>manufacturer</b>
3790   * <p>
3791   * Description: <b>Vaccine Manufacturer</b><br>
3792   * Type: <b>reference</b><br>
3793   * Path: <b>Immunization.manufacturer</b><br>
3794   * </p>
3795   */
3796  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MANUFACTURER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MANUFACTURER);
3797
3798/**
3799   * Constant for fluent queries to be used to add include statements. Specifies
3800   * the path value of "<b>Immunization:manufacturer</b>".
3801   */
3802  public static final ca.uhn.fhir.model.api.Include INCLUDE_MANUFACTURER = new ca.uhn.fhir.model.api.Include("Immunization:manufacturer").toLocked();
3803
3804 /**
3805   * Search parameter: <b>target-disease</b>
3806   * <p>
3807   * Description: <b>The target disease the dose is being administered against</b><br>
3808   * Type: <b>token</b><br>
3809   * Path: <b>Immunization.protocolApplied.targetDisease</b><br>
3810   * </p>
3811   */
3812  @SearchParamDefinition(name="target-disease", path="Immunization.protocolApplied.targetDisease", description="The target disease the dose is being administered against", type="token" )
3813  public static final String SP_TARGET_DISEASE = "target-disease";
3814 /**
3815   * <b>Fluent Client</b> search parameter constant for <b>target-disease</b>
3816   * <p>
3817   * Description: <b>The target disease the dose is being administered against</b><br>
3818   * Type: <b>token</b><br>
3819   * Path: <b>Immunization.protocolApplied.targetDisease</b><br>
3820   * </p>
3821   */
3822  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TARGET_DISEASE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TARGET_DISEASE);
3823
3824 /**
3825   * Search parameter: <b>patient</b>
3826   * <p>
3827   * Description: <b>The patient for the vaccination record</b><br>
3828   * Type: <b>reference</b><br>
3829   * Path: <b>Immunization.patient</b><br>
3830   * </p>
3831   */
3832  @SearchParamDefinition(name="patient", path="Immunization.patient", description="The patient for the vaccination record", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } )
3833  public static final String SP_PATIENT = "patient";
3834 /**
3835   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3836   * <p>
3837   * Description: <b>The patient for the vaccination record</b><br>
3838   * Type: <b>reference</b><br>
3839   * Path: <b>Immunization.patient</b><br>
3840   * </p>
3841   */
3842  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3843
3844/**
3845   * Constant for fluent queries to be used to add include statements. Specifies
3846   * the path value of "<b>Immunization:patient</b>".
3847   */
3848  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Immunization:patient").toLocked();
3849
3850 /**
3851   * Search parameter: <b>series</b>
3852   * <p>
3853   * Description: <b>The series being followed by the provider</b><br>
3854   * Type: <b>string</b><br>
3855   * Path: <b>Immunization.protocolApplied.series</b><br>
3856   * </p>
3857   */
3858  @SearchParamDefinition(name="series", path="Immunization.protocolApplied.series", description="The series being followed by the provider", type="string" )
3859  public static final String SP_SERIES = "series";
3860 /**
3861   * <b>Fluent Client</b> search parameter constant for <b>series</b>
3862   * <p>
3863   * Description: <b>The series being followed by the provider</b><br>
3864   * Type: <b>string</b><br>
3865   * Path: <b>Immunization.protocolApplied.series</b><br>
3866   * </p>
3867   */
3868  public static final ca.uhn.fhir.rest.gclient.StringClientParam SERIES = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_SERIES);
3869
3870 /**
3871   * Search parameter: <b>vaccine-code</b>
3872   * <p>
3873   * Description: <b>Vaccine Product Administered</b><br>
3874   * Type: <b>token</b><br>
3875   * Path: <b>Immunization.vaccineCode</b><br>
3876   * </p>
3877   */
3878  @SearchParamDefinition(name="vaccine-code", path="Immunization.vaccineCode", description="Vaccine Product Administered", type="token" )
3879  public static final String SP_VACCINE_CODE = "vaccine-code";
3880 /**
3881   * <b>Fluent Client</b> search parameter constant for <b>vaccine-code</b>
3882   * <p>
3883   * Description: <b>Vaccine Product Administered</b><br>
3884   * Type: <b>token</b><br>
3885   * Path: <b>Immunization.vaccineCode</b><br>
3886   * </p>
3887   */
3888  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VACCINE_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VACCINE_CODE);
3889
3890 /**
3891   * Search parameter: <b>reason-reference</b>
3892   * <p>
3893   * Description: <b>Why immunization occurred</b><br>
3894   * Type: <b>reference</b><br>
3895   * Path: <b>Immunization.reasonReference</b><br>
3896   * </p>
3897   */
3898  @SearchParamDefinition(name="reason-reference", path="Immunization.reasonReference", description="Why immunization occurred", type="reference", target={Condition.class, DiagnosticReport.class, Observation.class } )
3899  public static final String SP_REASON_REFERENCE = "reason-reference";
3900 /**
3901   * <b>Fluent Client</b> search parameter constant for <b>reason-reference</b>
3902   * <p>
3903   * Description: <b>Why immunization occurred</b><br>
3904   * Type: <b>reference</b><br>
3905   * Path: <b>Immunization.reasonReference</b><br>
3906   * </p>
3907   */
3908  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REASON_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REASON_REFERENCE);
3909
3910/**
3911   * Constant for fluent queries to be used to add include statements. Specifies
3912   * the path value of "<b>Immunization:reason-reference</b>".
3913   */
3914  public static final ca.uhn.fhir.model.api.Include INCLUDE_REASON_REFERENCE = new ca.uhn.fhir.model.api.Include("Immunization:reason-reference").toLocked();
3915
3916 /**
3917   * Search parameter: <b>location</b>
3918   * <p>
3919   * Description: <b>The service delivery location or facility in which the vaccine was / was to be administered</b><br>
3920   * Type: <b>reference</b><br>
3921   * Path: <b>Immunization.location</b><br>
3922   * </p>
3923   */
3924  @SearchParamDefinition(name="location", path="Immunization.location", description="The service delivery location or facility in which the vaccine was / was to be administered", type="reference", target={Location.class } )
3925  public static final String SP_LOCATION = "location";
3926 /**
3927   * <b>Fluent Client</b> search parameter constant for <b>location</b>
3928   * <p>
3929   * Description: <b>The service delivery location or facility in which the vaccine was / was to be administered</b><br>
3930   * Type: <b>reference</b><br>
3931   * Path: <b>Immunization.location</b><br>
3932   * </p>
3933   */
3934  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION);
3935
3936/**
3937   * Constant for fluent queries to be used to add include statements. Specifies
3938   * the path value of "<b>Immunization:location</b>".
3939   */
3940  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Immunization:location").toLocked();
3941
3942 /**
3943   * Search parameter: <b>status</b>
3944   * <p>
3945   * Description: <b>Immunization event status</b><br>
3946   * Type: <b>token</b><br>
3947   * Path: <b>Immunization.status</b><br>
3948   * </p>
3949   */
3950  @SearchParamDefinition(name="status", path="Immunization.status", description="Immunization event status", type="token" )
3951  public static final String SP_STATUS = "status";
3952 /**
3953   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3954   * <p>
3955   * Description: <b>Immunization event status</b><br>
3956   * Type: <b>token</b><br>
3957   * Path: <b>Immunization.status</b><br>
3958   * </p>
3959   */
3960  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3961
3962 /**
3963   * Search parameter: <b>reaction-date</b>
3964   * <p>
3965   * Description: <b>When reaction started</b><br>
3966   * Type: <b>date</b><br>
3967   * Path: <b>Immunization.reaction.date</b><br>
3968   * </p>
3969   */
3970  @SearchParamDefinition(name="reaction-date", path="Immunization.reaction.date", description="When reaction started", type="date" )
3971  public static final String SP_REACTION_DATE = "reaction-date";
3972 /**
3973   * <b>Fluent Client</b> search parameter constant for <b>reaction-date</b>
3974   * <p>
3975   * Description: <b>When reaction started</b><br>
3976   * Type: <b>date</b><br>
3977   * Path: <b>Immunization.reaction.date</b><br>
3978   * </p>
3979   */
3980  public static final ca.uhn.fhir.rest.gclient.DateClientParam REACTION_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_REACTION_DATE);
3981
3982
3983}
3984