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