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