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