001package org.hl7.fhir.r4b.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Fri, Dec 31, 2021 05:58+1100 for FHIR v4.3.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r4b.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification.
052 */
053@ResourceDef(name="ImmunizationRecommendation", profile="http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation")
054public class ImmunizationRecommendation extends DomainResource {
055
056    @Block()
057    public static class ImmunizationRecommendationRecommendationComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * Vaccine(s) or vaccine group that pertain to the recommendation.
060         */
061        @Child(name = "vaccineCode", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
062        @Description(shortDefinition="Vaccine  or vaccine group recommendation applies to", formalDefinition="Vaccine(s) or vaccine group that pertain to the recommendation." )
063        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/vaccine-code")
064        protected List<CodeableConcept> vaccineCode;
065
066        /**
067         * The targeted disease for the recommendation.
068         */
069        @Child(name = "targetDisease", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
070        @Description(shortDefinition="Disease to be immunized against", formalDefinition="The targeted disease for the recommendation." )
071        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-recommendation-target-disease")
072        protected CodeableConcept targetDisease;
073
074        /**
075         * Vaccine(s) which should not be used to fulfill the recommendation.
076         */
077        @Child(name = "contraindicatedVaccineCode", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
078        @Description(shortDefinition="Vaccine which is contraindicated to fulfill the recommendation", formalDefinition="Vaccine(s) which should not be used to fulfill the recommendation." )
079        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/vaccine-code")
080        protected List<CodeableConcept> contraindicatedVaccineCode;
081
082        /**
083         * Indicates the patient status with respect to the path to immunity for the target disease.
084         */
085        @Child(name = "forecastStatus", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=true, summary=true)
086        @Description(shortDefinition="Vaccine recommendation status", formalDefinition="Indicates the patient status with respect to the path to immunity for the target disease." )
087        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-recommendation-status")
088        protected CodeableConcept forecastStatus;
089
090        /**
091         * The reason for the assigned forecast status.
092         */
093        @Child(name = "forecastReason", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
094        @Description(shortDefinition="Vaccine administration status reason", formalDefinition="The reason for the assigned forecast status." )
095        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-recommendation-reason")
096        protected List<CodeableConcept> forecastReason;
097
098        /**
099         * Vaccine date recommendations.  For example, earliest date to administer, latest date to administer, etc.
100         */
101        @Child(name = "dateCriterion", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
102        @Description(shortDefinition="Dates governing proposed immunization", formalDefinition="Vaccine date recommendations.  For example, earliest date to administer, latest date to administer, etc." )
103        protected List<ImmunizationRecommendationRecommendationDateCriterionComponent> dateCriterion;
104
105        /**
106         * Contains the description about the protocol under which the vaccine was administered.
107         */
108        @Child(name = "description", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
109        @Description(shortDefinition="Protocol details", formalDefinition="Contains the description about the protocol under which the vaccine was administered." )
110        protected StringType description;
111
112        /**
113         * One possible path to achieve presumed immunity against a disease - within the context of an authority.
114         */
115        @Child(name = "series", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
116        @Description(shortDefinition="Name of vaccination series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." )
117        protected StringType series;
118
119        /**
120         * Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose).
121         */
122        @Child(name = "doseNumber", type = {PositiveIntType.class, StringType.class}, order=9, min=0, max=1, modifier=false, summary=true)
123        @Description(shortDefinition="Recommended dose number within series", formalDefinition="Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose)." )
124        protected DataType doseNumber;
125
126        /**
127         * The recommended number of doses to achieve immunity.
128         */
129        @Child(name = "seriesDoses", type = {PositiveIntType.class, StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
130        @Description(shortDefinition="Recommended number of doses for immunity", formalDefinition="The recommended number of doses to achieve immunity." )
131        protected DataType seriesDoses;
132
133        /**
134         * Immunization event history and/or evaluation that supports the status and recommendation.
135         */
136        @Child(name = "supportingImmunization", type = {Immunization.class, ImmunizationEvaluation.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
137        @Description(shortDefinition="Past immunizations supporting recommendation", formalDefinition="Immunization event history and/or evaluation that supports the status and recommendation." )
138        protected List<Reference> supportingImmunization;
139
140        /**
141         * Patient Information that supports the status and recommendation.  This includes patient observations, adverse reactions and allergy/intolerance information.
142         */
143        @Child(name = "supportingPatientInformation", type = {Reference.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
144        @Description(shortDefinition="Patient observations supporting recommendation", formalDefinition="Patient Information that supports the status and recommendation.  This includes patient observations, adverse reactions and allergy/intolerance information." )
145        protected List<Reference> supportingPatientInformation;
146
147        private static final long serialVersionUID = -1867892028L;
148
149    /**
150     * Constructor
151     */
152      public ImmunizationRecommendationRecommendationComponent() {
153        super();
154      }
155
156    /**
157     * Constructor
158     */
159      public ImmunizationRecommendationRecommendationComponent(CodeableConcept forecastStatus) {
160        super();
161        this.setForecastStatus(forecastStatus);
162      }
163
164        /**
165         * @return {@link #vaccineCode} (Vaccine(s) or vaccine group that pertain to the recommendation.)
166         */
167        public List<CodeableConcept> getVaccineCode() { 
168          if (this.vaccineCode == null)
169            this.vaccineCode = new ArrayList<CodeableConcept>();
170          return this.vaccineCode;
171        }
172
173        /**
174         * @return Returns a reference to <code>this</code> for easy method chaining
175         */
176        public ImmunizationRecommendationRecommendationComponent setVaccineCode(List<CodeableConcept> theVaccineCode) { 
177          this.vaccineCode = theVaccineCode;
178          return this;
179        }
180
181        public boolean hasVaccineCode() { 
182          if (this.vaccineCode == null)
183            return false;
184          for (CodeableConcept item : this.vaccineCode)
185            if (!item.isEmpty())
186              return true;
187          return false;
188        }
189
190        public CodeableConcept addVaccineCode() { //3
191          CodeableConcept t = new CodeableConcept();
192          if (this.vaccineCode == null)
193            this.vaccineCode = new ArrayList<CodeableConcept>();
194          this.vaccineCode.add(t);
195          return t;
196        }
197
198        public ImmunizationRecommendationRecommendationComponent addVaccineCode(CodeableConcept t) { //3
199          if (t == null)
200            return this;
201          if (this.vaccineCode == null)
202            this.vaccineCode = new ArrayList<CodeableConcept>();
203          this.vaccineCode.add(t);
204          return this;
205        }
206
207        /**
208         * @return The first repetition of repeating field {@link #vaccineCode}, creating it if it does not already exist {3}
209         */
210        public CodeableConcept getVaccineCodeFirstRep() { 
211          if (getVaccineCode().isEmpty()) {
212            addVaccineCode();
213          }
214          return getVaccineCode().get(0);
215        }
216
217        /**
218         * @return {@link #targetDisease} (The targeted disease for the recommendation.)
219         */
220        public CodeableConcept getTargetDisease() { 
221          if (this.targetDisease == null)
222            if (Configuration.errorOnAutoCreate())
223              throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.targetDisease");
224            else if (Configuration.doAutoCreate())
225              this.targetDisease = new CodeableConcept(); // cc
226          return this.targetDisease;
227        }
228
229        public boolean hasTargetDisease() { 
230          return this.targetDisease != null && !this.targetDisease.isEmpty();
231        }
232
233        /**
234         * @param value {@link #targetDisease} (The targeted disease for the recommendation.)
235         */
236        public ImmunizationRecommendationRecommendationComponent setTargetDisease(CodeableConcept value) { 
237          this.targetDisease = value;
238          return this;
239        }
240
241        /**
242         * @return {@link #contraindicatedVaccineCode} (Vaccine(s) which should not be used to fulfill the recommendation.)
243         */
244        public List<CodeableConcept> getContraindicatedVaccineCode() { 
245          if (this.contraindicatedVaccineCode == null)
246            this.contraindicatedVaccineCode = new ArrayList<CodeableConcept>();
247          return this.contraindicatedVaccineCode;
248        }
249
250        /**
251         * @return Returns a reference to <code>this</code> for easy method chaining
252         */
253        public ImmunizationRecommendationRecommendationComponent setContraindicatedVaccineCode(List<CodeableConcept> theContraindicatedVaccineCode) { 
254          this.contraindicatedVaccineCode = theContraindicatedVaccineCode;
255          return this;
256        }
257
258        public boolean hasContraindicatedVaccineCode() { 
259          if (this.contraindicatedVaccineCode == null)
260            return false;
261          for (CodeableConcept item : this.contraindicatedVaccineCode)
262            if (!item.isEmpty())
263              return true;
264          return false;
265        }
266
267        public CodeableConcept addContraindicatedVaccineCode() { //3
268          CodeableConcept t = new CodeableConcept();
269          if (this.contraindicatedVaccineCode == null)
270            this.contraindicatedVaccineCode = new ArrayList<CodeableConcept>();
271          this.contraindicatedVaccineCode.add(t);
272          return t;
273        }
274
275        public ImmunizationRecommendationRecommendationComponent addContraindicatedVaccineCode(CodeableConcept t) { //3
276          if (t == null)
277            return this;
278          if (this.contraindicatedVaccineCode == null)
279            this.contraindicatedVaccineCode = new ArrayList<CodeableConcept>();
280          this.contraindicatedVaccineCode.add(t);
281          return this;
282        }
283
284        /**
285         * @return The first repetition of repeating field {@link #contraindicatedVaccineCode}, creating it if it does not already exist {3}
286         */
287        public CodeableConcept getContraindicatedVaccineCodeFirstRep() { 
288          if (getContraindicatedVaccineCode().isEmpty()) {
289            addContraindicatedVaccineCode();
290          }
291          return getContraindicatedVaccineCode().get(0);
292        }
293
294        /**
295         * @return {@link #forecastStatus} (Indicates the patient status with respect to the path to immunity for the target disease.)
296         */
297        public CodeableConcept getForecastStatus() { 
298          if (this.forecastStatus == null)
299            if (Configuration.errorOnAutoCreate())
300              throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.forecastStatus");
301            else if (Configuration.doAutoCreate())
302              this.forecastStatus = new CodeableConcept(); // cc
303          return this.forecastStatus;
304        }
305
306        public boolean hasForecastStatus() { 
307          return this.forecastStatus != null && !this.forecastStatus.isEmpty();
308        }
309
310        /**
311         * @param value {@link #forecastStatus} (Indicates the patient status with respect to the path to immunity for the target disease.)
312         */
313        public ImmunizationRecommendationRecommendationComponent setForecastStatus(CodeableConcept value) { 
314          this.forecastStatus = value;
315          return this;
316        }
317
318        /**
319         * @return {@link #forecastReason} (The reason for the assigned forecast status.)
320         */
321        public List<CodeableConcept> getForecastReason() { 
322          if (this.forecastReason == null)
323            this.forecastReason = new ArrayList<CodeableConcept>();
324          return this.forecastReason;
325        }
326
327        /**
328         * @return Returns a reference to <code>this</code> for easy method chaining
329         */
330        public ImmunizationRecommendationRecommendationComponent setForecastReason(List<CodeableConcept> theForecastReason) { 
331          this.forecastReason = theForecastReason;
332          return this;
333        }
334
335        public boolean hasForecastReason() { 
336          if (this.forecastReason == null)
337            return false;
338          for (CodeableConcept item : this.forecastReason)
339            if (!item.isEmpty())
340              return true;
341          return false;
342        }
343
344        public CodeableConcept addForecastReason() { //3
345          CodeableConcept t = new CodeableConcept();
346          if (this.forecastReason == null)
347            this.forecastReason = new ArrayList<CodeableConcept>();
348          this.forecastReason.add(t);
349          return t;
350        }
351
352        public ImmunizationRecommendationRecommendationComponent addForecastReason(CodeableConcept t) { //3
353          if (t == null)
354            return this;
355          if (this.forecastReason == null)
356            this.forecastReason = new ArrayList<CodeableConcept>();
357          this.forecastReason.add(t);
358          return this;
359        }
360
361        /**
362         * @return The first repetition of repeating field {@link #forecastReason}, creating it if it does not already exist {3}
363         */
364        public CodeableConcept getForecastReasonFirstRep() { 
365          if (getForecastReason().isEmpty()) {
366            addForecastReason();
367          }
368          return getForecastReason().get(0);
369        }
370
371        /**
372         * @return {@link #dateCriterion} (Vaccine date recommendations.  For example, earliest date to administer, latest date to administer, etc.)
373         */
374        public List<ImmunizationRecommendationRecommendationDateCriterionComponent> getDateCriterion() { 
375          if (this.dateCriterion == null)
376            this.dateCriterion = new ArrayList<ImmunizationRecommendationRecommendationDateCriterionComponent>();
377          return this.dateCriterion;
378        }
379
380        /**
381         * @return Returns a reference to <code>this</code> for easy method chaining
382         */
383        public ImmunizationRecommendationRecommendationComponent setDateCriterion(List<ImmunizationRecommendationRecommendationDateCriterionComponent> theDateCriterion) { 
384          this.dateCriterion = theDateCriterion;
385          return this;
386        }
387
388        public boolean hasDateCriterion() { 
389          if (this.dateCriterion == null)
390            return false;
391          for (ImmunizationRecommendationRecommendationDateCriterionComponent item : this.dateCriterion)
392            if (!item.isEmpty())
393              return true;
394          return false;
395        }
396
397        public ImmunizationRecommendationRecommendationDateCriterionComponent addDateCriterion() { //3
398          ImmunizationRecommendationRecommendationDateCriterionComponent t = new ImmunizationRecommendationRecommendationDateCriterionComponent();
399          if (this.dateCriterion == null)
400            this.dateCriterion = new ArrayList<ImmunizationRecommendationRecommendationDateCriterionComponent>();
401          this.dateCriterion.add(t);
402          return t;
403        }
404
405        public ImmunizationRecommendationRecommendationComponent addDateCriterion(ImmunizationRecommendationRecommendationDateCriterionComponent t) { //3
406          if (t == null)
407            return this;
408          if (this.dateCriterion == null)
409            this.dateCriterion = new ArrayList<ImmunizationRecommendationRecommendationDateCriterionComponent>();
410          this.dateCriterion.add(t);
411          return this;
412        }
413
414        /**
415         * @return The first repetition of repeating field {@link #dateCriterion}, creating it if it does not already exist {3}
416         */
417        public ImmunizationRecommendationRecommendationDateCriterionComponent getDateCriterionFirstRep() { 
418          if (getDateCriterion().isEmpty()) {
419            addDateCriterion();
420          }
421          return getDateCriterion().get(0);
422        }
423
424        /**
425         * @return {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
426         */
427        public StringType getDescriptionElement() { 
428          if (this.description == null)
429            if (Configuration.errorOnAutoCreate())
430              throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.description");
431            else if (Configuration.doAutoCreate())
432              this.description = new StringType(); // bb
433          return this.description;
434        }
435
436        public boolean hasDescriptionElement() { 
437          return this.description != null && !this.description.isEmpty();
438        }
439
440        public boolean hasDescription() { 
441          return this.description != null && !this.description.isEmpty();
442        }
443
444        /**
445         * @param value {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
446         */
447        public ImmunizationRecommendationRecommendationComponent setDescriptionElement(StringType value) { 
448          this.description = value;
449          return this;
450        }
451
452        /**
453         * @return Contains the description about the protocol under which the vaccine was administered.
454         */
455        public String getDescription() { 
456          return this.description == null ? null : this.description.getValue();
457        }
458
459        /**
460         * @param value Contains the description about the protocol under which the vaccine was administered.
461         */
462        public ImmunizationRecommendationRecommendationComponent setDescription(String value) { 
463          if (Utilities.noString(value))
464            this.description = null;
465          else {
466            if (this.description == null)
467              this.description = new StringType();
468            this.description.setValue(value);
469          }
470          return this;
471        }
472
473        /**
474         * @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
475         */
476        public StringType getSeriesElement() { 
477          if (this.series == null)
478            if (Configuration.errorOnAutoCreate())
479              throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.series");
480            else if (Configuration.doAutoCreate())
481              this.series = new StringType(); // bb
482          return this.series;
483        }
484
485        public boolean hasSeriesElement() { 
486          return this.series != null && !this.series.isEmpty();
487        }
488
489        public boolean hasSeries() { 
490          return this.series != null && !this.series.isEmpty();
491        }
492
493        /**
494         * @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
495         */
496        public ImmunizationRecommendationRecommendationComponent setSeriesElement(StringType value) { 
497          this.series = value;
498          return this;
499        }
500
501        /**
502         * @return One possible path to achieve presumed immunity against a disease - within the context of an authority.
503         */
504        public String getSeries() { 
505          return this.series == null ? null : this.series.getValue();
506        }
507
508        /**
509         * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority.
510         */
511        public ImmunizationRecommendationRecommendationComponent setSeries(String value) { 
512          if (Utilities.noString(value))
513            this.series = null;
514          else {
515            if (this.series == null)
516              this.series = new StringType();
517            this.series.setValue(value);
518          }
519          return this;
520        }
521
522        /**
523         * @return {@link #doseNumber} (Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose).)
524         */
525        public DataType getDoseNumber() { 
526          return this.doseNumber;
527        }
528
529        /**
530         * @return {@link #doseNumber} (Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose).)
531         */
532        public PositiveIntType getDoseNumberPositiveIntType() throws FHIRException { 
533          if (this.doseNumber == null)
534            this.doseNumber = new PositiveIntType();
535          if (!(this.doseNumber instanceof PositiveIntType))
536            throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.doseNumber.getClass().getName()+" was encountered");
537          return (PositiveIntType) this.doseNumber;
538        }
539
540        public boolean hasDoseNumberPositiveIntType() { 
541          return this != null && this.doseNumber instanceof PositiveIntType;
542        }
543
544        /**
545         * @return {@link #doseNumber} (Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose).)
546         */
547        public StringType getDoseNumberStringType() throws FHIRException { 
548          if (this.doseNumber == null)
549            this.doseNumber = new StringType();
550          if (!(this.doseNumber instanceof StringType))
551            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.doseNumber.getClass().getName()+" was encountered");
552          return (StringType) this.doseNumber;
553        }
554
555        public boolean hasDoseNumberStringType() { 
556          return this != null && this.doseNumber instanceof StringType;
557        }
558
559        public boolean hasDoseNumber() { 
560          return this.doseNumber != null && !this.doseNumber.isEmpty();
561        }
562
563        /**
564         * @param value {@link #doseNumber} (Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose).)
565         */
566        public ImmunizationRecommendationRecommendationComponent setDoseNumber(DataType value) { 
567          if (value != null && !(value instanceof PositiveIntType || value instanceof StringType))
568            throw new Error("Not the right type for ImmunizationRecommendation.recommendation.doseNumber[x]: "+value.fhirType());
569          this.doseNumber = value;
570          return this;
571        }
572
573        /**
574         * @return {@link #seriesDoses} (The recommended number of doses to achieve immunity.)
575         */
576        public DataType getSeriesDoses() { 
577          return this.seriesDoses;
578        }
579
580        /**
581         * @return {@link #seriesDoses} (The recommended number of doses to achieve immunity.)
582         */
583        public PositiveIntType getSeriesDosesPositiveIntType() throws FHIRException { 
584          if (this.seriesDoses == null)
585            this.seriesDoses = new PositiveIntType();
586          if (!(this.seriesDoses instanceof PositiveIntType))
587            throw new FHIRException("Type mismatch: the type PositiveIntType was expected, but "+this.seriesDoses.getClass().getName()+" was encountered");
588          return (PositiveIntType) this.seriesDoses;
589        }
590
591        public boolean hasSeriesDosesPositiveIntType() { 
592          return this != null && this.seriesDoses instanceof PositiveIntType;
593        }
594
595        /**
596         * @return {@link #seriesDoses} (The recommended number of doses to achieve immunity.)
597         */
598        public StringType getSeriesDosesStringType() throws FHIRException { 
599          if (this.seriesDoses == null)
600            this.seriesDoses = new StringType();
601          if (!(this.seriesDoses instanceof StringType))
602            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.seriesDoses.getClass().getName()+" was encountered");
603          return (StringType) this.seriesDoses;
604        }
605
606        public boolean hasSeriesDosesStringType() { 
607          return this != null && this.seriesDoses instanceof StringType;
608        }
609
610        public boolean hasSeriesDoses() { 
611          return this.seriesDoses != null && !this.seriesDoses.isEmpty();
612        }
613
614        /**
615         * @param value {@link #seriesDoses} (The recommended number of doses to achieve immunity.)
616         */
617        public ImmunizationRecommendationRecommendationComponent setSeriesDoses(DataType value) { 
618          if (value != null && !(value instanceof PositiveIntType || value instanceof StringType))
619            throw new Error("Not the right type for ImmunizationRecommendation.recommendation.seriesDoses[x]: "+value.fhirType());
620          this.seriesDoses = value;
621          return this;
622        }
623
624        /**
625         * @return {@link #supportingImmunization} (Immunization event history and/or evaluation that supports the status and recommendation.)
626         */
627        public List<Reference> getSupportingImmunization() { 
628          if (this.supportingImmunization == null)
629            this.supportingImmunization = new ArrayList<Reference>();
630          return this.supportingImmunization;
631        }
632
633        /**
634         * @return Returns a reference to <code>this</code> for easy method chaining
635         */
636        public ImmunizationRecommendationRecommendationComponent setSupportingImmunization(List<Reference> theSupportingImmunization) { 
637          this.supportingImmunization = theSupportingImmunization;
638          return this;
639        }
640
641        public boolean hasSupportingImmunization() { 
642          if (this.supportingImmunization == null)
643            return false;
644          for (Reference item : this.supportingImmunization)
645            if (!item.isEmpty())
646              return true;
647          return false;
648        }
649
650        public Reference addSupportingImmunization() { //3
651          Reference t = new Reference();
652          if (this.supportingImmunization == null)
653            this.supportingImmunization = new ArrayList<Reference>();
654          this.supportingImmunization.add(t);
655          return t;
656        }
657
658        public ImmunizationRecommendationRecommendationComponent addSupportingImmunization(Reference t) { //3
659          if (t == null)
660            return this;
661          if (this.supportingImmunization == null)
662            this.supportingImmunization = new ArrayList<Reference>();
663          this.supportingImmunization.add(t);
664          return this;
665        }
666
667        /**
668         * @return The first repetition of repeating field {@link #supportingImmunization}, creating it if it does not already exist {3}
669         */
670        public Reference getSupportingImmunizationFirstRep() { 
671          if (getSupportingImmunization().isEmpty()) {
672            addSupportingImmunization();
673          }
674          return getSupportingImmunization().get(0);
675        }
676
677        /**
678         * @return {@link #supportingPatientInformation} (Patient Information that supports the status and recommendation.  This includes patient observations, adverse reactions and allergy/intolerance information.)
679         */
680        public List<Reference> getSupportingPatientInformation() { 
681          if (this.supportingPatientInformation == null)
682            this.supportingPatientInformation = new ArrayList<Reference>();
683          return this.supportingPatientInformation;
684        }
685
686        /**
687         * @return Returns a reference to <code>this</code> for easy method chaining
688         */
689        public ImmunizationRecommendationRecommendationComponent setSupportingPatientInformation(List<Reference> theSupportingPatientInformation) { 
690          this.supportingPatientInformation = theSupportingPatientInformation;
691          return this;
692        }
693
694        public boolean hasSupportingPatientInformation() { 
695          if (this.supportingPatientInformation == null)
696            return false;
697          for (Reference item : this.supportingPatientInformation)
698            if (!item.isEmpty())
699              return true;
700          return false;
701        }
702
703        public Reference addSupportingPatientInformation() { //3
704          Reference t = new Reference();
705          if (this.supportingPatientInformation == null)
706            this.supportingPatientInformation = new ArrayList<Reference>();
707          this.supportingPatientInformation.add(t);
708          return t;
709        }
710
711        public ImmunizationRecommendationRecommendationComponent addSupportingPatientInformation(Reference t) { //3
712          if (t == null)
713            return this;
714          if (this.supportingPatientInformation == null)
715            this.supportingPatientInformation = new ArrayList<Reference>();
716          this.supportingPatientInformation.add(t);
717          return this;
718        }
719
720        /**
721         * @return The first repetition of repeating field {@link #supportingPatientInformation}, creating it if it does not already exist {3}
722         */
723        public Reference getSupportingPatientInformationFirstRep() { 
724          if (getSupportingPatientInformation().isEmpty()) {
725            addSupportingPatientInformation();
726          }
727          return getSupportingPatientInformation().get(0);
728        }
729
730        protected void listChildren(List<Property> children) {
731          super.listChildren(children);
732          children.add(new Property("vaccineCode", "CodeableConcept", "Vaccine(s) or vaccine group that pertain to the recommendation.", 0, java.lang.Integer.MAX_VALUE, vaccineCode));
733          children.add(new Property("targetDisease", "CodeableConcept", "The targeted disease for the recommendation.", 0, 1, targetDisease));
734          children.add(new Property("contraindicatedVaccineCode", "CodeableConcept", "Vaccine(s) which should not be used to fulfill the recommendation.", 0, java.lang.Integer.MAX_VALUE, contraindicatedVaccineCode));
735          children.add(new Property("forecastStatus", "CodeableConcept", "Indicates the patient status with respect to the path to immunity for the target disease.", 0, 1, forecastStatus));
736          children.add(new Property("forecastReason", "CodeableConcept", "The reason for the assigned forecast status.", 0, java.lang.Integer.MAX_VALUE, forecastReason));
737          children.add(new Property("dateCriterion", "", "Vaccine date recommendations.  For example, earliest date to administer, latest date to administer, etc.", 0, java.lang.Integer.MAX_VALUE, dateCriterion));
738          children.add(new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, 1, description));
739          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));
740          children.add(new Property("doseNumber[x]", "positiveInt|string", "Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose).", 0, 1, doseNumber));
741          children.add(new Property("seriesDoses[x]", "positiveInt|string", "The recommended number of doses to achieve immunity.", 0, 1, seriesDoses));
742          children.add(new Property("supportingImmunization", "Reference(Immunization|ImmunizationEvaluation)", "Immunization event history and/or evaluation that supports the status and recommendation.", 0, java.lang.Integer.MAX_VALUE, supportingImmunization));
743          children.add(new Property("supportingPatientInformation", "Reference(Any)", "Patient Information that supports the status and recommendation.  This includes patient observations, adverse reactions and allergy/intolerance information.", 0, java.lang.Integer.MAX_VALUE, supportingPatientInformation));
744        }
745
746        @Override
747        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
748          switch (_hash) {
749          case 664556354: /*vaccineCode*/  return new Property("vaccineCode", "CodeableConcept", "Vaccine(s) or vaccine group that pertain to the recommendation.", 0, java.lang.Integer.MAX_VALUE, vaccineCode);
750          case -319593813: /*targetDisease*/  return new Property("targetDisease", "CodeableConcept", "The targeted disease for the recommendation.", 0, 1, targetDisease);
751          case 571105240: /*contraindicatedVaccineCode*/  return new Property("contraindicatedVaccineCode", "CodeableConcept", "Vaccine(s) which should not be used to fulfill the recommendation.", 0, java.lang.Integer.MAX_VALUE, contraindicatedVaccineCode);
752          case 1904598477: /*forecastStatus*/  return new Property("forecastStatus", "CodeableConcept", "Indicates the patient status with respect to the path to immunity for the target disease.", 0, 1, forecastStatus);
753          case 1862115359: /*forecastReason*/  return new Property("forecastReason", "CodeableConcept", "The reason for the assigned forecast status.", 0, java.lang.Integer.MAX_VALUE, forecastReason);
754          case 2087518867: /*dateCriterion*/  return new Property("dateCriterion", "", "Vaccine date recommendations.  For example, earliest date to administer, latest date to administer, etc.", 0, java.lang.Integer.MAX_VALUE, dateCriterion);
755          case -1724546052: /*description*/  return new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, 1, description);
756          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);
757          case -1632295686: /*doseNumber[x]*/  return new Property("doseNumber[x]", "positiveInt|string", "Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose).", 0, 1, doseNumber);
758          case -887709242: /*doseNumber*/  return new Property("doseNumber[x]", "positiveInt|string", "Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose).", 0, 1, doseNumber);
759          case -1826134640: /*doseNumberPositiveInt*/  return new Property("doseNumber[x]", "positiveInt", "Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose).", 0, 1, doseNumber);
760          case -333053577: /*doseNumberString*/  return new Property("doseNumber[x]", "string", "Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose).", 0, 1, doseNumber);
761          case 1553560673: /*seriesDoses[x]*/  return new Property("seriesDoses[x]", "positiveInt|string", "The recommended number of doses to achieve immunity.", 0, 1, seriesDoses);
762          case -1936727105: /*seriesDoses*/  return new Property("seriesDoses[x]", "positiveInt|string", "The recommended number of doses to achieve immunity.", 0, 1, seriesDoses);
763          case -220897801: /*seriesDosesPositiveInt*/  return new Property("seriesDoses[x]", "positiveInt", "The recommended number of doses to achieve immunity.", 0, 1, seriesDoses);
764          case -673569616: /*seriesDosesString*/  return new Property("seriesDoses[x]", "string", "The recommended number of doses to achieve immunity.", 0, 1, seriesDoses);
765          case 1171592021: /*supportingImmunization*/  return new Property("supportingImmunization", "Reference(Immunization|ImmunizationEvaluation)", "Immunization event history and/or evaluation that supports the status and recommendation.", 0, java.lang.Integer.MAX_VALUE, supportingImmunization);
766          case -1234160646: /*supportingPatientInformation*/  return new Property("supportingPatientInformation", "Reference(Any)", "Patient Information that supports the status and recommendation.  This includes patient observations, adverse reactions and allergy/intolerance information.", 0, java.lang.Integer.MAX_VALUE, supportingPatientInformation);
767          default: return super.getNamedProperty(_hash, _name, _checkValid);
768          }
769
770        }
771
772      @Override
773      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
774        switch (hash) {
775        case 664556354: /*vaccineCode*/ return this.vaccineCode == null ? new Base[0] : this.vaccineCode.toArray(new Base[this.vaccineCode.size()]); // CodeableConcept
776        case -319593813: /*targetDisease*/ return this.targetDisease == null ? new Base[0] : new Base[] {this.targetDisease}; // CodeableConcept
777        case 571105240: /*contraindicatedVaccineCode*/ return this.contraindicatedVaccineCode == null ? new Base[0] : this.contraindicatedVaccineCode.toArray(new Base[this.contraindicatedVaccineCode.size()]); // CodeableConcept
778        case 1904598477: /*forecastStatus*/ return this.forecastStatus == null ? new Base[0] : new Base[] {this.forecastStatus}; // CodeableConcept
779        case 1862115359: /*forecastReason*/ return this.forecastReason == null ? new Base[0] : this.forecastReason.toArray(new Base[this.forecastReason.size()]); // CodeableConcept
780        case 2087518867: /*dateCriterion*/ return this.dateCriterion == null ? new Base[0] : this.dateCriterion.toArray(new Base[this.dateCriterion.size()]); // ImmunizationRecommendationRecommendationDateCriterionComponent
781        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
782        case -905838985: /*series*/ return this.series == null ? new Base[0] : new Base[] {this.series}; // StringType
783        case -887709242: /*doseNumber*/ return this.doseNumber == null ? new Base[0] : new Base[] {this.doseNumber}; // DataType
784        case -1936727105: /*seriesDoses*/ return this.seriesDoses == null ? new Base[0] : new Base[] {this.seriesDoses}; // DataType
785        case 1171592021: /*supportingImmunization*/ return this.supportingImmunization == null ? new Base[0] : this.supportingImmunization.toArray(new Base[this.supportingImmunization.size()]); // Reference
786        case -1234160646: /*supportingPatientInformation*/ return this.supportingPatientInformation == null ? new Base[0] : this.supportingPatientInformation.toArray(new Base[this.supportingPatientInformation.size()]); // Reference
787        default: return super.getProperty(hash, name, checkValid);
788        }
789
790      }
791
792      @Override
793      public Base setProperty(int hash, String name, Base value) throws FHIRException {
794        switch (hash) {
795        case 664556354: // vaccineCode
796          this.getVaccineCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
797          return value;
798        case -319593813: // targetDisease
799          this.targetDisease = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
800          return value;
801        case 571105240: // contraindicatedVaccineCode
802          this.getContraindicatedVaccineCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
803          return value;
804        case 1904598477: // forecastStatus
805          this.forecastStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
806          return value;
807        case 1862115359: // forecastReason
808          this.getForecastReason().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
809          return value;
810        case 2087518867: // dateCriterion
811          this.getDateCriterion().add((ImmunizationRecommendationRecommendationDateCriterionComponent) value); // ImmunizationRecommendationRecommendationDateCriterionComponent
812          return value;
813        case -1724546052: // description
814          this.description = TypeConvertor.castToString(value); // StringType
815          return value;
816        case -905838985: // series
817          this.series = TypeConvertor.castToString(value); // StringType
818          return value;
819        case -887709242: // doseNumber
820          this.doseNumber = TypeConvertor.castToType(value); // DataType
821          return value;
822        case -1936727105: // seriesDoses
823          this.seriesDoses = TypeConvertor.castToType(value); // DataType
824          return value;
825        case 1171592021: // supportingImmunization
826          this.getSupportingImmunization().add(TypeConvertor.castToReference(value)); // Reference
827          return value;
828        case -1234160646: // supportingPatientInformation
829          this.getSupportingPatientInformation().add(TypeConvertor.castToReference(value)); // Reference
830          return value;
831        default: return super.setProperty(hash, name, value);
832        }
833
834      }
835
836      @Override
837      public Base setProperty(String name, Base value) throws FHIRException {
838        if (name.equals("vaccineCode")) {
839          this.getVaccineCode().add(TypeConvertor.castToCodeableConcept(value));
840        } else if (name.equals("targetDisease")) {
841          this.targetDisease = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
842        } else if (name.equals("contraindicatedVaccineCode")) {
843          this.getContraindicatedVaccineCode().add(TypeConvertor.castToCodeableConcept(value));
844        } else if (name.equals("forecastStatus")) {
845          this.forecastStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
846        } else if (name.equals("forecastReason")) {
847          this.getForecastReason().add(TypeConvertor.castToCodeableConcept(value));
848        } else if (name.equals("dateCriterion")) {
849          this.getDateCriterion().add((ImmunizationRecommendationRecommendationDateCriterionComponent) value);
850        } else if (name.equals("description")) {
851          this.description = TypeConvertor.castToString(value); // StringType
852        } else if (name.equals("series")) {
853          this.series = TypeConvertor.castToString(value); // StringType
854        } else if (name.equals("doseNumber[x]")) {
855          this.doseNumber = TypeConvertor.castToType(value); // DataType
856        } else if (name.equals("seriesDoses[x]")) {
857          this.seriesDoses = TypeConvertor.castToType(value); // DataType
858        } else if (name.equals("supportingImmunization")) {
859          this.getSupportingImmunization().add(TypeConvertor.castToReference(value));
860        } else if (name.equals("supportingPatientInformation")) {
861          this.getSupportingPatientInformation().add(TypeConvertor.castToReference(value));
862        } else
863          return super.setProperty(name, value);
864        return value;
865      }
866
867      @Override
868      public Base makeProperty(int hash, String name) throws FHIRException {
869        switch (hash) {
870        case 664556354:  return addVaccineCode(); 
871        case -319593813:  return getTargetDisease();
872        case 571105240:  return addContraindicatedVaccineCode(); 
873        case 1904598477:  return getForecastStatus();
874        case 1862115359:  return addForecastReason(); 
875        case 2087518867:  return addDateCriterion(); 
876        case -1724546052:  return getDescriptionElement();
877        case -905838985:  return getSeriesElement();
878        case -1632295686:  return getDoseNumber();
879        case -887709242:  return getDoseNumber();
880        case 1553560673:  return getSeriesDoses();
881        case -1936727105:  return getSeriesDoses();
882        case 1171592021:  return addSupportingImmunization(); 
883        case -1234160646:  return addSupportingPatientInformation(); 
884        default: return super.makeProperty(hash, name);
885        }
886
887      }
888
889      @Override
890      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
891        switch (hash) {
892        case 664556354: /*vaccineCode*/ return new String[] {"CodeableConcept"};
893        case -319593813: /*targetDisease*/ return new String[] {"CodeableConcept"};
894        case 571105240: /*contraindicatedVaccineCode*/ return new String[] {"CodeableConcept"};
895        case 1904598477: /*forecastStatus*/ return new String[] {"CodeableConcept"};
896        case 1862115359: /*forecastReason*/ return new String[] {"CodeableConcept"};
897        case 2087518867: /*dateCriterion*/ return new String[] {};
898        case -1724546052: /*description*/ return new String[] {"string"};
899        case -905838985: /*series*/ return new String[] {"string"};
900        case -887709242: /*doseNumber*/ return new String[] {"positiveInt", "string"};
901        case -1936727105: /*seriesDoses*/ return new String[] {"positiveInt", "string"};
902        case 1171592021: /*supportingImmunization*/ return new String[] {"Reference"};
903        case -1234160646: /*supportingPatientInformation*/ return new String[] {"Reference"};
904        default: return super.getTypesForProperty(hash, name);
905        }
906
907      }
908
909      @Override
910      public Base addChild(String name) throws FHIRException {
911        if (name.equals("vaccineCode")) {
912          return addVaccineCode();
913        }
914        else if (name.equals("targetDisease")) {
915          this.targetDisease = new CodeableConcept();
916          return this.targetDisease;
917        }
918        else if (name.equals("contraindicatedVaccineCode")) {
919          return addContraindicatedVaccineCode();
920        }
921        else if (name.equals("forecastStatus")) {
922          this.forecastStatus = new CodeableConcept();
923          return this.forecastStatus;
924        }
925        else if (name.equals("forecastReason")) {
926          return addForecastReason();
927        }
928        else if (name.equals("dateCriterion")) {
929          return addDateCriterion();
930        }
931        else if (name.equals("description")) {
932          throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.recommendation.description");
933        }
934        else if (name.equals("series")) {
935          throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.recommendation.series");
936        }
937        else if (name.equals("doseNumberPositiveInt")) {
938          this.doseNumber = new PositiveIntType();
939          return this.doseNumber;
940        }
941        else if (name.equals("doseNumberString")) {
942          this.doseNumber = new StringType();
943          return this.doseNumber;
944        }
945        else if (name.equals("seriesDosesPositiveInt")) {
946          this.seriesDoses = new PositiveIntType();
947          return this.seriesDoses;
948        }
949        else if (name.equals("seriesDosesString")) {
950          this.seriesDoses = new StringType();
951          return this.seriesDoses;
952        }
953        else if (name.equals("supportingImmunization")) {
954          return addSupportingImmunization();
955        }
956        else if (name.equals("supportingPatientInformation")) {
957          return addSupportingPatientInformation();
958        }
959        else
960          return super.addChild(name);
961      }
962
963      public ImmunizationRecommendationRecommendationComponent copy() {
964        ImmunizationRecommendationRecommendationComponent dst = new ImmunizationRecommendationRecommendationComponent();
965        copyValues(dst);
966        return dst;
967      }
968
969      public void copyValues(ImmunizationRecommendationRecommendationComponent dst) {
970        super.copyValues(dst);
971        if (vaccineCode != null) {
972          dst.vaccineCode = new ArrayList<CodeableConcept>();
973          for (CodeableConcept i : vaccineCode)
974            dst.vaccineCode.add(i.copy());
975        };
976        dst.targetDisease = targetDisease == null ? null : targetDisease.copy();
977        if (contraindicatedVaccineCode != null) {
978          dst.contraindicatedVaccineCode = new ArrayList<CodeableConcept>();
979          for (CodeableConcept i : contraindicatedVaccineCode)
980            dst.contraindicatedVaccineCode.add(i.copy());
981        };
982        dst.forecastStatus = forecastStatus == null ? null : forecastStatus.copy();
983        if (forecastReason != null) {
984          dst.forecastReason = new ArrayList<CodeableConcept>();
985          for (CodeableConcept i : forecastReason)
986            dst.forecastReason.add(i.copy());
987        };
988        if (dateCriterion != null) {
989          dst.dateCriterion = new ArrayList<ImmunizationRecommendationRecommendationDateCriterionComponent>();
990          for (ImmunizationRecommendationRecommendationDateCriterionComponent i : dateCriterion)
991            dst.dateCriterion.add(i.copy());
992        };
993        dst.description = description == null ? null : description.copy();
994        dst.series = series == null ? null : series.copy();
995        dst.doseNumber = doseNumber == null ? null : doseNumber.copy();
996        dst.seriesDoses = seriesDoses == null ? null : seriesDoses.copy();
997        if (supportingImmunization != null) {
998          dst.supportingImmunization = new ArrayList<Reference>();
999          for (Reference i : supportingImmunization)
1000            dst.supportingImmunization.add(i.copy());
1001        };
1002        if (supportingPatientInformation != null) {
1003          dst.supportingPatientInformation = new ArrayList<Reference>();
1004          for (Reference i : supportingPatientInformation)
1005            dst.supportingPatientInformation.add(i.copy());
1006        };
1007      }
1008
1009      @Override
1010      public boolean equalsDeep(Base other_) {
1011        if (!super.equalsDeep(other_))
1012          return false;
1013        if (!(other_ instanceof ImmunizationRecommendationRecommendationComponent))
1014          return false;
1015        ImmunizationRecommendationRecommendationComponent o = (ImmunizationRecommendationRecommendationComponent) other_;
1016        return compareDeep(vaccineCode, o.vaccineCode, true) && compareDeep(targetDisease, o.targetDisease, true)
1017           && compareDeep(contraindicatedVaccineCode, o.contraindicatedVaccineCode, true) && compareDeep(forecastStatus, o.forecastStatus, true)
1018           && compareDeep(forecastReason, o.forecastReason, true) && compareDeep(dateCriterion, o.dateCriterion, true)
1019           && compareDeep(description, o.description, true) && compareDeep(series, o.series, true) && compareDeep(doseNumber, o.doseNumber, true)
1020           && compareDeep(seriesDoses, o.seriesDoses, true) && compareDeep(supportingImmunization, o.supportingImmunization, true)
1021           && compareDeep(supportingPatientInformation, o.supportingPatientInformation, true);
1022      }
1023
1024      @Override
1025      public boolean equalsShallow(Base other_) {
1026        if (!super.equalsShallow(other_))
1027          return false;
1028        if (!(other_ instanceof ImmunizationRecommendationRecommendationComponent))
1029          return false;
1030        ImmunizationRecommendationRecommendationComponent o = (ImmunizationRecommendationRecommendationComponent) other_;
1031        return compareValues(description, o.description, true) && compareValues(series, o.series, true);
1032      }
1033
1034      public boolean isEmpty() {
1035        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(vaccineCode, targetDisease
1036          , contraindicatedVaccineCode, forecastStatus, forecastReason, dateCriterion, description
1037          , series, doseNumber, seriesDoses, supportingImmunization, supportingPatientInformation
1038          );
1039      }
1040
1041  public String fhirType() {
1042    return "ImmunizationRecommendation.recommendation";
1043
1044  }
1045
1046  }
1047
1048    @Block()
1049    public static class ImmunizationRecommendationRecommendationDateCriterionComponent extends BackboneElement implements IBaseBackboneElement {
1050        /**
1051         * Date classification of recommendation.  For example, earliest date to give, latest date to give, etc.
1052         */
1053        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1054        @Description(shortDefinition="Type of date", formalDefinition="Date classification of recommendation.  For example, earliest date to give, latest date to give, etc." )
1055        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/immunization-recommendation-date-criterion")
1056        protected CodeableConcept code;
1057
1058        /**
1059         * The date whose meaning is specified by dateCriterion.code.
1060         */
1061        @Child(name = "value", type = {DateTimeType.class}, order=2, min=1, max=1, modifier=false, summary=false)
1062        @Description(shortDefinition="Recommended date", formalDefinition="The date whose meaning is specified by dateCriterion.code." )
1063        protected DateTimeType value;
1064
1065        private static final long serialVersionUID = 1036994566L;
1066
1067    /**
1068     * Constructor
1069     */
1070      public ImmunizationRecommendationRecommendationDateCriterionComponent() {
1071        super();
1072      }
1073
1074    /**
1075     * Constructor
1076     */
1077      public ImmunizationRecommendationRecommendationDateCriterionComponent(CodeableConcept code, Date value) {
1078        super();
1079        this.setCode(code);
1080        this.setValue(value);
1081      }
1082
1083        /**
1084         * @return {@link #code} (Date classification of recommendation.  For example, earliest date to give, latest date to give, etc.)
1085         */
1086        public CodeableConcept getCode() { 
1087          if (this.code == null)
1088            if (Configuration.errorOnAutoCreate())
1089              throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.code");
1090            else if (Configuration.doAutoCreate())
1091              this.code = new CodeableConcept(); // cc
1092          return this.code;
1093        }
1094
1095        public boolean hasCode() { 
1096          return this.code != null && !this.code.isEmpty();
1097        }
1098
1099        /**
1100         * @param value {@link #code} (Date classification of recommendation.  For example, earliest date to give, latest date to give, etc.)
1101         */
1102        public ImmunizationRecommendationRecommendationDateCriterionComponent setCode(CodeableConcept value) { 
1103          this.code = value;
1104          return this;
1105        }
1106
1107        /**
1108         * @return {@link #value} (The date whose meaning is specified by dateCriterion.code.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
1109         */
1110        public DateTimeType getValueElement() { 
1111          if (this.value == null)
1112            if (Configuration.errorOnAutoCreate())
1113              throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.value");
1114            else if (Configuration.doAutoCreate())
1115              this.value = new DateTimeType(); // bb
1116          return this.value;
1117        }
1118
1119        public boolean hasValueElement() { 
1120          return this.value != null && !this.value.isEmpty();
1121        }
1122
1123        public boolean hasValue() { 
1124          return this.value != null && !this.value.isEmpty();
1125        }
1126
1127        /**
1128         * @param value {@link #value} (The date whose meaning is specified by dateCriterion.code.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
1129         */
1130        public ImmunizationRecommendationRecommendationDateCriterionComponent setValueElement(DateTimeType value) { 
1131          this.value = value;
1132          return this;
1133        }
1134
1135        /**
1136         * @return The date whose meaning is specified by dateCriterion.code.
1137         */
1138        public Date getValue() { 
1139          return this.value == null ? null : this.value.getValue();
1140        }
1141
1142        /**
1143         * @param value The date whose meaning is specified by dateCriterion.code.
1144         */
1145        public ImmunizationRecommendationRecommendationDateCriterionComponent setValue(Date value) { 
1146            if (this.value == null)
1147              this.value = new DateTimeType();
1148            this.value.setValue(value);
1149          return this;
1150        }
1151
1152        protected void listChildren(List<Property> children) {
1153          super.listChildren(children);
1154          children.add(new Property("code", "CodeableConcept", "Date classification of recommendation.  For example, earliest date to give, latest date to give, etc.", 0, 1, code));
1155          children.add(new Property("value", "dateTime", "The date whose meaning is specified by dateCriterion.code.", 0, 1, value));
1156        }
1157
1158        @Override
1159        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1160          switch (_hash) {
1161          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Date classification of recommendation.  For example, earliest date to give, latest date to give, etc.", 0, 1, code);
1162          case 111972721: /*value*/  return new Property("value", "dateTime", "The date whose meaning is specified by dateCriterion.code.", 0, 1, value);
1163          default: return super.getNamedProperty(_hash, _name, _checkValid);
1164          }
1165
1166        }
1167
1168      @Override
1169      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1170        switch (hash) {
1171        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1172        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DateTimeType
1173        default: return super.getProperty(hash, name, checkValid);
1174        }
1175
1176      }
1177
1178      @Override
1179      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1180        switch (hash) {
1181        case 3059181: // code
1182          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1183          return value;
1184        case 111972721: // value
1185          this.value = TypeConvertor.castToDateTime(value); // DateTimeType
1186          return value;
1187        default: return super.setProperty(hash, name, value);
1188        }
1189
1190      }
1191
1192      @Override
1193      public Base setProperty(String name, Base value) throws FHIRException {
1194        if (name.equals("code")) {
1195          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1196        } else if (name.equals("value")) {
1197          this.value = TypeConvertor.castToDateTime(value); // DateTimeType
1198        } else
1199          return super.setProperty(name, value);
1200        return value;
1201      }
1202
1203      @Override
1204      public Base makeProperty(int hash, String name) throws FHIRException {
1205        switch (hash) {
1206        case 3059181:  return getCode();
1207        case 111972721:  return getValueElement();
1208        default: return super.makeProperty(hash, name);
1209        }
1210
1211      }
1212
1213      @Override
1214      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1215        switch (hash) {
1216        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1217        case 111972721: /*value*/ return new String[] {"dateTime"};
1218        default: return super.getTypesForProperty(hash, name);
1219        }
1220
1221      }
1222
1223      @Override
1224      public Base addChild(String name) throws FHIRException {
1225        if (name.equals("code")) {
1226          this.code = new CodeableConcept();
1227          return this.code;
1228        }
1229        else if (name.equals("value")) {
1230          throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.recommendation.dateCriterion.value");
1231        }
1232        else
1233          return super.addChild(name);
1234      }
1235
1236      public ImmunizationRecommendationRecommendationDateCriterionComponent copy() {
1237        ImmunizationRecommendationRecommendationDateCriterionComponent dst = new ImmunizationRecommendationRecommendationDateCriterionComponent();
1238        copyValues(dst);
1239        return dst;
1240      }
1241
1242      public void copyValues(ImmunizationRecommendationRecommendationDateCriterionComponent dst) {
1243        super.copyValues(dst);
1244        dst.code = code == null ? null : code.copy();
1245        dst.value = value == null ? null : value.copy();
1246      }
1247
1248      @Override
1249      public boolean equalsDeep(Base other_) {
1250        if (!super.equalsDeep(other_))
1251          return false;
1252        if (!(other_ instanceof ImmunizationRecommendationRecommendationDateCriterionComponent))
1253          return false;
1254        ImmunizationRecommendationRecommendationDateCriterionComponent o = (ImmunizationRecommendationRecommendationDateCriterionComponent) other_;
1255        return compareDeep(code, o.code, true) && compareDeep(value, o.value, true);
1256      }
1257
1258      @Override
1259      public boolean equalsShallow(Base other_) {
1260        if (!super.equalsShallow(other_))
1261          return false;
1262        if (!(other_ instanceof ImmunizationRecommendationRecommendationDateCriterionComponent))
1263          return false;
1264        ImmunizationRecommendationRecommendationDateCriterionComponent o = (ImmunizationRecommendationRecommendationDateCriterionComponent) other_;
1265        return compareValues(value, o.value, true);
1266      }
1267
1268      public boolean isEmpty() {
1269        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, value);
1270      }
1271
1272  public String fhirType() {
1273    return "ImmunizationRecommendation.recommendation.dateCriterion";
1274
1275  }
1276
1277  }
1278
1279    /**
1280     * A unique identifier assigned to this particular recommendation record.
1281     */
1282    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1283    @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this particular recommendation record." )
1284    protected List<Identifier> identifier;
1285
1286    /**
1287     * The patient the recommendation(s) are for.
1288     */
1289    @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true)
1290    @Description(shortDefinition="Who this profile is for", formalDefinition="The patient the recommendation(s) are for." )
1291    protected Reference patient;
1292
1293    /**
1294     * The date the immunization recommendation(s) were created.
1295     */
1296    @Child(name = "date", type = {DateTimeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
1297    @Description(shortDefinition="Date recommendation(s) created", formalDefinition="The date the immunization recommendation(s) were created." )
1298    protected DateTimeType date;
1299
1300    /**
1301     * Indicates the authority who published the protocol (e.g. ACIP).
1302     */
1303    @Child(name = "authority", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=false)
1304    @Description(shortDefinition="Who is responsible for protocol", formalDefinition="Indicates the authority who published the protocol (e.g. ACIP)." )
1305    protected Reference authority;
1306
1307    /**
1308     * Vaccine administration recommendations.
1309     */
1310    @Child(name = "recommendation", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1311    @Description(shortDefinition="Vaccine administration recommendations", formalDefinition="Vaccine administration recommendations." )
1312    protected List<ImmunizationRecommendationRecommendationComponent> recommendation;
1313
1314    private static final long serialVersionUID = 534427937L;
1315
1316  /**
1317   * Constructor
1318   */
1319    public ImmunizationRecommendation() {
1320      super();
1321    }
1322
1323  /**
1324   * Constructor
1325   */
1326    public ImmunizationRecommendation(Reference patient, Date date, ImmunizationRecommendationRecommendationComponent recommendation) {
1327      super();
1328      this.setPatient(patient);
1329      this.setDate(date);
1330      this.addRecommendation(recommendation);
1331    }
1332
1333    /**
1334     * @return {@link #identifier} (A unique identifier assigned to this particular recommendation record.)
1335     */
1336    public List<Identifier> getIdentifier() { 
1337      if (this.identifier == null)
1338        this.identifier = new ArrayList<Identifier>();
1339      return this.identifier;
1340    }
1341
1342    /**
1343     * @return Returns a reference to <code>this</code> for easy method chaining
1344     */
1345    public ImmunizationRecommendation setIdentifier(List<Identifier> theIdentifier) { 
1346      this.identifier = theIdentifier;
1347      return this;
1348    }
1349
1350    public boolean hasIdentifier() { 
1351      if (this.identifier == null)
1352        return false;
1353      for (Identifier item : this.identifier)
1354        if (!item.isEmpty())
1355          return true;
1356      return false;
1357    }
1358
1359    public Identifier addIdentifier() { //3
1360      Identifier t = new Identifier();
1361      if (this.identifier == null)
1362        this.identifier = new ArrayList<Identifier>();
1363      this.identifier.add(t);
1364      return t;
1365    }
1366
1367    public ImmunizationRecommendation addIdentifier(Identifier t) { //3
1368      if (t == null)
1369        return this;
1370      if (this.identifier == null)
1371        this.identifier = new ArrayList<Identifier>();
1372      this.identifier.add(t);
1373      return this;
1374    }
1375
1376    /**
1377     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1378     */
1379    public Identifier getIdentifierFirstRep() { 
1380      if (getIdentifier().isEmpty()) {
1381        addIdentifier();
1382      }
1383      return getIdentifier().get(0);
1384    }
1385
1386    /**
1387     * @return {@link #patient} (The patient the recommendation(s) are for.)
1388     */
1389    public Reference getPatient() { 
1390      if (this.patient == null)
1391        if (Configuration.errorOnAutoCreate())
1392          throw new Error("Attempt to auto-create ImmunizationRecommendation.patient");
1393        else if (Configuration.doAutoCreate())
1394          this.patient = new Reference(); // cc
1395      return this.patient;
1396    }
1397
1398    public boolean hasPatient() { 
1399      return this.patient != null && !this.patient.isEmpty();
1400    }
1401
1402    /**
1403     * @param value {@link #patient} (The patient the recommendation(s) are for.)
1404     */
1405    public ImmunizationRecommendation setPatient(Reference value) { 
1406      this.patient = value;
1407      return this;
1408    }
1409
1410    /**
1411     * @return {@link #date} (The date the immunization recommendation(s) were created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1412     */
1413    public DateTimeType getDateElement() { 
1414      if (this.date == null)
1415        if (Configuration.errorOnAutoCreate())
1416          throw new Error("Attempt to auto-create ImmunizationRecommendation.date");
1417        else if (Configuration.doAutoCreate())
1418          this.date = new DateTimeType(); // bb
1419      return this.date;
1420    }
1421
1422    public boolean hasDateElement() { 
1423      return this.date != null && !this.date.isEmpty();
1424    }
1425
1426    public boolean hasDate() { 
1427      return this.date != null && !this.date.isEmpty();
1428    }
1429
1430    /**
1431     * @param value {@link #date} (The date the immunization recommendation(s) were created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1432     */
1433    public ImmunizationRecommendation setDateElement(DateTimeType value) { 
1434      this.date = value;
1435      return this;
1436    }
1437
1438    /**
1439     * @return The date the immunization recommendation(s) were created.
1440     */
1441    public Date getDate() { 
1442      return this.date == null ? null : this.date.getValue();
1443    }
1444
1445    /**
1446     * @param value The date the immunization recommendation(s) were created.
1447     */
1448    public ImmunizationRecommendation setDate(Date value) { 
1449        if (this.date == null)
1450          this.date = new DateTimeType();
1451        this.date.setValue(value);
1452      return this;
1453    }
1454
1455    /**
1456     * @return {@link #authority} (Indicates the authority who published the protocol (e.g. ACIP).)
1457     */
1458    public Reference getAuthority() { 
1459      if (this.authority == null)
1460        if (Configuration.errorOnAutoCreate())
1461          throw new Error("Attempt to auto-create ImmunizationRecommendation.authority");
1462        else if (Configuration.doAutoCreate())
1463          this.authority = new Reference(); // cc
1464      return this.authority;
1465    }
1466
1467    public boolean hasAuthority() { 
1468      return this.authority != null && !this.authority.isEmpty();
1469    }
1470
1471    /**
1472     * @param value {@link #authority} (Indicates the authority who published the protocol (e.g. ACIP).)
1473     */
1474    public ImmunizationRecommendation setAuthority(Reference value) { 
1475      this.authority = value;
1476      return this;
1477    }
1478
1479    /**
1480     * @return {@link #recommendation} (Vaccine administration recommendations.)
1481     */
1482    public List<ImmunizationRecommendationRecommendationComponent> getRecommendation() { 
1483      if (this.recommendation == null)
1484        this.recommendation = new ArrayList<ImmunizationRecommendationRecommendationComponent>();
1485      return this.recommendation;
1486    }
1487
1488    /**
1489     * @return Returns a reference to <code>this</code> for easy method chaining
1490     */
1491    public ImmunizationRecommendation setRecommendation(List<ImmunizationRecommendationRecommendationComponent> theRecommendation) { 
1492      this.recommendation = theRecommendation;
1493      return this;
1494    }
1495
1496    public boolean hasRecommendation() { 
1497      if (this.recommendation == null)
1498        return false;
1499      for (ImmunizationRecommendationRecommendationComponent item : this.recommendation)
1500        if (!item.isEmpty())
1501          return true;
1502      return false;
1503    }
1504
1505    public ImmunizationRecommendationRecommendationComponent addRecommendation() { //3
1506      ImmunizationRecommendationRecommendationComponent t = new ImmunizationRecommendationRecommendationComponent();
1507      if (this.recommendation == null)
1508        this.recommendation = new ArrayList<ImmunizationRecommendationRecommendationComponent>();
1509      this.recommendation.add(t);
1510      return t;
1511    }
1512
1513    public ImmunizationRecommendation addRecommendation(ImmunizationRecommendationRecommendationComponent t) { //3
1514      if (t == null)
1515        return this;
1516      if (this.recommendation == null)
1517        this.recommendation = new ArrayList<ImmunizationRecommendationRecommendationComponent>();
1518      this.recommendation.add(t);
1519      return this;
1520    }
1521
1522    /**
1523     * @return The first repetition of repeating field {@link #recommendation}, creating it if it does not already exist {3}
1524     */
1525    public ImmunizationRecommendationRecommendationComponent getRecommendationFirstRep() { 
1526      if (getRecommendation().isEmpty()) {
1527        addRecommendation();
1528      }
1529      return getRecommendation().get(0);
1530    }
1531
1532      protected void listChildren(List<Property> children) {
1533        super.listChildren(children);
1534        children.add(new Property("identifier", "Identifier", "A unique identifier assigned to this particular recommendation record.", 0, java.lang.Integer.MAX_VALUE, identifier));
1535        children.add(new Property("patient", "Reference(Patient)", "The patient the recommendation(s) are for.", 0, 1, patient));
1536        children.add(new Property("date", "dateTime", "The date the immunization recommendation(s) were created.", 0, 1, date));
1537        children.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol (e.g. ACIP).", 0, 1, authority));
1538        children.add(new Property("recommendation", "", "Vaccine administration recommendations.", 0, java.lang.Integer.MAX_VALUE, recommendation));
1539      }
1540
1541      @Override
1542      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1543        switch (_hash) {
1544        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier assigned to this particular recommendation record.", 0, java.lang.Integer.MAX_VALUE, identifier);
1545        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "The patient the recommendation(s) are for.", 0, 1, patient);
1546        case 3076014: /*date*/  return new Property("date", "dateTime", "The date the immunization recommendation(s) were created.", 0, 1, date);
1547        case 1475610435: /*authority*/  return new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol (e.g. ACIP).", 0, 1, authority);
1548        case -1028636743: /*recommendation*/  return new Property("recommendation", "", "Vaccine administration recommendations.", 0, java.lang.Integer.MAX_VALUE, recommendation);
1549        default: return super.getNamedProperty(_hash, _name, _checkValid);
1550        }
1551
1552      }
1553
1554      @Override
1555      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1556        switch (hash) {
1557        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1558        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
1559        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
1560        case 1475610435: /*authority*/ return this.authority == null ? new Base[0] : new Base[] {this.authority}; // Reference
1561        case -1028636743: /*recommendation*/ return this.recommendation == null ? new Base[0] : this.recommendation.toArray(new Base[this.recommendation.size()]); // ImmunizationRecommendationRecommendationComponent
1562        default: return super.getProperty(hash, name, checkValid);
1563        }
1564
1565      }
1566
1567      @Override
1568      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1569        switch (hash) {
1570        case -1618432855: // identifier
1571          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1572          return value;
1573        case -791418107: // patient
1574          this.patient = TypeConvertor.castToReference(value); // Reference
1575          return value;
1576        case 3076014: // date
1577          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
1578          return value;
1579        case 1475610435: // authority
1580          this.authority = TypeConvertor.castToReference(value); // Reference
1581          return value;
1582        case -1028636743: // recommendation
1583          this.getRecommendation().add((ImmunizationRecommendationRecommendationComponent) value); // ImmunizationRecommendationRecommendationComponent
1584          return value;
1585        default: return super.setProperty(hash, name, value);
1586        }
1587
1588      }
1589
1590      @Override
1591      public Base setProperty(String name, Base value) throws FHIRException {
1592        if (name.equals("identifier")) {
1593          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1594        } else if (name.equals("patient")) {
1595          this.patient = TypeConvertor.castToReference(value); // Reference
1596        } else if (name.equals("date")) {
1597          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
1598        } else if (name.equals("authority")) {
1599          this.authority = TypeConvertor.castToReference(value); // Reference
1600        } else if (name.equals("recommendation")) {
1601          this.getRecommendation().add((ImmunizationRecommendationRecommendationComponent) value);
1602        } else
1603          return super.setProperty(name, value);
1604        return value;
1605      }
1606
1607      @Override
1608      public Base makeProperty(int hash, String name) throws FHIRException {
1609        switch (hash) {
1610        case -1618432855:  return addIdentifier(); 
1611        case -791418107:  return getPatient();
1612        case 3076014:  return getDateElement();
1613        case 1475610435:  return getAuthority();
1614        case -1028636743:  return addRecommendation(); 
1615        default: return super.makeProperty(hash, name);
1616        }
1617
1618      }
1619
1620      @Override
1621      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1622        switch (hash) {
1623        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1624        case -791418107: /*patient*/ return new String[] {"Reference"};
1625        case 3076014: /*date*/ return new String[] {"dateTime"};
1626        case 1475610435: /*authority*/ return new String[] {"Reference"};
1627        case -1028636743: /*recommendation*/ return new String[] {};
1628        default: return super.getTypesForProperty(hash, name);
1629        }
1630
1631      }
1632
1633      @Override
1634      public Base addChild(String name) throws FHIRException {
1635        if (name.equals("identifier")) {
1636          return addIdentifier();
1637        }
1638        else if (name.equals("patient")) {
1639          this.patient = new Reference();
1640          return this.patient;
1641        }
1642        else if (name.equals("date")) {
1643          throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.date");
1644        }
1645        else if (name.equals("authority")) {
1646          this.authority = new Reference();
1647          return this.authority;
1648        }
1649        else if (name.equals("recommendation")) {
1650          return addRecommendation();
1651        }
1652        else
1653          return super.addChild(name);
1654      }
1655
1656  public String fhirType() {
1657    return "ImmunizationRecommendation";
1658
1659  }
1660
1661      public ImmunizationRecommendation copy() {
1662        ImmunizationRecommendation dst = new ImmunizationRecommendation();
1663        copyValues(dst);
1664        return dst;
1665      }
1666
1667      public void copyValues(ImmunizationRecommendation dst) {
1668        super.copyValues(dst);
1669        if (identifier != null) {
1670          dst.identifier = new ArrayList<Identifier>();
1671          for (Identifier i : identifier)
1672            dst.identifier.add(i.copy());
1673        };
1674        dst.patient = patient == null ? null : patient.copy();
1675        dst.date = date == null ? null : date.copy();
1676        dst.authority = authority == null ? null : authority.copy();
1677        if (recommendation != null) {
1678          dst.recommendation = new ArrayList<ImmunizationRecommendationRecommendationComponent>();
1679          for (ImmunizationRecommendationRecommendationComponent i : recommendation)
1680            dst.recommendation.add(i.copy());
1681        };
1682      }
1683
1684      protected ImmunizationRecommendation typedCopy() {
1685        return copy();
1686      }
1687
1688      @Override
1689      public boolean equalsDeep(Base other_) {
1690        if (!super.equalsDeep(other_))
1691          return false;
1692        if (!(other_ instanceof ImmunizationRecommendation))
1693          return false;
1694        ImmunizationRecommendation o = (ImmunizationRecommendation) other_;
1695        return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(date, o.date, true)
1696           && compareDeep(authority, o.authority, true) && compareDeep(recommendation, o.recommendation, true)
1697          ;
1698      }
1699
1700      @Override
1701      public boolean equalsShallow(Base other_) {
1702        if (!super.equalsShallow(other_))
1703          return false;
1704        if (!(other_ instanceof ImmunizationRecommendation))
1705          return false;
1706        ImmunizationRecommendation o = (ImmunizationRecommendation) other_;
1707        return compareValues(date, o.date, true);
1708      }
1709
1710      public boolean isEmpty() {
1711        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, patient, date
1712          , authority, recommendation);
1713      }
1714
1715  @Override
1716  public ResourceType getResourceType() {
1717    return ResourceType.ImmunizationRecommendation;
1718   }
1719
1720 /**
1721   * Search parameter: <b>date</b>
1722   * <p>
1723   * Description: <b>Date recommendation(s) created</b><br>
1724   * Type: <b>date</b><br>
1725   * Path: <b>ImmunizationRecommendation.date</b><br>
1726   * </p>
1727   */
1728  @SearchParamDefinition(name="date", path="ImmunizationRecommendation.date", description="Date recommendation(s) created", type="date" )
1729  public static final String SP_DATE = "date";
1730 /**
1731   * <b>Fluent Client</b> search parameter constant for <b>date</b>
1732   * <p>
1733   * Description: <b>Date recommendation(s) created</b><br>
1734   * Type: <b>date</b><br>
1735   * Path: <b>ImmunizationRecommendation.date</b><br>
1736   * </p>
1737   */
1738  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
1739
1740 /**
1741   * Search parameter: <b>identifier</b>
1742   * <p>
1743   * Description: <b>Business identifier</b><br>
1744   * Type: <b>token</b><br>
1745   * Path: <b>ImmunizationRecommendation.identifier</b><br>
1746   * </p>
1747   */
1748  @SearchParamDefinition(name="identifier", path="ImmunizationRecommendation.identifier", description="Business identifier", type="token" )
1749  public static final String SP_IDENTIFIER = "identifier";
1750 /**
1751   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1752   * <p>
1753   * Description: <b>Business identifier</b><br>
1754   * Type: <b>token</b><br>
1755   * Path: <b>ImmunizationRecommendation.identifier</b><br>
1756   * </p>
1757   */
1758  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1759
1760 /**
1761   * Search parameter: <b>information</b>
1762   * <p>
1763   * Description: <b>Patient observations supporting recommendation</b><br>
1764   * Type: <b>reference</b><br>
1765   * Path: <b>ImmunizationRecommendation.recommendation.supportingPatientInformation</b><br>
1766   * </p>
1767   */
1768  @SearchParamDefinition(name="information", path="ImmunizationRecommendation.recommendation.supportingPatientInformation", description="Patient observations supporting recommendation", type="reference", target={Account.class, ActivityDefinition.class, AdministrableProductDefinition.class, AdverseEvent.class, AllergyIntolerance.class, Appointment.class, AppointmentResponse.class, AuditEvent.class, Basic.class, Binary.class, BiologicallyDerivedProduct.class, BodyStructure.class, Bundle.class, CapabilityStatement.class, CarePlan.class, CareTeam.class, CatalogEntry.class, ChargeItem.class, ChargeItemDefinition.class, Citation.class, Claim.class, ClaimResponse.class, ClinicalImpression.class, ClinicalUseDefinition.class, CodeSystem.class, Communication.class, CommunicationRequest.class, CompartmentDefinition.class, Composition.class, ConceptMap.class, Condition.class, Consent.class, Contract.class, Coverage.class, CoverageEligibilityRequest.class, CoverageEligibilityResponse.class, DetectedIssue.class, Device.class, DeviceDefinition.class, DeviceMetric.class, DeviceRequest.class, DeviceUseStatement.class, DiagnosticReport.class, DocumentManifest.class, DocumentReference.class, Encounter.class, Endpoint.class, EnrollmentRequest.class, EnrollmentResponse.class, EpisodeOfCare.class, EventDefinition.class, Evidence.class, EvidenceReport.class, EvidenceVariable.class, ExampleScenario.class, ExplanationOfBenefit.class, FamilyMemberHistory.class, Flag.class, Goal.class, GraphDefinition.class, Group.class, GuidanceResponse.class, HealthcareService.class, ImagingStudy.class, Immunization.class, ImmunizationEvaluation.class, ImmunizationRecommendation.class, ImplementationGuide.class, Ingredient.class, InsurancePlan.class, Invoice.class, Library.class, Linkage.class, ListResource.class, Location.class, ManufacturedItemDefinition.class, Measure.class, MeasureReport.class, Media.class, Medication.class, MedicationAdministration.class, MedicationDispense.class, MedicationKnowledge.class, MedicationRequest.class, MedicationStatement.class, MedicinalProductDefinition.class, MessageDefinition.class, MessageHeader.class, MolecularSequence.class, NamingSystem.class, NutritionOrder.class, NutritionProduct.class, Observation.class, ObservationDefinition.class, OperationDefinition.class, OperationOutcome.class, Organization.class, OrganizationAffiliation.class, PackagedProductDefinition.class, Patient.class, PaymentNotice.class, PaymentReconciliation.class, Person.class, PlanDefinition.class, Practitioner.class, PractitionerRole.class, Procedure.class, Provenance.class, Questionnaire.class, QuestionnaireResponse.class, RegulatedAuthorization.class, RelatedPerson.class, RequestGroup.class, ResearchDefinition.class, ResearchElementDefinition.class, ResearchStudy.class, ResearchSubject.class, RiskAssessment.class, Schedule.class, SearchParameter.class, ServiceRequest.class, Slot.class, Specimen.class, SpecimenDefinition.class, StructureDefinition.class, StructureMap.class, Subscription.class, SubscriptionStatus.class, SubscriptionTopic.class, Substance.class, SubstanceDefinition.class, SupplyDelivery.class, SupplyRequest.class, Task.class, TerminologyCapabilities.class, TestReport.class, TestScript.class, ValueSet.class, VerificationResult.class, VisionPrescription.class } )
1769  public static final String SP_INFORMATION = "information";
1770 /**
1771   * <b>Fluent Client</b> search parameter constant for <b>information</b>
1772   * <p>
1773   * Description: <b>Patient observations supporting recommendation</b><br>
1774   * Type: <b>reference</b><br>
1775   * Path: <b>ImmunizationRecommendation.recommendation.supportingPatientInformation</b><br>
1776   * </p>
1777   */
1778  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INFORMATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INFORMATION);
1779
1780/**
1781   * Constant for fluent queries to be used to add include statements. Specifies
1782   * the path value of "<b>ImmunizationRecommendation:information</b>".
1783   */
1784  public static final ca.uhn.fhir.model.api.Include INCLUDE_INFORMATION = new ca.uhn.fhir.model.api.Include("ImmunizationRecommendation:information").toLocked();
1785
1786 /**
1787   * Search parameter: <b>patient</b>
1788   * <p>
1789   * Description: <b>Who this profile is for</b><br>
1790   * Type: <b>reference</b><br>
1791   * Path: <b>ImmunizationRecommendation.patient</b><br>
1792   * </p>
1793   */
1794  @SearchParamDefinition(name="patient", path="ImmunizationRecommendation.patient", description="Who this profile is for", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Patient.class } )
1795  public static final String SP_PATIENT = "patient";
1796 /**
1797   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1798   * <p>
1799   * Description: <b>Who this profile is for</b><br>
1800   * Type: <b>reference</b><br>
1801   * Path: <b>ImmunizationRecommendation.patient</b><br>
1802   * </p>
1803   */
1804  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
1805
1806/**
1807   * Constant for fluent queries to be used to add include statements. Specifies
1808   * the path value of "<b>ImmunizationRecommendation:patient</b>".
1809   */
1810  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ImmunizationRecommendation:patient").toLocked();
1811
1812 /**
1813   * Search parameter: <b>status</b>
1814   * <p>
1815   * Description: <b>Vaccine recommendation status</b><br>
1816   * Type: <b>token</b><br>
1817   * Path: <b>ImmunizationRecommendation.recommendation.forecastStatus</b><br>
1818   * </p>
1819   */
1820  @SearchParamDefinition(name="status", path="ImmunizationRecommendation.recommendation.forecastStatus", description="Vaccine recommendation status", type="token" )
1821  public static final String SP_STATUS = "status";
1822 /**
1823   * <b>Fluent Client</b> search parameter constant for <b>status</b>
1824   * <p>
1825   * Description: <b>Vaccine recommendation status</b><br>
1826   * Type: <b>token</b><br>
1827   * Path: <b>ImmunizationRecommendation.recommendation.forecastStatus</b><br>
1828   * </p>
1829   */
1830  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
1831
1832 /**
1833   * Search parameter: <b>support</b>
1834   * <p>
1835   * Description: <b>Past immunizations supporting recommendation</b><br>
1836   * Type: <b>reference</b><br>
1837   * Path: <b>ImmunizationRecommendation.recommendation.supportingImmunization</b><br>
1838   * </p>
1839   */
1840  @SearchParamDefinition(name="support", path="ImmunizationRecommendation.recommendation.supportingImmunization", description="Past immunizations supporting recommendation", type="reference", target={Immunization.class, ImmunizationEvaluation.class } )
1841  public static final String SP_SUPPORT = "support";
1842 /**
1843   * <b>Fluent Client</b> search parameter constant for <b>support</b>
1844   * <p>
1845   * Description: <b>Past immunizations supporting recommendation</b><br>
1846   * Type: <b>reference</b><br>
1847   * Path: <b>ImmunizationRecommendation.recommendation.supportingImmunization</b><br>
1848   * </p>
1849   */
1850  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPORT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUPPORT);
1851
1852/**
1853   * Constant for fluent queries to be used to add include statements. Specifies
1854   * the path value of "<b>ImmunizationRecommendation:support</b>".
1855   */
1856  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPORT = new ca.uhn.fhir.model.api.Include("ImmunizationRecommendation:support").toLocked();
1857
1858 /**
1859   * Search parameter: <b>target-disease</b>
1860   * <p>
1861   * Description: <b>Disease to be immunized against</b><br>
1862   * Type: <b>token</b><br>
1863   * Path: <b>ImmunizationRecommendation.recommendation.targetDisease</b><br>
1864   * </p>
1865   */
1866  @SearchParamDefinition(name="target-disease", path="ImmunizationRecommendation.recommendation.targetDisease", description="Disease to be immunized against", type="token" )
1867  public static final String SP_TARGET_DISEASE = "target-disease";
1868 /**
1869   * <b>Fluent Client</b> search parameter constant for <b>target-disease</b>
1870   * <p>
1871   * Description: <b>Disease to be immunized against</b><br>
1872   * Type: <b>token</b><br>
1873   * Path: <b>ImmunizationRecommendation.recommendation.targetDisease</b><br>
1874   * </p>
1875   */
1876  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TARGET_DISEASE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TARGET_DISEASE);
1877
1878 /**
1879   * Search parameter: <b>vaccine-type</b>
1880   * <p>
1881   * Description: <b>Vaccine  or vaccine group recommendation applies to</b><br>
1882   * Type: <b>token</b><br>
1883   * Path: <b>ImmunizationRecommendation.recommendation.vaccineCode</b><br>
1884   * </p>
1885   */
1886  @SearchParamDefinition(name="vaccine-type", path="ImmunizationRecommendation.recommendation.vaccineCode", description="Vaccine  or vaccine group recommendation applies to", type="token" )
1887  public static final String SP_VACCINE_TYPE = "vaccine-type";
1888 /**
1889   * <b>Fluent Client</b> search parameter constant for <b>vaccine-type</b>
1890   * <p>
1891   * Description: <b>Vaccine  or vaccine group recommendation applies to</b><br>
1892   * Type: <b>token</b><br>
1893   * Path: <b>ImmunizationRecommendation.recommendation.vaccineCode</b><br>
1894   * </p>
1895   */
1896  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VACCINE_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VACCINE_TYPE);
1897
1898
1899}
1900