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