001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 28, 2021 07:16+1100 for FHIR v5.0.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * The Citation Resource enables reference to any knowledge artifact for purposes of identification and attribution. The Citation Resource supports existing reference structures and developing publication practices such as versioning, expressing complex contributorship roles, and referencing computable resources.
052 */
053@ResourceDef(name="Citation", profile="http://hl7.org/fhir/StructureDefinition/Citation")
054public class Citation extends MetadataResource {
055
056    @Block()
057    public static class CitationSummaryComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * Format for display of the citation.
060         */
061        @Child(name = "style", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
062        @Description(shortDefinition="Format for display of the citation", formalDefinition="Format for display of the citation." )
063        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-summary-style")
064        protected CodeableConcept style;
065
066        /**
067         * The human-readable display of the citation.
068         */
069        @Child(name = "text", type = {MarkdownType.class}, order=2, min=1, max=1, modifier=false, summary=true)
070        @Description(shortDefinition="The human-readable display of the citation", formalDefinition="The human-readable display of the citation." )
071        protected MarkdownType text;
072
073        private static final long serialVersionUID = 123416446L;
074
075    /**
076     * Constructor
077     */
078      public CitationSummaryComponent() {
079        super();
080      }
081
082    /**
083     * Constructor
084     */
085      public CitationSummaryComponent(String text) {
086        super();
087        this.setText(text);
088      }
089
090        /**
091         * @return {@link #style} (Format for display of the citation.)
092         */
093        public CodeableConcept getStyle() { 
094          if (this.style == null)
095            if (Configuration.errorOnAutoCreate())
096              throw new Error("Attempt to auto-create CitationSummaryComponent.style");
097            else if (Configuration.doAutoCreate())
098              this.style = new CodeableConcept(); // cc
099          return this.style;
100        }
101
102        public boolean hasStyle() { 
103          return this.style != null && !this.style.isEmpty();
104        }
105
106        /**
107         * @param value {@link #style} (Format for display of the citation.)
108         */
109        public CitationSummaryComponent setStyle(CodeableConcept value) { 
110          this.style = value;
111          return this;
112        }
113
114        /**
115         * @return {@link #text} (The human-readable display of the citation.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
116         */
117        public MarkdownType getTextElement() { 
118          if (this.text == null)
119            if (Configuration.errorOnAutoCreate())
120              throw new Error("Attempt to auto-create CitationSummaryComponent.text");
121            else if (Configuration.doAutoCreate())
122              this.text = new MarkdownType(); // bb
123          return this.text;
124        }
125
126        public boolean hasTextElement() { 
127          return this.text != null && !this.text.isEmpty();
128        }
129
130        public boolean hasText() { 
131          return this.text != null && !this.text.isEmpty();
132        }
133
134        /**
135         * @param value {@link #text} (The human-readable display of the citation.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
136         */
137        public CitationSummaryComponent setTextElement(MarkdownType value) { 
138          this.text = value;
139          return this;
140        }
141
142        /**
143         * @return The human-readable display of the citation.
144         */
145        public String getText() { 
146          return this.text == null ? null : this.text.getValue();
147        }
148
149        /**
150         * @param value The human-readable display of the citation.
151         */
152        public CitationSummaryComponent setText(String value) { 
153            if (this.text == null)
154              this.text = new MarkdownType();
155            this.text.setValue(value);
156          return this;
157        }
158
159        protected void listChildren(List<Property> children) {
160          super.listChildren(children);
161          children.add(new Property("style", "CodeableConcept", "Format for display of the citation.", 0, 1, style));
162          children.add(new Property("text", "markdown", "The human-readable display of the citation.", 0, 1, text));
163        }
164
165        @Override
166        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
167          switch (_hash) {
168          case 109780401: /*style*/  return new Property("style", "CodeableConcept", "Format for display of the citation.", 0, 1, style);
169          case 3556653: /*text*/  return new Property("text", "markdown", "The human-readable display of the citation.", 0, 1, text);
170          default: return super.getNamedProperty(_hash, _name, _checkValid);
171          }
172
173        }
174
175      @Override
176      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
177        switch (hash) {
178        case 109780401: /*style*/ return this.style == null ? new Base[0] : new Base[] {this.style}; // CodeableConcept
179        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // MarkdownType
180        default: return super.getProperty(hash, name, checkValid);
181        }
182
183      }
184
185      @Override
186      public Base setProperty(int hash, String name, Base value) throws FHIRException {
187        switch (hash) {
188        case 109780401: // style
189          this.style = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
190          return value;
191        case 3556653: // text
192          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
193          return value;
194        default: return super.setProperty(hash, name, value);
195        }
196
197      }
198
199      @Override
200      public Base setProperty(String name, Base value) throws FHIRException {
201        if (name.equals("style")) {
202          this.style = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
203        } else if (name.equals("text")) {
204          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
205        } else
206          return super.setProperty(name, value);
207        return value;
208      }
209
210      @Override
211      public Base makeProperty(int hash, String name) throws FHIRException {
212        switch (hash) {
213        case 109780401:  return getStyle();
214        case 3556653:  return getTextElement();
215        default: return super.makeProperty(hash, name);
216        }
217
218      }
219
220      @Override
221      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
222        switch (hash) {
223        case 109780401: /*style*/ return new String[] {"CodeableConcept"};
224        case 3556653: /*text*/ return new String[] {"markdown"};
225        default: return super.getTypesForProperty(hash, name);
226        }
227
228      }
229
230      @Override
231      public Base addChild(String name) throws FHIRException {
232        if (name.equals("style")) {
233          this.style = new CodeableConcept();
234          return this.style;
235        }
236        else if (name.equals("text")) {
237          throw new FHIRException("Cannot call addChild on a primitive type Citation.summary.text");
238        }
239        else
240          return super.addChild(name);
241      }
242
243      public CitationSummaryComponent copy() {
244        CitationSummaryComponent dst = new CitationSummaryComponent();
245        copyValues(dst);
246        return dst;
247      }
248
249      public void copyValues(CitationSummaryComponent dst) {
250        super.copyValues(dst);
251        dst.style = style == null ? null : style.copy();
252        dst.text = text == null ? null : text.copy();
253      }
254
255      @Override
256      public boolean equalsDeep(Base other_) {
257        if (!super.equalsDeep(other_))
258          return false;
259        if (!(other_ instanceof CitationSummaryComponent))
260          return false;
261        CitationSummaryComponent o = (CitationSummaryComponent) other_;
262        return compareDeep(style, o.style, true) && compareDeep(text, o.text, true);
263      }
264
265      @Override
266      public boolean equalsShallow(Base other_) {
267        if (!super.equalsShallow(other_))
268          return false;
269        if (!(other_ instanceof CitationSummaryComponent))
270          return false;
271        CitationSummaryComponent o = (CitationSummaryComponent) other_;
272        return compareValues(text, o.text, true);
273      }
274
275      public boolean isEmpty() {
276        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(style, text);
277      }
278
279  public String fhirType() {
280    return "Citation.summary";
281
282  }
283
284  }
285
286    @Block()
287    public static class CitationClassificationComponent extends BackboneElement implements IBaseBackboneElement {
288        /**
289         * The kind of classifier (e.g. publication type, keyword).
290         */
291        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
292        @Description(shortDefinition="The kind of classifier (e.g. publication type, keyword)", formalDefinition="The kind of classifier (e.g. publication type, keyword)." )
293        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-classification-type")
294        protected CodeableConcept type;
295
296        /**
297         * The specific classification value.
298         */
299        @Child(name = "classifier", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
300        @Description(shortDefinition="The specific classification value", formalDefinition="The specific classification value." )
301        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-artifact-classifier")
302        protected List<CodeableConcept> classifier;
303
304        private static final long serialVersionUID = -283121869L;
305
306    /**
307     * Constructor
308     */
309      public CitationClassificationComponent() {
310        super();
311      }
312
313        /**
314         * @return {@link #type} (The kind of classifier (e.g. publication type, keyword).)
315         */
316        public CodeableConcept getType() { 
317          if (this.type == null)
318            if (Configuration.errorOnAutoCreate())
319              throw new Error("Attempt to auto-create CitationClassificationComponent.type");
320            else if (Configuration.doAutoCreate())
321              this.type = new CodeableConcept(); // cc
322          return this.type;
323        }
324
325        public boolean hasType() { 
326          return this.type != null && !this.type.isEmpty();
327        }
328
329        /**
330         * @param value {@link #type} (The kind of classifier (e.g. publication type, keyword).)
331         */
332        public CitationClassificationComponent setType(CodeableConcept value) { 
333          this.type = value;
334          return this;
335        }
336
337        /**
338         * @return {@link #classifier} (The specific classification value.)
339         */
340        public List<CodeableConcept> getClassifier() { 
341          if (this.classifier == null)
342            this.classifier = new ArrayList<CodeableConcept>();
343          return this.classifier;
344        }
345
346        /**
347         * @return Returns a reference to <code>this</code> for easy method chaining
348         */
349        public CitationClassificationComponent setClassifier(List<CodeableConcept> theClassifier) { 
350          this.classifier = theClassifier;
351          return this;
352        }
353
354        public boolean hasClassifier() { 
355          if (this.classifier == null)
356            return false;
357          for (CodeableConcept item : this.classifier)
358            if (!item.isEmpty())
359              return true;
360          return false;
361        }
362
363        public CodeableConcept addClassifier() { //3
364          CodeableConcept t = new CodeableConcept();
365          if (this.classifier == null)
366            this.classifier = new ArrayList<CodeableConcept>();
367          this.classifier.add(t);
368          return t;
369        }
370
371        public CitationClassificationComponent addClassifier(CodeableConcept t) { //3
372          if (t == null)
373            return this;
374          if (this.classifier == null)
375            this.classifier = new ArrayList<CodeableConcept>();
376          this.classifier.add(t);
377          return this;
378        }
379
380        /**
381         * @return The first repetition of repeating field {@link #classifier}, creating it if it does not already exist {3}
382         */
383        public CodeableConcept getClassifierFirstRep() { 
384          if (getClassifier().isEmpty()) {
385            addClassifier();
386          }
387          return getClassifier().get(0);
388        }
389
390        protected void listChildren(List<Property> children) {
391          super.listChildren(children);
392          children.add(new Property("type", "CodeableConcept", "The kind of classifier (e.g. publication type, keyword).", 0, 1, type));
393          children.add(new Property("classifier", "CodeableConcept", "The specific classification value.", 0, java.lang.Integer.MAX_VALUE, classifier));
394        }
395
396        @Override
397        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
398          switch (_hash) {
399          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of classifier (e.g. publication type, keyword).", 0, 1, type);
400          case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "The specific classification value.", 0, java.lang.Integer.MAX_VALUE, classifier);
401          default: return super.getNamedProperty(_hash, _name, _checkValid);
402          }
403
404        }
405
406      @Override
407      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
408        switch (hash) {
409        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
410        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : this.classifier.toArray(new Base[this.classifier.size()]); // CodeableConcept
411        default: return super.getProperty(hash, name, checkValid);
412        }
413
414      }
415
416      @Override
417      public Base setProperty(int hash, String name, Base value) throws FHIRException {
418        switch (hash) {
419        case 3575610: // type
420          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
421          return value;
422        case -281470431: // classifier
423          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
424          return value;
425        default: return super.setProperty(hash, name, value);
426        }
427
428      }
429
430      @Override
431      public Base setProperty(String name, Base value) throws FHIRException {
432        if (name.equals("type")) {
433          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
434        } else if (name.equals("classifier")) {
435          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value));
436        } else
437          return super.setProperty(name, value);
438        return value;
439      }
440
441      @Override
442      public Base makeProperty(int hash, String name) throws FHIRException {
443        switch (hash) {
444        case 3575610:  return getType();
445        case -281470431:  return addClassifier(); 
446        default: return super.makeProperty(hash, name);
447        }
448
449      }
450
451      @Override
452      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
453        switch (hash) {
454        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
455        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
456        default: return super.getTypesForProperty(hash, name);
457        }
458
459      }
460
461      @Override
462      public Base addChild(String name) throws FHIRException {
463        if (name.equals("type")) {
464          this.type = new CodeableConcept();
465          return this.type;
466        }
467        else if (name.equals("classifier")) {
468          return addClassifier();
469        }
470        else
471          return super.addChild(name);
472      }
473
474      public CitationClassificationComponent copy() {
475        CitationClassificationComponent dst = new CitationClassificationComponent();
476        copyValues(dst);
477        return dst;
478      }
479
480      public void copyValues(CitationClassificationComponent dst) {
481        super.copyValues(dst);
482        dst.type = type == null ? null : type.copy();
483        if (classifier != null) {
484          dst.classifier = new ArrayList<CodeableConcept>();
485          for (CodeableConcept i : classifier)
486            dst.classifier.add(i.copy());
487        };
488      }
489
490      @Override
491      public boolean equalsDeep(Base other_) {
492        if (!super.equalsDeep(other_))
493          return false;
494        if (!(other_ instanceof CitationClassificationComponent))
495          return false;
496        CitationClassificationComponent o = (CitationClassificationComponent) other_;
497        return compareDeep(type, o.type, true) && compareDeep(classifier, o.classifier, true);
498      }
499
500      @Override
501      public boolean equalsShallow(Base other_) {
502        if (!super.equalsShallow(other_))
503          return false;
504        if (!(other_ instanceof CitationClassificationComponent))
505          return false;
506        CitationClassificationComponent o = (CitationClassificationComponent) other_;
507        return true;
508      }
509
510      public boolean isEmpty() {
511        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, classifier);
512      }
513
514  public String fhirType() {
515    return "Citation.classification";
516
517  }
518
519  }
520
521    @Block()
522    public static class CitationStatusDateComponent extends BackboneElement implements IBaseBackboneElement {
523        /**
524         * Classification of the status.
525         */
526        @Child(name = "activity", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
527        @Description(shortDefinition="Classification of the status", formalDefinition="Classification of the status." )
528        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-status-type")
529        protected CodeableConcept activity;
530
531        /**
532         * Either occurred or expected.
533         */
534        @Child(name = "actual", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
535        @Description(shortDefinition="Either occurred or expected", formalDefinition="Either occurred or expected." )
536        protected BooleanType actual;
537
538        /**
539         * When the status started and/or ended.
540         */
541        @Child(name = "period", type = {Period.class}, order=3, min=1, max=1, modifier=false, summary=false)
542        @Description(shortDefinition="When the status started and/or ended", formalDefinition="When the status started and/or ended." )
543        protected Period period;
544
545        private static final long serialVersionUID = 1123586924L;
546
547    /**
548     * Constructor
549     */
550      public CitationStatusDateComponent() {
551        super();
552      }
553
554    /**
555     * Constructor
556     */
557      public CitationStatusDateComponent(CodeableConcept activity, Period period) {
558        super();
559        this.setActivity(activity);
560        this.setPeriod(period);
561      }
562
563        /**
564         * @return {@link #activity} (Classification of the status.)
565         */
566        public CodeableConcept getActivity() { 
567          if (this.activity == null)
568            if (Configuration.errorOnAutoCreate())
569              throw new Error("Attempt to auto-create CitationStatusDateComponent.activity");
570            else if (Configuration.doAutoCreate())
571              this.activity = new CodeableConcept(); // cc
572          return this.activity;
573        }
574
575        public boolean hasActivity() { 
576          return this.activity != null && !this.activity.isEmpty();
577        }
578
579        /**
580         * @param value {@link #activity} (Classification of the status.)
581         */
582        public CitationStatusDateComponent setActivity(CodeableConcept value) { 
583          this.activity = value;
584          return this;
585        }
586
587        /**
588         * @return {@link #actual} (Either occurred or expected.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
589         */
590        public BooleanType getActualElement() { 
591          if (this.actual == null)
592            if (Configuration.errorOnAutoCreate())
593              throw new Error("Attempt to auto-create CitationStatusDateComponent.actual");
594            else if (Configuration.doAutoCreate())
595              this.actual = new BooleanType(); // bb
596          return this.actual;
597        }
598
599        public boolean hasActualElement() { 
600          return this.actual != null && !this.actual.isEmpty();
601        }
602
603        public boolean hasActual() { 
604          return this.actual != null && !this.actual.isEmpty();
605        }
606
607        /**
608         * @param value {@link #actual} (Either occurred or expected.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
609         */
610        public CitationStatusDateComponent setActualElement(BooleanType value) { 
611          this.actual = value;
612          return this;
613        }
614
615        /**
616         * @return Either occurred or expected.
617         */
618        public boolean getActual() { 
619          return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue();
620        }
621
622        /**
623         * @param value Either occurred or expected.
624         */
625        public CitationStatusDateComponent setActual(boolean value) { 
626            if (this.actual == null)
627              this.actual = new BooleanType();
628            this.actual.setValue(value);
629          return this;
630        }
631
632        /**
633         * @return {@link #period} (When the status started and/or ended.)
634         */
635        public Period getPeriod() { 
636          if (this.period == null)
637            if (Configuration.errorOnAutoCreate())
638              throw new Error("Attempt to auto-create CitationStatusDateComponent.period");
639            else if (Configuration.doAutoCreate())
640              this.period = new Period(); // cc
641          return this.period;
642        }
643
644        public boolean hasPeriod() { 
645          return this.period != null && !this.period.isEmpty();
646        }
647
648        /**
649         * @param value {@link #period} (When the status started and/or ended.)
650         */
651        public CitationStatusDateComponent setPeriod(Period value) { 
652          this.period = value;
653          return this;
654        }
655
656        protected void listChildren(List<Property> children) {
657          super.listChildren(children);
658          children.add(new Property("activity", "CodeableConcept", "Classification of the status.", 0, 1, activity));
659          children.add(new Property("actual", "boolean", "Either occurred or expected.", 0, 1, actual));
660          children.add(new Property("period", "Period", "When the status started and/or ended.", 0, 1, period));
661        }
662
663        @Override
664        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
665          switch (_hash) {
666          case -1655966961: /*activity*/  return new Property("activity", "CodeableConcept", "Classification of the status.", 0, 1, activity);
667          case -1422939762: /*actual*/  return new Property("actual", "boolean", "Either occurred or expected.", 0, 1, actual);
668          case -991726143: /*period*/  return new Property("period", "Period", "When the status started and/or ended.", 0, 1, period);
669          default: return super.getNamedProperty(_hash, _name, _checkValid);
670          }
671
672        }
673
674      @Override
675      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
676        switch (hash) {
677        case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : new Base[] {this.activity}; // CodeableConcept
678        case -1422939762: /*actual*/ return this.actual == null ? new Base[0] : new Base[] {this.actual}; // BooleanType
679        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
680        default: return super.getProperty(hash, name, checkValid);
681        }
682
683      }
684
685      @Override
686      public Base setProperty(int hash, String name, Base value) throws FHIRException {
687        switch (hash) {
688        case -1655966961: // activity
689          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
690          return value;
691        case -1422939762: // actual
692          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
693          return value;
694        case -991726143: // period
695          this.period = TypeConvertor.castToPeriod(value); // Period
696          return value;
697        default: return super.setProperty(hash, name, value);
698        }
699
700      }
701
702      @Override
703      public Base setProperty(String name, Base value) throws FHIRException {
704        if (name.equals("activity")) {
705          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
706        } else if (name.equals("actual")) {
707          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
708        } else if (name.equals("period")) {
709          this.period = TypeConvertor.castToPeriod(value); // Period
710        } else
711          return super.setProperty(name, value);
712        return value;
713      }
714
715      @Override
716      public Base makeProperty(int hash, String name) throws FHIRException {
717        switch (hash) {
718        case -1655966961:  return getActivity();
719        case -1422939762:  return getActualElement();
720        case -991726143:  return getPeriod();
721        default: return super.makeProperty(hash, name);
722        }
723
724      }
725
726      @Override
727      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
728        switch (hash) {
729        case -1655966961: /*activity*/ return new String[] {"CodeableConcept"};
730        case -1422939762: /*actual*/ return new String[] {"boolean"};
731        case -991726143: /*period*/ return new String[] {"Period"};
732        default: return super.getTypesForProperty(hash, name);
733        }
734
735      }
736
737      @Override
738      public Base addChild(String name) throws FHIRException {
739        if (name.equals("activity")) {
740          this.activity = new CodeableConcept();
741          return this.activity;
742        }
743        else if (name.equals("actual")) {
744          throw new FHIRException("Cannot call addChild on a primitive type Citation.statusDate.actual");
745        }
746        else if (name.equals("period")) {
747          this.period = new Period();
748          return this.period;
749        }
750        else
751          return super.addChild(name);
752      }
753
754      public CitationStatusDateComponent copy() {
755        CitationStatusDateComponent dst = new CitationStatusDateComponent();
756        copyValues(dst);
757        return dst;
758      }
759
760      public void copyValues(CitationStatusDateComponent dst) {
761        super.copyValues(dst);
762        dst.activity = activity == null ? null : activity.copy();
763        dst.actual = actual == null ? null : actual.copy();
764        dst.period = period == null ? null : period.copy();
765      }
766
767      @Override
768      public boolean equalsDeep(Base other_) {
769        if (!super.equalsDeep(other_))
770          return false;
771        if (!(other_ instanceof CitationStatusDateComponent))
772          return false;
773        CitationStatusDateComponent o = (CitationStatusDateComponent) other_;
774        return compareDeep(activity, o.activity, true) && compareDeep(actual, o.actual, true) && compareDeep(period, o.period, true)
775          ;
776      }
777
778      @Override
779      public boolean equalsShallow(Base other_) {
780        if (!super.equalsShallow(other_))
781          return false;
782        if (!(other_ instanceof CitationStatusDateComponent))
783          return false;
784        CitationStatusDateComponent o = (CitationStatusDateComponent) other_;
785        return compareValues(actual, o.actual, true);
786      }
787
788      public boolean isEmpty() {
789        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(activity, actual, period
790          );
791      }
792
793  public String fhirType() {
794    return "Citation.statusDate";
795
796  }
797
798  }
799
800    @Block()
801    public static class CitationCitedArtifactComponent extends BackboneElement implements IBaseBackboneElement {
802        /**
803         * A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance.
804         */
805        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
806        @Description(shortDefinition="May include DOI, PMID, PMCID, etc.", formalDefinition="A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance." )
807        protected List<Identifier> identifier;
808
809        /**
810         * A formal identifier that is used to identify things closely related to this citation.
811         */
812        @Child(name = "relatedIdentifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
813        @Description(shortDefinition="May include trial registry identifiers", formalDefinition="A formal identifier that is used to identify things closely related to this citation." )
814        protected List<Identifier> relatedIdentifier;
815
816        /**
817         * When the cited artifact was accessed.
818         */
819        @Child(name = "dateAccessed", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
820        @Description(shortDefinition="When the cited artifact was accessed", formalDefinition="When the cited artifact was accessed." )
821        protected DateTimeType dateAccessed;
822
823        /**
824         * The defined version of the cited artifact.
825         */
826        @Child(name = "version", type = {}, order=4, min=0, max=1, modifier=false, summary=false)
827        @Description(shortDefinition="The defined version of the cited artifact", formalDefinition="The defined version of the cited artifact." )
828        protected CitationCitedArtifactVersionComponent version;
829
830        /**
831         * The status of the cited artifact.
832         */
833        @Child(name = "currentState", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
834        @Description(shortDefinition="The status of the cited artifact", formalDefinition="The status of the cited artifact." )
835        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-status-type")
836        protected List<CodeableConcept> currentState;
837
838        /**
839         * An effective date or period for a status of the cited artifact.
840         */
841        @Child(name = "statusDate", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
842        @Description(shortDefinition="An effective date or period for a status of the cited artifact", formalDefinition="An effective date or period for a status of the cited artifact." )
843        protected List<CitationCitedArtifactStatusDateComponent> statusDate;
844
845        /**
846         * The title details of the article or artifact.
847         */
848        @Child(name = "title", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
849        @Description(shortDefinition="The title details of the article or artifact", formalDefinition="The title details of the article or artifact." )
850        protected List<CitationCitedArtifactTitleComponent> title;
851
852        /**
853         * Summary of the article or artifact.
854         */
855        @Child(name = "abstract", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
856        @Description(shortDefinition="Summary of the article or artifact", formalDefinition="Summary of the article or artifact." )
857        protected List<CitationCitedArtifactAbstractComponent> abstract_;
858
859        /**
860         * The component of the article or artifact.
861         */
862        @Child(name = "part", type = {}, order=9, min=0, max=1, modifier=false, summary=false)
863        @Description(shortDefinition="The component of the article or artifact", formalDefinition="The component of the article or artifact." )
864        protected CitationCitedArtifactPartComponent part;
865
866        /**
867         * The artifact related to the cited artifact.
868         */
869        @Child(name = "relatesTo", type = {RelatedArtifact.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
870        @Description(shortDefinition="The artifact related to the cited artifact", formalDefinition="The artifact related to the cited artifact." )
871        protected List<RelatedArtifact> relatesTo;
872
873        /**
874         * If multiple, used to represent alternative forms of the article that are not separate citations.
875         */
876        @Child(name = "publicationForm", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
877        @Description(shortDefinition="If multiple, used to represent alternative forms of the article that are not separate citations", formalDefinition="If multiple, used to represent alternative forms of the article that are not separate citations." )
878        protected List<CitationCitedArtifactPublicationFormComponent> publicationForm;
879
880        /**
881         * Used for any URL for the article or artifact cited.
882         */
883        @Child(name = "webLocation", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
884        @Description(shortDefinition="Used for any URL for the article or artifact cited", formalDefinition="Used for any URL for the article or artifact cited." )
885        protected List<CitationCitedArtifactWebLocationComponent> webLocation;
886
887        /**
888         * The assignment to an organizing scheme.
889         */
890        @Child(name = "classification", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
891        @Description(shortDefinition="The assignment to an organizing scheme", formalDefinition="The assignment to an organizing scheme." )
892        protected List<CitationCitedArtifactClassificationComponent> classification;
893
894        /**
895         * This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements.
896         */
897        @Child(name = "contributorship", type = {}, order=14, min=0, max=1, modifier=false, summary=false)
898        @Description(shortDefinition="Attribution of authors and other contributors", formalDefinition="This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements." )
899        protected CitationCitedArtifactContributorshipComponent contributorship;
900
901        /**
902         * Any additional information or content for the article or artifact.
903         */
904        @Child(name = "note", type = {Annotation.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
905        @Description(shortDefinition="Any additional information or content for the article or artifact", formalDefinition="Any additional information or content for the article or artifact." )
906        protected List<Annotation> note;
907
908        private static final long serialVersionUID = 356898023L;
909
910    /**
911     * Constructor
912     */
913      public CitationCitedArtifactComponent() {
914        super();
915      }
916
917        /**
918         * @return {@link #identifier} (A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance.)
919         */
920        public List<Identifier> getIdentifier() { 
921          if (this.identifier == null)
922            this.identifier = new ArrayList<Identifier>();
923          return this.identifier;
924        }
925
926        /**
927         * @return Returns a reference to <code>this</code> for easy method chaining
928         */
929        public CitationCitedArtifactComponent setIdentifier(List<Identifier> theIdentifier) { 
930          this.identifier = theIdentifier;
931          return this;
932        }
933
934        public boolean hasIdentifier() { 
935          if (this.identifier == null)
936            return false;
937          for (Identifier item : this.identifier)
938            if (!item.isEmpty())
939              return true;
940          return false;
941        }
942
943        public Identifier addIdentifier() { //3
944          Identifier t = new Identifier();
945          if (this.identifier == null)
946            this.identifier = new ArrayList<Identifier>();
947          this.identifier.add(t);
948          return t;
949        }
950
951        public CitationCitedArtifactComponent addIdentifier(Identifier t) { //3
952          if (t == null)
953            return this;
954          if (this.identifier == null)
955            this.identifier = new ArrayList<Identifier>();
956          this.identifier.add(t);
957          return this;
958        }
959
960        /**
961         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
962         */
963        public Identifier getIdentifierFirstRep() { 
964          if (getIdentifier().isEmpty()) {
965            addIdentifier();
966          }
967          return getIdentifier().get(0);
968        }
969
970        /**
971         * @return {@link #relatedIdentifier} (A formal identifier that is used to identify things closely related to this citation.)
972         */
973        public List<Identifier> getRelatedIdentifier() { 
974          if (this.relatedIdentifier == null)
975            this.relatedIdentifier = new ArrayList<Identifier>();
976          return this.relatedIdentifier;
977        }
978
979        /**
980         * @return Returns a reference to <code>this</code> for easy method chaining
981         */
982        public CitationCitedArtifactComponent setRelatedIdentifier(List<Identifier> theRelatedIdentifier) { 
983          this.relatedIdentifier = theRelatedIdentifier;
984          return this;
985        }
986
987        public boolean hasRelatedIdentifier() { 
988          if (this.relatedIdentifier == null)
989            return false;
990          for (Identifier item : this.relatedIdentifier)
991            if (!item.isEmpty())
992              return true;
993          return false;
994        }
995
996        public Identifier addRelatedIdentifier() { //3
997          Identifier t = new Identifier();
998          if (this.relatedIdentifier == null)
999            this.relatedIdentifier = new ArrayList<Identifier>();
1000          this.relatedIdentifier.add(t);
1001          return t;
1002        }
1003
1004        public CitationCitedArtifactComponent addRelatedIdentifier(Identifier t) { //3
1005          if (t == null)
1006            return this;
1007          if (this.relatedIdentifier == null)
1008            this.relatedIdentifier = new ArrayList<Identifier>();
1009          this.relatedIdentifier.add(t);
1010          return this;
1011        }
1012
1013        /**
1014         * @return The first repetition of repeating field {@link #relatedIdentifier}, creating it if it does not already exist {3}
1015         */
1016        public Identifier getRelatedIdentifierFirstRep() { 
1017          if (getRelatedIdentifier().isEmpty()) {
1018            addRelatedIdentifier();
1019          }
1020          return getRelatedIdentifier().get(0);
1021        }
1022
1023        /**
1024         * @return {@link #dateAccessed} (When the cited artifact was accessed.). This is the underlying object with id, value and extensions. The accessor "getDateAccessed" gives direct access to the value
1025         */
1026        public DateTimeType getDateAccessedElement() { 
1027          if (this.dateAccessed == null)
1028            if (Configuration.errorOnAutoCreate())
1029              throw new Error("Attempt to auto-create CitationCitedArtifactComponent.dateAccessed");
1030            else if (Configuration.doAutoCreate())
1031              this.dateAccessed = new DateTimeType(); // bb
1032          return this.dateAccessed;
1033        }
1034
1035        public boolean hasDateAccessedElement() { 
1036          return this.dateAccessed != null && !this.dateAccessed.isEmpty();
1037        }
1038
1039        public boolean hasDateAccessed() { 
1040          return this.dateAccessed != null && !this.dateAccessed.isEmpty();
1041        }
1042
1043        /**
1044         * @param value {@link #dateAccessed} (When the cited artifact was accessed.). This is the underlying object with id, value and extensions. The accessor "getDateAccessed" gives direct access to the value
1045         */
1046        public CitationCitedArtifactComponent setDateAccessedElement(DateTimeType value) { 
1047          this.dateAccessed = value;
1048          return this;
1049        }
1050
1051        /**
1052         * @return When the cited artifact was accessed.
1053         */
1054        public Date getDateAccessed() { 
1055          return this.dateAccessed == null ? null : this.dateAccessed.getValue();
1056        }
1057
1058        /**
1059         * @param value When the cited artifact was accessed.
1060         */
1061        public CitationCitedArtifactComponent setDateAccessed(Date value) { 
1062          if (value == null)
1063            this.dateAccessed = null;
1064          else {
1065            if (this.dateAccessed == null)
1066              this.dateAccessed = new DateTimeType();
1067            this.dateAccessed.setValue(value);
1068          }
1069          return this;
1070        }
1071
1072        /**
1073         * @return {@link #version} (The defined version of the cited artifact.)
1074         */
1075        public CitationCitedArtifactVersionComponent getVersion() { 
1076          if (this.version == null)
1077            if (Configuration.errorOnAutoCreate())
1078              throw new Error("Attempt to auto-create CitationCitedArtifactComponent.version");
1079            else if (Configuration.doAutoCreate())
1080              this.version = new CitationCitedArtifactVersionComponent(); // cc
1081          return this.version;
1082        }
1083
1084        public boolean hasVersion() { 
1085          return this.version != null && !this.version.isEmpty();
1086        }
1087
1088        /**
1089         * @param value {@link #version} (The defined version of the cited artifact.)
1090         */
1091        public CitationCitedArtifactComponent setVersion(CitationCitedArtifactVersionComponent value) { 
1092          this.version = value;
1093          return this;
1094        }
1095
1096        /**
1097         * @return {@link #currentState} (The status of the cited artifact.)
1098         */
1099        public List<CodeableConcept> getCurrentState() { 
1100          if (this.currentState == null)
1101            this.currentState = new ArrayList<CodeableConcept>();
1102          return this.currentState;
1103        }
1104
1105        /**
1106         * @return Returns a reference to <code>this</code> for easy method chaining
1107         */
1108        public CitationCitedArtifactComponent setCurrentState(List<CodeableConcept> theCurrentState) { 
1109          this.currentState = theCurrentState;
1110          return this;
1111        }
1112
1113        public boolean hasCurrentState() { 
1114          if (this.currentState == null)
1115            return false;
1116          for (CodeableConcept item : this.currentState)
1117            if (!item.isEmpty())
1118              return true;
1119          return false;
1120        }
1121
1122        public CodeableConcept addCurrentState() { //3
1123          CodeableConcept t = new CodeableConcept();
1124          if (this.currentState == null)
1125            this.currentState = new ArrayList<CodeableConcept>();
1126          this.currentState.add(t);
1127          return t;
1128        }
1129
1130        public CitationCitedArtifactComponent addCurrentState(CodeableConcept t) { //3
1131          if (t == null)
1132            return this;
1133          if (this.currentState == null)
1134            this.currentState = new ArrayList<CodeableConcept>();
1135          this.currentState.add(t);
1136          return this;
1137        }
1138
1139        /**
1140         * @return The first repetition of repeating field {@link #currentState}, creating it if it does not already exist {3}
1141         */
1142        public CodeableConcept getCurrentStateFirstRep() { 
1143          if (getCurrentState().isEmpty()) {
1144            addCurrentState();
1145          }
1146          return getCurrentState().get(0);
1147        }
1148
1149        /**
1150         * @return {@link #statusDate} (An effective date or period for a status of the cited artifact.)
1151         */
1152        public List<CitationCitedArtifactStatusDateComponent> getStatusDate() { 
1153          if (this.statusDate == null)
1154            this.statusDate = new ArrayList<CitationCitedArtifactStatusDateComponent>();
1155          return this.statusDate;
1156        }
1157
1158        /**
1159         * @return Returns a reference to <code>this</code> for easy method chaining
1160         */
1161        public CitationCitedArtifactComponent setStatusDate(List<CitationCitedArtifactStatusDateComponent> theStatusDate) { 
1162          this.statusDate = theStatusDate;
1163          return this;
1164        }
1165
1166        public boolean hasStatusDate() { 
1167          if (this.statusDate == null)
1168            return false;
1169          for (CitationCitedArtifactStatusDateComponent item : this.statusDate)
1170            if (!item.isEmpty())
1171              return true;
1172          return false;
1173        }
1174
1175        public CitationCitedArtifactStatusDateComponent addStatusDate() { //3
1176          CitationCitedArtifactStatusDateComponent t = new CitationCitedArtifactStatusDateComponent();
1177          if (this.statusDate == null)
1178            this.statusDate = new ArrayList<CitationCitedArtifactStatusDateComponent>();
1179          this.statusDate.add(t);
1180          return t;
1181        }
1182
1183        public CitationCitedArtifactComponent addStatusDate(CitationCitedArtifactStatusDateComponent t) { //3
1184          if (t == null)
1185            return this;
1186          if (this.statusDate == null)
1187            this.statusDate = new ArrayList<CitationCitedArtifactStatusDateComponent>();
1188          this.statusDate.add(t);
1189          return this;
1190        }
1191
1192        /**
1193         * @return The first repetition of repeating field {@link #statusDate}, creating it if it does not already exist {3}
1194         */
1195        public CitationCitedArtifactStatusDateComponent getStatusDateFirstRep() { 
1196          if (getStatusDate().isEmpty()) {
1197            addStatusDate();
1198          }
1199          return getStatusDate().get(0);
1200        }
1201
1202        /**
1203         * @return {@link #title} (The title details of the article or artifact.)
1204         */
1205        public List<CitationCitedArtifactTitleComponent> getTitle() { 
1206          if (this.title == null)
1207            this.title = new ArrayList<CitationCitedArtifactTitleComponent>();
1208          return this.title;
1209        }
1210
1211        /**
1212         * @return Returns a reference to <code>this</code> for easy method chaining
1213         */
1214        public CitationCitedArtifactComponent setTitle(List<CitationCitedArtifactTitleComponent> theTitle) { 
1215          this.title = theTitle;
1216          return this;
1217        }
1218
1219        public boolean hasTitle() { 
1220          if (this.title == null)
1221            return false;
1222          for (CitationCitedArtifactTitleComponent item : this.title)
1223            if (!item.isEmpty())
1224              return true;
1225          return false;
1226        }
1227
1228        public CitationCitedArtifactTitleComponent addTitle() { //3
1229          CitationCitedArtifactTitleComponent t = new CitationCitedArtifactTitleComponent();
1230          if (this.title == null)
1231            this.title = new ArrayList<CitationCitedArtifactTitleComponent>();
1232          this.title.add(t);
1233          return t;
1234        }
1235
1236        public CitationCitedArtifactComponent addTitle(CitationCitedArtifactTitleComponent t) { //3
1237          if (t == null)
1238            return this;
1239          if (this.title == null)
1240            this.title = new ArrayList<CitationCitedArtifactTitleComponent>();
1241          this.title.add(t);
1242          return this;
1243        }
1244
1245        /**
1246         * @return The first repetition of repeating field {@link #title}, creating it if it does not already exist {3}
1247         */
1248        public CitationCitedArtifactTitleComponent getTitleFirstRep() { 
1249          if (getTitle().isEmpty()) {
1250            addTitle();
1251          }
1252          return getTitle().get(0);
1253        }
1254
1255        /**
1256         * @return {@link #abstract_} (Summary of the article or artifact.)
1257         */
1258        public List<CitationCitedArtifactAbstractComponent> getAbstract() { 
1259          if (this.abstract_ == null)
1260            this.abstract_ = new ArrayList<CitationCitedArtifactAbstractComponent>();
1261          return this.abstract_;
1262        }
1263
1264        /**
1265         * @return Returns a reference to <code>this</code> for easy method chaining
1266         */
1267        public CitationCitedArtifactComponent setAbstract(List<CitationCitedArtifactAbstractComponent> theAbstract) { 
1268          this.abstract_ = theAbstract;
1269          return this;
1270        }
1271
1272        public boolean hasAbstract() { 
1273          if (this.abstract_ == null)
1274            return false;
1275          for (CitationCitedArtifactAbstractComponent item : this.abstract_)
1276            if (!item.isEmpty())
1277              return true;
1278          return false;
1279        }
1280
1281        public CitationCitedArtifactAbstractComponent addAbstract() { //3
1282          CitationCitedArtifactAbstractComponent t = new CitationCitedArtifactAbstractComponent();
1283          if (this.abstract_ == null)
1284            this.abstract_ = new ArrayList<CitationCitedArtifactAbstractComponent>();
1285          this.abstract_.add(t);
1286          return t;
1287        }
1288
1289        public CitationCitedArtifactComponent addAbstract(CitationCitedArtifactAbstractComponent t) { //3
1290          if (t == null)
1291            return this;
1292          if (this.abstract_ == null)
1293            this.abstract_ = new ArrayList<CitationCitedArtifactAbstractComponent>();
1294          this.abstract_.add(t);
1295          return this;
1296        }
1297
1298        /**
1299         * @return The first repetition of repeating field {@link #abstract_}, creating it if it does not already exist {3}
1300         */
1301        public CitationCitedArtifactAbstractComponent getAbstractFirstRep() { 
1302          if (getAbstract().isEmpty()) {
1303            addAbstract();
1304          }
1305          return getAbstract().get(0);
1306        }
1307
1308        /**
1309         * @return {@link #part} (The component of the article or artifact.)
1310         */
1311        public CitationCitedArtifactPartComponent getPart() { 
1312          if (this.part == null)
1313            if (Configuration.errorOnAutoCreate())
1314              throw new Error("Attempt to auto-create CitationCitedArtifactComponent.part");
1315            else if (Configuration.doAutoCreate())
1316              this.part = new CitationCitedArtifactPartComponent(); // cc
1317          return this.part;
1318        }
1319
1320        public boolean hasPart() { 
1321          return this.part != null && !this.part.isEmpty();
1322        }
1323
1324        /**
1325         * @param value {@link #part} (The component of the article or artifact.)
1326         */
1327        public CitationCitedArtifactComponent setPart(CitationCitedArtifactPartComponent value) { 
1328          this.part = value;
1329          return this;
1330        }
1331
1332        /**
1333         * @return {@link #relatesTo} (The artifact related to the cited artifact.)
1334         */
1335        public List<RelatedArtifact> getRelatesTo() { 
1336          if (this.relatesTo == null)
1337            this.relatesTo = new ArrayList<RelatedArtifact>();
1338          return this.relatesTo;
1339        }
1340
1341        /**
1342         * @return Returns a reference to <code>this</code> for easy method chaining
1343         */
1344        public CitationCitedArtifactComponent setRelatesTo(List<RelatedArtifact> theRelatesTo) { 
1345          this.relatesTo = theRelatesTo;
1346          return this;
1347        }
1348
1349        public boolean hasRelatesTo() { 
1350          if (this.relatesTo == null)
1351            return false;
1352          for (RelatedArtifact item : this.relatesTo)
1353            if (!item.isEmpty())
1354              return true;
1355          return false;
1356        }
1357
1358        public RelatedArtifact addRelatesTo() { //3
1359          RelatedArtifact t = new RelatedArtifact();
1360          if (this.relatesTo == null)
1361            this.relatesTo = new ArrayList<RelatedArtifact>();
1362          this.relatesTo.add(t);
1363          return t;
1364        }
1365
1366        public CitationCitedArtifactComponent addRelatesTo(RelatedArtifact t) { //3
1367          if (t == null)
1368            return this;
1369          if (this.relatesTo == null)
1370            this.relatesTo = new ArrayList<RelatedArtifact>();
1371          this.relatesTo.add(t);
1372          return this;
1373        }
1374
1375        /**
1376         * @return The first repetition of repeating field {@link #relatesTo}, creating it if it does not already exist {3}
1377         */
1378        public RelatedArtifact getRelatesToFirstRep() { 
1379          if (getRelatesTo().isEmpty()) {
1380            addRelatesTo();
1381          }
1382          return getRelatesTo().get(0);
1383        }
1384
1385        /**
1386         * @return {@link #publicationForm} (If multiple, used to represent alternative forms of the article that are not separate citations.)
1387         */
1388        public List<CitationCitedArtifactPublicationFormComponent> getPublicationForm() { 
1389          if (this.publicationForm == null)
1390            this.publicationForm = new ArrayList<CitationCitedArtifactPublicationFormComponent>();
1391          return this.publicationForm;
1392        }
1393
1394        /**
1395         * @return Returns a reference to <code>this</code> for easy method chaining
1396         */
1397        public CitationCitedArtifactComponent setPublicationForm(List<CitationCitedArtifactPublicationFormComponent> thePublicationForm) { 
1398          this.publicationForm = thePublicationForm;
1399          return this;
1400        }
1401
1402        public boolean hasPublicationForm() { 
1403          if (this.publicationForm == null)
1404            return false;
1405          for (CitationCitedArtifactPublicationFormComponent item : this.publicationForm)
1406            if (!item.isEmpty())
1407              return true;
1408          return false;
1409        }
1410
1411        public CitationCitedArtifactPublicationFormComponent addPublicationForm() { //3
1412          CitationCitedArtifactPublicationFormComponent t = new CitationCitedArtifactPublicationFormComponent();
1413          if (this.publicationForm == null)
1414            this.publicationForm = new ArrayList<CitationCitedArtifactPublicationFormComponent>();
1415          this.publicationForm.add(t);
1416          return t;
1417        }
1418
1419        public CitationCitedArtifactComponent addPublicationForm(CitationCitedArtifactPublicationFormComponent t) { //3
1420          if (t == null)
1421            return this;
1422          if (this.publicationForm == null)
1423            this.publicationForm = new ArrayList<CitationCitedArtifactPublicationFormComponent>();
1424          this.publicationForm.add(t);
1425          return this;
1426        }
1427
1428        /**
1429         * @return The first repetition of repeating field {@link #publicationForm}, creating it if it does not already exist {3}
1430         */
1431        public CitationCitedArtifactPublicationFormComponent getPublicationFormFirstRep() { 
1432          if (getPublicationForm().isEmpty()) {
1433            addPublicationForm();
1434          }
1435          return getPublicationForm().get(0);
1436        }
1437
1438        /**
1439         * @return {@link #webLocation} (Used for any URL for the article or artifact cited.)
1440         */
1441        public List<CitationCitedArtifactWebLocationComponent> getWebLocation() { 
1442          if (this.webLocation == null)
1443            this.webLocation = new ArrayList<CitationCitedArtifactWebLocationComponent>();
1444          return this.webLocation;
1445        }
1446
1447        /**
1448         * @return Returns a reference to <code>this</code> for easy method chaining
1449         */
1450        public CitationCitedArtifactComponent setWebLocation(List<CitationCitedArtifactWebLocationComponent> theWebLocation) { 
1451          this.webLocation = theWebLocation;
1452          return this;
1453        }
1454
1455        public boolean hasWebLocation() { 
1456          if (this.webLocation == null)
1457            return false;
1458          for (CitationCitedArtifactWebLocationComponent item : this.webLocation)
1459            if (!item.isEmpty())
1460              return true;
1461          return false;
1462        }
1463
1464        public CitationCitedArtifactWebLocationComponent addWebLocation() { //3
1465          CitationCitedArtifactWebLocationComponent t = new CitationCitedArtifactWebLocationComponent();
1466          if (this.webLocation == null)
1467            this.webLocation = new ArrayList<CitationCitedArtifactWebLocationComponent>();
1468          this.webLocation.add(t);
1469          return t;
1470        }
1471
1472        public CitationCitedArtifactComponent addWebLocation(CitationCitedArtifactWebLocationComponent t) { //3
1473          if (t == null)
1474            return this;
1475          if (this.webLocation == null)
1476            this.webLocation = new ArrayList<CitationCitedArtifactWebLocationComponent>();
1477          this.webLocation.add(t);
1478          return this;
1479        }
1480
1481        /**
1482         * @return The first repetition of repeating field {@link #webLocation}, creating it if it does not already exist {3}
1483         */
1484        public CitationCitedArtifactWebLocationComponent getWebLocationFirstRep() { 
1485          if (getWebLocation().isEmpty()) {
1486            addWebLocation();
1487          }
1488          return getWebLocation().get(0);
1489        }
1490
1491        /**
1492         * @return {@link #classification} (The assignment to an organizing scheme.)
1493         */
1494        public List<CitationCitedArtifactClassificationComponent> getClassification() { 
1495          if (this.classification == null)
1496            this.classification = new ArrayList<CitationCitedArtifactClassificationComponent>();
1497          return this.classification;
1498        }
1499
1500        /**
1501         * @return Returns a reference to <code>this</code> for easy method chaining
1502         */
1503        public CitationCitedArtifactComponent setClassification(List<CitationCitedArtifactClassificationComponent> theClassification) { 
1504          this.classification = theClassification;
1505          return this;
1506        }
1507
1508        public boolean hasClassification() { 
1509          if (this.classification == null)
1510            return false;
1511          for (CitationCitedArtifactClassificationComponent item : this.classification)
1512            if (!item.isEmpty())
1513              return true;
1514          return false;
1515        }
1516
1517        public CitationCitedArtifactClassificationComponent addClassification() { //3
1518          CitationCitedArtifactClassificationComponent t = new CitationCitedArtifactClassificationComponent();
1519          if (this.classification == null)
1520            this.classification = new ArrayList<CitationCitedArtifactClassificationComponent>();
1521          this.classification.add(t);
1522          return t;
1523        }
1524
1525        public CitationCitedArtifactComponent addClassification(CitationCitedArtifactClassificationComponent t) { //3
1526          if (t == null)
1527            return this;
1528          if (this.classification == null)
1529            this.classification = new ArrayList<CitationCitedArtifactClassificationComponent>();
1530          this.classification.add(t);
1531          return this;
1532        }
1533
1534        /**
1535         * @return The first repetition of repeating field {@link #classification}, creating it if it does not already exist {3}
1536         */
1537        public CitationCitedArtifactClassificationComponent getClassificationFirstRep() { 
1538          if (getClassification().isEmpty()) {
1539            addClassification();
1540          }
1541          return getClassification().get(0);
1542        }
1543
1544        /**
1545         * @return {@link #contributorship} (This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements.)
1546         */
1547        public CitationCitedArtifactContributorshipComponent getContributorship() { 
1548          if (this.contributorship == null)
1549            if (Configuration.errorOnAutoCreate())
1550              throw new Error("Attempt to auto-create CitationCitedArtifactComponent.contributorship");
1551            else if (Configuration.doAutoCreate())
1552              this.contributorship = new CitationCitedArtifactContributorshipComponent(); // cc
1553          return this.contributorship;
1554        }
1555
1556        public boolean hasContributorship() { 
1557          return this.contributorship != null && !this.contributorship.isEmpty();
1558        }
1559
1560        /**
1561         * @param value {@link #contributorship} (This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements.)
1562         */
1563        public CitationCitedArtifactComponent setContributorship(CitationCitedArtifactContributorshipComponent value) { 
1564          this.contributorship = value;
1565          return this;
1566        }
1567
1568        /**
1569         * @return {@link #note} (Any additional information or content for the article or artifact.)
1570         */
1571        public List<Annotation> getNote() { 
1572          if (this.note == null)
1573            this.note = new ArrayList<Annotation>();
1574          return this.note;
1575        }
1576
1577        /**
1578         * @return Returns a reference to <code>this</code> for easy method chaining
1579         */
1580        public CitationCitedArtifactComponent setNote(List<Annotation> theNote) { 
1581          this.note = theNote;
1582          return this;
1583        }
1584
1585        public boolean hasNote() { 
1586          if (this.note == null)
1587            return false;
1588          for (Annotation item : this.note)
1589            if (!item.isEmpty())
1590              return true;
1591          return false;
1592        }
1593
1594        public Annotation addNote() { //3
1595          Annotation t = new Annotation();
1596          if (this.note == null)
1597            this.note = new ArrayList<Annotation>();
1598          this.note.add(t);
1599          return t;
1600        }
1601
1602        public CitationCitedArtifactComponent addNote(Annotation t) { //3
1603          if (t == null)
1604            return this;
1605          if (this.note == null)
1606            this.note = new ArrayList<Annotation>();
1607          this.note.add(t);
1608          return this;
1609        }
1610
1611        /**
1612         * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
1613         */
1614        public Annotation getNoteFirstRep() { 
1615          if (getNote().isEmpty()) {
1616            addNote();
1617          }
1618          return getNote().get(0);
1619        }
1620
1621        protected void listChildren(List<Property> children) {
1622          super.listChildren(children);
1623          children.add(new Property("identifier", "Identifier", "A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier));
1624          children.add(new Property("relatedIdentifier", "Identifier", "A formal identifier that is used to identify things closely related to this citation.", 0, java.lang.Integer.MAX_VALUE, relatedIdentifier));
1625          children.add(new Property("dateAccessed", "dateTime", "When the cited artifact was accessed.", 0, 1, dateAccessed));
1626          children.add(new Property("version", "", "The defined version of the cited artifact.", 0, 1, version));
1627          children.add(new Property("currentState", "CodeableConcept", "The status of the cited artifact.", 0, java.lang.Integer.MAX_VALUE, currentState));
1628          children.add(new Property("statusDate", "", "An effective date or period for a status of the cited artifact.", 0, java.lang.Integer.MAX_VALUE, statusDate));
1629          children.add(new Property("title", "", "The title details of the article or artifact.", 0, java.lang.Integer.MAX_VALUE, title));
1630          children.add(new Property("abstract", "", "Summary of the article or artifact.", 0, java.lang.Integer.MAX_VALUE, abstract_));
1631          children.add(new Property("part", "", "The component of the article or artifact.", 0, 1, part));
1632          children.add(new Property("relatesTo", "RelatedArtifact", "The artifact related to the cited artifact.", 0, java.lang.Integer.MAX_VALUE, relatesTo));
1633          children.add(new Property("publicationForm", "", "If multiple, used to represent alternative forms of the article that are not separate citations.", 0, java.lang.Integer.MAX_VALUE, publicationForm));
1634          children.add(new Property("webLocation", "", "Used for any URL for the article or artifact cited.", 0, java.lang.Integer.MAX_VALUE, webLocation));
1635          children.add(new Property("classification", "", "The assignment to an organizing scheme.", 0, java.lang.Integer.MAX_VALUE, classification));
1636          children.add(new Property("contributorship", "", "This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements.", 0, 1, contributorship));
1637          children.add(new Property("note", "Annotation", "Any additional information or content for the article or artifact.", 0, java.lang.Integer.MAX_VALUE, note));
1638        }
1639
1640        @Override
1641        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1642          switch (_hash) {
1643          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier);
1644          case -1007604940: /*relatedIdentifier*/  return new Property("relatedIdentifier", "Identifier", "A formal identifier that is used to identify things closely related to this citation.", 0, java.lang.Integer.MAX_VALUE, relatedIdentifier);
1645          case 540917457: /*dateAccessed*/  return new Property("dateAccessed", "dateTime", "When the cited artifact was accessed.", 0, 1, dateAccessed);
1646          case 351608024: /*version*/  return new Property("version", "", "The defined version of the cited artifact.", 0, 1, version);
1647          case 1457822360: /*currentState*/  return new Property("currentState", "CodeableConcept", "The status of the cited artifact.", 0, java.lang.Integer.MAX_VALUE, currentState);
1648          case 247524032: /*statusDate*/  return new Property("statusDate", "", "An effective date or period for a status of the cited artifact.", 0, java.lang.Integer.MAX_VALUE, statusDate);
1649          case 110371416: /*title*/  return new Property("title", "", "The title details of the article or artifact.", 0, java.lang.Integer.MAX_VALUE, title);
1650          case 1732898850: /*abstract*/  return new Property("abstract", "", "Summary of the article or artifact.", 0, java.lang.Integer.MAX_VALUE, abstract_);
1651          case 3433459: /*part*/  return new Property("part", "", "The component of the article or artifact.", 0, 1, part);
1652          case -7765931: /*relatesTo*/  return new Property("relatesTo", "RelatedArtifact", "The artifact related to the cited artifact.", 0, java.lang.Integer.MAX_VALUE, relatesTo);
1653          case 1470639376: /*publicationForm*/  return new Property("publicationForm", "", "If multiple, used to represent alternative forms of the article that are not separate citations.", 0, java.lang.Integer.MAX_VALUE, publicationForm);
1654          case -828032215: /*webLocation*/  return new Property("webLocation", "", "Used for any URL for the article or artifact cited.", 0, java.lang.Integer.MAX_VALUE, webLocation);
1655          case 382350310: /*classification*/  return new Property("classification", "", "The assignment to an organizing scheme.", 0, java.lang.Integer.MAX_VALUE, classification);
1656          case 538727831: /*contributorship*/  return new Property("contributorship", "", "This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements.", 0, 1, contributorship);
1657          case 3387378: /*note*/  return new Property("note", "Annotation", "Any additional information or content for the article or artifact.", 0, java.lang.Integer.MAX_VALUE, note);
1658          default: return super.getNamedProperty(_hash, _name, _checkValid);
1659          }
1660
1661        }
1662
1663      @Override
1664      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1665        switch (hash) {
1666        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1667        case -1007604940: /*relatedIdentifier*/ return this.relatedIdentifier == null ? new Base[0] : this.relatedIdentifier.toArray(new Base[this.relatedIdentifier.size()]); // Identifier
1668        case 540917457: /*dateAccessed*/ return this.dateAccessed == null ? new Base[0] : new Base[] {this.dateAccessed}; // DateTimeType
1669        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // CitationCitedArtifactVersionComponent
1670        case 1457822360: /*currentState*/ return this.currentState == null ? new Base[0] : this.currentState.toArray(new Base[this.currentState.size()]); // CodeableConcept
1671        case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : this.statusDate.toArray(new Base[this.statusDate.size()]); // CitationCitedArtifactStatusDateComponent
1672        case 110371416: /*title*/ return this.title == null ? new Base[0] : this.title.toArray(new Base[this.title.size()]); // CitationCitedArtifactTitleComponent
1673        case 1732898850: /*abstract*/ return this.abstract_ == null ? new Base[0] : this.abstract_.toArray(new Base[this.abstract_.size()]); // CitationCitedArtifactAbstractComponent
1674        case 3433459: /*part*/ return this.part == null ? new Base[0] : new Base[] {this.part}; // CitationCitedArtifactPartComponent
1675        case -7765931: /*relatesTo*/ return this.relatesTo == null ? new Base[0] : this.relatesTo.toArray(new Base[this.relatesTo.size()]); // RelatedArtifact
1676        case 1470639376: /*publicationForm*/ return this.publicationForm == null ? new Base[0] : this.publicationForm.toArray(new Base[this.publicationForm.size()]); // CitationCitedArtifactPublicationFormComponent
1677        case -828032215: /*webLocation*/ return this.webLocation == null ? new Base[0] : this.webLocation.toArray(new Base[this.webLocation.size()]); // CitationCitedArtifactWebLocationComponent
1678        case 382350310: /*classification*/ return this.classification == null ? new Base[0] : this.classification.toArray(new Base[this.classification.size()]); // CitationCitedArtifactClassificationComponent
1679        case 538727831: /*contributorship*/ return this.contributorship == null ? new Base[0] : new Base[] {this.contributorship}; // CitationCitedArtifactContributorshipComponent
1680        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1681        default: return super.getProperty(hash, name, checkValid);
1682        }
1683
1684      }
1685
1686      @Override
1687      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1688        switch (hash) {
1689        case -1618432855: // identifier
1690          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1691          return value;
1692        case -1007604940: // relatedIdentifier
1693          this.getRelatedIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1694          return value;
1695        case 540917457: // dateAccessed
1696          this.dateAccessed = TypeConvertor.castToDateTime(value); // DateTimeType
1697          return value;
1698        case 351608024: // version
1699          this.version = (CitationCitedArtifactVersionComponent) value; // CitationCitedArtifactVersionComponent
1700          return value;
1701        case 1457822360: // currentState
1702          this.getCurrentState().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1703          return value;
1704        case 247524032: // statusDate
1705          this.getStatusDate().add((CitationCitedArtifactStatusDateComponent) value); // CitationCitedArtifactStatusDateComponent
1706          return value;
1707        case 110371416: // title
1708          this.getTitle().add((CitationCitedArtifactTitleComponent) value); // CitationCitedArtifactTitleComponent
1709          return value;
1710        case 1732898850: // abstract
1711          this.getAbstract().add((CitationCitedArtifactAbstractComponent) value); // CitationCitedArtifactAbstractComponent
1712          return value;
1713        case 3433459: // part
1714          this.part = (CitationCitedArtifactPartComponent) value; // CitationCitedArtifactPartComponent
1715          return value;
1716        case -7765931: // relatesTo
1717          this.getRelatesTo().add(TypeConvertor.castToRelatedArtifact(value)); // RelatedArtifact
1718          return value;
1719        case 1470639376: // publicationForm
1720          this.getPublicationForm().add((CitationCitedArtifactPublicationFormComponent) value); // CitationCitedArtifactPublicationFormComponent
1721          return value;
1722        case -828032215: // webLocation
1723          this.getWebLocation().add((CitationCitedArtifactWebLocationComponent) value); // CitationCitedArtifactWebLocationComponent
1724          return value;
1725        case 382350310: // classification
1726          this.getClassification().add((CitationCitedArtifactClassificationComponent) value); // CitationCitedArtifactClassificationComponent
1727          return value;
1728        case 538727831: // contributorship
1729          this.contributorship = (CitationCitedArtifactContributorshipComponent) value; // CitationCitedArtifactContributorshipComponent
1730          return value;
1731        case 3387378: // note
1732          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
1733          return value;
1734        default: return super.setProperty(hash, name, value);
1735        }
1736
1737      }
1738
1739      @Override
1740      public Base setProperty(String name, Base value) throws FHIRException {
1741        if (name.equals("identifier")) {
1742          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1743        } else if (name.equals("relatedIdentifier")) {
1744          this.getRelatedIdentifier().add(TypeConvertor.castToIdentifier(value));
1745        } else if (name.equals("dateAccessed")) {
1746          this.dateAccessed = TypeConvertor.castToDateTime(value); // DateTimeType
1747        } else if (name.equals("version")) {
1748          this.version = (CitationCitedArtifactVersionComponent) value; // CitationCitedArtifactVersionComponent
1749        } else if (name.equals("currentState")) {
1750          this.getCurrentState().add(TypeConvertor.castToCodeableConcept(value));
1751        } else if (name.equals("statusDate")) {
1752          this.getStatusDate().add((CitationCitedArtifactStatusDateComponent) value);
1753        } else if (name.equals("title")) {
1754          this.getTitle().add((CitationCitedArtifactTitleComponent) value);
1755        } else if (name.equals("abstract")) {
1756          this.getAbstract().add((CitationCitedArtifactAbstractComponent) value);
1757        } else if (name.equals("part")) {
1758          this.part = (CitationCitedArtifactPartComponent) value; // CitationCitedArtifactPartComponent
1759        } else if (name.equals("relatesTo")) {
1760          this.getRelatesTo().add(TypeConvertor.castToRelatedArtifact(value));
1761        } else if (name.equals("publicationForm")) {
1762          this.getPublicationForm().add((CitationCitedArtifactPublicationFormComponent) value);
1763        } else if (name.equals("webLocation")) {
1764          this.getWebLocation().add((CitationCitedArtifactWebLocationComponent) value);
1765        } else if (name.equals("classification")) {
1766          this.getClassification().add((CitationCitedArtifactClassificationComponent) value);
1767        } else if (name.equals("contributorship")) {
1768          this.contributorship = (CitationCitedArtifactContributorshipComponent) value; // CitationCitedArtifactContributorshipComponent
1769        } else if (name.equals("note")) {
1770          this.getNote().add(TypeConvertor.castToAnnotation(value));
1771        } else
1772          return super.setProperty(name, value);
1773        return value;
1774      }
1775
1776      @Override
1777      public Base makeProperty(int hash, String name) throws FHIRException {
1778        switch (hash) {
1779        case -1618432855:  return addIdentifier(); 
1780        case -1007604940:  return addRelatedIdentifier(); 
1781        case 540917457:  return getDateAccessedElement();
1782        case 351608024:  return getVersion();
1783        case 1457822360:  return addCurrentState(); 
1784        case 247524032:  return addStatusDate(); 
1785        case 110371416:  return addTitle(); 
1786        case 1732898850:  return addAbstract(); 
1787        case 3433459:  return getPart();
1788        case -7765931:  return addRelatesTo(); 
1789        case 1470639376:  return addPublicationForm(); 
1790        case -828032215:  return addWebLocation(); 
1791        case 382350310:  return addClassification(); 
1792        case 538727831:  return getContributorship();
1793        case 3387378:  return addNote(); 
1794        default: return super.makeProperty(hash, name);
1795        }
1796
1797      }
1798
1799      @Override
1800      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1801        switch (hash) {
1802        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1803        case -1007604940: /*relatedIdentifier*/ return new String[] {"Identifier"};
1804        case 540917457: /*dateAccessed*/ return new String[] {"dateTime"};
1805        case 351608024: /*version*/ return new String[] {};
1806        case 1457822360: /*currentState*/ return new String[] {"CodeableConcept"};
1807        case 247524032: /*statusDate*/ return new String[] {};
1808        case 110371416: /*title*/ return new String[] {};
1809        case 1732898850: /*abstract*/ return new String[] {};
1810        case 3433459: /*part*/ return new String[] {};
1811        case -7765931: /*relatesTo*/ return new String[] {"RelatedArtifact"};
1812        case 1470639376: /*publicationForm*/ return new String[] {};
1813        case -828032215: /*webLocation*/ return new String[] {};
1814        case 382350310: /*classification*/ return new String[] {};
1815        case 538727831: /*contributorship*/ return new String[] {};
1816        case 3387378: /*note*/ return new String[] {"Annotation"};
1817        default: return super.getTypesForProperty(hash, name);
1818        }
1819
1820      }
1821
1822      @Override
1823      public Base addChild(String name) throws FHIRException {
1824        if (name.equals("identifier")) {
1825          return addIdentifier();
1826        }
1827        else if (name.equals("relatedIdentifier")) {
1828          return addRelatedIdentifier();
1829        }
1830        else if (name.equals("dateAccessed")) {
1831          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.dateAccessed");
1832        }
1833        else if (name.equals("version")) {
1834          this.version = new CitationCitedArtifactVersionComponent();
1835          return this.version;
1836        }
1837        else if (name.equals("currentState")) {
1838          return addCurrentState();
1839        }
1840        else if (name.equals("statusDate")) {
1841          return addStatusDate();
1842        }
1843        else if (name.equals("title")) {
1844          return addTitle();
1845        }
1846        else if (name.equals("abstract")) {
1847          return addAbstract();
1848        }
1849        else if (name.equals("part")) {
1850          this.part = new CitationCitedArtifactPartComponent();
1851          return this.part;
1852        }
1853        else if (name.equals("relatesTo")) {
1854          return addRelatesTo();
1855        }
1856        else if (name.equals("publicationForm")) {
1857          return addPublicationForm();
1858        }
1859        else if (name.equals("webLocation")) {
1860          return addWebLocation();
1861        }
1862        else if (name.equals("classification")) {
1863          return addClassification();
1864        }
1865        else if (name.equals("contributorship")) {
1866          this.contributorship = new CitationCitedArtifactContributorshipComponent();
1867          return this.contributorship;
1868        }
1869        else if (name.equals("note")) {
1870          return addNote();
1871        }
1872        else
1873          return super.addChild(name);
1874      }
1875
1876      public CitationCitedArtifactComponent copy() {
1877        CitationCitedArtifactComponent dst = new CitationCitedArtifactComponent();
1878        copyValues(dst);
1879        return dst;
1880      }
1881
1882      public void copyValues(CitationCitedArtifactComponent dst) {
1883        super.copyValues(dst);
1884        if (identifier != null) {
1885          dst.identifier = new ArrayList<Identifier>();
1886          for (Identifier i : identifier)
1887            dst.identifier.add(i.copy());
1888        };
1889        if (relatedIdentifier != null) {
1890          dst.relatedIdentifier = new ArrayList<Identifier>();
1891          for (Identifier i : relatedIdentifier)
1892            dst.relatedIdentifier.add(i.copy());
1893        };
1894        dst.dateAccessed = dateAccessed == null ? null : dateAccessed.copy();
1895        dst.version = version == null ? null : version.copy();
1896        if (currentState != null) {
1897          dst.currentState = new ArrayList<CodeableConcept>();
1898          for (CodeableConcept i : currentState)
1899            dst.currentState.add(i.copy());
1900        };
1901        if (statusDate != null) {
1902          dst.statusDate = new ArrayList<CitationCitedArtifactStatusDateComponent>();
1903          for (CitationCitedArtifactStatusDateComponent i : statusDate)
1904            dst.statusDate.add(i.copy());
1905        };
1906        if (title != null) {
1907          dst.title = new ArrayList<CitationCitedArtifactTitleComponent>();
1908          for (CitationCitedArtifactTitleComponent i : title)
1909            dst.title.add(i.copy());
1910        };
1911        if (abstract_ != null) {
1912          dst.abstract_ = new ArrayList<CitationCitedArtifactAbstractComponent>();
1913          for (CitationCitedArtifactAbstractComponent i : abstract_)
1914            dst.abstract_.add(i.copy());
1915        };
1916        dst.part = part == null ? null : part.copy();
1917        if (relatesTo != null) {
1918          dst.relatesTo = new ArrayList<RelatedArtifact>();
1919          for (RelatedArtifact i : relatesTo)
1920            dst.relatesTo.add(i.copy());
1921        };
1922        if (publicationForm != null) {
1923          dst.publicationForm = new ArrayList<CitationCitedArtifactPublicationFormComponent>();
1924          for (CitationCitedArtifactPublicationFormComponent i : publicationForm)
1925            dst.publicationForm.add(i.copy());
1926        };
1927        if (webLocation != null) {
1928          dst.webLocation = new ArrayList<CitationCitedArtifactWebLocationComponent>();
1929          for (CitationCitedArtifactWebLocationComponent i : webLocation)
1930            dst.webLocation.add(i.copy());
1931        };
1932        if (classification != null) {
1933          dst.classification = new ArrayList<CitationCitedArtifactClassificationComponent>();
1934          for (CitationCitedArtifactClassificationComponent i : classification)
1935            dst.classification.add(i.copy());
1936        };
1937        dst.contributorship = contributorship == null ? null : contributorship.copy();
1938        if (note != null) {
1939          dst.note = new ArrayList<Annotation>();
1940          for (Annotation i : note)
1941            dst.note.add(i.copy());
1942        };
1943      }
1944
1945      @Override
1946      public boolean equalsDeep(Base other_) {
1947        if (!super.equalsDeep(other_))
1948          return false;
1949        if (!(other_ instanceof CitationCitedArtifactComponent))
1950          return false;
1951        CitationCitedArtifactComponent o = (CitationCitedArtifactComponent) other_;
1952        return compareDeep(identifier, o.identifier, true) && compareDeep(relatedIdentifier, o.relatedIdentifier, true)
1953           && compareDeep(dateAccessed, o.dateAccessed, true) && compareDeep(version, o.version, true) && compareDeep(currentState, o.currentState, true)
1954           && compareDeep(statusDate, o.statusDate, true) && compareDeep(title, o.title, true) && compareDeep(abstract_, o.abstract_, true)
1955           && compareDeep(part, o.part, true) && compareDeep(relatesTo, o.relatesTo, true) && compareDeep(publicationForm, o.publicationForm, true)
1956           && compareDeep(webLocation, o.webLocation, true) && compareDeep(classification, o.classification, true)
1957           && compareDeep(contributorship, o.contributorship, true) && compareDeep(note, o.note, true);
1958      }
1959
1960      @Override
1961      public boolean equalsShallow(Base other_) {
1962        if (!super.equalsShallow(other_))
1963          return false;
1964        if (!(other_ instanceof CitationCitedArtifactComponent))
1965          return false;
1966        CitationCitedArtifactComponent o = (CitationCitedArtifactComponent) other_;
1967        return compareValues(dateAccessed, o.dateAccessed, true);
1968      }
1969
1970      public boolean isEmpty() {
1971        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, relatedIdentifier
1972          , dateAccessed, version, currentState, statusDate, title, abstract_, part, relatesTo
1973          , publicationForm, webLocation, classification, contributorship, note);
1974      }
1975
1976  public String fhirType() {
1977    return "Citation.citedArtifact";
1978
1979  }
1980
1981  }
1982
1983    @Block()
1984    public static class CitationCitedArtifactVersionComponent extends BackboneElement implements IBaseBackboneElement {
1985        /**
1986         * The version number or other version identifier.
1987         */
1988        @Child(name = "value", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1989        @Description(shortDefinition="The version number or other version identifier", formalDefinition="The version number or other version identifier." )
1990        protected StringType value;
1991
1992        /**
1993         * Citation for the main version of the cited artifact.
1994         */
1995        @Child(name = "baseCitation", type = {Citation.class}, order=2, min=0, max=1, modifier=false, summary=false)
1996        @Description(shortDefinition="Citation for the main version of the cited artifact", formalDefinition="Citation for the main version of the cited artifact." )
1997        protected Reference baseCitation;
1998
1999        private static final long serialVersionUID = 1437090319L;
2000
2001    /**
2002     * Constructor
2003     */
2004      public CitationCitedArtifactVersionComponent() {
2005        super();
2006      }
2007
2008    /**
2009     * Constructor
2010     */
2011      public CitationCitedArtifactVersionComponent(String value) {
2012        super();
2013        this.setValue(value);
2014      }
2015
2016        /**
2017         * @return {@link #value} (The version number or other version identifier.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
2018         */
2019        public StringType getValueElement() { 
2020          if (this.value == null)
2021            if (Configuration.errorOnAutoCreate())
2022              throw new Error("Attempt to auto-create CitationCitedArtifactVersionComponent.value");
2023            else if (Configuration.doAutoCreate())
2024              this.value = new StringType(); // bb
2025          return this.value;
2026        }
2027
2028        public boolean hasValueElement() { 
2029          return this.value != null && !this.value.isEmpty();
2030        }
2031
2032        public boolean hasValue() { 
2033          return this.value != null && !this.value.isEmpty();
2034        }
2035
2036        /**
2037         * @param value {@link #value} (The version number or other version identifier.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
2038         */
2039        public CitationCitedArtifactVersionComponent setValueElement(StringType value) { 
2040          this.value = value;
2041          return this;
2042        }
2043
2044        /**
2045         * @return The version number or other version identifier.
2046         */
2047        public String getValue() { 
2048          return this.value == null ? null : this.value.getValue();
2049        }
2050
2051        /**
2052         * @param value The version number or other version identifier.
2053         */
2054        public CitationCitedArtifactVersionComponent setValue(String value) { 
2055            if (this.value == null)
2056              this.value = new StringType();
2057            this.value.setValue(value);
2058          return this;
2059        }
2060
2061        /**
2062         * @return {@link #baseCitation} (Citation for the main version of the cited artifact.)
2063         */
2064        public Reference getBaseCitation() { 
2065          if (this.baseCitation == null)
2066            if (Configuration.errorOnAutoCreate())
2067              throw new Error("Attempt to auto-create CitationCitedArtifactVersionComponent.baseCitation");
2068            else if (Configuration.doAutoCreate())
2069              this.baseCitation = new Reference(); // cc
2070          return this.baseCitation;
2071        }
2072
2073        public boolean hasBaseCitation() { 
2074          return this.baseCitation != null && !this.baseCitation.isEmpty();
2075        }
2076
2077        /**
2078         * @param value {@link #baseCitation} (Citation for the main version of the cited artifact.)
2079         */
2080        public CitationCitedArtifactVersionComponent setBaseCitation(Reference value) { 
2081          this.baseCitation = value;
2082          return this;
2083        }
2084
2085        protected void listChildren(List<Property> children) {
2086          super.listChildren(children);
2087          children.add(new Property("value", "string", "The version number or other version identifier.", 0, 1, value));
2088          children.add(new Property("baseCitation", "Reference(Citation)", "Citation for the main version of the cited artifact.", 0, 1, baseCitation));
2089        }
2090
2091        @Override
2092        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2093          switch (_hash) {
2094          case 111972721: /*value*/  return new Property("value", "string", "The version number or other version identifier.", 0, 1, value);
2095          case 1182995672: /*baseCitation*/  return new Property("baseCitation", "Reference(Citation)", "Citation for the main version of the cited artifact.", 0, 1, baseCitation);
2096          default: return super.getNamedProperty(_hash, _name, _checkValid);
2097          }
2098
2099        }
2100
2101      @Override
2102      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2103        switch (hash) {
2104        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
2105        case 1182995672: /*baseCitation*/ return this.baseCitation == null ? new Base[0] : new Base[] {this.baseCitation}; // Reference
2106        default: return super.getProperty(hash, name, checkValid);
2107        }
2108
2109      }
2110
2111      @Override
2112      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2113        switch (hash) {
2114        case 111972721: // value
2115          this.value = TypeConvertor.castToString(value); // StringType
2116          return value;
2117        case 1182995672: // baseCitation
2118          this.baseCitation = TypeConvertor.castToReference(value); // Reference
2119          return value;
2120        default: return super.setProperty(hash, name, value);
2121        }
2122
2123      }
2124
2125      @Override
2126      public Base setProperty(String name, Base value) throws FHIRException {
2127        if (name.equals("value")) {
2128          this.value = TypeConvertor.castToString(value); // StringType
2129        } else if (name.equals("baseCitation")) {
2130          this.baseCitation = TypeConvertor.castToReference(value); // Reference
2131        } else
2132          return super.setProperty(name, value);
2133        return value;
2134      }
2135
2136      @Override
2137      public Base makeProperty(int hash, String name) throws FHIRException {
2138        switch (hash) {
2139        case 111972721:  return getValueElement();
2140        case 1182995672:  return getBaseCitation();
2141        default: return super.makeProperty(hash, name);
2142        }
2143
2144      }
2145
2146      @Override
2147      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2148        switch (hash) {
2149        case 111972721: /*value*/ return new String[] {"string"};
2150        case 1182995672: /*baseCitation*/ return new String[] {"Reference"};
2151        default: return super.getTypesForProperty(hash, name);
2152        }
2153
2154      }
2155
2156      @Override
2157      public Base addChild(String name) throws FHIRException {
2158        if (name.equals("value")) {
2159          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.version.value");
2160        }
2161        else if (name.equals("baseCitation")) {
2162          this.baseCitation = new Reference();
2163          return this.baseCitation;
2164        }
2165        else
2166          return super.addChild(name);
2167      }
2168
2169      public CitationCitedArtifactVersionComponent copy() {
2170        CitationCitedArtifactVersionComponent dst = new CitationCitedArtifactVersionComponent();
2171        copyValues(dst);
2172        return dst;
2173      }
2174
2175      public void copyValues(CitationCitedArtifactVersionComponent dst) {
2176        super.copyValues(dst);
2177        dst.value = value == null ? null : value.copy();
2178        dst.baseCitation = baseCitation == null ? null : baseCitation.copy();
2179      }
2180
2181      @Override
2182      public boolean equalsDeep(Base other_) {
2183        if (!super.equalsDeep(other_))
2184          return false;
2185        if (!(other_ instanceof CitationCitedArtifactVersionComponent))
2186          return false;
2187        CitationCitedArtifactVersionComponent o = (CitationCitedArtifactVersionComponent) other_;
2188        return compareDeep(value, o.value, true) && compareDeep(baseCitation, o.baseCitation, true);
2189      }
2190
2191      @Override
2192      public boolean equalsShallow(Base other_) {
2193        if (!super.equalsShallow(other_))
2194          return false;
2195        if (!(other_ instanceof CitationCitedArtifactVersionComponent))
2196          return false;
2197        CitationCitedArtifactVersionComponent o = (CitationCitedArtifactVersionComponent) other_;
2198        return compareValues(value, o.value, true);
2199      }
2200
2201      public boolean isEmpty() {
2202        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value, baseCitation);
2203      }
2204
2205  public String fhirType() {
2206    return "Citation.citedArtifact.version";
2207
2208  }
2209
2210  }
2211
2212    @Block()
2213    public static class CitationCitedArtifactStatusDateComponent extends BackboneElement implements IBaseBackboneElement {
2214        /**
2215         * Classification of the status.
2216         */
2217        @Child(name = "activity", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
2218        @Description(shortDefinition="Classification of the status", formalDefinition="Classification of the status." )
2219        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-status-type")
2220        protected CodeableConcept activity;
2221
2222        /**
2223         * Either occurred or expected.
2224         */
2225        @Child(name = "actual", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2226        @Description(shortDefinition="Either occurred or expected", formalDefinition="Either occurred or expected." )
2227        protected BooleanType actual;
2228
2229        /**
2230         * When the status started and/or ended.
2231         */
2232        @Child(name = "period", type = {Period.class}, order=3, min=1, max=1, modifier=false, summary=false)
2233        @Description(shortDefinition="When the status started and/or ended", formalDefinition="When the status started and/or ended." )
2234        protected Period period;
2235
2236        private static final long serialVersionUID = 1123586924L;
2237
2238    /**
2239     * Constructor
2240     */
2241      public CitationCitedArtifactStatusDateComponent() {
2242        super();
2243      }
2244
2245    /**
2246     * Constructor
2247     */
2248      public CitationCitedArtifactStatusDateComponent(CodeableConcept activity, Period period) {
2249        super();
2250        this.setActivity(activity);
2251        this.setPeriod(period);
2252      }
2253
2254        /**
2255         * @return {@link #activity} (Classification of the status.)
2256         */
2257        public CodeableConcept getActivity() { 
2258          if (this.activity == null)
2259            if (Configuration.errorOnAutoCreate())
2260              throw new Error("Attempt to auto-create CitationCitedArtifactStatusDateComponent.activity");
2261            else if (Configuration.doAutoCreate())
2262              this.activity = new CodeableConcept(); // cc
2263          return this.activity;
2264        }
2265
2266        public boolean hasActivity() { 
2267          return this.activity != null && !this.activity.isEmpty();
2268        }
2269
2270        /**
2271         * @param value {@link #activity} (Classification of the status.)
2272         */
2273        public CitationCitedArtifactStatusDateComponent setActivity(CodeableConcept value) { 
2274          this.activity = value;
2275          return this;
2276        }
2277
2278        /**
2279         * @return {@link #actual} (Either occurred or expected.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
2280         */
2281        public BooleanType getActualElement() { 
2282          if (this.actual == null)
2283            if (Configuration.errorOnAutoCreate())
2284              throw new Error("Attempt to auto-create CitationCitedArtifactStatusDateComponent.actual");
2285            else if (Configuration.doAutoCreate())
2286              this.actual = new BooleanType(); // bb
2287          return this.actual;
2288        }
2289
2290        public boolean hasActualElement() { 
2291          return this.actual != null && !this.actual.isEmpty();
2292        }
2293
2294        public boolean hasActual() { 
2295          return this.actual != null && !this.actual.isEmpty();
2296        }
2297
2298        /**
2299         * @param value {@link #actual} (Either occurred or expected.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
2300         */
2301        public CitationCitedArtifactStatusDateComponent setActualElement(BooleanType value) { 
2302          this.actual = value;
2303          return this;
2304        }
2305
2306        /**
2307         * @return Either occurred or expected.
2308         */
2309        public boolean getActual() { 
2310          return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue();
2311        }
2312
2313        /**
2314         * @param value Either occurred or expected.
2315         */
2316        public CitationCitedArtifactStatusDateComponent setActual(boolean value) { 
2317            if (this.actual == null)
2318              this.actual = new BooleanType();
2319            this.actual.setValue(value);
2320          return this;
2321        }
2322
2323        /**
2324         * @return {@link #period} (When the status started and/or ended.)
2325         */
2326        public Period getPeriod() { 
2327          if (this.period == null)
2328            if (Configuration.errorOnAutoCreate())
2329              throw new Error("Attempt to auto-create CitationCitedArtifactStatusDateComponent.period");
2330            else if (Configuration.doAutoCreate())
2331              this.period = new Period(); // cc
2332          return this.period;
2333        }
2334
2335        public boolean hasPeriod() { 
2336          return this.period != null && !this.period.isEmpty();
2337        }
2338
2339        /**
2340         * @param value {@link #period} (When the status started and/or ended.)
2341         */
2342        public CitationCitedArtifactStatusDateComponent setPeriod(Period value) { 
2343          this.period = value;
2344          return this;
2345        }
2346
2347        protected void listChildren(List<Property> children) {
2348          super.listChildren(children);
2349          children.add(new Property("activity", "CodeableConcept", "Classification of the status.", 0, 1, activity));
2350          children.add(new Property("actual", "boolean", "Either occurred or expected.", 0, 1, actual));
2351          children.add(new Property("period", "Period", "When the status started and/or ended.", 0, 1, period));
2352        }
2353
2354        @Override
2355        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2356          switch (_hash) {
2357          case -1655966961: /*activity*/  return new Property("activity", "CodeableConcept", "Classification of the status.", 0, 1, activity);
2358          case -1422939762: /*actual*/  return new Property("actual", "boolean", "Either occurred or expected.", 0, 1, actual);
2359          case -991726143: /*period*/  return new Property("period", "Period", "When the status started and/or ended.", 0, 1, period);
2360          default: return super.getNamedProperty(_hash, _name, _checkValid);
2361          }
2362
2363        }
2364
2365      @Override
2366      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2367        switch (hash) {
2368        case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : new Base[] {this.activity}; // CodeableConcept
2369        case -1422939762: /*actual*/ return this.actual == null ? new Base[0] : new Base[] {this.actual}; // BooleanType
2370        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
2371        default: return super.getProperty(hash, name, checkValid);
2372        }
2373
2374      }
2375
2376      @Override
2377      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2378        switch (hash) {
2379        case -1655966961: // activity
2380          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2381          return value;
2382        case -1422939762: // actual
2383          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
2384          return value;
2385        case -991726143: // period
2386          this.period = TypeConvertor.castToPeriod(value); // Period
2387          return value;
2388        default: return super.setProperty(hash, name, value);
2389        }
2390
2391      }
2392
2393      @Override
2394      public Base setProperty(String name, Base value) throws FHIRException {
2395        if (name.equals("activity")) {
2396          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2397        } else if (name.equals("actual")) {
2398          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
2399        } else if (name.equals("period")) {
2400          this.period = TypeConvertor.castToPeriod(value); // Period
2401        } else
2402          return super.setProperty(name, value);
2403        return value;
2404      }
2405
2406      @Override
2407      public Base makeProperty(int hash, String name) throws FHIRException {
2408        switch (hash) {
2409        case -1655966961:  return getActivity();
2410        case -1422939762:  return getActualElement();
2411        case -991726143:  return getPeriod();
2412        default: return super.makeProperty(hash, name);
2413        }
2414
2415      }
2416
2417      @Override
2418      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2419        switch (hash) {
2420        case -1655966961: /*activity*/ return new String[] {"CodeableConcept"};
2421        case -1422939762: /*actual*/ return new String[] {"boolean"};
2422        case -991726143: /*period*/ return new String[] {"Period"};
2423        default: return super.getTypesForProperty(hash, name);
2424        }
2425
2426      }
2427
2428      @Override
2429      public Base addChild(String name) throws FHIRException {
2430        if (name.equals("activity")) {
2431          this.activity = new CodeableConcept();
2432          return this.activity;
2433        }
2434        else if (name.equals("actual")) {
2435          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.statusDate.actual");
2436        }
2437        else if (name.equals("period")) {
2438          this.period = new Period();
2439          return this.period;
2440        }
2441        else
2442          return super.addChild(name);
2443      }
2444
2445      public CitationCitedArtifactStatusDateComponent copy() {
2446        CitationCitedArtifactStatusDateComponent dst = new CitationCitedArtifactStatusDateComponent();
2447        copyValues(dst);
2448        return dst;
2449      }
2450
2451      public void copyValues(CitationCitedArtifactStatusDateComponent dst) {
2452        super.copyValues(dst);
2453        dst.activity = activity == null ? null : activity.copy();
2454        dst.actual = actual == null ? null : actual.copy();
2455        dst.period = period == null ? null : period.copy();
2456      }
2457
2458      @Override
2459      public boolean equalsDeep(Base other_) {
2460        if (!super.equalsDeep(other_))
2461          return false;
2462        if (!(other_ instanceof CitationCitedArtifactStatusDateComponent))
2463          return false;
2464        CitationCitedArtifactStatusDateComponent o = (CitationCitedArtifactStatusDateComponent) other_;
2465        return compareDeep(activity, o.activity, true) && compareDeep(actual, o.actual, true) && compareDeep(period, o.period, true)
2466          ;
2467      }
2468
2469      @Override
2470      public boolean equalsShallow(Base other_) {
2471        if (!super.equalsShallow(other_))
2472          return false;
2473        if (!(other_ instanceof CitationCitedArtifactStatusDateComponent))
2474          return false;
2475        CitationCitedArtifactStatusDateComponent o = (CitationCitedArtifactStatusDateComponent) other_;
2476        return compareValues(actual, o.actual, true);
2477      }
2478
2479      public boolean isEmpty() {
2480        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(activity, actual, period
2481          );
2482      }
2483
2484  public String fhirType() {
2485    return "Citation.citedArtifact.statusDate";
2486
2487  }
2488
2489  }
2490
2491    @Block()
2492    public static class CitationCitedArtifactTitleComponent extends BackboneElement implements IBaseBackboneElement {
2493        /**
2494         * Used to express the reason or specific aspect for the title.
2495         */
2496        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2497        @Description(shortDefinition="The kind of title", formalDefinition="Used to express the reason or specific aspect for the title." )
2498        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/title-type")
2499        protected List<CodeableConcept> type;
2500
2501        /**
2502         * Used to express the specific language.
2503         */
2504        @Child(name = "language", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
2505        @Description(shortDefinition="Used to express the specific language", formalDefinition="Used to express the specific language." )
2506        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
2507        protected CodeableConcept language;
2508
2509        /**
2510         * The title of the article or artifact.
2511         */
2512        @Child(name = "text", type = {MarkdownType.class}, order=3, min=1, max=1, modifier=false, summary=false)
2513        @Description(shortDefinition="The title of the article or artifact", formalDefinition="The title of the article or artifact." )
2514        protected MarkdownType text;
2515
2516        private static final long serialVersionUID = 1526221998L;
2517
2518    /**
2519     * Constructor
2520     */
2521      public CitationCitedArtifactTitleComponent() {
2522        super();
2523      }
2524
2525    /**
2526     * Constructor
2527     */
2528      public CitationCitedArtifactTitleComponent(String text) {
2529        super();
2530        this.setText(text);
2531      }
2532
2533        /**
2534         * @return {@link #type} (Used to express the reason or specific aspect for the title.)
2535         */
2536        public List<CodeableConcept> getType() { 
2537          if (this.type == null)
2538            this.type = new ArrayList<CodeableConcept>();
2539          return this.type;
2540        }
2541
2542        /**
2543         * @return Returns a reference to <code>this</code> for easy method chaining
2544         */
2545        public CitationCitedArtifactTitleComponent setType(List<CodeableConcept> theType) { 
2546          this.type = theType;
2547          return this;
2548        }
2549
2550        public boolean hasType() { 
2551          if (this.type == null)
2552            return false;
2553          for (CodeableConcept item : this.type)
2554            if (!item.isEmpty())
2555              return true;
2556          return false;
2557        }
2558
2559        public CodeableConcept addType() { //3
2560          CodeableConcept t = new CodeableConcept();
2561          if (this.type == null)
2562            this.type = new ArrayList<CodeableConcept>();
2563          this.type.add(t);
2564          return t;
2565        }
2566
2567        public CitationCitedArtifactTitleComponent addType(CodeableConcept t) { //3
2568          if (t == null)
2569            return this;
2570          if (this.type == null)
2571            this.type = new ArrayList<CodeableConcept>();
2572          this.type.add(t);
2573          return this;
2574        }
2575
2576        /**
2577         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
2578         */
2579        public CodeableConcept getTypeFirstRep() { 
2580          if (getType().isEmpty()) {
2581            addType();
2582          }
2583          return getType().get(0);
2584        }
2585
2586        /**
2587         * @return {@link #language} (Used to express the specific language.)
2588         */
2589        public CodeableConcept getLanguage() { 
2590          if (this.language == null)
2591            if (Configuration.errorOnAutoCreate())
2592              throw new Error("Attempt to auto-create CitationCitedArtifactTitleComponent.language");
2593            else if (Configuration.doAutoCreate())
2594              this.language = new CodeableConcept(); // cc
2595          return this.language;
2596        }
2597
2598        public boolean hasLanguage() { 
2599          return this.language != null && !this.language.isEmpty();
2600        }
2601
2602        /**
2603         * @param value {@link #language} (Used to express the specific language.)
2604         */
2605        public CitationCitedArtifactTitleComponent setLanguage(CodeableConcept value) { 
2606          this.language = value;
2607          return this;
2608        }
2609
2610        /**
2611         * @return {@link #text} (The title of the article or artifact.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
2612         */
2613        public MarkdownType getTextElement() { 
2614          if (this.text == null)
2615            if (Configuration.errorOnAutoCreate())
2616              throw new Error("Attempt to auto-create CitationCitedArtifactTitleComponent.text");
2617            else if (Configuration.doAutoCreate())
2618              this.text = new MarkdownType(); // bb
2619          return this.text;
2620        }
2621
2622        public boolean hasTextElement() { 
2623          return this.text != null && !this.text.isEmpty();
2624        }
2625
2626        public boolean hasText() { 
2627          return this.text != null && !this.text.isEmpty();
2628        }
2629
2630        /**
2631         * @param value {@link #text} (The title of the article or artifact.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
2632         */
2633        public CitationCitedArtifactTitleComponent setTextElement(MarkdownType value) { 
2634          this.text = value;
2635          return this;
2636        }
2637
2638        /**
2639         * @return The title of the article or artifact.
2640         */
2641        public String getText() { 
2642          return this.text == null ? null : this.text.getValue();
2643        }
2644
2645        /**
2646         * @param value The title of the article or artifact.
2647         */
2648        public CitationCitedArtifactTitleComponent setText(String value) { 
2649            if (this.text == null)
2650              this.text = new MarkdownType();
2651            this.text.setValue(value);
2652          return this;
2653        }
2654
2655        protected void listChildren(List<Property> children) {
2656          super.listChildren(children);
2657          children.add(new Property("type", "CodeableConcept", "Used to express the reason or specific aspect for the title.", 0, java.lang.Integer.MAX_VALUE, type));
2658          children.add(new Property("language", "CodeableConcept", "Used to express the specific language.", 0, 1, language));
2659          children.add(new Property("text", "markdown", "The title of the article or artifact.", 0, 1, text));
2660        }
2661
2662        @Override
2663        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2664          switch (_hash) {
2665          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Used to express the reason or specific aspect for the title.", 0, java.lang.Integer.MAX_VALUE, type);
2666          case -1613589672: /*language*/  return new Property("language", "CodeableConcept", "Used to express the specific language.", 0, 1, language);
2667          case 3556653: /*text*/  return new Property("text", "markdown", "The title of the article or artifact.", 0, 1, text);
2668          default: return super.getNamedProperty(_hash, _name, _checkValid);
2669          }
2670
2671        }
2672
2673      @Override
2674      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2675        switch (hash) {
2676        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
2677        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept
2678        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // MarkdownType
2679        default: return super.getProperty(hash, name, checkValid);
2680        }
2681
2682      }
2683
2684      @Override
2685      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2686        switch (hash) {
2687        case 3575610: // type
2688          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2689          return value;
2690        case -1613589672: // language
2691          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2692          return value;
2693        case 3556653: // text
2694          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
2695          return value;
2696        default: return super.setProperty(hash, name, value);
2697        }
2698
2699      }
2700
2701      @Override
2702      public Base setProperty(String name, Base value) throws FHIRException {
2703        if (name.equals("type")) {
2704          this.getType().add(TypeConvertor.castToCodeableConcept(value));
2705        } else if (name.equals("language")) {
2706          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2707        } else if (name.equals("text")) {
2708          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
2709        } else
2710          return super.setProperty(name, value);
2711        return value;
2712      }
2713
2714      @Override
2715      public Base makeProperty(int hash, String name) throws FHIRException {
2716        switch (hash) {
2717        case 3575610:  return addType(); 
2718        case -1613589672:  return getLanguage();
2719        case 3556653:  return getTextElement();
2720        default: return super.makeProperty(hash, name);
2721        }
2722
2723      }
2724
2725      @Override
2726      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2727        switch (hash) {
2728        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2729        case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
2730        case 3556653: /*text*/ return new String[] {"markdown"};
2731        default: return super.getTypesForProperty(hash, name);
2732        }
2733
2734      }
2735
2736      @Override
2737      public Base addChild(String name) throws FHIRException {
2738        if (name.equals("type")) {
2739          return addType();
2740        }
2741        else if (name.equals("language")) {
2742          this.language = new CodeableConcept();
2743          return this.language;
2744        }
2745        else if (name.equals("text")) {
2746          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.title.text");
2747        }
2748        else
2749          return super.addChild(name);
2750      }
2751
2752      public CitationCitedArtifactTitleComponent copy() {
2753        CitationCitedArtifactTitleComponent dst = new CitationCitedArtifactTitleComponent();
2754        copyValues(dst);
2755        return dst;
2756      }
2757
2758      public void copyValues(CitationCitedArtifactTitleComponent dst) {
2759        super.copyValues(dst);
2760        if (type != null) {
2761          dst.type = new ArrayList<CodeableConcept>();
2762          for (CodeableConcept i : type)
2763            dst.type.add(i.copy());
2764        };
2765        dst.language = language == null ? null : language.copy();
2766        dst.text = text == null ? null : text.copy();
2767      }
2768
2769      @Override
2770      public boolean equalsDeep(Base other_) {
2771        if (!super.equalsDeep(other_))
2772          return false;
2773        if (!(other_ instanceof CitationCitedArtifactTitleComponent))
2774          return false;
2775        CitationCitedArtifactTitleComponent o = (CitationCitedArtifactTitleComponent) other_;
2776        return compareDeep(type, o.type, true) && compareDeep(language, o.language, true) && compareDeep(text, o.text, true)
2777          ;
2778      }
2779
2780      @Override
2781      public boolean equalsShallow(Base other_) {
2782        if (!super.equalsShallow(other_))
2783          return false;
2784        if (!(other_ instanceof CitationCitedArtifactTitleComponent))
2785          return false;
2786        CitationCitedArtifactTitleComponent o = (CitationCitedArtifactTitleComponent) other_;
2787        return compareValues(text, o.text, true);
2788      }
2789
2790      public boolean isEmpty() {
2791        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, language, text);
2792      }
2793
2794  public String fhirType() {
2795    return "Citation.citedArtifact.title";
2796
2797  }
2798
2799  }
2800
2801    @Block()
2802    public static class CitationCitedArtifactAbstractComponent extends BackboneElement implements IBaseBackboneElement {
2803        /**
2804         * Used to express the reason or specific aspect for the abstract.
2805         */
2806        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
2807        @Description(shortDefinition="The kind of abstract", formalDefinition="Used to express the reason or specific aspect for the abstract." )
2808        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-abstract-type")
2809        protected CodeableConcept type;
2810
2811        /**
2812         * Used to express the specific language.
2813         */
2814        @Child(name = "language", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
2815        @Description(shortDefinition="Used to express the specific language", formalDefinition="Used to express the specific language." )
2816        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
2817        protected CodeableConcept language;
2818
2819        /**
2820         * Abstract content.
2821         */
2822        @Child(name = "text", type = {MarkdownType.class}, order=3, min=1, max=1, modifier=false, summary=false)
2823        @Description(shortDefinition="Abstract content", formalDefinition="Abstract content." )
2824        protected MarkdownType text;
2825
2826        /**
2827         * Copyright notice for the abstract.
2828         */
2829        @Child(name = "copyright", type = {MarkdownType.class}, order=4, min=0, max=1, modifier=false, summary=false)
2830        @Description(shortDefinition="Copyright notice for the abstract", formalDefinition="Copyright notice for the abstract." )
2831        protected MarkdownType copyright;
2832
2833        private static final long serialVersionUID = -1882363442L;
2834
2835    /**
2836     * Constructor
2837     */
2838      public CitationCitedArtifactAbstractComponent() {
2839        super();
2840      }
2841
2842    /**
2843     * Constructor
2844     */
2845      public CitationCitedArtifactAbstractComponent(String text) {
2846        super();
2847        this.setText(text);
2848      }
2849
2850        /**
2851         * @return {@link #type} (Used to express the reason or specific aspect for the abstract.)
2852         */
2853        public CodeableConcept getType() { 
2854          if (this.type == null)
2855            if (Configuration.errorOnAutoCreate())
2856              throw new Error("Attempt to auto-create CitationCitedArtifactAbstractComponent.type");
2857            else if (Configuration.doAutoCreate())
2858              this.type = new CodeableConcept(); // cc
2859          return this.type;
2860        }
2861
2862        public boolean hasType() { 
2863          return this.type != null && !this.type.isEmpty();
2864        }
2865
2866        /**
2867         * @param value {@link #type} (Used to express the reason or specific aspect for the abstract.)
2868         */
2869        public CitationCitedArtifactAbstractComponent setType(CodeableConcept value) { 
2870          this.type = value;
2871          return this;
2872        }
2873
2874        /**
2875         * @return {@link #language} (Used to express the specific language.)
2876         */
2877        public CodeableConcept getLanguage() { 
2878          if (this.language == null)
2879            if (Configuration.errorOnAutoCreate())
2880              throw new Error("Attempt to auto-create CitationCitedArtifactAbstractComponent.language");
2881            else if (Configuration.doAutoCreate())
2882              this.language = new CodeableConcept(); // cc
2883          return this.language;
2884        }
2885
2886        public boolean hasLanguage() { 
2887          return this.language != null && !this.language.isEmpty();
2888        }
2889
2890        /**
2891         * @param value {@link #language} (Used to express the specific language.)
2892         */
2893        public CitationCitedArtifactAbstractComponent setLanguage(CodeableConcept value) { 
2894          this.language = value;
2895          return this;
2896        }
2897
2898        /**
2899         * @return {@link #text} (Abstract content.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
2900         */
2901        public MarkdownType getTextElement() { 
2902          if (this.text == null)
2903            if (Configuration.errorOnAutoCreate())
2904              throw new Error("Attempt to auto-create CitationCitedArtifactAbstractComponent.text");
2905            else if (Configuration.doAutoCreate())
2906              this.text = new MarkdownType(); // bb
2907          return this.text;
2908        }
2909
2910        public boolean hasTextElement() { 
2911          return this.text != null && !this.text.isEmpty();
2912        }
2913
2914        public boolean hasText() { 
2915          return this.text != null && !this.text.isEmpty();
2916        }
2917
2918        /**
2919         * @param value {@link #text} (Abstract content.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
2920         */
2921        public CitationCitedArtifactAbstractComponent setTextElement(MarkdownType value) { 
2922          this.text = value;
2923          return this;
2924        }
2925
2926        /**
2927         * @return Abstract content.
2928         */
2929        public String getText() { 
2930          return this.text == null ? null : this.text.getValue();
2931        }
2932
2933        /**
2934         * @param value Abstract content.
2935         */
2936        public CitationCitedArtifactAbstractComponent setText(String value) { 
2937            if (this.text == null)
2938              this.text = new MarkdownType();
2939            this.text.setValue(value);
2940          return this;
2941        }
2942
2943        /**
2944         * @return {@link #copyright} (Copyright notice for the abstract.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
2945         */
2946        public MarkdownType getCopyrightElement() { 
2947          if (this.copyright == null)
2948            if (Configuration.errorOnAutoCreate())
2949              throw new Error("Attempt to auto-create CitationCitedArtifactAbstractComponent.copyright");
2950            else if (Configuration.doAutoCreate())
2951              this.copyright = new MarkdownType(); // bb
2952          return this.copyright;
2953        }
2954
2955        public boolean hasCopyrightElement() { 
2956          return this.copyright != null && !this.copyright.isEmpty();
2957        }
2958
2959        public boolean hasCopyright() { 
2960          return this.copyright != null && !this.copyright.isEmpty();
2961        }
2962
2963        /**
2964         * @param value {@link #copyright} (Copyright notice for the abstract.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
2965         */
2966        public CitationCitedArtifactAbstractComponent setCopyrightElement(MarkdownType value) { 
2967          this.copyright = value;
2968          return this;
2969        }
2970
2971        /**
2972         * @return Copyright notice for the abstract.
2973         */
2974        public String getCopyright() { 
2975          return this.copyright == null ? null : this.copyright.getValue();
2976        }
2977
2978        /**
2979         * @param value Copyright notice for the abstract.
2980         */
2981        public CitationCitedArtifactAbstractComponent setCopyright(String value) { 
2982          if (value == null)
2983            this.copyright = null;
2984          else {
2985            if (this.copyright == null)
2986              this.copyright = new MarkdownType();
2987            this.copyright.setValue(value);
2988          }
2989          return this;
2990        }
2991
2992        protected void listChildren(List<Property> children) {
2993          super.listChildren(children);
2994          children.add(new Property("type", "CodeableConcept", "Used to express the reason or specific aspect for the abstract.", 0, 1, type));
2995          children.add(new Property("language", "CodeableConcept", "Used to express the specific language.", 0, 1, language));
2996          children.add(new Property("text", "markdown", "Abstract content.", 0, 1, text));
2997          children.add(new Property("copyright", "markdown", "Copyright notice for the abstract.", 0, 1, copyright));
2998        }
2999
3000        @Override
3001        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3002          switch (_hash) {
3003          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Used to express the reason or specific aspect for the abstract.", 0, 1, type);
3004          case -1613589672: /*language*/  return new Property("language", "CodeableConcept", "Used to express the specific language.", 0, 1, language);
3005          case 3556653: /*text*/  return new Property("text", "markdown", "Abstract content.", 0, 1, text);
3006          case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "Copyright notice for the abstract.", 0, 1, copyright);
3007          default: return super.getNamedProperty(_hash, _name, _checkValid);
3008          }
3009
3010        }
3011
3012      @Override
3013      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3014        switch (hash) {
3015        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3016        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept
3017        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // MarkdownType
3018        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
3019        default: return super.getProperty(hash, name, checkValid);
3020        }
3021
3022      }
3023
3024      @Override
3025      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3026        switch (hash) {
3027        case 3575610: // type
3028          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3029          return value;
3030        case -1613589672: // language
3031          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3032          return value;
3033        case 3556653: // text
3034          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
3035          return value;
3036        case 1522889671: // copyright
3037          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
3038          return value;
3039        default: return super.setProperty(hash, name, value);
3040        }
3041
3042      }
3043
3044      @Override
3045      public Base setProperty(String name, Base value) throws FHIRException {
3046        if (name.equals("type")) {
3047          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3048        } else if (name.equals("language")) {
3049          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3050        } else if (name.equals("text")) {
3051          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
3052        } else if (name.equals("copyright")) {
3053          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
3054        } else
3055          return super.setProperty(name, value);
3056        return value;
3057      }
3058
3059      @Override
3060      public Base makeProperty(int hash, String name) throws FHIRException {
3061        switch (hash) {
3062        case 3575610:  return getType();
3063        case -1613589672:  return getLanguage();
3064        case 3556653:  return getTextElement();
3065        case 1522889671:  return getCopyrightElement();
3066        default: return super.makeProperty(hash, name);
3067        }
3068
3069      }
3070
3071      @Override
3072      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3073        switch (hash) {
3074        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3075        case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
3076        case 3556653: /*text*/ return new String[] {"markdown"};
3077        case 1522889671: /*copyright*/ return new String[] {"markdown"};
3078        default: return super.getTypesForProperty(hash, name);
3079        }
3080
3081      }
3082
3083      @Override
3084      public Base addChild(String name) throws FHIRException {
3085        if (name.equals("type")) {
3086          this.type = new CodeableConcept();
3087          return this.type;
3088        }
3089        else if (name.equals("language")) {
3090          this.language = new CodeableConcept();
3091          return this.language;
3092        }
3093        else if (name.equals("text")) {
3094          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.abstract.text");
3095        }
3096        else if (name.equals("copyright")) {
3097          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.abstract.copyright");
3098        }
3099        else
3100          return super.addChild(name);
3101      }
3102
3103      public CitationCitedArtifactAbstractComponent copy() {
3104        CitationCitedArtifactAbstractComponent dst = new CitationCitedArtifactAbstractComponent();
3105        copyValues(dst);
3106        return dst;
3107      }
3108
3109      public void copyValues(CitationCitedArtifactAbstractComponent dst) {
3110        super.copyValues(dst);
3111        dst.type = type == null ? null : type.copy();
3112        dst.language = language == null ? null : language.copy();
3113        dst.text = text == null ? null : text.copy();
3114        dst.copyright = copyright == null ? null : copyright.copy();
3115      }
3116
3117      @Override
3118      public boolean equalsDeep(Base other_) {
3119        if (!super.equalsDeep(other_))
3120          return false;
3121        if (!(other_ instanceof CitationCitedArtifactAbstractComponent))
3122          return false;
3123        CitationCitedArtifactAbstractComponent o = (CitationCitedArtifactAbstractComponent) other_;
3124        return compareDeep(type, o.type, true) && compareDeep(language, o.language, true) && compareDeep(text, o.text, true)
3125           && compareDeep(copyright, o.copyright, true);
3126      }
3127
3128      @Override
3129      public boolean equalsShallow(Base other_) {
3130        if (!super.equalsShallow(other_))
3131          return false;
3132        if (!(other_ instanceof CitationCitedArtifactAbstractComponent))
3133          return false;
3134        CitationCitedArtifactAbstractComponent o = (CitationCitedArtifactAbstractComponent) other_;
3135        return compareValues(text, o.text, true) && compareValues(copyright, o.copyright, true);
3136      }
3137
3138      public boolean isEmpty() {
3139        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, language, text, copyright
3140          );
3141      }
3142
3143  public String fhirType() {
3144    return "Citation.citedArtifact.abstract";
3145
3146  }
3147
3148  }
3149
3150    @Block()
3151    public static class CitationCitedArtifactPartComponent extends BackboneElement implements IBaseBackboneElement {
3152        /**
3153         * The kind of component.
3154         */
3155        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
3156        @Description(shortDefinition="The kind of component", formalDefinition="The kind of component." )
3157        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-part-type")
3158        protected CodeableConcept type;
3159
3160        /**
3161         * The specification of the component.
3162         */
3163        @Child(name = "value", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
3164        @Description(shortDefinition="The specification of the component", formalDefinition="The specification of the component." )
3165        protected StringType value;
3166
3167        /**
3168         * The citation for the full article or artifact.
3169         */
3170        @Child(name = "baseCitation", type = {Citation.class}, order=3, min=0, max=1, modifier=false, summary=false)
3171        @Description(shortDefinition="The citation for the full article or artifact", formalDefinition="The citation for the full article or artifact." )
3172        protected Reference baseCitation;
3173
3174        private static final long serialVersionUID = -765350500L;
3175
3176    /**
3177     * Constructor
3178     */
3179      public CitationCitedArtifactPartComponent() {
3180        super();
3181      }
3182
3183        /**
3184         * @return {@link #type} (The kind of component.)
3185         */
3186        public CodeableConcept getType() { 
3187          if (this.type == null)
3188            if (Configuration.errorOnAutoCreate())
3189              throw new Error("Attempt to auto-create CitationCitedArtifactPartComponent.type");
3190            else if (Configuration.doAutoCreate())
3191              this.type = new CodeableConcept(); // cc
3192          return this.type;
3193        }
3194
3195        public boolean hasType() { 
3196          return this.type != null && !this.type.isEmpty();
3197        }
3198
3199        /**
3200         * @param value {@link #type} (The kind of component.)
3201         */
3202        public CitationCitedArtifactPartComponent setType(CodeableConcept value) { 
3203          this.type = value;
3204          return this;
3205        }
3206
3207        /**
3208         * @return {@link #value} (The specification of the component.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
3209         */
3210        public StringType getValueElement() { 
3211          if (this.value == null)
3212            if (Configuration.errorOnAutoCreate())
3213              throw new Error("Attempt to auto-create CitationCitedArtifactPartComponent.value");
3214            else if (Configuration.doAutoCreate())
3215              this.value = new StringType(); // bb
3216          return this.value;
3217        }
3218
3219        public boolean hasValueElement() { 
3220          return this.value != null && !this.value.isEmpty();
3221        }
3222
3223        public boolean hasValue() { 
3224          return this.value != null && !this.value.isEmpty();
3225        }
3226
3227        /**
3228         * @param value {@link #value} (The specification of the component.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
3229         */
3230        public CitationCitedArtifactPartComponent setValueElement(StringType value) { 
3231          this.value = value;
3232          return this;
3233        }
3234
3235        /**
3236         * @return The specification of the component.
3237         */
3238        public String getValue() { 
3239          return this.value == null ? null : this.value.getValue();
3240        }
3241
3242        /**
3243         * @param value The specification of the component.
3244         */
3245        public CitationCitedArtifactPartComponent setValue(String value) { 
3246          if (Utilities.noString(value))
3247            this.value = null;
3248          else {
3249            if (this.value == null)
3250              this.value = new StringType();
3251            this.value.setValue(value);
3252          }
3253          return this;
3254        }
3255
3256        /**
3257         * @return {@link #baseCitation} (The citation for the full article or artifact.)
3258         */
3259        public Reference getBaseCitation() { 
3260          if (this.baseCitation == null)
3261            if (Configuration.errorOnAutoCreate())
3262              throw new Error("Attempt to auto-create CitationCitedArtifactPartComponent.baseCitation");
3263            else if (Configuration.doAutoCreate())
3264              this.baseCitation = new Reference(); // cc
3265          return this.baseCitation;
3266        }
3267
3268        public boolean hasBaseCitation() { 
3269          return this.baseCitation != null && !this.baseCitation.isEmpty();
3270        }
3271
3272        /**
3273         * @param value {@link #baseCitation} (The citation for the full article or artifact.)
3274         */
3275        public CitationCitedArtifactPartComponent setBaseCitation(Reference value) { 
3276          this.baseCitation = value;
3277          return this;
3278        }
3279
3280        protected void listChildren(List<Property> children) {
3281          super.listChildren(children);
3282          children.add(new Property("type", "CodeableConcept", "The kind of component.", 0, 1, type));
3283          children.add(new Property("value", "string", "The specification of the component.", 0, 1, value));
3284          children.add(new Property("baseCitation", "Reference(Citation)", "The citation for the full article or artifact.", 0, 1, baseCitation));
3285        }
3286
3287        @Override
3288        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3289          switch (_hash) {
3290          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of component.", 0, 1, type);
3291          case 111972721: /*value*/  return new Property("value", "string", "The specification of the component.", 0, 1, value);
3292          case 1182995672: /*baseCitation*/  return new Property("baseCitation", "Reference(Citation)", "The citation for the full article or artifact.", 0, 1, baseCitation);
3293          default: return super.getNamedProperty(_hash, _name, _checkValid);
3294          }
3295
3296        }
3297
3298      @Override
3299      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3300        switch (hash) {
3301        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3302        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
3303        case 1182995672: /*baseCitation*/ return this.baseCitation == null ? new Base[0] : new Base[] {this.baseCitation}; // Reference
3304        default: return super.getProperty(hash, name, checkValid);
3305        }
3306
3307      }
3308
3309      @Override
3310      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3311        switch (hash) {
3312        case 3575610: // type
3313          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3314          return value;
3315        case 111972721: // value
3316          this.value = TypeConvertor.castToString(value); // StringType
3317          return value;
3318        case 1182995672: // baseCitation
3319          this.baseCitation = TypeConvertor.castToReference(value); // Reference
3320          return value;
3321        default: return super.setProperty(hash, name, value);
3322        }
3323
3324      }
3325
3326      @Override
3327      public Base setProperty(String name, Base value) throws FHIRException {
3328        if (name.equals("type")) {
3329          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3330        } else if (name.equals("value")) {
3331          this.value = TypeConvertor.castToString(value); // StringType
3332        } else if (name.equals("baseCitation")) {
3333          this.baseCitation = TypeConvertor.castToReference(value); // Reference
3334        } else
3335          return super.setProperty(name, value);
3336        return value;
3337      }
3338
3339      @Override
3340      public Base makeProperty(int hash, String name) throws FHIRException {
3341        switch (hash) {
3342        case 3575610:  return getType();
3343        case 111972721:  return getValueElement();
3344        case 1182995672:  return getBaseCitation();
3345        default: return super.makeProperty(hash, name);
3346        }
3347
3348      }
3349
3350      @Override
3351      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3352        switch (hash) {
3353        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3354        case 111972721: /*value*/ return new String[] {"string"};
3355        case 1182995672: /*baseCitation*/ return new String[] {"Reference"};
3356        default: return super.getTypesForProperty(hash, name);
3357        }
3358
3359      }
3360
3361      @Override
3362      public Base addChild(String name) throws FHIRException {
3363        if (name.equals("type")) {
3364          this.type = new CodeableConcept();
3365          return this.type;
3366        }
3367        else if (name.equals("value")) {
3368          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.part.value");
3369        }
3370        else if (name.equals("baseCitation")) {
3371          this.baseCitation = new Reference();
3372          return this.baseCitation;
3373        }
3374        else
3375          return super.addChild(name);
3376      }
3377
3378      public CitationCitedArtifactPartComponent copy() {
3379        CitationCitedArtifactPartComponent dst = new CitationCitedArtifactPartComponent();
3380        copyValues(dst);
3381        return dst;
3382      }
3383
3384      public void copyValues(CitationCitedArtifactPartComponent dst) {
3385        super.copyValues(dst);
3386        dst.type = type == null ? null : type.copy();
3387        dst.value = value == null ? null : value.copy();
3388        dst.baseCitation = baseCitation == null ? null : baseCitation.copy();
3389      }
3390
3391      @Override
3392      public boolean equalsDeep(Base other_) {
3393        if (!super.equalsDeep(other_))
3394          return false;
3395        if (!(other_ instanceof CitationCitedArtifactPartComponent))
3396          return false;
3397        CitationCitedArtifactPartComponent o = (CitationCitedArtifactPartComponent) other_;
3398        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true) && compareDeep(baseCitation, o.baseCitation, true)
3399          ;
3400      }
3401
3402      @Override
3403      public boolean equalsShallow(Base other_) {
3404        if (!super.equalsShallow(other_))
3405          return false;
3406        if (!(other_ instanceof CitationCitedArtifactPartComponent))
3407          return false;
3408        CitationCitedArtifactPartComponent o = (CitationCitedArtifactPartComponent) other_;
3409        return compareValues(value, o.value, true);
3410      }
3411
3412      public boolean isEmpty() {
3413        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value, baseCitation
3414          );
3415      }
3416
3417  public String fhirType() {
3418    return "Citation.citedArtifact.part";
3419
3420  }
3421
3422  }
3423
3424    @Block()
3425    public static class CitationCitedArtifactPublicationFormComponent extends BackboneElement implements IBaseBackboneElement {
3426        /**
3427         * The collection the cited article or artifact is published in.
3428         */
3429        @Child(name = "publishedIn", type = {}, order=1, min=0, max=1, modifier=false, summary=false)
3430        @Description(shortDefinition="The collection the cited article or artifact is published in", formalDefinition="The collection the cited article or artifact is published in." )
3431        protected CitationCitedArtifactPublicationFormPublishedInComponent publishedIn;
3432
3433        /**
3434         * The specific issue in which the cited article resides.
3435         */
3436        @Child(name = "periodicRelease", type = {}, order=2, min=0, max=1, modifier=false, summary=false)
3437        @Description(shortDefinition="The specific issue in which the cited article resides", formalDefinition="The specific issue in which the cited article resides." )
3438        protected CitationCitedArtifactPublicationFormPeriodicReleaseComponent periodicRelease;
3439
3440        /**
3441         * The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).
3442         */
3443        @Child(name = "articleDate", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
3444        @Description(shortDefinition="The date the article was added to the database, or the date the article was released", formalDefinition="The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date)." )
3445        protected DateTimeType articleDate;
3446
3447        /**
3448         * The date the article was last revised or updated in the database.
3449         */
3450        @Child(name = "lastRevisionDate", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false)
3451        @Description(shortDefinition="The date the article was last revised or updated in the database", formalDefinition="The date the article was last revised or updated in the database." )
3452        protected DateTimeType lastRevisionDate;
3453
3454        /**
3455         * Language in which this form of the article is published.
3456         */
3457        @Child(name = "language", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3458        @Description(shortDefinition="Language in which this form of the article is published", formalDefinition="Language in which this form of the article is published." )
3459        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
3460        protected List<CodeableConcept> language;
3461
3462        /**
3463         * Entry number or identifier for inclusion in a database.
3464         */
3465        @Child(name = "accessionNumber", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
3466        @Description(shortDefinition="Entry number or identifier for inclusion in a database", formalDefinition="Entry number or identifier for inclusion in a database." )
3467        protected StringType accessionNumber;
3468
3469        /**
3470         * Used for full display of pagination.
3471         */
3472        @Child(name = "pageString", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
3473        @Description(shortDefinition="Used for full display of pagination", formalDefinition="Used for full display of pagination." )
3474        protected StringType pageString;
3475
3476        /**
3477         * Used for isolated representation of first page.
3478         */
3479        @Child(name = "firstPage", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
3480        @Description(shortDefinition="Used for isolated representation of first page", formalDefinition="Used for isolated representation of first page." )
3481        protected StringType firstPage;
3482
3483        /**
3484         * Used for isolated representation of last page.
3485         */
3486        @Child(name = "lastPage", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
3487        @Description(shortDefinition="Used for isolated representation of last page", formalDefinition="Used for isolated representation of last page." )
3488        protected StringType lastPage;
3489
3490        /**
3491         * Actual or approximate number of pages or screens.
3492         */
3493        @Child(name = "pageCount", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
3494        @Description(shortDefinition="Number of pages or screens", formalDefinition="Actual or approximate number of pages or screens." )
3495        protected StringType pageCount;
3496
3497        /**
3498         * Copyright notice for the full article or artifact.
3499         */
3500        @Child(name = "copyright", type = {MarkdownType.class}, order=11, min=0, max=1, modifier=false, summary=false)
3501        @Description(shortDefinition="Copyright notice for the full article or artifact", formalDefinition="Copyright notice for the full article or artifact." )
3502        protected MarkdownType copyright;
3503
3504        private static final long serialVersionUID = -191740896L;
3505
3506    /**
3507     * Constructor
3508     */
3509      public CitationCitedArtifactPublicationFormComponent() {
3510        super();
3511      }
3512
3513        /**
3514         * @return {@link #publishedIn} (The collection the cited article or artifact is published in.)
3515         */
3516        public CitationCitedArtifactPublicationFormPublishedInComponent getPublishedIn() { 
3517          if (this.publishedIn == null)
3518            if (Configuration.errorOnAutoCreate())
3519              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.publishedIn");
3520            else if (Configuration.doAutoCreate())
3521              this.publishedIn = new CitationCitedArtifactPublicationFormPublishedInComponent(); // cc
3522          return this.publishedIn;
3523        }
3524
3525        public boolean hasPublishedIn() { 
3526          return this.publishedIn != null && !this.publishedIn.isEmpty();
3527        }
3528
3529        /**
3530         * @param value {@link #publishedIn} (The collection the cited article or artifact is published in.)
3531         */
3532        public CitationCitedArtifactPublicationFormComponent setPublishedIn(CitationCitedArtifactPublicationFormPublishedInComponent value) { 
3533          this.publishedIn = value;
3534          return this;
3535        }
3536
3537        /**
3538         * @return {@link #periodicRelease} (The specific issue in which the cited article resides.)
3539         */
3540        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent getPeriodicRelease() { 
3541          if (this.periodicRelease == null)
3542            if (Configuration.errorOnAutoCreate())
3543              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.periodicRelease");
3544            else if (Configuration.doAutoCreate())
3545              this.periodicRelease = new CitationCitedArtifactPublicationFormPeriodicReleaseComponent(); // cc
3546          return this.periodicRelease;
3547        }
3548
3549        public boolean hasPeriodicRelease() { 
3550          return this.periodicRelease != null && !this.periodicRelease.isEmpty();
3551        }
3552
3553        /**
3554         * @param value {@link #periodicRelease} (The specific issue in which the cited article resides.)
3555         */
3556        public CitationCitedArtifactPublicationFormComponent setPeriodicRelease(CitationCitedArtifactPublicationFormPeriodicReleaseComponent value) { 
3557          this.periodicRelease = value;
3558          return this;
3559        }
3560
3561        /**
3562         * @return {@link #articleDate} (The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).). This is the underlying object with id, value and extensions. The accessor "getArticleDate" gives direct access to the value
3563         */
3564        public DateTimeType getArticleDateElement() { 
3565          if (this.articleDate == null)
3566            if (Configuration.errorOnAutoCreate())
3567              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.articleDate");
3568            else if (Configuration.doAutoCreate())
3569              this.articleDate = new DateTimeType(); // bb
3570          return this.articleDate;
3571        }
3572
3573        public boolean hasArticleDateElement() { 
3574          return this.articleDate != null && !this.articleDate.isEmpty();
3575        }
3576
3577        public boolean hasArticleDate() { 
3578          return this.articleDate != null && !this.articleDate.isEmpty();
3579        }
3580
3581        /**
3582         * @param value {@link #articleDate} (The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).). This is the underlying object with id, value and extensions. The accessor "getArticleDate" gives direct access to the value
3583         */
3584        public CitationCitedArtifactPublicationFormComponent setArticleDateElement(DateTimeType value) { 
3585          this.articleDate = value;
3586          return this;
3587        }
3588
3589        /**
3590         * @return The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).
3591         */
3592        public Date getArticleDate() { 
3593          return this.articleDate == null ? null : this.articleDate.getValue();
3594        }
3595
3596        /**
3597         * @param value The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).
3598         */
3599        public CitationCitedArtifactPublicationFormComponent setArticleDate(Date value) { 
3600          if (value == null)
3601            this.articleDate = null;
3602          else {
3603            if (this.articleDate == null)
3604              this.articleDate = new DateTimeType();
3605            this.articleDate.setValue(value);
3606          }
3607          return this;
3608        }
3609
3610        /**
3611         * @return {@link #lastRevisionDate} (The date the article was last revised or updated in the database.). This is the underlying object with id, value and extensions. The accessor "getLastRevisionDate" gives direct access to the value
3612         */
3613        public DateTimeType getLastRevisionDateElement() { 
3614          if (this.lastRevisionDate == null)
3615            if (Configuration.errorOnAutoCreate())
3616              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.lastRevisionDate");
3617            else if (Configuration.doAutoCreate())
3618              this.lastRevisionDate = new DateTimeType(); // bb
3619          return this.lastRevisionDate;
3620        }
3621
3622        public boolean hasLastRevisionDateElement() { 
3623          return this.lastRevisionDate != null && !this.lastRevisionDate.isEmpty();
3624        }
3625
3626        public boolean hasLastRevisionDate() { 
3627          return this.lastRevisionDate != null && !this.lastRevisionDate.isEmpty();
3628        }
3629
3630        /**
3631         * @param value {@link #lastRevisionDate} (The date the article was last revised or updated in the database.). This is the underlying object with id, value and extensions. The accessor "getLastRevisionDate" gives direct access to the value
3632         */
3633        public CitationCitedArtifactPublicationFormComponent setLastRevisionDateElement(DateTimeType value) { 
3634          this.lastRevisionDate = value;
3635          return this;
3636        }
3637
3638        /**
3639         * @return The date the article was last revised or updated in the database.
3640         */
3641        public Date getLastRevisionDate() { 
3642          return this.lastRevisionDate == null ? null : this.lastRevisionDate.getValue();
3643        }
3644
3645        /**
3646         * @param value The date the article was last revised or updated in the database.
3647         */
3648        public CitationCitedArtifactPublicationFormComponent setLastRevisionDate(Date value) { 
3649          if (value == null)
3650            this.lastRevisionDate = null;
3651          else {
3652            if (this.lastRevisionDate == null)
3653              this.lastRevisionDate = new DateTimeType();
3654            this.lastRevisionDate.setValue(value);
3655          }
3656          return this;
3657        }
3658
3659        /**
3660         * @return {@link #language} (Language in which this form of the article is published.)
3661         */
3662        public List<CodeableConcept> getLanguage() { 
3663          if (this.language == null)
3664            this.language = new ArrayList<CodeableConcept>();
3665          return this.language;
3666        }
3667
3668        /**
3669         * @return Returns a reference to <code>this</code> for easy method chaining
3670         */
3671        public CitationCitedArtifactPublicationFormComponent setLanguage(List<CodeableConcept> theLanguage) { 
3672          this.language = theLanguage;
3673          return this;
3674        }
3675
3676        public boolean hasLanguage() { 
3677          if (this.language == null)
3678            return false;
3679          for (CodeableConcept item : this.language)
3680            if (!item.isEmpty())
3681              return true;
3682          return false;
3683        }
3684
3685        public CodeableConcept addLanguage() { //3
3686          CodeableConcept t = new CodeableConcept();
3687          if (this.language == null)
3688            this.language = new ArrayList<CodeableConcept>();
3689          this.language.add(t);
3690          return t;
3691        }
3692
3693        public CitationCitedArtifactPublicationFormComponent addLanguage(CodeableConcept t) { //3
3694          if (t == null)
3695            return this;
3696          if (this.language == null)
3697            this.language = new ArrayList<CodeableConcept>();
3698          this.language.add(t);
3699          return this;
3700        }
3701
3702        /**
3703         * @return The first repetition of repeating field {@link #language}, creating it if it does not already exist {3}
3704         */
3705        public CodeableConcept getLanguageFirstRep() { 
3706          if (getLanguage().isEmpty()) {
3707            addLanguage();
3708          }
3709          return getLanguage().get(0);
3710        }
3711
3712        /**
3713         * @return {@link #accessionNumber} (Entry number or identifier for inclusion in a database.). This is the underlying object with id, value and extensions. The accessor "getAccessionNumber" gives direct access to the value
3714         */
3715        public StringType getAccessionNumberElement() { 
3716          if (this.accessionNumber == null)
3717            if (Configuration.errorOnAutoCreate())
3718              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.accessionNumber");
3719            else if (Configuration.doAutoCreate())
3720              this.accessionNumber = new StringType(); // bb
3721          return this.accessionNumber;
3722        }
3723
3724        public boolean hasAccessionNumberElement() { 
3725          return this.accessionNumber != null && !this.accessionNumber.isEmpty();
3726        }
3727
3728        public boolean hasAccessionNumber() { 
3729          return this.accessionNumber != null && !this.accessionNumber.isEmpty();
3730        }
3731
3732        /**
3733         * @param value {@link #accessionNumber} (Entry number or identifier for inclusion in a database.). This is the underlying object with id, value and extensions. The accessor "getAccessionNumber" gives direct access to the value
3734         */
3735        public CitationCitedArtifactPublicationFormComponent setAccessionNumberElement(StringType value) { 
3736          this.accessionNumber = value;
3737          return this;
3738        }
3739
3740        /**
3741         * @return Entry number or identifier for inclusion in a database.
3742         */
3743        public String getAccessionNumber() { 
3744          return this.accessionNumber == null ? null : this.accessionNumber.getValue();
3745        }
3746
3747        /**
3748         * @param value Entry number or identifier for inclusion in a database.
3749         */
3750        public CitationCitedArtifactPublicationFormComponent setAccessionNumber(String value) { 
3751          if (Utilities.noString(value))
3752            this.accessionNumber = null;
3753          else {
3754            if (this.accessionNumber == null)
3755              this.accessionNumber = new StringType();
3756            this.accessionNumber.setValue(value);
3757          }
3758          return this;
3759        }
3760
3761        /**
3762         * @return {@link #pageString} (Used for full display of pagination.). This is the underlying object with id, value and extensions. The accessor "getPageString" gives direct access to the value
3763         */
3764        public StringType getPageStringElement() { 
3765          if (this.pageString == null)
3766            if (Configuration.errorOnAutoCreate())
3767              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.pageString");
3768            else if (Configuration.doAutoCreate())
3769              this.pageString = new StringType(); // bb
3770          return this.pageString;
3771        }
3772
3773        public boolean hasPageStringElement() { 
3774          return this.pageString != null && !this.pageString.isEmpty();
3775        }
3776
3777        public boolean hasPageString() { 
3778          return this.pageString != null && !this.pageString.isEmpty();
3779        }
3780
3781        /**
3782         * @param value {@link #pageString} (Used for full display of pagination.). This is the underlying object with id, value and extensions. The accessor "getPageString" gives direct access to the value
3783         */
3784        public CitationCitedArtifactPublicationFormComponent setPageStringElement(StringType value) { 
3785          this.pageString = value;
3786          return this;
3787        }
3788
3789        /**
3790         * @return Used for full display of pagination.
3791         */
3792        public String getPageString() { 
3793          return this.pageString == null ? null : this.pageString.getValue();
3794        }
3795
3796        /**
3797         * @param value Used for full display of pagination.
3798         */
3799        public CitationCitedArtifactPublicationFormComponent setPageString(String value) { 
3800          if (Utilities.noString(value))
3801            this.pageString = null;
3802          else {
3803            if (this.pageString == null)
3804              this.pageString = new StringType();
3805            this.pageString.setValue(value);
3806          }
3807          return this;
3808        }
3809
3810        /**
3811         * @return {@link #firstPage} (Used for isolated representation of first page.). This is the underlying object with id, value and extensions. The accessor "getFirstPage" gives direct access to the value
3812         */
3813        public StringType getFirstPageElement() { 
3814          if (this.firstPage == null)
3815            if (Configuration.errorOnAutoCreate())
3816              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.firstPage");
3817            else if (Configuration.doAutoCreate())
3818              this.firstPage = new StringType(); // bb
3819          return this.firstPage;
3820        }
3821
3822        public boolean hasFirstPageElement() { 
3823          return this.firstPage != null && !this.firstPage.isEmpty();
3824        }
3825
3826        public boolean hasFirstPage() { 
3827          return this.firstPage != null && !this.firstPage.isEmpty();
3828        }
3829
3830        /**
3831         * @param value {@link #firstPage} (Used for isolated representation of first page.). This is the underlying object with id, value and extensions. The accessor "getFirstPage" gives direct access to the value
3832         */
3833        public CitationCitedArtifactPublicationFormComponent setFirstPageElement(StringType value) { 
3834          this.firstPage = value;
3835          return this;
3836        }
3837
3838        /**
3839         * @return Used for isolated representation of first page.
3840         */
3841        public String getFirstPage() { 
3842          return this.firstPage == null ? null : this.firstPage.getValue();
3843        }
3844
3845        /**
3846         * @param value Used for isolated representation of first page.
3847         */
3848        public CitationCitedArtifactPublicationFormComponent setFirstPage(String value) { 
3849          if (Utilities.noString(value))
3850            this.firstPage = null;
3851          else {
3852            if (this.firstPage == null)
3853              this.firstPage = new StringType();
3854            this.firstPage.setValue(value);
3855          }
3856          return this;
3857        }
3858
3859        /**
3860         * @return {@link #lastPage} (Used for isolated representation of last page.). This is the underlying object with id, value and extensions. The accessor "getLastPage" gives direct access to the value
3861         */
3862        public StringType getLastPageElement() { 
3863          if (this.lastPage == null)
3864            if (Configuration.errorOnAutoCreate())
3865              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.lastPage");
3866            else if (Configuration.doAutoCreate())
3867              this.lastPage = new StringType(); // bb
3868          return this.lastPage;
3869        }
3870
3871        public boolean hasLastPageElement() { 
3872          return this.lastPage != null && !this.lastPage.isEmpty();
3873        }
3874
3875        public boolean hasLastPage() { 
3876          return this.lastPage != null && !this.lastPage.isEmpty();
3877        }
3878
3879        /**
3880         * @param value {@link #lastPage} (Used for isolated representation of last page.). This is the underlying object with id, value and extensions. The accessor "getLastPage" gives direct access to the value
3881         */
3882        public CitationCitedArtifactPublicationFormComponent setLastPageElement(StringType value) { 
3883          this.lastPage = value;
3884          return this;
3885        }
3886
3887        /**
3888         * @return Used for isolated representation of last page.
3889         */
3890        public String getLastPage() { 
3891          return this.lastPage == null ? null : this.lastPage.getValue();
3892        }
3893
3894        /**
3895         * @param value Used for isolated representation of last page.
3896         */
3897        public CitationCitedArtifactPublicationFormComponent setLastPage(String value) { 
3898          if (Utilities.noString(value))
3899            this.lastPage = null;
3900          else {
3901            if (this.lastPage == null)
3902              this.lastPage = new StringType();
3903            this.lastPage.setValue(value);
3904          }
3905          return this;
3906        }
3907
3908        /**
3909         * @return {@link #pageCount} (Actual or approximate number of pages or screens.). This is the underlying object with id, value and extensions. The accessor "getPageCount" gives direct access to the value
3910         */
3911        public StringType getPageCountElement() { 
3912          if (this.pageCount == null)
3913            if (Configuration.errorOnAutoCreate())
3914              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.pageCount");
3915            else if (Configuration.doAutoCreate())
3916              this.pageCount = new StringType(); // bb
3917          return this.pageCount;
3918        }
3919
3920        public boolean hasPageCountElement() { 
3921          return this.pageCount != null && !this.pageCount.isEmpty();
3922        }
3923
3924        public boolean hasPageCount() { 
3925          return this.pageCount != null && !this.pageCount.isEmpty();
3926        }
3927
3928        /**
3929         * @param value {@link #pageCount} (Actual or approximate number of pages or screens.). This is the underlying object with id, value and extensions. The accessor "getPageCount" gives direct access to the value
3930         */
3931        public CitationCitedArtifactPublicationFormComponent setPageCountElement(StringType value) { 
3932          this.pageCount = value;
3933          return this;
3934        }
3935
3936        /**
3937         * @return Actual or approximate number of pages or screens.
3938         */
3939        public String getPageCount() { 
3940          return this.pageCount == null ? null : this.pageCount.getValue();
3941        }
3942
3943        /**
3944         * @param value Actual or approximate number of pages or screens.
3945         */
3946        public CitationCitedArtifactPublicationFormComponent setPageCount(String value) { 
3947          if (Utilities.noString(value))
3948            this.pageCount = null;
3949          else {
3950            if (this.pageCount == null)
3951              this.pageCount = new StringType();
3952            this.pageCount.setValue(value);
3953          }
3954          return this;
3955        }
3956
3957        /**
3958         * @return {@link #copyright} (Copyright notice for the full article or artifact.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3959         */
3960        public MarkdownType getCopyrightElement() { 
3961          if (this.copyright == null)
3962            if (Configuration.errorOnAutoCreate())
3963              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.copyright");
3964            else if (Configuration.doAutoCreate())
3965              this.copyright = new MarkdownType(); // bb
3966          return this.copyright;
3967        }
3968
3969        public boolean hasCopyrightElement() { 
3970          return this.copyright != null && !this.copyright.isEmpty();
3971        }
3972
3973        public boolean hasCopyright() { 
3974          return this.copyright != null && !this.copyright.isEmpty();
3975        }
3976
3977        /**
3978         * @param value {@link #copyright} (Copyright notice for the full article or artifact.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3979         */
3980        public CitationCitedArtifactPublicationFormComponent setCopyrightElement(MarkdownType value) { 
3981          this.copyright = value;
3982          return this;
3983        }
3984
3985        /**
3986         * @return Copyright notice for the full article or artifact.
3987         */
3988        public String getCopyright() { 
3989          return this.copyright == null ? null : this.copyright.getValue();
3990        }
3991
3992        /**
3993         * @param value Copyright notice for the full article or artifact.
3994         */
3995        public CitationCitedArtifactPublicationFormComponent setCopyright(String value) { 
3996          if (value == null)
3997            this.copyright = null;
3998          else {
3999            if (this.copyright == null)
4000              this.copyright = new MarkdownType();
4001            this.copyright.setValue(value);
4002          }
4003          return this;
4004        }
4005
4006        protected void listChildren(List<Property> children) {
4007          super.listChildren(children);
4008          children.add(new Property("publishedIn", "", "The collection the cited article or artifact is published in.", 0, 1, publishedIn));
4009          children.add(new Property("periodicRelease", "", "The specific issue in which the cited article resides.", 0, 1, periodicRelease));
4010          children.add(new Property("articleDate", "dateTime", "The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).", 0, 1, articleDate));
4011          children.add(new Property("lastRevisionDate", "dateTime", "The date the article was last revised or updated in the database.", 0, 1, lastRevisionDate));
4012          children.add(new Property("language", "CodeableConcept", "Language in which this form of the article is published.", 0, java.lang.Integer.MAX_VALUE, language));
4013          children.add(new Property("accessionNumber", "string", "Entry number or identifier for inclusion in a database.", 0, 1, accessionNumber));
4014          children.add(new Property("pageString", "string", "Used for full display of pagination.", 0, 1, pageString));
4015          children.add(new Property("firstPage", "string", "Used for isolated representation of first page.", 0, 1, firstPage));
4016          children.add(new Property("lastPage", "string", "Used for isolated representation of last page.", 0, 1, lastPage));
4017          children.add(new Property("pageCount", "string", "Actual or approximate number of pages or screens.", 0, 1, pageCount));
4018          children.add(new Property("copyright", "markdown", "Copyright notice for the full article or artifact.", 0, 1, copyright));
4019        }
4020
4021        @Override
4022        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4023          switch (_hash) {
4024          case -614144077: /*publishedIn*/  return new Property("publishedIn", "", "The collection the cited article or artifact is published in.", 0, 1, publishedIn);
4025          case 1726878956: /*periodicRelease*/  return new Property("periodicRelease", "", "The specific issue in which the cited article resides.", 0, 1, periodicRelease);
4026          case 817743300: /*articleDate*/  return new Property("articleDate", "dateTime", "The date the article was added to the database, or the date the article was released (which may differ from the journal issue publication date).", 0, 1, articleDate);
4027          case 2129161183: /*lastRevisionDate*/  return new Property("lastRevisionDate", "dateTime", "The date the article was last revised or updated in the database.", 0, 1, lastRevisionDate);
4028          case -1613589672: /*language*/  return new Property("language", "CodeableConcept", "Language in which this form of the article is published.", 0, java.lang.Integer.MAX_VALUE, language);
4029          case 1807963277: /*accessionNumber*/  return new Property("accessionNumber", "string", "Entry number or identifier for inclusion in a database.", 0, 1, accessionNumber);
4030          case 1287145344: /*pageString*/  return new Property("pageString", "string", "Used for full display of pagination.", 0, 1, pageString);
4031          case 132895071: /*firstPage*/  return new Property("firstPage", "string", "Used for isolated representation of first page.", 0, 1, firstPage);
4032          case -1459540411: /*lastPage*/  return new Property("lastPage", "string", "Used for isolated representation of last page.", 0, 1, lastPage);
4033          case 857882560: /*pageCount*/  return new Property("pageCount", "string", "Actual or approximate number of pages or screens.", 0, 1, pageCount);
4034          case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "Copyright notice for the full article or artifact.", 0, 1, copyright);
4035          default: return super.getNamedProperty(_hash, _name, _checkValid);
4036          }
4037
4038        }
4039
4040      @Override
4041      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4042        switch (hash) {
4043        case -614144077: /*publishedIn*/ return this.publishedIn == null ? new Base[0] : new Base[] {this.publishedIn}; // CitationCitedArtifactPublicationFormPublishedInComponent
4044        case 1726878956: /*periodicRelease*/ return this.periodicRelease == null ? new Base[0] : new Base[] {this.periodicRelease}; // CitationCitedArtifactPublicationFormPeriodicReleaseComponent
4045        case 817743300: /*articleDate*/ return this.articleDate == null ? new Base[0] : new Base[] {this.articleDate}; // DateTimeType
4046        case 2129161183: /*lastRevisionDate*/ return this.lastRevisionDate == null ? new Base[0] : new Base[] {this.lastRevisionDate}; // DateTimeType
4047        case -1613589672: /*language*/ return this.language == null ? new Base[0] : this.language.toArray(new Base[this.language.size()]); // CodeableConcept
4048        case 1807963277: /*accessionNumber*/ return this.accessionNumber == null ? new Base[0] : new Base[] {this.accessionNumber}; // StringType
4049        case 1287145344: /*pageString*/ return this.pageString == null ? new Base[0] : new Base[] {this.pageString}; // StringType
4050        case 132895071: /*firstPage*/ return this.firstPage == null ? new Base[0] : new Base[] {this.firstPage}; // StringType
4051        case -1459540411: /*lastPage*/ return this.lastPage == null ? new Base[0] : new Base[] {this.lastPage}; // StringType
4052        case 857882560: /*pageCount*/ return this.pageCount == null ? new Base[0] : new Base[] {this.pageCount}; // StringType
4053        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
4054        default: return super.getProperty(hash, name, checkValid);
4055        }
4056
4057      }
4058
4059      @Override
4060      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4061        switch (hash) {
4062        case -614144077: // publishedIn
4063          this.publishedIn = (CitationCitedArtifactPublicationFormPublishedInComponent) value; // CitationCitedArtifactPublicationFormPublishedInComponent
4064          return value;
4065        case 1726878956: // periodicRelease
4066          this.periodicRelease = (CitationCitedArtifactPublicationFormPeriodicReleaseComponent) value; // CitationCitedArtifactPublicationFormPeriodicReleaseComponent
4067          return value;
4068        case 817743300: // articleDate
4069          this.articleDate = TypeConvertor.castToDateTime(value); // DateTimeType
4070          return value;
4071        case 2129161183: // lastRevisionDate
4072          this.lastRevisionDate = TypeConvertor.castToDateTime(value); // DateTimeType
4073          return value;
4074        case -1613589672: // language
4075          this.getLanguage().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4076          return value;
4077        case 1807963277: // accessionNumber
4078          this.accessionNumber = TypeConvertor.castToString(value); // StringType
4079          return value;
4080        case 1287145344: // pageString
4081          this.pageString = TypeConvertor.castToString(value); // StringType
4082          return value;
4083        case 132895071: // firstPage
4084          this.firstPage = TypeConvertor.castToString(value); // StringType
4085          return value;
4086        case -1459540411: // lastPage
4087          this.lastPage = TypeConvertor.castToString(value); // StringType
4088          return value;
4089        case 857882560: // pageCount
4090          this.pageCount = TypeConvertor.castToString(value); // StringType
4091          return value;
4092        case 1522889671: // copyright
4093          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
4094          return value;
4095        default: return super.setProperty(hash, name, value);
4096        }
4097
4098      }
4099
4100      @Override
4101      public Base setProperty(String name, Base value) throws FHIRException {
4102        if (name.equals("publishedIn")) {
4103          this.publishedIn = (CitationCitedArtifactPublicationFormPublishedInComponent) value; // CitationCitedArtifactPublicationFormPublishedInComponent
4104        } else if (name.equals("periodicRelease")) {
4105          this.periodicRelease = (CitationCitedArtifactPublicationFormPeriodicReleaseComponent) value; // CitationCitedArtifactPublicationFormPeriodicReleaseComponent
4106        } else if (name.equals("articleDate")) {
4107          this.articleDate = TypeConvertor.castToDateTime(value); // DateTimeType
4108        } else if (name.equals("lastRevisionDate")) {
4109          this.lastRevisionDate = TypeConvertor.castToDateTime(value); // DateTimeType
4110        } else if (name.equals("language")) {
4111          this.getLanguage().add(TypeConvertor.castToCodeableConcept(value));
4112        } else if (name.equals("accessionNumber")) {
4113          this.accessionNumber = TypeConvertor.castToString(value); // StringType
4114        } else if (name.equals("pageString")) {
4115          this.pageString = TypeConvertor.castToString(value); // StringType
4116        } else if (name.equals("firstPage")) {
4117          this.firstPage = TypeConvertor.castToString(value); // StringType
4118        } else if (name.equals("lastPage")) {
4119          this.lastPage = TypeConvertor.castToString(value); // StringType
4120        } else if (name.equals("pageCount")) {
4121          this.pageCount = TypeConvertor.castToString(value); // StringType
4122        } else if (name.equals("copyright")) {
4123          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
4124        } else
4125          return super.setProperty(name, value);
4126        return value;
4127      }
4128
4129      @Override
4130      public Base makeProperty(int hash, String name) throws FHIRException {
4131        switch (hash) {
4132        case -614144077:  return getPublishedIn();
4133        case 1726878956:  return getPeriodicRelease();
4134        case 817743300:  return getArticleDateElement();
4135        case 2129161183:  return getLastRevisionDateElement();
4136        case -1613589672:  return addLanguage(); 
4137        case 1807963277:  return getAccessionNumberElement();
4138        case 1287145344:  return getPageStringElement();
4139        case 132895071:  return getFirstPageElement();
4140        case -1459540411:  return getLastPageElement();
4141        case 857882560:  return getPageCountElement();
4142        case 1522889671:  return getCopyrightElement();
4143        default: return super.makeProperty(hash, name);
4144        }
4145
4146      }
4147
4148      @Override
4149      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4150        switch (hash) {
4151        case -614144077: /*publishedIn*/ return new String[] {};
4152        case 1726878956: /*periodicRelease*/ return new String[] {};
4153        case 817743300: /*articleDate*/ return new String[] {"dateTime"};
4154        case 2129161183: /*lastRevisionDate*/ return new String[] {"dateTime"};
4155        case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
4156        case 1807963277: /*accessionNumber*/ return new String[] {"string"};
4157        case 1287145344: /*pageString*/ return new String[] {"string"};
4158        case 132895071: /*firstPage*/ return new String[] {"string"};
4159        case -1459540411: /*lastPage*/ return new String[] {"string"};
4160        case 857882560: /*pageCount*/ return new String[] {"string"};
4161        case 1522889671: /*copyright*/ return new String[] {"markdown"};
4162        default: return super.getTypesForProperty(hash, name);
4163        }
4164
4165      }
4166
4167      @Override
4168      public Base addChild(String name) throws FHIRException {
4169        if (name.equals("publishedIn")) {
4170          this.publishedIn = new CitationCitedArtifactPublicationFormPublishedInComponent();
4171          return this.publishedIn;
4172        }
4173        else if (name.equals("periodicRelease")) {
4174          this.periodicRelease = new CitationCitedArtifactPublicationFormPeriodicReleaseComponent();
4175          return this.periodicRelease;
4176        }
4177        else if (name.equals("articleDate")) {
4178          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.articleDate");
4179        }
4180        else if (name.equals("lastRevisionDate")) {
4181          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.lastRevisionDate");
4182        }
4183        else if (name.equals("language")) {
4184          return addLanguage();
4185        }
4186        else if (name.equals("accessionNumber")) {
4187          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.accessionNumber");
4188        }
4189        else if (name.equals("pageString")) {
4190          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.pageString");
4191        }
4192        else if (name.equals("firstPage")) {
4193          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.firstPage");
4194        }
4195        else if (name.equals("lastPage")) {
4196          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.lastPage");
4197        }
4198        else if (name.equals("pageCount")) {
4199          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.pageCount");
4200        }
4201        else if (name.equals("copyright")) {
4202          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.copyright");
4203        }
4204        else
4205          return super.addChild(name);
4206      }
4207
4208      public CitationCitedArtifactPublicationFormComponent copy() {
4209        CitationCitedArtifactPublicationFormComponent dst = new CitationCitedArtifactPublicationFormComponent();
4210        copyValues(dst);
4211        return dst;
4212      }
4213
4214      public void copyValues(CitationCitedArtifactPublicationFormComponent dst) {
4215        super.copyValues(dst);
4216        dst.publishedIn = publishedIn == null ? null : publishedIn.copy();
4217        dst.periodicRelease = periodicRelease == null ? null : periodicRelease.copy();
4218        dst.articleDate = articleDate == null ? null : articleDate.copy();
4219        dst.lastRevisionDate = lastRevisionDate == null ? null : lastRevisionDate.copy();
4220        if (language != null) {
4221          dst.language = new ArrayList<CodeableConcept>();
4222          for (CodeableConcept i : language)
4223            dst.language.add(i.copy());
4224        };
4225        dst.accessionNumber = accessionNumber == null ? null : accessionNumber.copy();
4226        dst.pageString = pageString == null ? null : pageString.copy();
4227        dst.firstPage = firstPage == null ? null : firstPage.copy();
4228        dst.lastPage = lastPage == null ? null : lastPage.copy();
4229        dst.pageCount = pageCount == null ? null : pageCount.copy();
4230        dst.copyright = copyright == null ? null : copyright.copy();
4231      }
4232
4233      @Override
4234      public boolean equalsDeep(Base other_) {
4235        if (!super.equalsDeep(other_))
4236          return false;
4237        if (!(other_ instanceof CitationCitedArtifactPublicationFormComponent))
4238          return false;
4239        CitationCitedArtifactPublicationFormComponent o = (CitationCitedArtifactPublicationFormComponent) other_;
4240        return compareDeep(publishedIn, o.publishedIn, true) && compareDeep(periodicRelease, o.periodicRelease, true)
4241           && compareDeep(articleDate, o.articleDate, true) && compareDeep(lastRevisionDate, o.lastRevisionDate, true)
4242           && compareDeep(language, o.language, true) && compareDeep(accessionNumber, o.accessionNumber, true)
4243           && compareDeep(pageString, o.pageString, true) && compareDeep(firstPage, o.firstPage, true) && compareDeep(lastPage, o.lastPage, true)
4244           && compareDeep(pageCount, o.pageCount, true) && compareDeep(copyright, o.copyright, true);
4245      }
4246
4247      @Override
4248      public boolean equalsShallow(Base other_) {
4249        if (!super.equalsShallow(other_))
4250          return false;
4251        if (!(other_ instanceof CitationCitedArtifactPublicationFormComponent))
4252          return false;
4253        CitationCitedArtifactPublicationFormComponent o = (CitationCitedArtifactPublicationFormComponent) other_;
4254        return compareValues(articleDate, o.articleDate, true) && compareValues(lastRevisionDate, o.lastRevisionDate, true)
4255           && compareValues(accessionNumber, o.accessionNumber, true) && compareValues(pageString, o.pageString, true)
4256           && compareValues(firstPage, o.firstPage, true) && compareValues(lastPage, o.lastPage, true) && compareValues(pageCount, o.pageCount, true)
4257           && compareValues(copyright, o.copyright, true);
4258      }
4259
4260      public boolean isEmpty() {
4261        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(publishedIn, periodicRelease
4262          , articleDate, lastRevisionDate, language, accessionNumber, pageString, firstPage
4263          , lastPage, pageCount, copyright);
4264      }
4265
4266  public String fhirType() {
4267    return "Citation.citedArtifact.publicationForm";
4268
4269  }
4270
4271  }
4272
4273    @Block()
4274    public static class CitationCitedArtifactPublicationFormPublishedInComponent extends BackboneElement implements IBaseBackboneElement {
4275        /**
4276         * Kind of container (e.g. Periodical, database, or book).
4277         */
4278        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
4279        @Description(shortDefinition="Kind of container (e.g. Periodical, database, or book)", formalDefinition="Kind of container (e.g. Periodical, database, or book)." )
4280        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/published-in-type")
4281        protected CodeableConcept type;
4282
4283        /**
4284         * Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN.
4285         */
4286        @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4287        @Description(shortDefinition="Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN", formalDefinition="Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN." )
4288        protected List<Identifier> identifier;
4289
4290        /**
4291         * Name of the database or title of the book or journal.
4292         */
4293        @Child(name = "title", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
4294        @Description(shortDefinition="Name of the database or title of the book or journal", formalDefinition="Name of the database or title of the book or journal." )
4295        protected StringType title;
4296
4297        /**
4298         * Name of the publisher.
4299         */
4300        @Child(name = "publisher", type = {Organization.class}, order=4, min=0, max=1, modifier=false, summary=false)
4301        @Description(shortDefinition="Name of the publisher", formalDefinition="Name of the publisher." )
4302        protected Reference publisher;
4303
4304        /**
4305         * Geographic location of the publisher.
4306         */
4307        @Child(name = "publisherLocation", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
4308        @Description(shortDefinition="Geographic location of the publisher", formalDefinition="Geographic location of the publisher." )
4309        protected StringType publisherLocation;
4310
4311        private static final long serialVersionUID = 1440066953L;
4312
4313    /**
4314     * Constructor
4315     */
4316      public CitationCitedArtifactPublicationFormPublishedInComponent() {
4317        super();
4318      }
4319
4320        /**
4321         * @return {@link #type} (Kind of container (e.g. Periodical, database, or book).)
4322         */
4323        public CodeableConcept getType() { 
4324          if (this.type == null)
4325            if (Configuration.errorOnAutoCreate())
4326              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPublishedInComponent.type");
4327            else if (Configuration.doAutoCreate())
4328              this.type = new CodeableConcept(); // cc
4329          return this.type;
4330        }
4331
4332        public boolean hasType() { 
4333          return this.type != null && !this.type.isEmpty();
4334        }
4335
4336        /**
4337         * @param value {@link #type} (Kind of container (e.g. Periodical, database, or book).)
4338         */
4339        public CitationCitedArtifactPublicationFormPublishedInComponent setType(CodeableConcept value) { 
4340          this.type = value;
4341          return this;
4342        }
4343
4344        /**
4345         * @return {@link #identifier} (Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN.)
4346         */
4347        public List<Identifier> getIdentifier() { 
4348          if (this.identifier == null)
4349            this.identifier = new ArrayList<Identifier>();
4350          return this.identifier;
4351        }
4352
4353        /**
4354         * @return Returns a reference to <code>this</code> for easy method chaining
4355         */
4356        public CitationCitedArtifactPublicationFormPublishedInComponent setIdentifier(List<Identifier> theIdentifier) { 
4357          this.identifier = theIdentifier;
4358          return this;
4359        }
4360
4361        public boolean hasIdentifier() { 
4362          if (this.identifier == null)
4363            return false;
4364          for (Identifier item : this.identifier)
4365            if (!item.isEmpty())
4366              return true;
4367          return false;
4368        }
4369
4370        public Identifier addIdentifier() { //3
4371          Identifier t = new Identifier();
4372          if (this.identifier == null)
4373            this.identifier = new ArrayList<Identifier>();
4374          this.identifier.add(t);
4375          return t;
4376        }
4377
4378        public CitationCitedArtifactPublicationFormPublishedInComponent addIdentifier(Identifier t) { //3
4379          if (t == null)
4380            return this;
4381          if (this.identifier == null)
4382            this.identifier = new ArrayList<Identifier>();
4383          this.identifier.add(t);
4384          return this;
4385        }
4386
4387        /**
4388         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
4389         */
4390        public Identifier getIdentifierFirstRep() { 
4391          if (getIdentifier().isEmpty()) {
4392            addIdentifier();
4393          }
4394          return getIdentifier().get(0);
4395        }
4396
4397        /**
4398         * @return {@link #title} (Name of the database or title of the book or journal.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
4399         */
4400        public StringType getTitleElement() { 
4401          if (this.title == null)
4402            if (Configuration.errorOnAutoCreate())
4403              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPublishedInComponent.title");
4404            else if (Configuration.doAutoCreate())
4405              this.title = new StringType(); // bb
4406          return this.title;
4407        }
4408
4409        public boolean hasTitleElement() { 
4410          return this.title != null && !this.title.isEmpty();
4411        }
4412
4413        public boolean hasTitle() { 
4414          return this.title != null && !this.title.isEmpty();
4415        }
4416
4417        /**
4418         * @param value {@link #title} (Name of the database or title of the book or journal.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
4419         */
4420        public CitationCitedArtifactPublicationFormPublishedInComponent setTitleElement(StringType value) { 
4421          this.title = value;
4422          return this;
4423        }
4424
4425        /**
4426         * @return Name of the database or title of the book or journal.
4427         */
4428        public String getTitle() { 
4429          return this.title == null ? null : this.title.getValue();
4430        }
4431
4432        /**
4433         * @param value Name of the database or title of the book or journal.
4434         */
4435        public CitationCitedArtifactPublicationFormPublishedInComponent setTitle(String value) { 
4436          if (Utilities.noString(value))
4437            this.title = null;
4438          else {
4439            if (this.title == null)
4440              this.title = new StringType();
4441            this.title.setValue(value);
4442          }
4443          return this;
4444        }
4445
4446        /**
4447         * @return {@link #publisher} (Name of the publisher.)
4448         */
4449        public Reference getPublisher() { 
4450          if (this.publisher == null)
4451            if (Configuration.errorOnAutoCreate())
4452              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPublishedInComponent.publisher");
4453            else if (Configuration.doAutoCreate())
4454              this.publisher = new Reference(); // cc
4455          return this.publisher;
4456        }
4457
4458        public boolean hasPublisher() { 
4459          return this.publisher != null && !this.publisher.isEmpty();
4460        }
4461
4462        /**
4463         * @param value {@link #publisher} (Name of the publisher.)
4464         */
4465        public CitationCitedArtifactPublicationFormPublishedInComponent setPublisher(Reference value) { 
4466          this.publisher = value;
4467          return this;
4468        }
4469
4470        /**
4471         * @return {@link #publisherLocation} (Geographic location of the publisher.). This is the underlying object with id, value and extensions. The accessor "getPublisherLocation" gives direct access to the value
4472         */
4473        public StringType getPublisherLocationElement() { 
4474          if (this.publisherLocation == null)
4475            if (Configuration.errorOnAutoCreate())
4476              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPublishedInComponent.publisherLocation");
4477            else if (Configuration.doAutoCreate())
4478              this.publisherLocation = new StringType(); // bb
4479          return this.publisherLocation;
4480        }
4481
4482        public boolean hasPublisherLocationElement() { 
4483          return this.publisherLocation != null && !this.publisherLocation.isEmpty();
4484        }
4485
4486        public boolean hasPublisherLocation() { 
4487          return this.publisherLocation != null && !this.publisherLocation.isEmpty();
4488        }
4489
4490        /**
4491         * @param value {@link #publisherLocation} (Geographic location of the publisher.). This is the underlying object with id, value and extensions. The accessor "getPublisherLocation" gives direct access to the value
4492         */
4493        public CitationCitedArtifactPublicationFormPublishedInComponent setPublisherLocationElement(StringType value) { 
4494          this.publisherLocation = value;
4495          return this;
4496        }
4497
4498        /**
4499         * @return Geographic location of the publisher.
4500         */
4501        public String getPublisherLocation() { 
4502          return this.publisherLocation == null ? null : this.publisherLocation.getValue();
4503        }
4504
4505        /**
4506         * @param value Geographic location of the publisher.
4507         */
4508        public CitationCitedArtifactPublicationFormPublishedInComponent setPublisherLocation(String value) { 
4509          if (Utilities.noString(value))
4510            this.publisherLocation = null;
4511          else {
4512            if (this.publisherLocation == null)
4513              this.publisherLocation = new StringType();
4514            this.publisherLocation.setValue(value);
4515          }
4516          return this;
4517        }
4518
4519        protected void listChildren(List<Property> children) {
4520          super.listChildren(children);
4521          children.add(new Property("type", "CodeableConcept", "Kind of container (e.g. Periodical, database, or book).", 0, 1, type));
4522          children.add(new Property("identifier", "Identifier", "Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN.", 0, java.lang.Integer.MAX_VALUE, identifier));
4523          children.add(new Property("title", "string", "Name of the database or title of the book or journal.", 0, 1, title));
4524          children.add(new Property("publisher", "Reference(Organization)", "Name of the publisher.", 0, 1, publisher));
4525          children.add(new Property("publisherLocation", "string", "Geographic location of the publisher.", 0, 1, publisherLocation));
4526        }
4527
4528        @Override
4529        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4530          switch (_hash) {
4531          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Kind of container (e.g. Periodical, database, or book).", 0, 1, type);
4532          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN.", 0, java.lang.Integer.MAX_VALUE, identifier);
4533          case 110371416: /*title*/  return new Property("title", "string", "Name of the database or title of the book or journal.", 0, 1, title);
4534          case 1447404028: /*publisher*/  return new Property("publisher", "Reference(Organization)", "Name of the publisher.", 0, 1, publisher);
4535          case -1281627695: /*publisherLocation*/  return new Property("publisherLocation", "string", "Geographic location of the publisher.", 0, 1, publisherLocation);
4536          default: return super.getNamedProperty(_hash, _name, _checkValid);
4537          }
4538
4539        }
4540
4541      @Override
4542      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4543        switch (hash) {
4544        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
4545        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
4546        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
4547        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // Reference
4548        case -1281627695: /*publisherLocation*/ return this.publisherLocation == null ? new Base[0] : new Base[] {this.publisherLocation}; // StringType
4549        default: return super.getProperty(hash, name, checkValid);
4550        }
4551
4552      }
4553
4554      @Override
4555      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4556        switch (hash) {
4557        case 3575610: // type
4558          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4559          return value;
4560        case -1618432855: // identifier
4561          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
4562          return value;
4563        case 110371416: // title
4564          this.title = TypeConvertor.castToString(value); // StringType
4565          return value;
4566        case 1447404028: // publisher
4567          this.publisher = TypeConvertor.castToReference(value); // Reference
4568          return value;
4569        case -1281627695: // publisherLocation
4570          this.publisherLocation = TypeConvertor.castToString(value); // StringType
4571          return value;
4572        default: return super.setProperty(hash, name, value);
4573        }
4574
4575      }
4576
4577      @Override
4578      public Base setProperty(String name, Base value) throws FHIRException {
4579        if (name.equals("type")) {
4580          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4581        } else if (name.equals("identifier")) {
4582          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
4583        } else if (name.equals("title")) {
4584          this.title = TypeConvertor.castToString(value); // StringType
4585        } else if (name.equals("publisher")) {
4586          this.publisher = TypeConvertor.castToReference(value); // Reference
4587        } else if (name.equals("publisherLocation")) {
4588          this.publisherLocation = TypeConvertor.castToString(value); // StringType
4589        } else
4590          return super.setProperty(name, value);
4591        return value;
4592      }
4593
4594      @Override
4595      public Base makeProperty(int hash, String name) throws FHIRException {
4596        switch (hash) {
4597        case 3575610:  return getType();
4598        case -1618432855:  return addIdentifier(); 
4599        case 110371416:  return getTitleElement();
4600        case 1447404028:  return getPublisher();
4601        case -1281627695:  return getPublisherLocationElement();
4602        default: return super.makeProperty(hash, name);
4603        }
4604
4605      }
4606
4607      @Override
4608      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4609        switch (hash) {
4610        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
4611        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
4612        case 110371416: /*title*/ return new String[] {"string"};
4613        case 1447404028: /*publisher*/ return new String[] {"Reference"};
4614        case -1281627695: /*publisherLocation*/ return new String[] {"string"};
4615        default: return super.getTypesForProperty(hash, name);
4616        }
4617
4618      }
4619
4620      @Override
4621      public Base addChild(String name) throws FHIRException {
4622        if (name.equals("type")) {
4623          this.type = new CodeableConcept();
4624          return this.type;
4625        }
4626        else if (name.equals("identifier")) {
4627          return addIdentifier();
4628        }
4629        else if (name.equals("title")) {
4630          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.publishedIn.title");
4631        }
4632        else if (name.equals("publisher")) {
4633          this.publisher = new Reference();
4634          return this.publisher;
4635        }
4636        else if (name.equals("publisherLocation")) {
4637          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.publishedIn.publisherLocation");
4638        }
4639        else
4640          return super.addChild(name);
4641      }
4642
4643      public CitationCitedArtifactPublicationFormPublishedInComponent copy() {
4644        CitationCitedArtifactPublicationFormPublishedInComponent dst = new CitationCitedArtifactPublicationFormPublishedInComponent();
4645        copyValues(dst);
4646        return dst;
4647      }
4648
4649      public void copyValues(CitationCitedArtifactPublicationFormPublishedInComponent dst) {
4650        super.copyValues(dst);
4651        dst.type = type == null ? null : type.copy();
4652        if (identifier != null) {
4653          dst.identifier = new ArrayList<Identifier>();
4654          for (Identifier i : identifier)
4655            dst.identifier.add(i.copy());
4656        };
4657        dst.title = title == null ? null : title.copy();
4658        dst.publisher = publisher == null ? null : publisher.copy();
4659        dst.publisherLocation = publisherLocation == null ? null : publisherLocation.copy();
4660      }
4661
4662      @Override
4663      public boolean equalsDeep(Base other_) {
4664        if (!super.equalsDeep(other_))
4665          return false;
4666        if (!(other_ instanceof CitationCitedArtifactPublicationFormPublishedInComponent))
4667          return false;
4668        CitationCitedArtifactPublicationFormPublishedInComponent o = (CitationCitedArtifactPublicationFormPublishedInComponent) other_;
4669        return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(title, o.title, true)
4670           && compareDeep(publisher, o.publisher, true) && compareDeep(publisherLocation, o.publisherLocation, true)
4671          ;
4672      }
4673
4674      @Override
4675      public boolean equalsShallow(Base other_) {
4676        if (!super.equalsShallow(other_))
4677          return false;
4678        if (!(other_ instanceof CitationCitedArtifactPublicationFormPublishedInComponent))
4679          return false;
4680        CitationCitedArtifactPublicationFormPublishedInComponent o = (CitationCitedArtifactPublicationFormPublishedInComponent) other_;
4681        return compareValues(title, o.title, true) && compareValues(publisherLocation, o.publisherLocation, true)
4682          ;
4683      }
4684
4685      public boolean isEmpty() {
4686        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, identifier, title
4687          , publisher, publisherLocation);
4688      }
4689
4690  public String fhirType() {
4691    return "Citation.citedArtifact.publicationForm.publishedIn";
4692
4693  }
4694
4695  }
4696
4697    @Block()
4698    public static class CitationCitedArtifactPublicationFormPeriodicReleaseComponent extends BackboneElement implements IBaseBackboneElement {
4699        /**
4700         * Describes the form of the medium cited. Common codes are "Internet" or "Print".
4701         */
4702        @Child(name = "citedMedium", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
4703        @Description(shortDefinition="Internet or Print", formalDefinition="Describes the form of the medium cited. Common codes are \"Internet\" or \"Print\"." )
4704        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-medium")
4705        protected CodeableConcept citedMedium;
4706
4707        /**
4708         * Volume number of journal in which the article is published.
4709         */
4710        @Child(name = "volume", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
4711        @Description(shortDefinition="Volume number of journal in which the article is published", formalDefinition="Volume number of journal in which the article is published." )
4712        protected StringType volume;
4713
4714        /**
4715         * Issue, part or supplement of journal in which the article is published.
4716         */
4717        @Child(name = "issue", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
4718        @Description(shortDefinition="Issue, part or supplement of journal in which the article is published", formalDefinition="Issue, part or supplement of journal in which the article is published." )
4719        protected StringType issue;
4720
4721        /**
4722         * Defining the date on which the issue of the journal was published.
4723         */
4724        @Child(name = "dateOfPublication", type = {}, order=4, min=0, max=1, modifier=false, summary=false)
4725        @Description(shortDefinition="Defining the date on which the issue of the journal was published", formalDefinition="Defining the date on which the issue of the journal was published." )
4726        protected CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent dateOfPublication;
4727
4728        private static final long serialVersionUID = -474554951L;
4729
4730    /**
4731     * Constructor
4732     */
4733      public CitationCitedArtifactPublicationFormPeriodicReleaseComponent() {
4734        super();
4735      }
4736
4737        /**
4738         * @return {@link #citedMedium} (Describes the form of the medium cited. Common codes are "Internet" or "Print".)
4739         */
4740        public CodeableConcept getCitedMedium() { 
4741          if (this.citedMedium == null)
4742            if (Configuration.errorOnAutoCreate())
4743              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseComponent.citedMedium");
4744            else if (Configuration.doAutoCreate())
4745              this.citedMedium = new CodeableConcept(); // cc
4746          return this.citedMedium;
4747        }
4748
4749        public boolean hasCitedMedium() { 
4750          return this.citedMedium != null && !this.citedMedium.isEmpty();
4751        }
4752
4753        /**
4754         * @param value {@link #citedMedium} (Describes the form of the medium cited. Common codes are "Internet" or "Print".)
4755         */
4756        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setCitedMedium(CodeableConcept value) { 
4757          this.citedMedium = value;
4758          return this;
4759        }
4760
4761        /**
4762         * @return {@link #volume} (Volume number of journal in which the article is published.). This is the underlying object with id, value and extensions. The accessor "getVolume" gives direct access to the value
4763         */
4764        public StringType getVolumeElement() { 
4765          if (this.volume == null)
4766            if (Configuration.errorOnAutoCreate())
4767              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseComponent.volume");
4768            else if (Configuration.doAutoCreate())
4769              this.volume = new StringType(); // bb
4770          return this.volume;
4771        }
4772
4773        public boolean hasVolumeElement() { 
4774          return this.volume != null && !this.volume.isEmpty();
4775        }
4776
4777        public boolean hasVolume() { 
4778          return this.volume != null && !this.volume.isEmpty();
4779        }
4780
4781        /**
4782         * @param value {@link #volume} (Volume number of journal in which the article is published.). This is the underlying object with id, value and extensions. The accessor "getVolume" gives direct access to the value
4783         */
4784        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setVolumeElement(StringType value) { 
4785          this.volume = value;
4786          return this;
4787        }
4788
4789        /**
4790         * @return Volume number of journal in which the article is published.
4791         */
4792        public String getVolume() { 
4793          return this.volume == null ? null : this.volume.getValue();
4794        }
4795
4796        /**
4797         * @param value Volume number of journal in which the article is published.
4798         */
4799        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setVolume(String value) { 
4800          if (Utilities.noString(value))
4801            this.volume = null;
4802          else {
4803            if (this.volume == null)
4804              this.volume = new StringType();
4805            this.volume.setValue(value);
4806          }
4807          return this;
4808        }
4809
4810        /**
4811         * @return {@link #issue} (Issue, part or supplement of journal in which the article is published.). This is the underlying object with id, value and extensions. The accessor "getIssue" gives direct access to the value
4812         */
4813        public StringType getIssueElement() { 
4814          if (this.issue == null)
4815            if (Configuration.errorOnAutoCreate())
4816              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseComponent.issue");
4817            else if (Configuration.doAutoCreate())
4818              this.issue = new StringType(); // bb
4819          return this.issue;
4820        }
4821
4822        public boolean hasIssueElement() { 
4823          return this.issue != null && !this.issue.isEmpty();
4824        }
4825
4826        public boolean hasIssue() { 
4827          return this.issue != null && !this.issue.isEmpty();
4828        }
4829
4830        /**
4831         * @param value {@link #issue} (Issue, part or supplement of journal in which the article is published.). This is the underlying object with id, value and extensions. The accessor "getIssue" gives direct access to the value
4832         */
4833        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setIssueElement(StringType value) { 
4834          this.issue = value;
4835          return this;
4836        }
4837
4838        /**
4839         * @return Issue, part or supplement of journal in which the article is published.
4840         */
4841        public String getIssue() { 
4842          return this.issue == null ? null : this.issue.getValue();
4843        }
4844
4845        /**
4846         * @param value Issue, part or supplement of journal in which the article is published.
4847         */
4848        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setIssue(String value) { 
4849          if (Utilities.noString(value))
4850            this.issue = null;
4851          else {
4852            if (this.issue == null)
4853              this.issue = new StringType();
4854            this.issue.setValue(value);
4855          }
4856          return this;
4857        }
4858
4859        /**
4860         * @return {@link #dateOfPublication} (Defining the date on which the issue of the journal was published.)
4861         */
4862        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent getDateOfPublication() { 
4863          if (this.dateOfPublication == null)
4864            if (Configuration.errorOnAutoCreate())
4865              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseComponent.dateOfPublication");
4866            else if (Configuration.doAutoCreate())
4867              this.dateOfPublication = new CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent(); // cc
4868          return this.dateOfPublication;
4869        }
4870
4871        public boolean hasDateOfPublication() { 
4872          return this.dateOfPublication != null && !this.dateOfPublication.isEmpty();
4873        }
4874
4875        /**
4876         * @param value {@link #dateOfPublication} (Defining the date on which the issue of the journal was published.)
4877         */
4878        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setDateOfPublication(CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent value) { 
4879          this.dateOfPublication = value;
4880          return this;
4881        }
4882
4883        protected void listChildren(List<Property> children) {
4884          super.listChildren(children);
4885          children.add(new Property("citedMedium", "CodeableConcept", "Describes the form of the medium cited. Common codes are \"Internet\" or \"Print\".", 0, 1, citedMedium));
4886          children.add(new Property("volume", "string", "Volume number of journal in which the article is published.", 0, 1, volume));
4887          children.add(new Property("issue", "string", "Issue, part or supplement of journal in which the article is published.", 0, 1, issue));
4888          children.add(new Property("dateOfPublication", "", "Defining the date on which the issue of the journal was published.", 0, 1, dateOfPublication));
4889        }
4890
4891        @Override
4892        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4893          switch (_hash) {
4894          case 612116418: /*citedMedium*/  return new Property("citedMedium", "CodeableConcept", "Describes the form of the medium cited. Common codes are \"Internet\" or \"Print\".", 0, 1, citedMedium);
4895          case -810883302: /*volume*/  return new Property("volume", "string", "Volume number of journal in which the article is published.", 0, 1, volume);
4896          case 100509913: /*issue*/  return new Property("issue", "string", "Issue, part or supplement of journal in which the article is published.", 0, 1, issue);
4897          case -1662473529: /*dateOfPublication*/  return new Property("dateOfPublication", "", "Defining the date on which the issue of the journal was published.", 0, 1, dateOfPublication);
4898          default: return super.getNamedProperty(_hash, _name, _checkValid);
4899          }
4900
4901        }
4902
4903      @Override
4904      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4905        switch (hash) {
4906        case 612116418: /*citedMedium*/ return this.citedMedium == null ? new Base[0] : new Base[] {this.citedMedium}; // CodeableConcept
4907        case -810883302: /*volume*/ return this.volume == null ? new Base[0] : new Base[] {this.volume}; // StringType
4908        case 100509913: /*issue*/ return this.issue == null ? new Base[0] : new Base[] {this.issue}; // StringType
4909        case -1662473529: /*dateOfPublication*/ return this.dateOfPublication == null ? new Base[0] : new Base[] {this.dateOfPublication}; // CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent
4910        default: return super.getProperty(hash, name, checkValid);
4911        }
4912
4913      }
4914
4915      @Override
4916      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4917        switch (hash) {
4918        case 612116418: // citedMedium
4919          this.citedMedium = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4920          return value;
4921        case -810883302: // volume
4922          this.volume = TypeConvertor.castToString(value); // StringType
4923          return value;
4924        case 100509913: // issue
4925          this.issue = TypeConvertor.castToString(value); // StringType
4926          return value;
4927        case -1662473529: // dateOfPublication
4928          this.dateOfPublication = (CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent) value; // CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent
4929          return value;
4930        default: return super.setProperty(hash, name, value);
4931        }
4932
4933      }
4934
4935      @Override
4936      public Base setProperty(String name, Base value) throws FHIRException {
4937        if (name.equals("citedMedium")) {
4938          this.citedMedium = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4939        } else if (name.equals("volume")) {
4940          this.volume = TypeConvertor.castToString(value); // StringType
4941        } else if (name.equals("issue")) {
4942          this.issue = TypeConvertor.castToString(value); // StringType
4943        } else if (name.equals("dateOfPublication")) {
4944          this.dateOfPublication = (CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent) value; // CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent
4945        } else
4946          return super.setProperty(name, value);
4947        return value;
4948      }
4949
4950      @Override
4951      public Base makeProperty(int hash, String name) throws FHIRException {
4952        switch (hash) {
4953        case 612116418:  return getCitedMedium();
4954        case -810883302:  return getVolumeElement();
4955        case 100509913:  return getIssueElement();
4956        case -1662473529:  return getDateOfPublication();
4957        default: return super.makeProperty(hash, name);
4958        }
4959
4960      }
4961
4962      @Override
4963      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4964        switch (hash) {
4965        case 612116418: /*citedMedium*/ return new String[] {"CodeableConcept"};
4966        case -810883302: /*volume*/ return new String[] {"string"};
4967        case 100509913: /*issue*/ return new String[] {"string"};
4968        case -1662473529: /*dateOfPublication*/ return new String[] {};
4969        default: return super.getTypesForProperty(hash, name);
4970        }
4971
4972      }
4973
4974      @Override
4975      public Base addChild(String name) throws FHIRException {
4976        if (name.equals("citedMedium")) {
4977          this.citedMedium = new CodeableConcept();
4978          return this.citedMedium;
4979        }
4980        else if (name.equals("volume")) {
4981          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.volume");
4982        }
4983        else if (name.equals("issue")) {
4984          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.issue");
4985        }
4986        else if (name.equals("dateOfPublication")) {
4987          this.dateOfPublication = new CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent();
4988          return this.dateOfPublication;
4989        }
4990        else
4991          return super.addChild(name);
4992      }
4993
4994      public CitationCitedArtifactPublicationFormPeriodicReleaseComponent copy() {
4995        CitationCitedArtifactPublicationFormPeriodicReleaseComponent dst = new CitationCitedArtifactPublicationFormPeriodicReleaseComponent();
4996        copyValues(dst);
4997        return dst;
4998      }
4999
5000      public void copyValues(CitationCitedArtifactPublicationFormPeriodicReleaseComponent dst) {
5001        super.copyValues(dst);
5002        dst.citedMedium = citedMedium == null ? null : citedMedium.copy();
5003        dst.volume = volume == null ? null : volume.copy();
5004        dst.issue = issue == null ? null : issue.copy();
5005        dst.dateOfPublication = dateOfPublication == null ? null : dateOfPublication.copy();
5006      }
5007
5008      @Override
5009      public boolean equalsDeep(Base other_) {
5010        if (!super.equalsDeep(other_))
5011          return false;
5012        if (!(other_ instanceof CitationCitedArtifactPublicationFormPeriodicReleaseComponent))
5013          return false;
5014        CitationCitedArtifactPublicationFormPeriodicReleaseComponent o = (CitationCitedArtifactPublicationFormPeriodicReleaseComponent) other_;
5015        return compareDeep(citedMedium, o.citedMedium, true) && compareDeep(volume, o.volume, true) && compareDeep(issue, o.issue, true)
5016           && compareDeep(dateOfPublication, o.dateOfPublication, true);
5017      }
5018
5019      @Override
5020      public boolean equalsShallow(Base other_) {
5021        if (!super.equalsShallow(other_))
5022          return false;
5023        if (!(other_ instanceof CitationCitedArtifactPublicationFormPeriodicReleaseComponent))
5024          return false;
5025        CitationCitedArtifactPublicationFormPeriodicReleaseComponent o = (CitationCitedArtifactPublicationFormPeriodicReleaseComponent) other_;
5026        return compareValues(volume, o.volume, true) && compareValues(issue, o.issue, true);
5027      }
5028
5029      public boolean isEmpty() {
5030        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(citedMedium, volume, issue
5031          , dateOfPublication);
5032      }
5033
5034  public String fhirType() {
5035    return "Citation.citedArtifact.publicationForm.periodicRelease";
5036
5037  }
5038
5039  }
5040
5041    @Block()
5042    public static class CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent extends BackboneElement implements IBaseBackboneElement {
5043        /**
5044         * Date on which the issue of the journal was published.
5045         */
5046        @Child(name = "date", type = {DateType.class}, order=1, min=0, max=1, modifier=false, summary=false)
5047        @Description(shortDefinition="Date on which the issue of the journal was published", formalDefinition="Date on which the issue of the journal was published." )
5048        protected DateType date;
5049
5050        /**
5051         * Year on which the issue of the journal was published.
5052         */
5053        @Child(name = "year", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5054        @Description(shortDefinition="Year on which the issue of the journal was published", formalDefinition="Year on which the issue of the journal was published." )
5055        protected StringType year;
5056
5057        /**
5058         * Month on which the issue of the journal was published.
5059         */
5060        @Child(name = "month", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
5061        @Description(shortDefinition="Month on which the issue of the journal was published", formalDefinition="Month on which the issue of the journal was published." )
5062        protected StringType month;
5063
5064        /**
5065         * Day on which the issue of the journal was published.
5066         */
5067        @Child(name = "day", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
5068        @Description(shortDefinition="Day on which the issue of the journal was published", formalDefinition="Day on which the issue of the journal was published." )
5069        protected StringType day;
5070
5071        /**
5072         * Spring, Summer, Fall/Autumn, Winter.
5073         */
5074        @Child(name = "season", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
5075        @Description(shortDefinition="Season on which the issue of the journal was published", formalDefinition="Spring, Summer, Fall/Autumn, Winter." )
5076        protected StringType season;
5077
5078        /**
5079         * Text representation of the date of which the issue of the journal was published.
5080         */
5081        @Child(name = "text", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
5082        @Description(shortDefinition="Text representation of the date of which the issue of the journal was published", formalDefinition="Text representation of the date of which the issue of the journal was published." )
5083        protected StringType text;
5084
5085        private static final long serialVersionUID = 1585589146L;
5086
5087    /**
5088     * Constructor
5089     */
5090      public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent() {
5091        super();
5092      }
5093
5094        /**
5095         * @return {@link #date} (Date on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
5096         */
5097        public DateType getDateElement() { 
5098          if (this.date == null)
5099            if (Configuration.errorOnAutoCreate())
5100              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.date");
5101            else if (Configuration.doAutoCreate())
5102              this.date = new DateType(); // bb
5103          return this.date;
5104        }
5105
5106        public boolean hasDateElement() { 
5107          return this.date != null && !this.date.isEmpty();
5108        }
5109
5110        public boolean hasDate() { 
5111          return this.date != null && !this.date.isEmpty();
5112        }
5113
5114        /**
5115         * @param value {@link #date} (Date on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
5116         */
5117        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setDateElement(DateType value) { 
5118          this.date = value;
5119          return this;
5120        }
5121
5122        /**
5123         * @return Date on which the issue of the journal was published.
5124         */
5125        public Date getDate() { 
5126          return this.date == null ? null : this.date.getValue();
5127        }
5128
5129        /**
5130         * @param value Date on which the issue of the journal was published.
5131         */
5132        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setDate(Date value) { 
5133          if (value == null)
5134            this.date = null;
5135          else {
5136            if (this.date == null)
5137              this.date = new DateType();
5138            this.date.setValue(value);
5139          }
5140          return this;
5141        }
5142
5143        /**
5144         * @return {@link #year} (Year on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getYear" gives direct access to the value
5145         */
5146        public StringType getYearElement() { 
5147          if (this.year == null)
5148            if (Configuration.errorOnAutoCreate())
5149              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.year");
5150            else if (Configuration.doAutoCreate())
5151              this.year = new StringType(); // bb
5152          return this.year;
5153        }
5154
5155        public boolean hasYearElement() { 
5156          return this.year != null && !this.year.isEmpty();
5157        }
5158
5159        public boolean hasYear() { 
5160          return this.year != null && !this.year.isEmpty();
5161        }
5162
5163        /**
5164         * @param value {@link #year} (Year on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getYear" gives direct access to the value
5165         */
5166        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setYearElement(StringType value) { 
5167          this.year = value;
5168          return this;
5169        }
5170
5171        /**
5172         * @return Year on which the issue of the journal was published.
5173         */
5174        public String getYear() { 
5175          return this.year == null ? null : this.year.getValue();
5176        }
5177
5178        /**
5179         * @param value Year on which the issue of the journal was published.
5180         */
5181        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setYear(String value) { 
5182          if (Utilities.noString(value))
5183            this.year = null;
5184          else {
5185            if (this.year == null)
5186              this.year = new StringType();
5187            this.year.setValue(value);
5188          }
5189          return this;
5190        }
5191
5192        /**
5193         * @return {@link #month} (Month on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getMonth" gives direct access to the value
5194         */
5195        public StringType getMonthElement() { 
5196          if (this.month == null)
5197            if (Configuration.errorOnAutoCreate())
5198              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.month");
5199            else if (Configuration.doAutoCreate())
5200              this.month = new StringType(); // bb
5201          return this.month;
5202        }
5203
5204        public boolean hasMonthElement() { 
5205          return this.month != null && !this.month.isEmpty();
5206        }
5207
5208        public boolean hasMonth() { 
5209          return this.month != null && !this.month.isEmpty();
5210        }
5211
5212        /**
5213         * @param value {@link #month} (Month on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getMonth" gives direct access to the value
5214         */
5215        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setMonthElement(StringType value) { 
5216          this.month = value;
5217          return this;
5218        }
5219
5220        /**
5221         * @return Month on which the issue of the journal was published.
5222         */
5223        public String getMonth() { 
5224          return this.month == null ? null : this.month.getValue();
5225        }
5226
5227        /**
5228         * @param value Month on which the issue of the journal was published.
5229         */
5230        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setMonth(String value) { 
5231          if (Utilities.noString(value))
5232            this.month = null;
5233          else {
5234            if (this.month == null)
5235              this.month = new StringType();
5236            this.month.setValue(value);
5237          }
5238          return this;
5239        }
5240
5241        /**
5242         * @return {@link #day} (Day on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getDay" gives direct access to the value
5243         */
5244        public StringType getDayElement() { 
5245          if (this.day == null)
5246            if (Configuration.errorOnAutoCreate())
5247              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.day");
5248            else if (Configuration.doAutoCreate())
5249              this.day = new StringType(); // bb
5250          return this.day;
5251        }
5252
5253        public boolean hasDayElement() { 
5254          return this.day != null && !this.day.isEmpty();
5255        }
5256
5257        public boolean hasDay() { 
5258          return this.day != null && !this.day.isEmpty();
5259        }
5260
5261        /**
5262         * @param value {@link #day} (Day on which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getDay" gives direct access to the value
5263         */
5264        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setDayElement(StringType value) { 
5265          this.day = value;
5266          return this;
5267        }
5268
5269        /**
5270         * @return Day on which the issue of the journal was published.
5271         */
5272        public String getDay() { 
5273          return this.day == null ? null : this.day.getValue();
5274        }
5275
5276        /**
5277         * @param value Day on which the issue of the journal was published.
5278         */
5279        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setDay(String value) { 
5280          if (Utilities.noString(value))
5281            this.day = null;
5282          else {
5283            if (this.day == null)
5284              this.day = new StringType();
5285            this.day.setValue(value);
5286          }
5287          return this;
5288        }
5289
5290        /**
5291         * @return {@link #season} (Spring, Summer, Fall/Autumn, Winter.). This is the underlying object with id, value and extensions. The accessor "getSeason" gives direct access to the value
5292         */
5293        public StringType getSeasonElement() { 
5294          if (this.season == null)
5295            if (Configuration.errorOnAutoCreate())
5296              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.season");
5297            else if (Configuration.doAutoCreate())
5298              this.season = new StringType(); // bb
5299          return this.season;
5300        }
5301
5302        public boolean hasSeasonElement() { 
5303          return this.season != null && !this.season.isEmpty();
5304        }
5305
5306        public boolean hasSeason() { 
5307          return this.season != null && !this.season.isEmpty();
5308        }
5309
5310        /**
5311         * @param value {@link #season} (Spring, Summer, Fall/Autumn, Winter.). This is the underlying object with id, value and extensions. The accessor "getSeason" gives direct access to the value
5312         */
5313        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setSeasonElement(StringType value) { 
5314          this.season = value;
5315          return this;
5316        }
5317
5318        /**
5319         * @return Spring, Summer, Fall/Autumn, Winter.
5320         */
5321        public String getSeason() { 
5322          return this.season == null ? null : this.season.getValue();
5323        }
5324
5325        /**
5326         * @param value Spring, Summer, Fall/Autumn, Winter.
5327         */
5328        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setSeason(String value) { 
5329          if (Utilities.noString(value))
5330            this.season = null;
5331          else {
5332            if (this.season == null)
5333              this.season = new StringType();
5334            this.season.setValue(value);
5335          }
5336          return this;
5337        }
5338
5339        /**
5340         * @return {@link #text} (Text representation of the date of which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
5341         */
5342        public StringType getTextElement() { 
5343          if (this.text == null)
5344            if (Configuration.errorOnAutoCreate())
5345              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.text");
5346            else if (Configuration.doAutoCreate())
5347              this.text = new StringType(); // bb
5348          return this.text;
5349        }
5350
5351        public boolean hasTextElement() { 
5352          return this.text != null && !this.text.isEmpty();
5353        }
5354
5355        public boolean hasText() { 
5356          return this.text != null && !this.text.isEmpty();
5357        }
5358
5359        /**
5360         * @param value {@link #text} (Text representation of the date of which the issue of the journal was published.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
5361         */
5362        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setTextElement(StringType value) { 
5363          this.text = value;
5364          return this;
5365        }
5366
5367        /**
5368         * @return Text representation of the date of which the issue of the journal was published.
5369         */
5370        public String getText() { 
5371          return this.text == null ? null : this.text.getValue();
5372        }
5373
5374        /**
5375         * @param value Text representation of the date of which the issue of the journal was published.
5376         */
5377        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setText(String value) { 
5378          if (Utilities.noString(value))
5379            this.text = null;
5380          else {
5381            if (this.text == null)
5382              this.text = new StringType();
5383            this.text.setValue(value);
5384          }
5385          return this;
5386        }
5387
5388        protected void listChildren(List<Property> children) {
5389          super.listChildren(children);
5390          children.add(new Property("date", "date", "Date on which the issue of the journal was published.", 0, 1, date));
5391          children.add(new Property("year", "string", "Year on which the issue of the journal was published.", 0, 1, year));
5392          children.add(new Property("month", "string", "Month on which the issue of the journal was published.", 0, 1, month));
5393          children.add(new Property("day", "string", "Day on which the issue of the journal was published.", 0, 1, day));
5394          children.add(new Property("season", "string", "Spring, Summer, Fall/Autumn, Winter.", 0, 1, season));
5395          children.add(new Property("text", "string", "Text representation of the date of which the issue of the journal was published.", 0, 1, text));
5396        }
5397
5398        @Override
5399        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5400          switch (_hash) {
5401          case 3076014: /*date*/  return new Property("date", "date", "Date on which the issue of the journal was published.", 0, 1, date);
5402          case 3704893: /*year*/  return new Property("year", "string", "Year on which the issue of the journal was published.", 0, 1, year);
5403          case 104080000: /*month*/  return new Property("month", "string", "Month on which the issue of the journal was published.", 0, 1, month);
5404          case 99228: /*day*/  return new Property("day", "string", "Day on which the issue of the journal was published.", 0, 1, day);
5405          case -906335517: /*season*/  return new Property("season", "string", "Spring, Summer, Fall/Autumn, Winter.", 0, 1, season);
5406          case 3556653: /*text*/  return new Property("text", "string", "Text representation of the date of which the issue of the journal was published.", 0, 1, text);
5407          default: return super.getNamedProperty(_hash, _name, _checkValid);
5408          }
5409
5410        }
5411
5412      @Override
5413      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5414        switch (hash) {
5415        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType
5416        case 3704893: /*year*/ return this.year == null ? new Base[0] : new Base[] {this.year}; // StringType
5417        case 104080000: /*month*/ return this.month == null ? new Base[0] : new Base[] {this.month}; // StringType
5418        case 99228: /*day*/ return this.day == null ? new Base[0] : new Base[] {this.day}; // StringType
5419        case -906335517: /*season*/ return this.season == null ? new Base[0] : new Base[] {this.season}; // StringType
5420        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
5421        default: return super.getProperty(hash, name, checkValid);
5422        }
5423
5424      }
5425
5426      @Override
5427      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5428        switch (hash) {
5429        case 3076014: // date
5430          this.date = TypeConvertor.castToDate(value); // DateType
5431          return value;
5432        case 3704893: // year
5433          this.year = TypeConvertor.castToString(value); // StringType
5434          return value;
5435        case 104080000: // month
5436          this.month = TypeConvertor.castToString(value); // StringType
5437          return value;
5438        case 99228: // day
5439          this.day = TypeConvertor.castToString(value); // StringType
5440          return value;
5441        case -906335517: // season
5442          this.season = TypeConvertor.castToString(value); // StringType
5443          return value;
5444        case 3556653: // text
5445          this.text = TypeConvertor.castToString(value); // StringType
5446          return value;
5447        default: return super.setProperty(hash, name, value);
5448        }
5449
5450      }
5451
5452      @Override
5453      public Base setProperty(String name, Base value) throws FHIRException {
5454        if (name.equals("date")) {
5455          this.date = TypeConvertor.castToDate(value); // DateType
5456        } else if (name.equals("year")) {
5457          this.year = TypeConvertor.castToString(value); // StringType
5458        } else if (name.equals("month")) {
5459          this.month = TypeConvertor.castToString(value); // StringType
5460        } else if (name.equals("day")) {
5461          this.day = TypeConvertor.castToString(value); // StringType
5462        } else if (name.equals("season")) {
5463          this.season = TypeConvertor.castToString(value); // StringType
5464        } else if (name.equals("text")) {
5465          this.text = TypeConvertor.castToString(value); // StringType
5466        } else
5467          return super.setProperty(name, value);
5468        return value;
5469      }
5470
5471      @Override
5472      public Base makeProperty(int hash, String name) throws FHIRException {
5473        switch (hash) {
5474        case 3076014:  return getDateElement();
5475        case 3704893:  return getYearElement();
5476        case 104080000:  return getMonthElement();
5477        case 99228:  return getDayElement();
5478        case -906335517:  return getSeasonElement();
5479        case 3556653:  return getTextElement();
5480        default: return super.makeProperty(hash, name);
5481        }
5482
5483      }
5484
5485      @Override
5486      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5487        switch (hash) {
5488        case 3076014: /*date*/ return new String[] {"date"};
5489        case 3704893: /*year*/ return new String[] {"string"};
5490        case 104080000: /*month*/ return new String[] {"string"};
5491        case 99228: /*day*/ return new String[] {"string"};
5492        case -906335517: /*season*/ return new String[] {"string"};
5493        case 3556653: /*text*/ return new String[] {"string"};
5494        default: return super.getTypesForProperty(hash, name);
5495        }
5496
5497      }
5498
5499      @Override
5500      public Base addChild(String name) throws FHIRException {
5501        if (name.equals("date")) {
5502          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.date");
5503        }
5504        else if (name.equals("year")) {
5505          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.year");
5506        }
5507        else if (name.equals("month")) {
5508          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.month");
5509        }
5510        else if (name.equals("day")) {
5511          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.day");
5512        }
5513        else if (name.equals("season")) {
5514          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.season");
5515        }
5516        else if (name.equals("text")) {
5517          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.text");
5518        }
5519        else
5520          return super.addChild(name);
5521      }
5522
5523      public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent copy() {
5524        CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent dst = new CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent();
5525        copyValues(dst);
5526        return dst;
5527      }
5528
5529      public void copyValues(CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent dst) {
5530        super.copyValues(dst);
5531        dst.date = date == null ? null : date.copy();
5532        dst.year = year == null ? null : year.copy();
5533        dst.month = month == null ? null : month.copy();
5534        dst.day = day == null ? null : day.copy();
5535        dst.season = season == null ? null : season.copy();
5536        dst.text = text == null ? null : text.copy();
5537      }
5538
5539      @Override
5540      public boolean equalsDeep(Base other_) {
5541        if (!super.equalsDeep(other_))
5542          return false;
5543        if (!(other_ instanceof CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent))
5544          return false;
5545        CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent o = (CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent) other_;
5546        return compareDeep(date, o.date, true) && compareDeep(year, o.year, true) && compareDeep(month, o.month, true)
5547           && compareDeep(day, o.day, true) && compareDeep(season, o.season, true) && compareDeep(text, o.text, true)
5548          ;
5549      }
5550
5551      @Override
5552      public boolean equalsShallow(Base other_) {
5553        if (!super.equalsShallow(other_))
5554          return false;
5555        if (!(other_ instanceof CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent))
5556          return false;
5557        CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent o = (CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent) other_;
5558        return compareValues(date, o.date, true) && compareValues(year, o.year, true) && compareValues(month, o.month, true)
5559           && compareValues(day, o.day, true) && compareValues(season, o.season, true) && compareValues(text, o.text, true)
5560          ;
5561      }
5562
5563      public boolean isEmpty() {
5564        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(date, year, month, day
5565          , season, text);
5566      }
5567
5568  public String fhirType() {
5569    return "Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication";
5570
5571  }
5572
5573  }
5574
5575    @Block()
5576    public static class CitationCitedArtifactWebLocationComponent extends BackboneElement implements IBaseBackboneElement {
5577        /**
5578         * Code the reason for different URLs, e.g. abstract and full-text.
5579         */
5580        @Child(name = "classifier", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5581        @Description(shortDefinition="Code the reason for different URLs, e.g. abstract and full-text", formalDefinition="Code the reason for different URLs, e.g. abstract and full-text." )
5582        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/artifact-url-classifier")
5583        protected List<CodeableConcept> classifier;
5584
5585        /**
5586         * The specific URL.
5587         */
5588        @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5589        @Description(shortDefinition="The specific URL", formalDefinition="The specific URL." )
5590        protected UriType url;
5591
5592        private static final long serialVersionUID = -1300703403L;
5593
5594    /**
5595     * Constructor
5596     */
5597      public CitationCitedArtifactWebLocationComponent() {
5598        super();
5599      }
5600
5601        /**
5602         * @return {@link #classifier} (Code the reason for different URLs, e.g. abstract and full-text.)
5603         */
5604        public List<CodeableConcept> getClassifier() { 
5605          if (this.classifier == null)
5606            this.classifier = new ArrayList<CodeableConcept>();
5607          return this.classifier;
5608        }
5609
5610        /**
5611         * @return Returns a reference to <code>this</code> for easy method chaining
5612         */
5613        public CitationCitedArtifactWebLocationComponent setClassifier(List<CodeableConcept> theClassifier) { 
5614          this.classifier = theClassifier;
5615          return this;
5616        }
5617
5618        public boolean hasClassifier() { 
5619          if (this.classifier == null)
5620            return false;
5621          for (CodeableConcept item : this.classifier)
5622            if (!item.isEmpty())
5623              return true;
5624          return false;
5625        }
5626
5627        public CodeableConcept addClassifier() { //3
5628          CodeableConcept t = new CodeableConcept();
5629          if (this.classifier == null)
5630            this.classifier = new ArrayList<CodeableConcept>();
5631          this.classifier.add(t);
5632          return t;
5633        }
5634
5635        public CitationCitedArtifactWebLocationComponent addClassifier(CodeableConcept t) { //3
5636          if (t == null)
5637            return this;
5638          if (this.classifier == null)
5639            this.classifier = new ArrayList<CodeableConcept>();
5640          this.classifier.add(t);
5641          return this;
5642        }
5643
5644        /**
5645         * @return The first repetition of repeating field {@link #classifier}, creating it if it does not already exist {3}
5646         */
5647        public CodeableConcept getClassifierFirstRep() { 
5648          if (getClassifier().isEmpty()) {
5649            addClassifier();
5650          }
5651          return getClassifier().get(0);
5652        }
5653
5654        /**
5655         * @return {@link #url} (The specific URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
5656         */
5657        public UriType getUrlElement() { 
5658          if (this.url == null)
5659            if (Configuration.errorOnAutoCreate())
5660              throw new Error("Attempt to auto-create CitationCitedArtifactWebLocationComponent.url");
5661            else if (Configuration.doAutoCreate())
5662              this.url = new UriType(); // bb
5663          return this.url;
5664        }
5665
5666        public boolean hasUrlElement() { 
5667          return this.url != null && !this.url.isEmpty();
5668        }
5669
5670        public boolean hasUrl() { 
5671          return this.url != null && !this.url.isEmpty();
5672        }
5673
5674        /**
5675         * @param value {@link #url} (The specific URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
5676         */
5677        public CitationCitedArtifactWebLocationComponent setUrlElement(UriType value) { 
5678          this.url = value;
5679          return this;
5680        }
5681
5682        /**
5683         * @return The specific URL.
5684         */
5685        public String getUrl() { 
5686          return this.url == null ? null : this.url.getValue();
5687        }
5688
5689        /**
5690         * @param value The specific URL.
5691         */
5692        public CitationCitedArtifactWebLocationComponent setUrl(String value) { 
5693          if (Utilities.noString(value))
5694            this.url = null;
5695          else {
5696            if (this.url == null)
5697              this.url = new UriType();
5698            this.url.setValue(value);
5699          }
5700          return this;
5701        }
5702
5703        protected void listChildren(List<Property> children) {
5704          super.listChildren(children);
5705          children.add(new Property("classifier", "CodeableConcept", "Code the reason for different URLs, e.g. abstract and full-text.", 0, java.lang.Integer.MAX_VALUE, classifier));
5706          children.add(new Property("url", "uri", "The specific URL.", 0, 1, url));
5707        }
5708
5709        @Override
5710        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5711          switch (_hash) {
5712          case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "Code the reason for different URLs, e.g. abstract and full-text.", 0, java.lang.Integer.MAX_VALUE, classifier);
5713          case 116079: /*url*/  return new Property("url", "uri", "The specific URL.", 0, 1, url);
5714          default: return super.getNamedProperty(_hash, _name, _checkValid);
5715          }
5716
5717        }
5718
5719      @Override
5720      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5721        switch (hash) {
5722        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : this.classifier.toArray(new Base[this.classifier.size()]); // CodeableConcept
5723        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
5724        default: return super.getProperty(hash, name, checkValid);
5725        }
5726
5727      }
5728
5729      @Override
5730      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5731        switch (hash) {
5732        case -281470431: // classifier
5733          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
5734          return value;
5735        case 116079: // url
5736          this.url = TypeConvertor.castToUri(value); // UriType
5737          return value;
5738        default: return super.setProperty(hash, name, value);
5739        }
5740
5741      }
5742
5743      @Override
5744      public Base setProperty(String name, Base value) throws FHIRException {
5745        if (name.equals("classifier")) {
5746          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value));
5747        } else if (name.equals("url")) {
5748          this.url = TypeConvertor.castToUri(value); // UriType
5749        } else
5750          return super.setProperty(name, value);
5751        return value;
5752      }
5753
5754      @Override
5755      public Base makeProperty(int hash, String name) throws FHIRException {
5756        switch (hash) {
5757        case -281470431:  return addClassifier(); 
5758        case 116079:  return getUrlElement();
5759        default: return super.makeProperty(hash, name);
5760        }
5761
5762      }
5763
5764      @Override
5765      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5766        switch (hash) {
5767        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
5768        case 116079: /*url*/ return new String[] {"uri"};
5769        default: return super.getTypesForProperty(hash, name);
5770        }
5771
5772      }
5773
5774      @Override
5775      public Base addChild(String name) throws FHIRException {
5776        if (name.equals("classifier")) {
5777          return addClassifier();
5778        }
5779        else if (name.equals("url")) {
5780          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.webLocation.url");
5781        }
5782        else
5783          return super.addChild(name);
5784      }
5785
5786      public CitationCitedArtifactWebLocationComponent copy() {
5787        CitationCitedArtifactWebLocationComponent dst = new CitationCitedArtifactWebLocationComponent();
5788        copyValues(dst);
5789        return dst;
5790      }
5791
5792      public void copyValues(CitationCitedArtifactWebLocationComponent dst) {
5793        super.copyValues(dst);
5794        if (classifier != null) {
5795          dst.classifier = new ArrayList<CodeableConcept>();
5796          for (CodeableConcept i : classifier)
5797            dst.classifier.add(i.copy());
5798        };
5799        dst.url = url == null ? null : url.copy();
5800      }
5801
5802      @Override
5803      public boolean equalsDeep(Base other_) {
5804        if (!super.equalsDeep(other_))
5805          return false;
5806        if (!(other_ instanceof CitationCitedArtifactWebLocationComponent))
5807          return false;
5808        CitationCitedArtifactWebLocationComponent o = (CitationCitedArtifactWebLocationComponent) other_;
5809        return compareDeep(classifier, o.classifier, true) && compareDeep(url, o.url, true);
5810      }
5811
5812      @Override
5813      public boolean equalsShallow(Base other_) {
5814        if (!super.equalsShallow(other_))
5815          return false;
5816        if (!(other_ instanceof CitationCitedArtifactWebLocationComponent))
5817          return false;
5818        CitationCitedArtifactWebLocationComponent o = (CitationCitedArtifactWebLocationComponent) other_;
5819        return compareValues(url, o.url, true);
5820      }
5821
5822      public boolean isEmpty() {
5823        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(classifier, url);
5824      }
5825
5826  public String fhirType() {
5827    return "Citation.citedArtifact.webLocation";
5828
5829  }
5830
5831  }
5832
5833    @Block()
5834    public static class CitationCitedArtifactClassificationComponent extends BackboneElement implements IBaseBackboneElement {
5835        /**
5836         * The kind of classifier (e.g. publication type, keyword).
5837         */
5838        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
5839        @Description(shortDefinition="The kind of classifier (e.g. publication type, keyword)", formalDefinition="The kind of classifier (e.g. publication type, keyword)." )
5840        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-classification-type")
5841        protected CodeableConcept type;
5842
5843        /**
5844         * The specific classification value.
5845         */
5846        @Child(name = "classifier", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5847        @Description(shortDefinition="The specific classification value", formalDefinition="The specific classification value." )
5848        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-artifact-classifier")
5849        protected List<CodeableConcept> classifier;
5850
5851        /**
5852         * Provenance and copyright of classification.
5853         */
5854        @Child(name = "whoClassified", type = {}, order=3, min=0, max=1, modifier=false, summary=false)
5855        @Description(shortDefinition="Provenance and copyright of classification", formalDefinition="Provenance and copyright of classification." )
5856        protected CitationCitedArtifactClassificationWhoClassifiedComponent whoClassified;
5857
5858        private static final long serialVersionUID = -1887617918L;
5859
5860    /**
5861     * Constructor
5862     */
5863      public CitationCitedArtifactClassificationComponent() {
5864        super();
5865      }
5866
5867        /**
5868         * @return {@link #type} (The kind of classifier (e.g. publication type, keyword).)
5869         */
5870        public CodeableConcept getType() { 
5871          if (this.type == null)
5872            if (Configuration.errorOnAutoCreate())
5873              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationComponent.type");
5874            else if (Configuration.doAutoCreate())
5875              this.type = new CodeableConcept(); // cc
5876          return this.type;
5877        }
5878
5879        public boolean hasType() { 
5880          return this.type != null && !this.type.isEmpty();
5881        }
5882
5883        /**
5884         * @param value {@link #type} (The kind of classifier (e.g. publication type, keyword).)
5885         */
5886        public CitationCitedArtifactClassificationComponent setType(CodeableConcept value) { 
5887          this.type = value;
5888          return this;
5889        }
5890
5891        /**
5892         * @return {@link #classifier} (The specific classification value.)
5893         */
5894        public List<CodeableConcept> getClassifier() { 
5895          if (this.classifier == null)
5896            this.classifier = new ArrayList<CodeableConcept>();
5897          return this.classifier;
5898        }
5899
5900        /**
5901         * @return Returns a reference to <code>this</code> for easy method chaining
5902         */
5903        public CitationCitedArtifactClassificationComponent setClassifier(List<CodeableConcept> theClassifier) { 
5904          this.classifier = theClassifier;
5905          return this;
5906        }
5907
5908        public boolean hasClassifier() { 
5909          if (this.classifier == null)
5910            return false;
5911          for (CodeableConcept item : this.classifier)
5912            if (!item.isEmpty())
5913              return true;
5914          return false;
5915        }
5916
5917        public CodeableConcept addClassifier() { //3
5918          CodeableConcept t = new CodeableConcept();
5919          if (this.classifier == null)
5920            this.classifier = new ArrayList<CodeableConcept>();
5921          this.classifier.add(t);
5922          return t;
5923        }
5924
5925        public CitationCitedArtifactClassificationComponent addClassifier(CodeableConcept t) { //3
5926          if (t == null)
5927            return this;
5928          if (this.classifier == null)
5929            this.classifier = new ArrayList<CodeableConcept>();
5930          this.classifier.add(t);
5931          return this;
5932        }
5933
5934        /**
5935         * @return The first repetition of repeating field {@link #classifier}, creating it if it does not already exist {3}
5936         */
5937        public CodeableConcept getClassifierFirstRep() { 
5938          if (getClassifier().isEmpty()) {
5939            addClassifier();
5940          }
5941          return getClassifier().get(0);
5942        }
5943
5944        /**
5945         * @return {@link #whoClassified} (Provenance and copyright of classification.)
5946         */
5947        public CitationCitedArtifactClassificationWhoClassifiedComponent getWhoClassified() { 
5948          if (this.whoClassified == null)
5949            if (Configuration.errorOnAutoCreate())
5950              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationComponent.whoClassified");
5951            else if (Configuration.doAutoCreate())
5952              this.whoClassified = new CitationCitedArtifactClassificationWhoClassifiedComponent(); // cc
5953          return this.whoClassified;
5954        }
5955
5956        public boolean hasWhoClassified() { 
5957          return this.whoClassified != null && !this.whoClassified.isEmpty();
5958        }
5959
5960        /**
5961         * @param value {@link #whoClassified} (Provenance and copyright of classification.)
5962         */
5963        public CitationCitedArtifactClassificationComponent setWhoClassified(CitationCitedArtifactClassificationWhoClassifiedComponent value) { 
5964          this.whoClassified = value;
5965          return this;
5966        }
5967
5968        protected void listChildren(List<Property> children) {
5969          super.listChildren(children);
5970          children.add(new Property("type", "CodeableConcept", "The kind of classifier (e.g. publication type, keyword).", 0, 1, type));
5971          children.add(new Property("classifier", "CodeableConcept", "The specific classification value.", 0, java.lang.Integer.MAX_VALUE, classifier));
5972          children.add(new Property("whoClassified", "", "Provenance and copyright of classification.", 0, 1, whoClassified));
5973        }
5974
5975        @Override
5976        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5977          switch (_hash) {
5978          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of classifier (e.g. publication type, keyword).", 0, 1, type);
5979          case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "The specific classification value.", 0, java.lang.Integer.MAX_VALUE, classifier);
5980          case -196629391: /*whoClassified*/  return new Property("whoClassified", "", "Provenance and copyright of classification.", 0, 1, whoClassified);
5981          default: return super.getNamedProperty(_hash, _name, _checkValid);
5982          }
5983
5984        }
5985
5986      @Override
5987      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5988        switch (hash) {
5989        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
5990        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : this.classifier.toArray(new Base[this.classifier.size()]); // CodeableConcept
5991        case -196629391: /*whoClassified*/ return this.whoClassified == null ? new Base[0] : new Base[] {this.whoClassified}; // CitationCitedArtifactClassificationWhoClassifiedComponent
5992        default: return super.getProperty(hash, name, checkValid);
5993        }
5994
5995      }
5996
5997      @Override
5998      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5999        switch (hash) {
6000        case 3575610: // type
6001          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
6002          return value;
6003        case -281470431: // classifier
6004          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
6005          return value;
6006        case -196629391: // whoClassified
6007          this.whoClassified = (CitationCitedArtifactClassificationWhoClassifiedComponent) value; // CitationCitedArtifactClassificationWhoClassifiedComponent
6008          return value;
6009        default: return super.setProperty(hash, name, value);
6010        }
6011
6012      }
6013
6014      @Override
6015      public Base setProperty(String name, Base value) throws FHIRException {
6016        if (name.equals("type")) {
6017          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
6018        } else if (name.equals("classifier")) {
6019          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value));
6020        } else if (name.equals("whoClassified")) {
6021          this.whoClassified = (CitationCitedArtifactClassificationWhoClassifiedComponent) value; // CitationCitedArtifactClassificationWhoClassifiedComponent
6022        } else
6023          return super.setProperty(name, value);
6024        return value;
6025      }
6026
6027      @Override
6028      public Base makeProperty(int hash, String name) throws FHIRException {
6029        switch (hash) {
6030        case 3575610:  return getType();
6031        case -281470431:  return addClassifier(); 
6032        case -196629391:  return getWhoClassified();
6033        default: return super.makeProperty(hash, name);
6034        }
6035
6036      }
6037
6038      @Override
6039      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6040        switch (hash) {
6041        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
6042        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
6043        case -196629391: /*whoClassified*/ return new String[] {};
6044        default: return super.getTypesForProperty(hash, name);
6045        }
6046
6047      }
6048
6049      @Override
6050      public Base addChild(String name) throws FHIRException {
6051        if (name.equals("type")) {
6052          this.type = new CodeableConcept();
6053          return this.type;
6054        }
6055        else if (name.equals("classifier")) {
6056          return addClassifier();
6057        }
6058        else if (name.equals("whoClassified")) {
6059          this.whoClassified = new CitationCitedArtifactClassificationWhoClassifiedComponent();
6060          return this.whoClassified;
6061        }
6062        else
6063          return super.addChild(name);
6064      }
6065
6066      public CitationCitedArtifactClassificationComponent copy() {
6067        CitationCitedArtifactClassificationComponent dst = new CitationCitedArtifactClassificationComponent();
6068        copyValues(dst);
6069        return dst;
6070      }
6071
6072      public void copyValues(CitationCitedArtifactClassificationComponent dst) {
6073        super.copyValues(dst);
6074        dst.type = type == null ? null : type.copy();
6075        if (classifier != null) {
6076          dst.classifier = new ArrayList<CodeableConcept>();
6077          for (CodeableConcept i : classifier)
6078            dst.classifier.add(i.copy());
6079        };
6080        dst.whoClassified = whoClassified == null ? null : whoClassified.copy();
6081      }
6082
6083      @Override
6084      public boolean equalsDeep(Base other_) {
6085        if (!super.equalsDeep(other_))
6086          return false;
6087        if (!(other_ instanceof CitationCitedArtifactClassificationComponent))
6088          return false;
6089        CitationCitedArtifactClassificationComponent o = (CitationCitedArtifactClassificationComponent) other_;
6090        return compareDeep(type, o.type, true) && compareDeep(classifier, o.classifier, true) && compareDeep(whoClassified, o.whoClassified, true)
6091          ;
6092      }
6093
6094      @Override
6095      public boolean equalsShallow(Base other_) {
6096        if (!super.equalsShallow(other_))
6097          return false;
6098        if (!(other_ instanceof CitationCitedArtifactClassificationComponent))
6099          return false;
6100        CitationCitedArtifactClassificationComponent o = (CitationCitedArtifactClassificationComponent) other_;
6101        return true;
6102      }
6103
6104      public boolean isEmpty() {
6105        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, classifier, whoClassified
6106          );
6107      }
6108
6109  public String fhirType() {
6110    return "Citation.citedArtifact.classification";
6111
6112  }
6113
6114  }
6115
6116    @Block()
6117    public static class CitationCitedArtifactClassificationWhoClassifiedComponent extends BackboneElement implements IBaseBackboneElement {
6118        /**
6119         * Person who created the classification.
6120         */
6121        @Child(name = "person", type = {Person.class, Practitioner.class}, order=1, min=0, max=1, modifier=false, summary=false)
6122        @Description(shortDefinition="Person who created the classification", formalDefinition="Person who created the classification." )
6123        protected Reference person;
6124
6125        /**
6126         * Organization who created the classification.
6127         */
6128        @Child(name = "organization", type = {Organization.class}, order=2, min=0, max=1, modifier=false, summary=false)
6129        @Description(shortDefinition="Organization who created the classification", formalDefinition="Organization who created the classification." )
6130        protected Reference organization;
6131
6132        /**
6133         * The publisher of the classification, not the publisher of the article or artifact being cited.
6134         */
6135        @Child(name = "publisher", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=false)
6136        @Description(shortDefinition="The publisher of the classification, not the publisher of the article or artifact being cited", formalDefinition="The publisher of the classification, not the publisher of the article or artifact being cited." )
6137        protected Reference publisher;
6138
6139        /**
6140         * Rights management statement for the classification.
6141         */
6142        @Child(name = "classifierCopyright", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
6143        @Description(shortDefinition="Rights management statement for the classification", formalDefinition="Rights management statement for the classification." )
6144        protected StringType classifierCopyright;
6145
6146        /**
6147         * Acceptable to re-use the classification.
6148         */
6149        @Child(name = "freeToShare", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=false)
6150        @Description(shortDefinition="Acceptable to re-use the classification", formalDefinition="Acceptable to re-use the classification." )
6151        protected BooleanType freeToShare;
6152
6153        private static final long serialVersionUID = -1835300032L;
6154
6155    /**
6156     * Constructor
6157     */
6158      public CitationCitedArtifactClassificationWhoClassifiedComponent() {
6159        super();
6160      }
6161
6162        /**
6163         * @return {@link #person} (Person who created the classification.)
6164         */
6165        public Reference getPerson() { 
6166          if (this.person == null)
6167            if (Configuration.errorOnAutoCreate())
6168              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationWhoClassifiedComponent.person");
6169            else if (Configuration.doAutoCreate())
6170              this.person = new Reference(); // cc
6171          return this.person;
6172        }
6173
6174        public boolean hasPerson() { 
6175          return this.person != null && !this.person.isEmpty();
6176        }
6177
6178        /**
6179         * @param value {@link #person} (Person who created the classification.)
6180         */
6181        public CitationCitedArtifactClassificationWhoClassifiedComponent setPerson(Reference value) { 
6182          this.person = value;
6183          return this;
6184        }
6185
6186        /**
6187         * @return {@link #organization} (Organization who created the classification.)
6188         */
6189        public Reference getOrganization() { 
6190          if (this.organization == null)
6191            if (Configuration.errorOnAutoCreate())
6192              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationWhoClassifiedComponent.organization");
6193            else if (Configuration.doAutoCreate())
6194              this.organization = new Reference(); // cc
6195          return this.organization;
6196        }
6197
6198        public boolean hasOrganization() { 
6199          return this.organization != null && !this.organization.isEmpty();
6200        }
6201
6202        /**
6203         * @param value {@link #organization} (Organization who created the classification.)
6204         */
6205        public CitationCitedArtifactClassificationWhoClassifiedComponent setOrganization(Reference value) { 
6206          this.organization = value;
6207          return this;
6208        }
6209
6210        /**
6211         * @return {@link #publisher} (The publisher of the classification, not the publisher of the article or artifact being cited.)
6212         */
6213        public Reference getPublisher() { 
6214          if (this.publisher == null)
6215            if (Configuration.errorOnAutoCreate())
6216              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationWhoClassifiedComponent.publisher");
6217            else if (Configuration.doAutoCreate())
6218              this.publisher = new Reference(); // cc
6219          return this.publisher;
6220        }
6221
6222        public boolean hasPublisher() { 
6223          return this.publisher != null && !this.publisher.isEmpty();
6224        }
6225
6226        /**
6227         * @param value {@link #publisher} (The publisher of the classification, not the publisher of the article or artifact being cited.)
6228         */
6229        public CitationCitedArtifactClassificationWhoClassifiedComponent setPublisher(Reference value) { 
6230          this.publisher = value;
6231          return this;
6232        }
6233
6234        /**
6235         * @return {@link #classifierCopyright} (Rights management statement for the classification.). This is the underlying object with id, value and extensions. The accessor "getClassifierCopyright" gives direct access to the value
6236         */
6237        public StringType getClassifierCopyrightElement() { 
6238          if (this.classifierCopyright == null)
6239            if (Configuration.errorOnAutoCreate())
6240              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationWhoClassifiedComponent.classifierCopyright");
6241            else if (Configuration.doAutoCreate())
6242              this.classifierCopyright = new StringType(); // bb
6243          return this.classifierCopyright;
6244        }
6245
6246        public boolean hasClassifierCopyrightElement() { 
6247          return this.classifierCopyright != null && !this.classifierCopyright.isEmpty();
6248        }
6249
6250        public boolean hasClassifierCopyright() { 
6251          return this.classifierCopyright != null && !this.classifierCopyright.isEmpty();
6252        }
6253
6254        /**
6255         * @param value {@link #classifierCopyright} (Rights management statement for the classification.). This is the underlying object with id, value and extensions. The accessor "getClassifierCopyright" gives direct access to the value
6256         */
6257        public CitationCitedArtifactClassificationWhoClassifiedComponent setClassifierCopyrightElement(StringType value) { 
6258          this.classifierCopyright = value;
6259          return this;
6260        }
6261
6262        /**
6263         * @return Rights management statement for the classification.
6264         */
6265        public String getClassifierCopyright() { 
6266          return this.classifierCopyright == null ? null : this.classifierCopyright.getValue();
6267        }
6268
6269        /**
6270         * @param value Rights management statement for the classification.
6271         */
6272        public CitationCitedArtifactClassificationWhoClassifiedComponent setClassifierCopyright(String value) { 
6273          if (Utilities.noString(value))
6274            this.classifierCopyright = null;
6275          else {
6276            if (this.classifierCopyright == null)
6277              this.classifierCopyright = new StringType();
6278            this.classifierCopyright.setValue(value);
6279          }
6280          return this;
6281        }
6282
6283        /**
6284         * @return {@link #freeToShare} (Acceptable to re-use the classification.). This is the underlying object with id, value and extensions. The accessor "getFreeToShare" gives direct access to the value
6285         */
6286        public BooleanType getFreeToShareElement() { 
6287          if (this.freeToShare == null)
6288            if (Configuration.errorOnAutoCreate())
6289              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationWhoClassifiedComponent.freeToShare");
6290            else if (Configuration.doAutoCreate())
6291              this.freeToShare = new BooleanType(); // bb
6292          return this.freeToShare;
6293        }
6294
6295        public boolean hasFreeToShareElement() { 
6296          return this.freeToShare != null && !this.freeToShare.isEmpty();
6297        }
6298
6299        public boolean hasFreeToShare() { 
6300          return this.freeToShare != null && !this.freeToShare.isEmpty();
6301        }
6302
6303        /**
6304         * @param value {@link #freeToShare} (Acceptable to re-use the classification.). This is the underlying object with id, value and extensions. The accessor "getFreeToShare" gives direct access to the value
6305         */
6306        public CitationCitedArtifactClassificationWhoClassifiedComponent setFreeToShareElement(BooleanType value) { 
6307          this.freeToShare = value;
6308          return this;
6309        }
6310
6311        /**
6312         * @return Acceptable to re-use the classification.
6313         */
6314        public boolean getFreeToShare() { 
6315          return this.freeToShare == null || this.freeToShare.isEmpty() ? false : this.freeToShare.getValue();
6316        }
6317
6318        /**
6319         * @param value Acceptable to re-use the classification.
6320         */
6321        public CitationCitedArtifactClassificationWhoClassifiedComponent setFreeToShare(boolean value) { 
6322            if (this.freeToShare == null)
6323              this.freeToShare = new BooleanType();
6324            this.freeToShare.setValue(value);
6325          return this;
6326        }
6327
6328        protected void listChildren(List<Property> children) {
6329          super.listChildren(children);
6330          children.add(new Property("person", "Reference(Person|Practitioner)", "Person who created the classification.", 0, 1, person));
6331          children.add(new Property("organization", "Reference(Organization)", "Organization who created the classification.", 0, 1, organization));
6332          children.add(new Property("publisher", "Reference(Organization)", "The publisher of the classification, not the publisher of the article or artifact being cited.", 0, 1, publisher));
6333          children.add(new Property("classifierCopyright", "string", "Rights management statement for the classification.", 0, 1, classifierCopyright));
6334          children.add(new Property("freeToShare", "boolean", "Acceptable to re-use the classification.", 0, 1, freeToShare));
6335        }
6336
6337        @Override
6338        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6339          switch (_hash) {
6340          case -991716523: /*person*/  return new Property("person", "Reference(Person|Practitioner)", "Person who created the classification.", 0, 1, person);
6341          case 1178922291: /*organization*/  return new Property("organization", "Reference(Organization)", "Organization who created the classification.", 0, 1, organization);
6342          case 1447404028: /*publisher*/  return new Property("publisher", "Reference(Organization)", "The publisher of the classification, not the publisher of the article or artifact being cited.", 0, 1, publisher);
6343          case -434942298: /*classifierCopyright*/  return new Property("classifierCopyright", "string", "Rights management statement for the classification.", 0, 1, classifierCopyright);
6344          case -1268656616: /*freeToShare*/  return new Property("freeToShare", "boolean", "Acceptable to re-use the classification.", 0, 1, freeToShare);
6345          default: return super.getNamedProperty(_hash, _name, _checkValid);
6346          }
6347
6348        }
6349
6350      @Override
6351      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6352        switch (hash) {
6353        case -991716523: /*person*/ return this.person == null ? new Base[0] : new Base[] {this.person}; // Reference
6354        case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference
6355        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // Reference
6356        case -434942298: /*classifierCopyright*/ return this.classifierCopyright == null ? new Base[0] : new Base[] {this.classifierCopyright}; // StringType
6357        case -1268656616: /*freeToShare*/ return this.freeToShare == null ? new Base[0] : new Base[] {this.freeToShare}; // BooleanType
6358        default: return super.getProperty(hash, name, checkValid);
6359        }
6360
6361      }
6362
6363      @Override
6364      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6365        switch (hash) {
6366        case -991716523: // person
6367          this.person = TypeConvertor.castToReference(value); // Reference
6368          return value;
6369        case 1178922291: // organization
6370          this.organization = TypeConvertor.castToReference(value); // Reference
6371          return value;
6372        case 1447404028: // publisher
6373          this.publisher = TypeConvertor.castToReference(value); // Reference
6374          return value;
6375        case -434942298: // classifierCopyright
6376          this.classifierCopyright = TypeConvertor.castToString(value); // StringType
6377          return value;
6378        case -1268656616: // freeToShare
6379          this.freeToShare = TypeConvertor.castToBoolean(value); // BooleanType
6380          return value;
6381        default: return super.setProperty(hash, name, value);
6382        }
6383
6384      }
6385
6386      @Override
6387      public Base setProperty(String name, Base value) throws FHIRException {
6388        if (name.equals("person")) {
6389          this.person = TypeConvertor.castToReference(value); // Reference
6390        } else if (name.equals("organization")) {
6391          this.organization = TypeConvertor.castToReference(value); // Reference
6392        } else if (name.equals("publisher")) {
6393          this.publisher = TypeConvertor.castToReference(value); // Reference
6394        } else if (name.equals("classifierCopyright")) {
6395          this.classifierCopyright = TypeConvertor.castToString(value); // StringType
6396        } else if (name.equals("freeToShare")) {
6397          this.freeToShare = TypeConvertor.castToBoolean(value); // BooleanType
6398        } else
6399          return super.setProperty(name, value);
6400        return value;
6401      }
6402
6403      @Override
6404      public Base makeProperty(int hash, String name) throws FHIRException {
6405        switch (hash) {
6406        case -991716523:  return getPerson();
6407        case 1178922291:  return getOrganization();
6408        case 1447404028:  return getPublisher();
6409        case -434942298:  return getClassifierCopyrightElement();
6410        case -1268656616:  return getFreeToShareElement();
6411        default: return super.makeProperty(hash, name);
6412        }
6413
6414      }
6415
6416      @Override
6417      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6418        switch (hash) {
6419        case -991716523: /*person*/ return new String[] {"Reference"};
6420        case 1178922291: /*organization*/ return new String[] {"Reference"};
6421        case 1447404028: /*publisher*/ return new String[] {"Reference"};
6422        case -434942298: /*classifierCopyright*/ return new String[] {"string"};
6423        case -1268656616: /*freeToShare*/ return new String[] {"boolean"};
6424        default: return super.getTypesForProperty(hash, name);
6425        }
6426
6427      }
6428
6429      @Override
6430      public Base addChild(String name) throws FHIRException {
6431        if (name.equals("person")) {
6432          this.person = new Reference();
6433          return this.person;
6434        }
6435        else if (name.equals("organization")) {
6436          this.organization = new Reference();
6437          return this.organization;
6438        }
6439        else if (name.equals("publisher")) {
6440          this.publisher = new Reference();
6441          return this.publisher;
6442        }
6443        else if (name.equals("classifierCopyright")) {
6444          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.classification.whoClassified.classifierCopyright");
6445        }
6446        else if (name.equals("freeToShare")) {
6447          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.classification.whoClassified.freeToShare");
6448        }
6449        else
6450          return super.addChild(name);
6451      }
6452
6453      public CitationCitedArtifactClassificationWhoClassifiedComponent copy() {
6454        CitationCitedArtifactClassificationWhoClassifiedComponent dst = new CitationCitedArtifactClassificationWhoClassifiedComponent();
6455        copyValues(dst);
6456        return dst;
6457      }
6458
6459      public void copyValues(CitationCitedArtifactClassificationWhoClassifiedComponent dst) {
6460        super.copyValues(dst);
6461        dst.person = person == null ? null : person.copy();
6462        dst.organization = organization == null ? null : organization.copy();
6463        dst.publisher = publisher == null ? null : publisher.copy();
6464        dst.classifierCopyright = classifierCopyright == null ? null : classifierCopyright.copy();
6465        dst.freeToShare = freeToShare == null ? null : freeToShare.copy();
6466      }
6467
6468      @Override
6469      public boolean equalsDeep(Base other_) {
6470        if (!super.equalsDeep(other_))
6471          return false;
6472        if (!(other_ instanceof CitationCitedArtifactClassificationWhoClassifiedComponent))
6473          return false;
6474        CitationCitedArtifactClassificationWhoClassifiedComponent o = (CitationCitedArtifactClassificationWhoClassifiedComponent) other_;
6475        return compareDeep(person, o.person, true) && compareDeep(organization, o.organization, true) && compareDeep(publisher, o.publisher, true)
6476           && compareDeep(classifierCopyright, o.classifierCopyright, true) && compareDeep(freeToShare, o.freeToShare, true)
6477          ;
6478      }
6479
6480      @Override
6481      public boolean equalsShallow(Base other_) {
6482        if (!super.equalsShallow(other_))
6483          return false;
6484        if (!(other_ instanceof CitationCitedArtifactClassificationWhoClassifiedComponent))
6485          return false;
6486        CitationCitedArtifactClassificationWhoClassifiedComponent o = (CitationCitedArtifactClassificationWhoClassifiedComponent) other_;
6487        return compareValues(classifierCopyright, o.classifierCopyright, true) && compareValues(freeToShare, o.freeToShare, true)
6488          ;
6489      }
6490
6491      public boolean isEmpty() {
6492        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(person, organization, publisher
6493          , classifierCopyright, freeToShare);
6494      }
6495
6496  public String fhirType() {
6497    return "Citation.citedArtifact.classification.whoClassified";
6498
6499  }
6500
6501  }
6502
6503    @Block()
6504    public static class CitationCitedArtifactContributorshipComponent extends BackboneElement implements IBaseBackboneElement {
6505        /**
6506         * Indicates if the list includes all authors and/or contributors.
6507         */
6508        @Child(name = "complete", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false)
6509        @Description(shortDefinition="Indicates if the list includes all authors and/or contributors", formalDefinition="Indicates if the list includes all authors and/or contributors." )
6510        protected BooleanType complete;
6511
6512        /**
6513         * An individual entity named in the author list or contributor list.
6514         */
6515        @Child(name = "entry", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6516        @Description(shortDefinition="An individual entity named in the list", formalDefinition="An individual entity named in the author list or contributor list." )
6517        protected List<CitationCitedArtifactContributorshipEntryComponent> entry;
6518
6519        /**
6520         * Used to record a display of the author/contributor list without separate coding for each list member.
6521         */
6522        @Child(name = "summary", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6523        @Description(shortDefinition="Used to record a display of the author/contributor list without separate coding for each list member", formalDefinition="Used to record a display of the author/contributor list without separate coding for each list member." )
6524        protected List<CitationCitedArtifactContributorshipSummaryComponent> summary;
6525
6526        private static final long serialVersionUID = 78346599L;
6527
6528    /**
6529     * Constructor
6530     */
6531      public CitationCitedArtifactContributorshipComponent() {
6532        super();
6533      }
6534
6535        /**
6536         * @return {@link #complete} (Indicates if the list includes all authors and/or contributors.). This is the underlying object with id, value and extensions. The accessor "getComplete" gives direct access to the value
6537         */
6538        public BooleanType getCompleteElement() { 
6539          if (this.complete == null)
6540            if (Configuration.errorOnAutoCreate())
6541              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipComponent.complete");
6542            else if (Configuration.doAutoCreate())
6543              this.complete = new BooleanType(); // bb
6544          return this.complete;
6545        }
6546
6547        public boolean hasCompleteElement() { 
6548          return this.complete != null && !this.complete.isEmpty();
6549        }
6550
6551        public boolean hasComplete() { 
6552          return this.complete != null && !this.complete.isEmpty();
6553        }
6554
6555        /**
6556         * @param value {@link #complete} (Indicates if the list includes all authors and/or contributors.). This is the underlying object with id, value and extensions. The accessor "getComplete" gives direct access to the value
6557         */
6558        public CitationCitedArtifactContributorshipComponent setCompleteElement(BooleanType value) { 
6559          this.complete = value;
6560          return this;
6561        }
6562
6563        /**
6564         * @return Indicates if the list includes all authors and/or contributors.
6565         */
6566        public boolean getComplete() { 
6567          return this.complete == null || this.complete.isEmpty() ? false : this.complete.getValue();
6568        }
6569
6570        /**
6571         * @param value Indicates if the list includes all authors and/or contributors.
6572         */
6573        public CitationCitedArtifactContributorshipComponent setComplete(boolean value) { 
6574            if (this.complete == null)
6575              this.complete = new BooleanType();
6576            this.complete.setValue(value);
6577          return this;
6578        }
6579
6580        /**
6581         * @return {@link #entry} (An individual entity named in the author list or contributor list.)
6582         */
6583        public List<CitationCitedArtifactContributorshipEntryComponent> getEntry() { 
6584          if (this.entry == null)
6585            this.entry = new ArrayList<CitationCitedArtifactContributorshipEntryComponent>();
6586          return this.entry;
6587        }
6588
6589        /**
6590         * @return Returns a reference to <code>this</code> for easy method chaining
6591         */
6592        public CitationCitedArtifactContributorshipComponent setEntry(List<CitationCitedArtifactContributorshipEntryComponent> theEntry) { 
6593          this.entry = theEntry;
6594          return this;
6595        }
6596
6597        public boolean hasEntry() { 
6598          if (this.entry == null)
6599            return false;
6600          for (CitationCitedArtifactContributorshipEntryComponent item : this.entry)
6601            if (!item.isEmpty())
6602              return true;
6603          return false;
6604        }
6605
6606        public CitationCitedArtifactContributorshipEntryComponent addEntry() { //3
6607          CitationCitedArtifactContributorshipEntryComponent t = new CitationCitedArtifactContributorshipEntryComponent();
6608          if (this.entry == null)
6609            this.entry = new ArrayList<CitationCitedArtifactContributorshipEntryComponent>();
6610          this.entry.add(t);
6611          return t;
6612        }
6613
6614        public CitationCitedArtifactContributorshipComponent addEntry(CitationCitedArtifactContributorshipEntryComponent t) { //3
6615          if (t == null)
6616            return this;
6617          if (this.entry == null)
6618            this.entry = new ArrayList<CitationCitedArtifactContributorshipEntryComponent>();
6619          this.entry.add(t);
6620          return this;
6621        }
6622
6623        /**
6624         * @return The first repetition of repeating field {@link #entry}, creating it if it does not already exist {3}
6625         */
6626        public CitationCitedArtifactContributorshipEntryComponent getEntryFirstRep() { 
6627          if (getEntry().isEmpty()) {
6628            addEntry();
6629          }
6630          return getEntry().get(0);
6631        }
6632
6633        /**
6634         * @return {@link #summary} (Used to record a display of the author/contributor list without separate coding for each list member.)
6635         */
6636        public List<CitationCitedArtifactContributorshipSummaryComponent> getSummary() { 
6637          if (this.summary == null)
6638            this.summary = new ArrayList<CitationCitedArtifactContributorshipSummaryComponent>();
6639          return this.summary;
6640        }
6641
6642        /**
6643         * @return Returns a reference to <code>this</code> for easy method chaining
6644         */
6645        public CitationCitedArtifactContributorshipComponent setSummary(List<CitationCitedArtifactContributorshipSummaryComponent> theSummary) { 
6646          this.summary = theSummary;
6647          return this;
6648        }
6649
6650        public boolean hasSummary() { 
6651          if (this.summary == null)
6652            return false;
6653          for (CitationCitedArtifactContributorshipSummaryComponent item : this.summary)
6654            if (!item.isEmpty())
6655              return true;
6656          return false;
6657        }
6658
6659        public CitationCitedArtifactContributorshipSummaryComponent addSummary() { //3
6660          CitationCitedArtifactContributorshipSummaryComponent t = new CitationCitedArtifactContributorshipSummaryComponent();
6661          if (this.summary == null)
6662            this.summary = new ArrayList<CitationCitedArtifactContributorshipSummaryComponent>();
6663          this.summary.add(t);
6664          return t;
6665        }
6666
6667        public CitationCitedArtifactContributorshipComponent addSummary(CitationCitedArtifactContributorshipSummaryComponent t) { //3
6668          if (t == null)
6669            return this;
6670          if (this.summary == null)
6671            this.summary = new ArrayList<CitationCitedArtifactContributorshipSummaryComponent>();
6672          this.summary.add(t);
6673          return this;
6674        }
6675
6676        /**
6677         * @return The first repetition of repeating field {@link #summary}, creating it if it does not already exist {3}
6678         */
6679        public CitationCitedArtifactContributorshipSummaryComponent getSummaryFirstRep() { 
6680          if (getSummary().isEmpty()) {
6681            addSummary();
6682          }
6683          return getSummary().get(0);
6684        }
6685
6686        protected void listChildren(List<Property> children) {
6687          super.listChildren(children);
6688          children.add(new Property("complete", "boolean", "Indicates if the list includes all authors and/or contributors.", 0, 1, complete));
6689          children.add(new Property("entry", "", "An individual entity named in the author list or contributor list.", 0, java.lang.Integer.MAX_VALUE, entry));
6690          children.add(new Property("summary", "", "Used to record a display of the author/contributor list without separate coding for each list member.", 0, java.lang.Integer.MAX_VALUE, summary));
6691        }
6692
6693        @Override
6694        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6695          switch (_hash) {
6696          case -599445191: /*complete*/  return new Property("complete", "boolean", "Indicates if the list includes all authors and/or contributors.", 0, 1, complete);
6697          case 96667762: /*entry*/  return new Property("entry", "", "An individual entity named in the author list or contributor list.", 0, java.lang.Integer.MAX_VALUE, entry);
6698          case -1857640538: /*summary*/  return new Property("summary", "", "Used to record a display of the author/contributor list without separate coding for each list member.", 0, java.lang.Integer.MAX_VALUE, summary);
6699          default: return super.getNamedProperty(_hash, _name, _checkValid);
6700          }
6701
6702        }
6703
6704      @Override
6705      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6706        switch (hash) {
6707        case -599445191: /*complete*/ return this.complete == null ? new Base[0] : new Base[] {this.complete}; // BooleanType
6708        case 96667762: /*entry*/ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // CitationCitedArtifactContributorshipEntryComponent
6709        case -1857640538: /*summary*/ return this.summary == null ? new Base[0] : this.summary.toArray(new Base[this.summary.size()]); // CitationCitedArtifactContributorshipSummaryComponent
6710        default: return super.getProperty(hash, name, checkValid);
6711        }
6712
6713      }
6714
6715      @Override
6716      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6717        switch (hash) {
6718        case -599445191: // complete
6719          this.complete = TypeConvertor.castToBoolean(value); // BooleanType
6720          return value;
6721        case 96667762: // entry
6722          this.getEntry().add((CitationCitedArtifactContributorshipEntryComponent) value); // CitationCitedArtifactContributorshipEntryComponent
6723          return value;
6724        case -1857640538: // summary
6725          this.getSummary().add((CitationCitedArtifactContributorshipSummaryComponent) value); // CitationCitedArtifactContributorshipSummaryComponent
6726          return value;
6727        default: return super.setProperty(hash, name, value);
6728        }
6729
6730      }
6731
6732      @Override
6733      public Base setProperty(String name, Base value) throws FHIRException {
6734        if (name.equals("complete")) {
6735          this.complete = TypeConvertor.castToBoolean(value); // BooleanType
6736        } else if (name.equals("entry")) {
6737          this.getEntry().add((CitationCitedArtifactContributorshipEntryComponent) value);
6738        } else if (name.equals("summary")) {
6739          this.getSummary().add((CitationCitedArtifactContributorshipSummaryComponent) value);
6740        } else
6741          return super.setProperty(name, value);
6742        return value;
6743      }
6744
6745      @Override
6746      public Base makeProperty(int hash, String name) throws FHIRException {
6747        switch (hash) {
6748        case -599445191:  return getCompleteElement();
6749        case 96667762:  return addEntry(); 
6750        case -1857640538:  return addSummary(); 
6751        default: return super.makeProperty(hash, name);
6752        }
6753
6754      }
6755
6756      @Override
6757      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6758        switch (hash) {
6759        case -599445191: /*complete*/ return new String[] {"boolean"};
6760        case 96667762: /*entry*/ return new String[] {};
6761        case -1857640538: /*summary*/ return new String[] {};
6762        default: return super.getTypesForProperty(hash, name);
6763        }
6764
6765      }
6766
6767      @Override
6768      public Base addChild(String name) throws FHIRException {
6769        if (name.equals("complete")) {
6770          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.complete");
6771        }
6772        else if (name.equals("entry")) {
6773          return addEntry();
6774        }
6775        else if (name.equals("summary")) {
6776          return addSummary();
6777        }
6778        else
6779          return super.addChild(name);
6780      }
6781
6782      public CitationCitedArtifactContributorshipComponent copy() {
6783        CitationCitedArtifactContributorshipComponent dst = new CitationCitedArtifactContributorshipComponent();
6784        copyValues(dst);
6785        return dst;
6786      }
6787
6788      public void copyValues(CitationCitedArtifactContributorshipComponent dst) {
6789        super.copyValues(dst);
6790        dst.complete = complete == null ? null : complete.copy();
6791        if (entry != null) {
6792          dst.entry = new ArrayList<CitationCitedArtifactContributorshipEntryComponent>();
6793          for (CitationCitedArtifactContributorshipEntryComponent i : entry)
6794            dst.entry.add(i.copy());
6795        };
6796        if (summary != null) {
6797          dst.summary = new ArrayList<CitationCitedArtifactContributorshipSummaryComponent>();
6798          for (CitationCitedArtifactContributorshipSummaryComponent i : summary)
6799            dst.summary.add(i.copy());
6800        };
6801      }
6802
6803      @Override
6804      public boolean equalsDeep(Base other_) {
6805        if (!super.equalsDeep(other_))
6806          return false;
6807        if (!(other_ instanceof CitationCitedArtifactContributorshipComponent))
6808          return false;
6809        CitationCitedArtifactContributorshipComponent o = (CitationCitedArtifactContributorshipComponent) other_;
6810        return compareDeep(complete, o.complete, true) && compareDeep(entry, o.entry, true) && compareDeep(summary, o.summary, true)
6811          ;
6812      }
6813
6814      @Override
6815      public boolean equalsShallow(Base other_) {
6816        if (!super.equalsShallow(other_))
6817          return false;
6818        if (!(other_ instanceof CitationCitedArtifactContributorshipComponent))
6819          return false;
6820        CitationCitedArtifactContributorshipComponent o = (CitationCitedArtifactContributorshipComponent) other_;
6821        return compareValues(complete, o.complete, true);
6822      }
6823
6824      public boolean isEmpty() {
6825        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(complete, entry, summary
6826          );
6827      }
6828
6829  public String fhirType() {
6830    return "Citation.citedArtifact.contributorship";
6831
6832  }
6833
6834  }
6835
6836    @Block()
6837    public static class CitationCitedArtifactContributorshipEntryComponent extends BackboneElement implements IBaseBackboneElement {
6838        /**
6839         * A name associated with the individual.
6840         */
6841        @Child(name = "name", type = {HumanName.class}, order=1, min=0, max=1, modifier=false, summary=false)
6842        @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the individual." )
6843        protected HumanName name;
6844
6845        /**
6846         * Initials for forename.
6847         */
6848        @Child(name = "initials", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
6849        @Description(shortDefinition="Initials for forename", formalDefinition="Initials for forename." )
6850        protected StringType initials;
6851
6852        /**
6853         * Used for collective or corporate name as an author.
6854         */
6855        @Child(name = "collectiveName", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
6856        @Description(shortDefinition="Used for collective or corporate name as an author", formalDefinition="Used for collective or corporate name as an author." )
6857        protected StringType collectiveName;
6858
6859        /**
6860         * Unique person identifier.
6861         */
6862        @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6863        @Description(shortDefinition="Author identifier, e.g., ORCID", formalDefinition="Unique person identifier." )
6864        protected List<Identifier> identifier;
6865
6866        /**
6867         * Organization affiliated with the entity.
6868         */
6869        @Child(name = "affiliationInfo", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6870        @Description(shortDefinition="Organizational affiliation", formalDefinition="Organization affiliated with the entity." )
6871        protected List<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent> affiliationInfo;
6872
6873        /**
6874         * Physical mailing address for the author or contributor.
6875         */
6876        @Child(name = "address", type = {Address.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6877        @Description(shortDefinition="Physical mailing address", formalDefinition="Physical mailing address for the author or contributor." )
6878        protected List<Address> address;
6879
6880        /**
6881         * Email or telephone contact methods for the author or contributor.
6882         */
6883        @Child(name = "telecom", type = {ContactPoint.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6884        @Description(shortDefinition="Email or telephone contact methods for the author or contributor", formalDefinition="Email or telephone contact methods for the author or contributor." )
6885        protected List<ContactPoint> telecom;
6886
6887        /**
6888         * This element identifies the specific nature of an individual?s contribution with respect to the cited work.
6889         */
6890        @Child(name = "contributionType", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6891        @Description(shortDefinition="The specific contribution", formalDefinition="This element identifies the specific nature of an individual?s contribution with respect to the cited work." )
6892        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/artifact-contribution-type")
6893        protected List<CodeableConcept> contributionType;
6894
6895        /**
6896         * The role of the contributor (e.g. author, editor, reviewer).
6897         */
6898        @Child(name = "role", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false)
6899        @Description(shortDefinition="The role of the contributor (e.g. author, editor, reviewer)", formalDefinition="The role of the contributor (e.g. author, editor, reviewer)." )
6900        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contributor-role")
6901        protected CodeableConcept role;
6902
6903        /**
6904         * Contributions with accounting for time or number.
6905         */
6906        @Child(name = "contributionInstance", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6907        @Description(shortDefinition="Contributions with accounting for time or number", formalDefinition="Contributions with accounting for time or number." )
6908        protected List<CitationCitedArtifactContributorshipEntryContributionInstanceComponent> contributionInstance;
6909
6910        /**
6911         * Indication of which contributor is the corresponding contributor for the role.
6912         */
6913        @Child(name = "correspondingContact", type = {BooleanType.class}, order=11, min=0, max=1, modifier=false, summary=false)
6914        @Description(shortDefinition="Indication of which contributor is the corresponding contributor for the role", formalDefinition="Indication of which contributor is the corresponding contributor for the role." )
6915        protected BooleanType correspondingContact;
6916
6917        /**
6918         * Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.
6919         */
6920        @Child(name = "rankingOrder", type = {PositiveIntType.class}, order=12, min=0, max=1, modifier=false, summary=false)
6921        @Description(shortDefinition="Ranked order of contribution", formalDefinition="Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author." )
6922        protected PositiveIntType rankingOrder;
6923
6924        private static final long serialVersionUID = -1625647137L;
6925
6926    /**
6927     * Constructor
6928     */
6929      public CitationCitedArtifactContributorshipEntryComponent() {
6930        super();
6931      }
6932
6933        /**
6934         * @return {@link #name} (A name associated with the individual.)
6935         */
6936        public HumanName getName() { 
6937          if (this.name == null)
6938            if (Configuration.errorOnAutoCreate())
6939              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.name");
6940            else if (Configuration.doAutoCreate())
6941              this.name = new HumanName(); // cc
6942          return this.name;
6943        }
6944
6945        public boolean hasName() { 
6946          return this.name != null && !this.name.isEmpty();
6947        }
6948
6949        /**
6950         * @param value {@link #name} (A name associated with the individual.)
6951         */
6952        public CitationCitedArtifactContributorshipEntryComponent setName(HumanName value) { 
6953          this.name = value;
6954          return this;
6955        }
6956
6957        /**
6958         * @return {@link #initials} (Initials for forename.). This is the underlying object with id, value and extensions. The accessor "getInitials" gives direct access to the value
6959         */
6960        public StringType getInitialsElement() { 
6961          if (this.initials == null)
6962            if (Configuration.errorOnAutoCreate())
6963              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.initials");
6964            else if (Configuration.doAutoCreate())
6965              this.initials = new StringType(); // bb
6966          return this.initials;
6967        }
6968
6969        public boolean hasInitialsElement() { 
6970          return this.initials != null && !this.initials.isEmpty();
6971        }
6972
6973        public boolean hasInitials() { 
6974          return this.initials != null && !this.initials.isEmpty();
6975        }
6976
6977        /**
6978         * @param value {@link #initials} (Initials for forename.). This is the underlying object with id, value and extensions. The accessor "getInitials" gives direct access to the value
6979         */
6980        public CitationCitedArtifactContributorshipEntryComponent setInitialsElement(StringType value) { 
6981          this.initials = value;
6982          return this;
6983        }
6984
6985        /**
6986         * @return Initials for forename.
6987         */
6988        public String getInitials() { 
6989          return this.initials == null ? null : this.initials.getValue();
6990        }
6991
6992        /**
6993         * @param value Initials for forename.
6994         */
6995        public CitationCitedArtifactContributorshipEntryComponent setInitials(String value) { 
6996          if (Utilities.noString(value))
6997            this.initials = null;
6998          else {
6999            if (this.initials == null)
7000              this.initials = new StringType();
7001            this.initials.setValue(value);
7002          }
7003          return this;
7004        }
7005
7006        /**
7007         * @return {@link #collectiveName} (Used for collective or corporate name as an author.). This is the underlying object with id, value and extensions. The accessor "getCollectiveName" gives direct access to the value
7008         */
7009        public StringType getCollectiveNameElement() { 
7010          if (this.collectiveName == null)
7011            if (Configuration.errorOnAutoCreate())
7012              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.collectiveName");
7013            else if (Configuration.doAutoCreate())
7014              this.collectiveName = new StringType(); // bb
7015          return this.collectiveName;
7016        }
7017
7018        public boolean hasCollectiveNameElement() { 
7019          return this.collectiveName != null && !this.collectiveName.isEmpty();
7020        }
7021
7022        public boolean hasCollectiveName() { 
7023          return this.collectiveName != null && !this.collectiveName.isEmpty();
7024        }
7025
7026        /**
7027         * @param value {@link #collectiveName} (Used for collective or corporate name as an author.). This is the underlying object with id, value and extensions. The accessor "getCollectiveName" gives direct access to the value
7028         */
7029        public CitationCitedArtifactContributorshipEntryComponent setCollectiveNameElement(StringType value) { 
7030          this.collectiveName = value;
7031          return this;
7032        }
7033
7034        /**
7035         * @return Used for collective or corporate name as an author.
7036         */
7037        public String getCollectiveName() { 
7038          return this.collectiveName == null ? null : this.collectiveName.getValue();
7039        }
7040
7041        /**
7042         * @param value Used for collective or corporate name as an author.
7043         */
7044        public CitationCitedArtifactContributorshipEntryComponent setCollectiveName(String value) { 
7045          if (Utilities.noString(value))
7046            this.collectiveName = null;
7047          else {
7048            if (this.collectiveName == null)
7049              this.collectiveName = new StringType();
7050            this.collectiveName.setValue(value);
7051          }
7052          return this;
7053        }
7054
7055        /**
7056         * @return {@link #identifier} (Unique person identifier.)
7057         */
7058        public List<Identifier> getIdentifier() { 
7059          if (this.identifier == null)
7060            this.identifier = new ArrayList<Identifier>();
7061          return this.identifier;
7062        }
7063
7064        /**
7065         * @return Returns a reference to <code>this</code> for easy method chaining
7066         */
7067        public CitationCitedArtifactContributorshipEntryComponent setIdentifier(List<Identifier> theIdentifier) { 
7068          this.identifier = theIdentifier;
7069          return this;
7070        }
7071
7072        public boolean hasIdentifier() { 
7073          if (this.identifier == null)
7074            return false;
7075          for (Identifier item : this.identifier)
7076            if (!item.isEmpty())
7077              return true;
7078          return false;
7079        }
7080
7081        public Identifier addIdentifier() { //3
7082          Identifier t = new Identifier();
7083          if (this.identifier == null)
7084            this.identifier = new ArrayList<Identifier>();
7085          this.identifier.add(t);
7086          return t;
7087        }
7088
7089        public CitationCitedArtifactContributorshipEntryComponent addIdentifier(Identifier t) { //3
7090          if (t == null)
7091            return this;
7092          if (this.identifier == null)
7093            this.identifier = new ArrayList<Identifier>();
7094          this.identifier.add(t);
7095          return this;
7096        }
7097
7098        /**
7099         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
7100         */
7101        public Identifier getIdentifierFirstRep() { 
7102          if (getIdentifier().isEmpty()) {
7103            addIdentifier();
7104          }
7105          return getIdentifier().get(0);
7106        }
7107
7108        /**
7109         * @return {@link #affiliationInfo} (Organization affiliated with the entity.)
7110         */
7111        public List<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent> getAffiliationInfo() { 
7112          if (this.affiliationInfo == null)
7113            this.affiliationInfo = new ArrayList<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent>();
7114          return this.affiliationInfo;
7115        }
7116
7117        /**
7118         * @return Returns a reference to <code>this</code> for easy method chaining
7119         */
7120        public CitationCitedArtifactContributorshipEntryComponent setAffiliationInfo(List<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent> theAffiliationInfo) { 
7121          this.affiliationInfo = theAffiliationInfo;
7122          return this;
7123        }
7124
7125        public boolean hasAffiliationInfo() { 
7126          if (this.affiliationInfo == null)
7127            return false;
7128          for (CitationCitedArtifactContributorshipEntryAffiliationInfoComponent item : this.affiliationInfo)
7129            if (!item.isEmpty())
7130              return true;
7131          return false;
7132        }
7133
7134        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent addAffiliationInfo() { //3
7135          CitationCitedArtifactContributorshipEntryAffiliationInfoComponent t = new CitationCitedArtifactContributorshipEntryAffiliationInfoComponent();
7136          if (this.affiliationInfo == null)
7137            this.affiliationInfo = new ArrayList<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent>();
7138          this.affiliationInfo.add(t);
7139          return t;
7140        }
7141
7142        public CitationCitedArtifactContributorshipEntryComponent addAffiliationInfo(CitationCitedArtifactContributorshipEntryAffiliationInfoComponent t) { //3
7143          if (t == null)
7144            return this;
7145          if (this.affiliationInfo == null)
7146            this.affiliationInfo = new ArrayList<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent>();
7147          this.affiliationInfo.add(t);
7148          return this;
7149        }
7150
7151        /**
7152         * @return The first repetition of repeating field {@link #affiliationInfo}, creating it if it does not already exist {3}
7153         */
7154        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent getAffiliationInfoFirstRep() { 
7155          if (getAffiliationInfo().isEmpty()) {
7156            addAffiliationInfo();
7157          }
7158          return getAffiliationInfo().get(0);
7159        }
7160
7161        /**
7162         * @return {@link #address} (Physical mailing address for the author or contributor.)
7163         */
7164        public List<Address> getAddress() { 
7165          if (this.address == null)
7166            this.address = new ArrayList<Address>();
7167          return this.address;
7168        }
7169
7170        /**
7171         * @return Returns a reference to <code>this</code> for easy method chaining
7172         */
7173        public CitationCitedArtifactContributorshipEntryComponent setAddress(List<Address> theAddress) { 
7174          this.address = theAddress;
7175          return this;
7176        }
7177
7178        public boolean hasAddress() { 
7179          if (this.address == null)
7180            return false;
7181          for (Address item : this.address)
7182            if (!item.isEmpty())
7183              return true;
7184          return false;
7185        }
7186
7187        public Address addAddress() { //3
7188          Address t = new Address();
7189          if (this.address == null)
7190            this.address = new ArrayList<Address>();
7191          this.address.add(t);
7192          return t;
7193        }
7194
7195        public CitationCitedArtifactContributorshipEntryComponent addAddress(Address t) { //3
7196          if (t == null)
7197            return this;
7198          if (this.address == null)
7199            this.address = new ArrayList<Address>();
7200          this.address.add(t);
7201          return this;
7202        }
7203
7204        /**
7205         * @return The first repetition of repeating field {@link #address}, creating it if it does not already exist {3}
7206         */
7207        public Address getAddressFirstRep() { 
7208          if (getAddress().isEmpty()) {
7209            addAddress();
7210          }
7211          return getAddress().get(0);
7212        }
7213
7214        /**
7215         * @return {@link #telecom} (Email or telephone contact methods for the author or contributor.)
7216         */
7217        public List<ContactPoint> getTelecom() { 
7218          if (this.telecom == null)
7219            this.telecom = new ArrayList<ContactPoint>();
7220          return this.telecom;
7221        }
7222
7223        /**
7224         * @return Returns a reference to <code>this</code> for easy method chaining
7225         */
7226        public CitationCitedArtifactContributorshipEntryComponent setTelecom(List<ContactPoint> theTelecom) { 
7227          this.telecom = theTelecom;
7228          return this;
7229        }
7230
7231        public boolean hasTelecom() { 
7232          if (this.telecom == null)
7233            return false;
7234          for (ContactPoint item : this.telecom)
7235            if (!item.isEmpty())
7236              return true;
7237          return false;
7238        }
7239
7240        public ContactPoint addTelecom() { //3
7241          ContactPoint t = new ContactPoint();
7242          if (this.telecom == null)
7243            this.telecom = new ArrayList<ContactPoint>();
7244          this.telecom.add(t);
7245          return t;
7246        }
7247
7248        public CitationCitedArtifactContributorshipEntryComponent addTelecom(ContactPoint t) { //3
7249          if (t == null)
7250            return this;
7251          if (this.telecom == null)
7252            this.telecom = new ArrayList<ContactPoint>();
7253          this.telecom.add(t);
7254          return this;
7255        }
7256
7257        /**
7258         * @return The first repetition of repeating field {@link #telecom}, creating it if it does not already exist {3}
7259         */
7260        public ContactPoint getTelecomFirstRep() { 
7261          if (getTelecom().isEmpty()) {
7262            addTelecom();
7263          }
7264          return getTelecom().get(0);
7265        }
7266
7267        /**
7268         * @return {@link #contributionType} (This element identifies the specific nature of an individual?s contribution with respect to the cited work.)
7269         */
7270        public List<CodeableConcept> getContributionType() { 
7271          if (this.contributionType == null)
7272            this.contributionType = new ArrayList<CodeableConcept>();
7273          return this.contributionType;
7274        }
7275
7276        /**
7277         * @return Returns a reference to <code>this</code> for easy method chaining
7278         */
7279        public CitationCitedArtifactContributorshipEntryComponent setContributionType(List<CodeableConcept> theContributionType) { 
7280          this.contributionType = theContributionType;
7281          return this;
7282        }
7283
7284        public boolean hasContributionType() { 
7285          if (this.contributionType == null)
7286            return false;
7287          for (CodeableConcept item : this.contributionType)
7288            if (!item.isEmpty())
7289              return true;
7290          return false;
7291        }
7292
7293        public CodeableConcept addContributionType() { //3
7294          CodeableConcept t = new CodeableConcept();
7295          if (this.contributionType == null)
7296            this.contributionType = new ArrayList<CodeableConcept>();
7297          this.contributionType.add(t);
7298          return t;
7299        }
7300
7301        public CitationCitedArtifactContributorshipEntryComponent addContributionType(CodeableConcept t) { //3
7302          if (t == null)
7303            return this;
7304          if (this.contributionType == null)
7305            this.contributionType = new ArrayList<CodeableConcept>();
7306          this.contributionType.add(t);
7307          return this;
7308        }
7309
7310        /**
7311         * @return The first repetition of repeating field {@link #contributionType}, creating it if it does not already exist {3}
7312         */
7313        public CodeableConcept getContributionTypeFirstRep() { 
7314          if (getContributionType().isEmpty()) {
7315            addContributionType();
7316          }
7317          return getContributionType().get(0);
7318        }
7319
7320        /**
7321         * @return {@link #role} (The role of the contributor (e.g. author, editor, reviewer).)
7322         */
7323        public CodeableConcept getRole() { 
7324          if (this.role == null)
7325            if (Configuration.errorOnAutoCreate())
7326              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.role");
7327            else if (Configuration.doAutoCreate())
7328              this.role = new CodeableConcept(); // cc
7329          return this.role;
7330        }
7331
7332        public boolean hasRole() { 
7333          return this.role != null && !this.role.isEmpty();
7334        }
7335
7336        /**
7337         * @param value {@link #role} (The role of the contributor (e.g. author, editor, reviewer).)
7338         */
7339        public CitationCitedArtifactContributorshipEntryComponent setRole(CodeableConcept value) { 
7340          this.role = value;
7341          return this;
7342        }
7343
7344        /**
7345         * @return {@link #contributionInstance} (Contributions with accounting for time or number.)
7346         */
7347        public List<CitationCitedArtifactContributorshipEntryContributionInstanceComponent> getContributionInstance() { 
7348          if (this.contributionInstance == null)
7349            this.contributionInstance = new ArrayList<CitationCitedArtifactContributorshipEntryContributionInstanceComponent>();
7350          return this.contributionInstance;
7351        }
7352
7353        /**
7354         * @return Returns a reference to <code>this</code> for easy method chaining
7355         */
7356        public CitationCitedArtifactContributorshipEntryComponent setContributionInstance(List<CitationCitedArtifactContributorshipEntryContributionInstanceComponent> theContributionInstance) { 
7357          this.contributionInstance = theContributionInstance;
7358          return this;
7359        }
7360
7361        public boolean hasContributionInstance() { 
7362          if (this.contributionInstance == null)
7363            return false;
7364          for (CitationCitedArtifactContributorshipEntryContributionInstanceComponent item : this.contributionInstance)
7365            if (!item.isEmpty())
7366              return true;
7367          return false;
7368        }
7369
7370        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent addContributionInstance() { //3
7371          CitationCitedArtifactContributorshipEntryContributionInstanceComponent t = new CitationCitedArtifactContributorshipEntryContributionInstanceComponent();
7372          if (this.contributionInstance == null)
7373            this.contributionInstance = new ArrayList<CitationCitedArtifactContributorshipEntryContributionInstanceComponent>();
7374          this.contributionInstance.add(t);
7375          return t;
7376        }
7377
7378        public CitationCitedArtifactContributorshipEntryComponent addContributionInstance(CitationCitedArtifactContributorshipEntryContributionInstanceComponent t) { //3
7379          if (t == null)
7380            return this;
7381          if (this.contributionInstance == null)
7382            this.contributionInstance = new ArrayList<CitationCitedArtifactContributorshipEntryContributionInstanceComponent>();
7383          this.contributionInstance.add(t);
7384          return this;
7385        }
7386
7387        /**
7388         * @return The first repetition of repeating field {@link #contributionInstance}, creating it if it does not already exist {3}
7389         */
7390        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent getContributionInstanceFirstRep() { 
7391          if (getContributionInstance().isEmpty()) {
7392            addContributionInstance();
7393          }
7394          return getContributionInstance().get(0);
7395        }
7396
7397        /**
7398         * @return {@link #correspondingContact} (Indication of which contributor is the corresponding contributor for the role.). This is the underlying object with id, value and extensions. The accessor "getCorrespondingContact" gives direct access to the value
7399         */
7400        public BooleanType getCorrespondingContactElement() { 
7401          if (this.correspondingContact == null)
7402            if (Configuration.errorOnAutoCreate())
7403              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.correspondingContact");
7404            else if (Configuration.doAutoCreate())
7405              this.correspondingContact = new BooleanType(); // bb
7406          return this.correspondingContact;
7407        }
7408
7409        public boolean hasCorrespondingContactElement() { 
7410          return this.correspondingContact != null && !this.correspondingContact.isEmpty();
7411        }
7412
7413        public boolean hasCorrespondingContact() { 
7414          return this.correspondingContact != null && !this.correspondingContact.isEmpty();
7415        }
7416
7417        /**
7418         * @param value {@link #correspondingContact} (Indication of which contributor is the corresponding contributor for the role.). This is the underlying object with id, value and extensions. The accessor "getCorrespondingContact" gives direct access to the value
7419         */
7420        public CitationCitedArtifactContributorshipEntryComponent setCorrespondingContactElement(BooleanType value) { 
7421          this.correspondingContact = value;
7422          return this;
7423        }
7424
7425        /**
7426         * @return Indication of which contributor is the corresponding contributor for the role.
7427         */
7428        public boolean getCorrespondingContact() { 
7429          return this.correspondingContact == null || this.correspondingContact.isEmpty() ? false : this.correspondingContact.getValue();
7430        }
7431
7432        /**
7433         * @param value Indication of which contributor is the corresponding contributor for the role.
7434         */
7435        public CitationCitedArtifactContributorshipEntryComponent setCorrespondingContact(boolean value) { 
7436            if (this.correspondingContact == null)
7437              this.correspondingContact = new BooleanType();
7438            this.correspondingContact.setValue(value);
7439          return this;
7440        }
7441
7442        /**
7443         * @return {@link #rankingOrder} (Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.). This is the underlying object with id, value and extensions. The accessor "getRankingOrder" gives direct access to the value
7444         */
7445        public PositiveIntType getRankingOrderElement() { 
7446          if (this.rankingOrder == null)
7447            if (Configuration.errorOnAutoCreate())
7448              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.rankingOrder");
7449            else if (Configuration.doAutoCreate())
7450              this.rankingOrder = new PositiveIntType(); // bb
7451          return this.rankingOrder;
7452        }
7453
7454        public boolean hasRankingOrderElement() { 
7455          return this.rankingOrder != null && !this.rankingOrder.isEmpty();
7456        }
7457
7458        public boolean hasRankingOrder() { 
7459          return this.rankingOrder != null && !this.rankingOrder.isEmpty();
7460        }
7461
7462        /**
7463         * @param value {@link #rankingOrder} (Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.). This is the underlying object with id, value and extensions. The accessor "getRankingOrder" gives direct access to the value
7464         */
7465        public CitationCitedArtifactContributorshipEntryComponent setRankingOrderElement(PositiveIntType value) { 
7466          this.rankingOrder = value;
7467          return this;
7468        }
7469
7470        /**
7471         * @return Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.
7472         */
7473        public int getRankingOrder() { 
7474          return this.rankingOrder == null || this.rankingOrder.isEmpty() ? 0 : this.rankingOrder.getValue();
7475        }
7476
7477        /**
7478         * @param value Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.
7479         */
7480        public CitationCitedArtifactContributorshipEntryComponent setRankingOrder(int value) { 
7481            if (this.rankingOrder == null)
7482              this.rankingOrder = new PositiveIntType();
7483            this.rankingOrder.setValue(value);
7484          return this;
7485        }
7486
7487        protected void listChildren(List<Property> children) {
7488          super.listChildren(children);
7489          children.add(new Property("name", "HumanName", "A name associated with the individual.", 0, 1, name));
7490          children.add(new Property("initials", "string", "Initials for forename.", 0, 1, initials));
7491          children.add(new Property("collectiveName", "string", "Used for collective or corporate name as an author.", 0, 1, collectiveName));
7492          children.add(new Property("identifier", "Identifier", "Unique person identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
7493          children.add(new Property("affiliationInfo", "", "Organization affiliated with the entity.", 0, java.lang.Integer.MAX_VALUE, affiliationInfo));
7494          children.add(new Property("address", "Address", "Physical mailing address for the author or contributor.", 0, java.lang.Integer.MAX_VALUE, address));
7495          children.add(new Property("telecom", "ContactPoint", "Email or telephone contact methods for the author or contributor.", 0, java.lang.Integer.MAX_VALUE, telecom));
7496          children.add(new Property("contributionType", "CodeableConcept", "This element identifies the specific nature of an individual?s contribution with respect to the cited work.", 0, java.lang.Integer.MAX_VALUE, contributionType));
7497          children.add(new Property("role", "CodeableConcept", "The role of the contributor (e.g. author, editor, reviewer).", 0, 1, role));
7498          children.add(new Property("contributionInstance", "", "Contributions with accounting for time or number.", 0, java.lang.Integer.MAX_VALUE, contributionInstance));
7499          children.add(new Property("correspondingContact", "boolean", "Indication of which contributor is the corresponding contributor for the role.", 0, 1, correspondingContact));
7500          children.add(new Property("rankingOrder", "positiveInt", "Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.", 0, 1, rankingOrder));
7501        }
7502
7503        @Override
7504        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7505          switch (_hash) {
7506          case 3373707: /*name*/  return new Property("name", "HumanName", "A name associated with the individual.", 0, 1, name);
7507          case 269062575: /*initials*/  return new Property("initials", "string", "Initials for forename.", 0, 1, initials);
7508          case 502871833: /*collectiveName*/  return new Property("collectiveName", "string", "Used for collective or corporate name as an author.", 0, 1, collectiveName);
7509          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique person identifier.", 0, java.lang.Integer.MAX_VALUE, identifier);
7510          case -215129154: /*affiliationInfo*/  return new Property("affiliationInfo", "", "Organization affiliated with the entity.", 0, java.lang.Integer.MAX_VALUE, affiliationInfo);
7511          case -1147692044: /*address*/  return new Property("address", "Address", "Physical mailing address for the author or contributor.", 0, java.lang.Integer.MAX_VALUE, address);
7512          case -1429363305: /*telecom*/  return new Property("telecom", "ContactPoint", "Email or telephone contact methods for the author or contributor.", 0, java.lang.Integer.MAX_VALUE, telecom);
7513          case -1600446614: /*contributionType*/  return new Property("contributionType", "CodeableConcept", "This element identifies the specific nature of an individual?s contribution with respect to the cited work.", 0, java.lang.Integer.MAX_VALUE, contributionType);
7514          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "The role of the contributor (e.g. author, editor, reviewer).", 0, 1, role);
7515          case -547910459: /*contributionInstance*/  return new Property("contributionInstance", "", "Contributions with accounting for time or number.", 0, java.lang.Integer.MAX_VALUE, contributionInstance);
7516          case -1816008851: /*correspondingContact*/  return new Property("correspondingContact", "boolean", "Indication of which contributor is the corresponding contributor for the role.", 0, 1, correspondingContact);
7517          case -762905416: /*rankingOrder*/  return new Property("rankingOrder", "positiveInt", "Provides a numerical ranking to represent the degree of contributorship relative to other contributors, such as 1 for first author and 2 for second author.", 0, 1, rankingOrder);
7518          default: return super.getNamedProperty(_hash, _name, _checkValid);
7519          }
7520
7521        }
7522
7523      @Override
7524      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7525        switch (hash) {
7526        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // HumanName
7527        case 269062575: /*initials*/ return this.initials == null ? new Base[0] : new Base[] {this.initials}; // StringType
7528        case 502871833: /*collectiveName*/ return this.collectiveName == null ? new Base[0] : new Base[] {this.collectiveName}; // StringType
7529        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
7530        case -215129154: /*affiliationInfo*/ return this.affiliationInfo == null ? new Base[0] : this.affiliationInfo.toArray(new Base[this.affiliationInfo.size()]); // CitationCitedArtifactContributorshipEntryAffiliationInfoComponent
7531        case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address
7532        case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
7533        case -1600446614: /*contributionType*/ return this.contributionType == null ? new Base[0] : this.contributionType.toArray(new Base[this.contributionType.size()]); // CodeableConcept
7534        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
7535        case -547910459: /*contributionInstance*/ return this.contributionInstance == null ? new Base[0] : this.contributionInstance.toArray(new Base[this.contributionInstance.size()]); // CitationCitedArtifactContributorshipEntryContributionInstanceComponent
7536        case -1816008851: /*correspondingContact*/ return this.correspondingContact == null ? new Base[0] : new Base[] {this.correspondingContact}; // BooleanType
7537        case -762905416: /*rankingOrder*/ return this.rankingOrder == null ? new Base[0] : new Base[] {this.rankingOrder}; // PositiveIntType
7538        default: return super.getProperty(hash, name, checkValid);
7539        }
7540
7541      }
7542
7543      @Override
7544      public Base setProperty(int hash, String name, Base value) throws FHIRException {
7545        switch (hash) {
7546        case 3373707: // name
7547          this.name = TypeConvertor.castToHumanName(value); // HumanName
7548          return value;
7549        case 269062575: // initials
7550          this.initials = TypeConvertor.castToString(value); // StringType
7551          return value;
7552        case 502871833: // collectiveName
7553          this.collectiveName = TypeConvertor.castToString(value); // StringType
7554          return value;
7555        case -1618432855: // identifier
7556          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
7557          return value;
7558        case -215129154: // affiliationInfo
7559          this.getAffiliationInfo().add((CitationCitedArtifactContributorshipEntryAffiliationInfoComponent) value); // CitationCitedArtifactContributorshipEntryAffiliationInfoComponent
7560          return value;
7561        case -1147692044: // address
7562          this.getAddress().add(TypeConvertor.castToAddress(value)); // Address
7563          return value;
7564        case -1429363305: // telecom
7565          this.getTelecom().add(TypeConvertor.castToContactPoint(value)); // ContactPoint
7566          return value;
7567        case -1600446614: // contributionType
7568          this.getContributionType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
7569          return value;
7570        case 3506294: // role
7571          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
7572          return value;
7573        case -547910459: // contributionInstance
7574          this.getContributionInstance().add((CitationCitedArtifactContributorshipEntryContributionInstanceComponent) value); // CitationCitedArtifactContributorshipEntryContributionInstanceComponent
7575          return value;
7576        case -1816008851: // correspondingContact
7577          this.correspondingContact = TypeConvertor.castToBoolean(value); // BooleanType
7578          return value;
7579        case -762905416: // rankingOrder
7580          this.rankingOrder = TypeConvertor.castToPositiveInt(value); // PositiveIntType
7581          return value;
7582        default: return super.setProperty(hash, name, value);
7583        }
7584
7585      }
7586
7587      @Override
7588      public Base setProperty(String name, Base value) throws FHIRException {
7589        if (name.equals("name")) {
7590          this.name = TypeConvertor.castToHumanName(value); // HumanName
7591        } else if (name.equals("initials")) {
7592          this.initials = TypeConvertor.castToString(value); // StringType
7593        } else if (name.equals("collectiveName")) {
7594          this.collectiveName = TypeConvertor.castToString(value); // StringType
7595        } else if (name.equals("identifier")) {
7596          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
7597        } else if (name.equals("affiliationInfo")) {
7598          this.getAffiliationInfo().add((CitationCitedArtifactContributorshipEntryAffiliationInfoComponent) value);
7599        } else if (name.equals("address")) {
7600          this.getAddress().add(TypeConvertor.castToAddress(value));
7601        } else if (name.equals("telecom")) {
7602          this.getTelecom().add(TypeConvertor.castToContactPoint(value));
7603        } else if (name.equals("contributionType")) {
7604          this.getContributionType().add(TypeConvertor.castToCodeableConcept(value));
7605        } else if (name.equals("role")) {
7606          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
7607        } else if (name.equals("contributionInstance")) {
7608          this.getContributionInstance().add((CitationCitedArtifactContributorshipEntryContributionInstanceComponent) value);
7609        } else if (name.equals("correspondingContact")) {
7610          this.correspondingContact = TypeConvertor.castToBoolean(value); // BooleanType
7611        } else if (name.equals("rankingOrder")) {
7612          this.rankingOrder = TypeConvertor.castToPositiveInt(value); // PositiveIntType
7613        } else
7614          return super.setProperty(name, value);
7615        return value;
7616      }
7617
7618      @Override
7619      public Base makeProperty(int hash, String name) throws FHIRException {
7620        switch (hash) {
7621        case 3373707:  return getName();
7622        case 269062575:  return getInitialsElement();
7623        case 502871833:  return getCollectiveNameElement();
7624        case -1618432855:  return addIdentifier(); 
7625        case -215129154:  return addAffiliationInfo(); 
7626        case -1147692044:  return addAddress(); 
7627        case -1429363305:  return addTelecom(); 
7628        case -1600446614:  return addContributionType(); 
7629        case 3506294:  return getRole();
7630        case -547910459:  return addContributionInstance(); 
7631        case -1816008851:  return getCorrespondingContactElement();
7632        case -762905416:  return getRankingOrderElement();
7633        default: return super.makeProperty(hash, name);
7634        }
7635
7636      }
7637
7638      @Override
7639      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
7640        switch (hash) {
7641        case 3373707: /*name*/ return new String[] {"HumanName"};
7642        case 269062575: /*initials*/ return new String[] {"string"};
7643        case 502871833: /*collectiveName*/ return new String[] {"string"};
7644        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
7645        case -215129154: /*affiliationInfo*/ return new String[] {};
7646        case -1147692044: /*address*/ return new String[] {"Address"};
7647        case -1429363305: /*telecom*/ return new String[] {"ContactPoint"};
7648        case -1600446614: /*contributionType*/ return new String[] {"CodeableConcept"};
7649        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
7650        case -547910459: /*contributionInstance*/ return new String[] {};
7651        case -1816008851: /*correspondingContact*/ return new String[] {"boolean"};
7652        case -762905416: /*rankingOrder*/ return new String[] {"positiveInt"};
7653        default: return super.getTypesForProperty(hash, name);
7654        }
7655
7656      }
7657
7658      @Override
7659      public Base addChild(String name) throws FHIRException {
7660        if (name.equals("name")) {
7661          this.name = new HumanName();
7662          return this.name;
7663        }
7664        else if (name.equals("initials")) {
7665          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.initials");
7666        }
7667        else if (name.equals("collectiveName")) {
7668          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.collectiveName");
7669        }
7670        else if (name.equals("identifier")) {
7671          return addIdentifier();
7672        }
7673        else if (name.equals("affiliationInfo")) {
7674          return addAffiliationInfo();
7675        }
7676        else if (name.equals("address")) {
7677          return addAddress();
7678        }
7679        else if (name.equals("telecom")) {
7680          return addTelecom();
7681        }
7682        else if (name.equals("contributionType")) {
7683          return addContributionType();
7684        }
7685        else if (name.equals("role")) {
7686          this.role = new CodeableConcept();
7687          return this.role;
7688        }
7689        else if (name.equals("contributionInstance")) {
7690          return addContributionInstance();
7691        }
7692        else if (name.equals("correspondingContact")) {
7693          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.correspondingContact");
7694        }
7695        else if (name.equals("rankingOrder")) {
7696          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.rankingOrder");
7697        }
7698        else
7699          return super.addChild(name);
7700      }
7701
7702      public CitationCitedArtifactContributorshipEntryComponent copy() {
7703        CitationCitedArtifactContributorshipEntryComponent dst = new CitationCitedArtifactContributorshipEntryComponent();
7704        copyValues(dst);
7705        return dst;
7706      }
7707
7708      public void copyValues(CitationCitedArtifactContributorshipEntryComponent dst) {
7709        super.copyValues(dst);
7710        dst.name = name == null ? null : name.copy();
7711        dst.initials = initials == null ? null : initials.copy();
7712        dst.collectiveName = collectiveName == null ? null : collectiveName.copy();
7713        if (identifier != null) {
7714          dst.identifier = new ArrayList<Identifier>();
7715          for (Identifier i : identifier)
7716            dst.identifier.add(i.copy());
7717        };
7718        if (affiliationInfo != null) {
7719          dst.affiliationInfo = new ArrayList<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent>();
7720          for (CitationCitedArtifactContributorshipEntryAffiliationInfoComponent i : affiliationInfo)
7721            dst.affiliationInfo.add(i.copy());
7722        };
7723        if (address != null) {
7724          dst.address = new ArrayList<Address>();
7725          for (Address i : address)
7726            dst.address.add(i.copy());
7727        };
7728        if (telecom != null) {
7729          dst.telecom = new ArrayList<ContactPoint>();
7730          for (ContactPoint i : telecom)
7731            dst.telecom.add(i.copy());
7732        };
7733        if (contributionType != null) {
7734          dst.contributionType = new ArrayList<CodeableConcept>();
7735          for (CodeableConcept i : contributionType)
7736            dst.contributionType.add(i.copy());
7737        };
7738        dst.role = role == null ? null : role.copy();
7739        if (contributionInstance != null) {
7740          dst.contributionInstance = new ArrayList<CitationCitedArtifactContributorshipEntryContributionInstanceComponent>();
7741          for (CitationCitedArtifactContributorshipEntryContributionInstanceComponent i : contributionInstance)
7742            dst.contributionInstance.add(i.copy());
7743        };
7744        dst.correspondingContact = correspondingContact == null ? null : correspondingContact.copy();
7745        dst.rankingOrder = rankingOrder == null ? null : rankingOrder.copy();
7746      }
7747
7748      @Override
7749      public boolean equalsDeep(Base other_) {
7750        if (!super.equalsDeep(other_))
7751          return false;
7752        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryComponent))
7753          return false;
7754        CitationCitedArtifactContributorshipEntryComponent o = (CitationCitedArtifactContributorshipEntryComponent) other_;
7755        return compareDeep(name, o.name, true) && compareDeep(initials, o.initials, true) && compareDeep(collectiveName, o.collectiveName, true)
7756           && compareDeep(identifier, o.identifier, true) && compareDeep(affiliationInfo, o.affiliationInfo, true)
7757           && compareDeep(address, o.address, true) && compareDeep(telecom, o.telecom, true) && compareDeep(contributionType, o.contributionType, true)
7758           && compareDeep(role, o.role, true) && compareDeep(contributionInstance, o.contributionInstance, true)
7759           && compareDeep(correspondingContact, o.correspondingContact, true) && compareDeep(rankingOrder, o.rankingOrder, true)
7760          ;
7761      }
7762
7763      @Override
7764      public boolean equalsShallow(Base other_) {
7765        if (!super.equalsShallow(other_))
7766          return false;
7767        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryComponent))
7768          return false;
7769        CitationCitedArtifactContributorshipEntryComponent o = (CitationCitedArtifactContributorshipEntryComponent) other_;
7770        return compareValues(initials, o.initials, true) && compareValues(collectiveName, o.collectiveName, true)
7771           && compareValues(correspondingContact, o.correspondingContact, true) && compareValues(rankingOrder, o.rankingOrder, true)
7772          ;
7773      }
7774
7775      public boolean isEmpty() {
7776        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, initials, collectiveName
7777          , identifier, affiliationInfo, address, telecom, contributionType, role, contributionInstance
7778          , correspondingContact, rankingOrder);
7779      }
7780
7781  public String fhirType() {
7782    return "Citation.citedArtifact.contributorship.entry";
7783
7784  }
7785
7786  }
7787
7788    @Block()
7789    public static class CitationCitedArtifactContributorshipEntryAffiliationInfoComponent extends BackboneElement implements IBaseBackboneElement {
7790        /**
7791         * Display for the organization.
7792         */
7793        @Child(name = "affiliation", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
7794        @Description(shortDefinition="Display for the organization", formalDefinition="Display for the organization." )
7795        protected StringType affiliation;
7796
7797        /**
7798         * Role within the organization, such as professional title.
7799         */
7800        @Child(name = "role", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
7801        @Description(shortDefinition="Role within the organization, such as professional title", formalDefinition="Role within the organization, such as professional title." )
7802        protected StringType role;
7803
7804        /**
7805         * Identifier for the organization.
7806         */
7807        @Child(name = "identifier", type = {Identifier.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7808        @Description(shortDefinition="Identifier for the organization", formalDefinition="Identifier for the organization." )
7809        protected List<Identifier> identifier;
7810
7811        private static final long serialVersionUID = 548335522L;
7812
7813    /**
7814     * Constructor
7815     */
7816      public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent() {
7817        super();
7818      }
7819
7820        /**
7821         * @return {@link #affiliation} (Display for the organization.). This is the underlying object with id, value and extensions. The accessor "getAffiliation" gives direct access to the value
7822         */
7823        public StringType getAffiliationElement() { 
7824          if (this.affiliation == null)
7825            if (Configuration.errorOnAutoCreate())
7826              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryAffiliationInfoComponent.affiliation");
7827            else if (Configuration.doAutoCreate())
7828              this.affiliation = new StringType(); // bb
7829          return this.affiliation;
7830        }
7831
7832        public boolean hasAffiliationElement() { 
7833          return this.affiliation != null && !this.affiliation.isEmpty();
7834        }
7835
7836        public boolean hasAffiliation() { 
7837          return this.affiliation != null && !this.affiliation.isEmpty();
7838        }
7839
7840        /**
7841         * @param value {@link #affiliation} (Display for the organization.). This is the underlying object with id, value and extensions. The accessor "getAffiliation" gives direct access to the value
7842         */
7843        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent setAffiliationElement(StringType value) { 
7844          this.affiliation = value;
7845          return this;
7846        }
7847
7848        /**
7849         * @return Display for the organization.
7850         */
7851        public String getAffiliation() { 
7852          return this.affiliation == null ? null : this.affiliation.getValue();
7853        }
7854
7855        /**
7856         * @param value Display for the organization.
7857         */
7858        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent setAffiliation(String value) { 
7859          if (Utilities.noString(value))
7860            this.affiliation = null;
7861          else {
7862            if (this.affiliation == null)
7863              this.affiliation = new StringType();
7864            this.affiliation.setValue(value);
7865          }
7866          return this;
7867        }
7868
7869        /**
7870         * @return {@link #role} (Role within the organization, such as professional title.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value
7871         */
7872        public StringType getRoleElement() { 
7873          if (this.role == null)
7874            if (Configuration.errorOnAutoCreate())
7875              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryAffiliationInfoComponent.role");
7876            else if (Configuration.doAutoCreate())
7877              this.role = new StringType(); // bb
7878          return this.role;
7879        }
7880
7881        public boolean hasRoleElement() { 
7882          return this.role != null && !this.role.isEmpty();
7883        }
7884
7885        public boolean hasRole() { 
7886          return this.role != null && !this.role.isEmpty();
7887        }
7888
7889        /**
7890         * @param value {@link #role} (Role within the organization, such as professional title.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value
7891         */
7892        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent setRoleElement(StringType value) { 
7893          this.role = value;
7894          return this;
7895        }
7896
7897        /**
7898         * @return Role within the organization, such as professional title.
7899         */
7900        public String getRole() { 
7901          return this.role == null ? null : this.role.getValue();
7902        }
7903
7904        /**
7905         * @param value Role within the organization, such as professional title.
7906         */
7907        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent setRole(String value) { 
7908          if (Utilities.noString(value))
7909            this.role = null;
7910          else {
7911            if (this.role == null)
7912              this.role = new StringType();
7913            this.role.setValue(value);
7914          }
7915          return this;
7916        }
7917
7918        /**
7919         * @return {@link #identifier} (Identifier for the organization.)
7920         */
7921        public List<Identifier> getIdentifier() { 
7922          if (this.identifier == null)
7923            this.identifier = new ArrayList<Identifier>();
7924          return this.identifier;
7925        }
7926
7927        /**
7928         * @return Returns a reference to <code>this</code> for easy method chaining
7929         */
7930        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent setIdentifier(List<Identifier> theIdentifier) { 
7931          this.identifier = theIdentifier;
7932          return this;
7933        }
7934
7935        public boolean hasIdentifier() { 
7936          if (this.identifier == null)
7937            return false;
7938          for (Identifier item : this.identifier)
7939            if (!item.isEmpty())
7940              return true;
7941          return false;
7942        }
7943
7944        public Identifier addIdentifier() { //3
7945          Identifier t = new Identifier();
7946          if (this.identifier == null)
7947            this.identifier = new ArrayList<Identifier>();
7948          this.identifier.add(t);
7949          return t;
7950        }
7951
7952        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent addIdentifier(Identifier t) { //3
7953          if (t == null)
7954            return this;
7955          if (this.identifier == null)
7956            this.identifier = new ArrayList<Identifier>();
7957          this.identifier.add(t);
7958          return this;
7959        }
7960
7961        /**
7962         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
7963         */
7964        public Identifier getIdentifierFirstRep() { 
7965          if (getIdentifier().isEmpty()) {
7966            addIdentifier();
7967          }
7968          return getIdentifier().get(0);
7969        }
7970
7971        protected void listChildren(List<Property> children) {
7972          super.listChildren(children);
7973          children.add(new Property("affiliation", "string", "Display for the organization.", 0, 1, affiliation));
7974          children.add(new Property("role", "string", "Role within the organization, such as professional title.", 0, 1, role));
7975          children.add(new Property("identifier", "Identifier", "Identifier for the organization.", 0, java.lang.Integer.MAX_VALUE, identifier));
7976        }
7977
7978        @Override
7979        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7980          switch (_hash) {
7981          case 2019918576: /*affiliation*/  return new Property("affiliation", "string", "Display for the organization.", 0, 1, affiliation);
7982          case 3506294: /*role*/  return new Property("role", "string", "Role within the organization, such as professional title.", 0, 1, role);
7983          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifier for the organization.", 0, java.lang.Integer.MAX_VALUE, identifier);
7984          default: return super.getNamedProperty(_hash, _name, _checkValid);
7985          }
7986
7987        }
7988
7989      @Override
7990      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7991        switch (hash) {
7992        case 2019918576: /*affiliation*/ return this.affiliation == null ? new Base[0] : new Base[] {this.affiliation}; // StringType
7993        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // StringType
7994        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
7995        default: return super.getProperty(hash, name, checkValid);
7996        }
7997
7998      }
7999
8000      @Override
8001      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8002        switch (hash) {
8003        case 2019918576: // affiliation
8004          this.affiliation = TypeConvertor.castToString(value); // StringType
8005          return value;
8006        case 3506294: // role
8007          this.role = TypeConvertor.castToString(value); // StringType
8008          return value;
8009        case -1618432855: // identifier
8010          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
8011          return value;
8012        default: return super.setProperty(hash, name, value);
8013        }
8014
8015      }
8016
8017      @Override
8018      public Base setProperty(String name, Base value) throws FHIRException {
8019        if (name.equals("affiliation")) {
8020          this.affiliation = TypeConvertor.castToString(value); // StringType
8021        } else if (name.equals("role")) {
8022          this.role = TypeConvertor.castToString(value); // StringType
8023        } else if (name.equals("identifier")) {
8024          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
8025        } else
8026          return super.setProperty(name, value);
8027        return value;
8028      }
8029
8030      @Override
8031      public Base makeProperty(int hash, String name) throws FHIRException {
8032        switch (hash) {
8033        case 2019918576:  return getAffiliationElement();
8034        case 3506294:  return getRoleElement();
8035        case -1618432855:  return addIdentifier(); 
8036        default: return super.makeProperty(hash, name);
8037        }
8038
8039      }
8040
8041      @Override
8042      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8043        switch (hash) {
8044        case 2019918576: /*affiliation*/ return new String[] {"string"};
8045        case 3506294: /*role*/ return new String[] {"string"};
8046        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
8047        default: return super.getTypesForProperty(hash, name);
8048        }
8049
8050      }
8051
8052      @Override
8053      public Base addChild(String name) throws FHIRException {
8054        if (name.equals("affiliation")) {
8055          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.affiliationInfo.affiliation");
8056        }
8057        else if (name.equals("role")) {
8058          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.affiliationInfo.role");
8059        }
8060        else if (name.equals("identifier")) {
8061          return addIdentifier();
8062        }
8063        else
8064          return super.addChild(name);
8065      }
8066
8067      public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent copy() {
8068        CitationCitedArtifactContributorshipEntryAffiliationInfoComponent dst = new CitationCitedArtifactContributorshipEntryAffiliationInfoComponent();
8069        copyValues(dst);
8070        return dst;
8071      }
8072
8073      public void copyValues(CitationCitedArtifactContributorshipEntryAffiliationInfoComponent dst) {
8074        super.copyValues(dst);
8075        dst.affiliation = affiliation == null ? null : affiliation.copy();
8076        dst.role = role == null ? null : role.copy();
8077        if (identifier != null) {
8078          dst.identifier = new ArrayList<Identifier>();
8079          for (Identifier i : identifier)
8080            dst.identifier.add(i.copy());
8081        };
8082      }
8083
8084      @Override
8085      public boolean equalsDeep(Base other_) {
8086        if (!super.equalsDeep(other_))
8087          return false;
8088        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryAffiliationInfoComponent))
8089          return false;
8090        CitationCitedArtifactContributorshipEntryAffiliationInfoComponent o = (CitationCitedArtifactContributorshipEntryAffiliationInfoComponent) other_;
8091        return compareDeep(affiliation, o.affiliation, true) && compareDeep(role, o.role, true) && compareDeep(identifier, o.identifier, true)
8092          ;
8093      }
8094
8095      @Override
8096      public boolean equalsShallow(Base other_) {
8097        if (!super.equalsShallow(other_))
8098          return false;
8099        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryAffiliationInfoComponent))
8100          return false;
8101        CitationCitedArtifactContributorshipEntryAffiliationInfoComponent o = (CitationCitedArtifactContributorshipEntryAffiliationInfoComponent) other_;
8102        return compareValues(affiliation, o.affiliation, true) && compareValues(role, o.role, true);
8103      }
8104
8105      public boolean isEmpty() {
8106        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(affiliation, role, identifier
8107          );
8108      }
8109
8110  public String fhirType() {
8111    return "Citation.citedArtifact.contributorship.entry.affiliationInfo";
8112
8113  }
8114
8115  }
8116
8117    @Block()
8118    public static class CitationCitedArtifactContributorshipEntryContributionInstanceComponent extends BackboneElement implements IBaseBackboneElement {
8119        /**
8120         * The specific contribution.
8121         */
8122        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
8123        @Description(shortDefinition="The specific contribution", formalDefinition="The specific contribution." )
8124        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/artifact-contribution-instance-type")
8125        protected CodeableConcept type;
8126
8127        /**
8128         * The time that the contribution was made.
8129         */
8130        @Child(name = "time", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
8131        @Description(shortDefinition="The time that the contribution was made", formalDefinition="The time that the contribution was made." )
8132        protected DateTimeType time;
8133
8134        private static final long serialVersionUID = -196837729L;
8135
8136    /**
8137     * Constructor
8138     */
8139      public CitationCitedArtifactContributorshipEntryContributionInstanceComponent() {
8140        super();
8141      }
8142
8143    /**
8144     * Constructor
8145     */
8146      public CitationCitedArtifactContributorshipEntryContributionInstanceComponent(CodeableConcept type) {
8147        super();
8148        this.setType(type);
8149      }
8150
8151        /**
8152         * @return {@link #type} (The specific contribution.)
8153         */
8154        public CodeableConcept getType() { 
8155          if (this.type == null)
8156            if (Configuration.errorOnAutoCreate())
8157              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryContributionInstanceComponent.type");
8158            else if (Configuration.doAutoCreate())
8159              this.type = new CodeableConcept(); // cc
8160          return this.type;
8161        }
8162
8163        public boolean hasType() { 
8164          return this.type != null && !this.type.isEmpty();
8165        }
8166
8167        /**
8168         * @param value {@link #type} (The specific contribution.)
8169         */
8170        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent setType(CodeableConcept value) { 
8171          this.type = value;
8172          return this;
8173        }
8174
8175        /**
8176         * @return {@link #time} (The time that the contribution was made.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value
8177         */
8178        public DateTimeType getTimeElement() { 
8179          if (this.time == null)
8180            if (Configuration.errorOnAutoCreate())
8181              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryContributionInstanceComponent.time");
8182            else if (Configuration.doAutoCreate())
8183              this.time = new DateTimeType(); // bb
8184          return this.time;
8185        }
8186
8187        public boolean hasTimeElement() { 
8188          return this.time != null && !this.time.isEmpty();
8189        }
8190
8191        public boolean hasTime() { 
8192          return this.time != null && !this.time.isEmpty();
8193        }
8194
8195        /**
8196         * @param value {@link #time} (The time that the contribution was made.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value
8197         */
8198        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent setTimeElement(DateTimeType value) { 
8199          this.time = value;
8200          return this;
8201        }
8202
8203        /**
8204         * @return The time that the contribution was made.
8205         */
8206        public Date getTime() { 
8207          return this.time == null ? null : this.time.getValue();
8208        }
8209
8210        /**
8211         * @param value The time that the contribution was made.
8212         */
8213        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent setTime(Date value) { 
8214          if (value == null)
8215            this.time = null;
8216          else {
8217            if (this.time == null)
8218              this.time = new DateTimeType();
8219            this.time.setValue(value);
8220          }
8221          return this;
8222        }
8223
8224        protected void listChildren(List<Property> children) {
8225          super.listChildren(children);
8226          children.add(new Property("type", "CodeableConcept", "The specific contribution.", 0, 1, type));
8227          children.add(new Property("time", "dateTime", "The time that the contribution was made.", 0, 1, time));
8228        }
8229
8230        @Override
8231        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8232          switch (_hash) {
8233          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The specific contribution.", 0, 1, type);
8234          case 3560141: /*time*/  return new Property("time", "dateTime", "The time that the contribution was made.", 0, 1, time);
8235          default: return super.getNamedProperty(_hash, _name, _checkValid);
8236          }
8237
8238        }
8239
8240      @Override
8241      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8242        switch (hash) {
8243        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
8244        case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // DateTimeType
8245        default: return super.getProperty(hash, name, checkValid);
8246        }
8247
8248      }
8249
8250      @Override
8251      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8252        switch (hash) {
8253        case 3575610: // type
8254          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8255          return value;
8256        case 3560141: // time
8257          this.time = TypeConvertor.castToDateTime(value); // DateTimeType
8258          return value;
8259        default: return super.setProperty(hash, name, value);
8260        }
8261
8262      }
8263
8264      @Override
8265      public Base setProperty(String name, Base value) throws FHIRException {
8266        if (name.equals("type")) {
8267          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8268        } else if (name.equals("time")) {
8269          this.time = TypeConvertor.castToDateTime(value); // DateTimeType
8270        } else
8271          return super.setProperty(name, value);
8272        return value;
8273      }
8274
8275      @Override
8276      public Base makeProperty(int hash, String name) throws FHIRException {
8277        switch (hash) {
8278        case 3575610:  return getType();
8279        case 3560141:  return getTimeElement();
8280        default: return super.makeProperty(hash, name);
8281        }
8282
8283      }
8284
8285      @Override
8286      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8287        switch (hash) {
8288        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
8289        case 3560141: /*time*/ return new String[] {"dateTime"};
8290        default: return super.getTypesForProperty(hash, name);
8291        }
8292
8293      }
8294
8295      @Override
8296      public Base addChild(String name) throws FHIRException {
8297        if (name.equals("type")) {
8298          this.type = new CodeableConcept();
8299          return this.type;
8300        }
8301        else if (name.equals("time")) {
8302          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.contributionInstance.time");
8303        }
8304        else
8305          return super.addChild(name);
8306      }
8307
8308      public CitationCitedArtifactContributorshipEntryContributionInstanceComponent copy() {
8309        CitationCitedArtifactContributorshipEntryContributionInstanceComponent dst = new CitationCitedArtifactContributorshipEntryContributionInstanceComponent();
8310        copyValues(dst);
8311        return dst;
8312      }
8313
8314      public void copyValues(CitationCitedArtifactContributorshipEntryContributionInstanceComponent dst) {
8315        super.copyValues(dst);
8316        dst.type = type == null ? null : type.copy();
8317        dst.time = time == null ? null : time.copy();
8318      }
8319
8320      @Override
8321      public boolean equalsDeep(Base other_) {
8322        if (!super.equalsDeep(other_))
8323          return false;
8324        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryContributionInstanceComponent))
8325          return false;
8326        CitationCitedArtifactContributorshipEntryContributionInstanceComponent o = (CitationCitedArtifactContributorshipEntryContributionInstanceComponent) other_;
8327        return compareDeep(type, o.type, true) && compareDeep(time, o.time, true);
8328      }
8329
8330      @Override
8331      public boolean equalsShallow(Base other_) {
8332        if (!super.equalsShallow(other_))
8333          return false;
8334        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryContributionInstanceComponent))
8335          return false;
8336        CitationCitedArtifactContributorshipEntryContributionInstanceComponent o = (CitationCitedArtifactContributorshipEntryContributionInstanceComponent) other_;
8337        return compareValues(time, o.time, true);
8338      }
8339
8340      public boolean isEmpty() {
8341        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, time);
8342      }
8343
8344  public String fhirType() {
8345    return "Citation.citedArtifact.contributorship.entry.contributionInstance";
8346
8347  }
8348
8349  }
8350
8351    @Block()
8352    public static class CitationCitedArtifactContributorshipSummaryComponent extends BackboneElement implements IBaseBackboneElement {
8353        /**
8354         * Used most commonly to express an author list or a contributorship statement.
8355         */
8356        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
8357        @Description(shortDefinition="Either authorList or contributorshipStatement", formalDefinition="Used most commonly to express an author list or a contributorship statement." )
8358        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contributor-summary-type")
8359        protected CodeableConcept type;
8360
8361        /**
8362         * The format for the display string.
8363         */
8364        @Child(name = "style", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
8365        @Description(shortDefinition="The format for the display string", formalDefinition="The format for the display string." )
8366        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contributor-summary-style")
8367        protected CodeableConcept style;
8368
8369        /**
8370         * Used to code the producer or rule for creating the display string.
8371         */
8372        @Child(name = "source", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
8373        @Description(shortDefinition="Used to code the producer or rule for creating the display string", formalDefinition="Used to code the producer or rule for creating the display string." )
8374        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contributor-summary-source")
8375        protected CodeableConcept source;
8376
8377        /**
8378         * The display string for the author list, contributor list, or contributorship statement.
8379         */
8380        @Child(name = "value", type = {MarkdownType.class}, order=4, min=1, max=1, modifier=false, summary=false)
8381        @Description(shortDefinition="The display string for the author list, contributor list, or contributorship statement", formalDefinition="The display string for the author list, contributor list, or contributorship statement." )
8382        protected MarkdownType value;
8383
8384        private static final long serialVersionUID = 1353383781L;
8385
8386    /**
8387     * Constructor
8388     */
8389      public CitationCitedArtifactContributorshipSummaryComponent() {
8390        super();
8391      }
8392
8393    /**
8394     * Constructor
8395     */
8396      public CitationCitedArtifactContributorshipSummaryComponent(String value) {
8397        super();
8398        this.setValue(value);
8399      }
8400
8401        /**
8402         * @return {@link #type} (Used most commonly to express an author list or a contributorship statement.)
8403         */
8404        public CodeableConcept getType() { 
8405          if (this.type == null)
8406            if (Configuration.errorOnAutoCreate())
8407              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipSummaryComponent.type");
8408            else if (Configuration.doAutoCreate())
8409              this.type = new CodeableConcept(); // cc
8410          return this.type;
8411        }
8412
8413        public boolean hasType() { 
8414          return this.type != null && !this.type.isEmpty();
8415        }
8416
8417        /**
8418         * @param value {@link #type} (Used most commonly to express an author list or a contributorship statement.)
8419         */
8420        public CitationCitedArtifactContributorshipSummaryComponent setType(CodeableConcept value) { 
8421          this.type = value;
8422          return this;
8423        }
8424
8425        /**
8426         * @return {@link #style} (The format for the display string.)
8427         */
8428        public CodeableConcept getStyle() { 
8429          if (this.style == null)
8430            if (Configuration.errorOnAutoCreate())
8431              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipSummaryComponent.style");
8432            else if (Configuration.doAutoCreate())
8433              this.style = new CodeableConcept(); // cc
8434          return this.style;
8435        }
8436
8437        public boolean hasStyle() { 
8438          return this.style != null && !this.style.isEmpty();
8439        }
8440
8441        /**
8442         * @param value {@link #style} (The format for the display string.)
8443         */
8444        public CitationCitedArtifactContributorshipSummaryComponent setStyle(CodeableConcept value) { 
8445          this.style = value;
8446          return this;
8447        }
8448
8449        /**
8450         * @return {@link #source} (Used to code the producer or rule for creating the display string.)
8451         */
8452        public CodeableConcept getSource() { 
8453          if (this.source == null)
8454            if (Configuration.errorOnAutoCreate())
8455              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipSummaryComponent.source");
8456            else if (Configuration.doAutoCreate())
8457              this.source = new CodeableConcept(); // cc
8458          return this.source;
8459        }
8460
8461        public boolean hasSource() { 
8462          return this.source != null && !this.source.isEmpty();
8463        }
8464
8465        /**
8466         * @param value {@link #source} (Used to code the producer or rule for creating the display string.)
8467         */
8468        public CitationCitedArtifactContributorshipSummaryComponent setSource(CodeableConcept value) { 
8469          this.source = value;
8470          return this;
8471        }
8472
8473        /**
8474         * @return {@link #value} (The display string for the author list, contributor list, or contributorship statement.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
8475         */
8476        public MarkdownType getValueElement() { 
8477          if (this.value == null)
8478            if (Configuration.errorOnAutoCreate())
8479              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipSummaryComponent.value");
8480            else if (Configuration.doAutoCreate())
8481              this.value = new MarkdownType(); // bb
8482          return this.value;
8483        }
8484
8485        public boolean hasValueElement() { 
8486          return this.value != null && !this.value.isEmpty();
8487        }
8488
8489        public boolean hasValue() { 
8490          return this.value != null && !this.value.isEmpty();
8491        }
8492
8493        /**
8494         * @param value {@link #value} (The display string for the author list, contributor list, or contributorship statement.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
8495         */
8496        public CitationCitedArtifactContributorshipSummaryComponent setValueElement(MarkdownType value) { 
8497          this.value = value;
8498          return this;
8499        }
8500
8501        /**
8502         * @return The display string for the author list, contributor list, or contributorship statement.
8503         */
8504        public String getValue() { 
8505          return this.value == null ? null : this.value.getValue();
8506        }
8507
8508        /**
8509         * @param value The display string for the author list, contributor list, or contributorship statement.
8510         */
8511        public CitationCitedArtifactContributorshipSummaryComponent setValue(String value) { 
8512            if (this.value == null)
8513              this.value = new MarkdownType();
8514            this.value.setValue(value);
8515          return this;
8516        }
8517
8518        protected void listChildren(List<Property> children) {
8519          super.listChildren(children);
8520          children.add(new Property("type", "CodeableConcept", "Used most commonly to express an author list or a contributorship statement.", 0, 1, type));
8521          children.add(new Property("style", "CodeableConcept", "The format for the display string.", 0, 1, style));
8522          children.add(new Property("source", "CodeableConcept", "Used to code the producer or rule for creating the display string.", 0, 1, source));
8523          children.add(new Property("value", "markdown", "The display string for the author list, contributor list, or contributorship statement.", 0, 1, value));
8524        }
8525
8526        @Override
8527        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8528          switch (_hash) {
8529          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Used most commonly to express an author list or a contributorship statement.", 0, 1, type);
8530          case 109780401: /*style*/  return new Property("style", "CodeableConcept", "The format for the display string.", 0, 1, style);
8531          case -896505829: /*source*/  return new Property("source", "CodeableConcept", "Used to code the producer or rule for creating the display string.", 0, 1, source);
8532          case 111972721: /*value*/  return new Property("value", "markdown", "The display string for the author list, contributor list, or contributorship statement.", 0, 1, value);
8533          default: return super.getNamedProperty(_hash, _name, _checkValid);
8534          }
8535
8536        }
8537
8538      @Override
8539      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8540        switch (hash) {
8541        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
8542        case 109780401: /*style*/ return this.style == null ? new Base[0] : new Base[] {this.style}; // CodeableConcept
8543        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // CodeableConcept
8544        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // MarkdownType
8545        default: return super.getProperty(hash, name, checkValid);
8546        }
8547
8548      }
8549
8550      @Override
8551      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8552        switch (hash) {
8553        case 3575610: // type
8554          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8555          return value;
8556        case 109780401: // style
8557          this.style = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8558          return value;
8559        case -896505829: // source
8560          this.source = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8561          return value;
8562        case 111972721: // value
8563          this.value = TypeConvertor.castToMarkdown(value); // MarkdownType
8564          return value;
8565        default: return super.setProperty(hash, name, value);
8566        }
8567
8568      }
8569
8570      @Override
8571      public Base setProperty(String name, Base value) throws FHIRException {
8572        if (name.equals("type")) {
8573          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8574        } else if (name.equals("style")) {
8575          this.style = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8576        } else if (name.equals("source")) {
8577          this.source = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8578        } else if (name.equals("value")) {
8579          this.value = TypeConvertor.castToMarkdown(value); // MarkdownType
8580        } else
8581          return super.setProperty(name, value);
8582        return value;
8583      }
8584
8585      @Override
8586      public Base makeProperty(int hash, String name) throws FHIRException {
8587        switch (hash) {
8588        case 3575610:  return getType();
8589        case 109780401:  return getStyle();
8590        case -896505829:  return getSource();
8591        case 111972721:  return getValueElement();
8592        default: return super.makeProperty(hash, name);
8593        }
8594
8595      }
8596
8597      @Override
8598      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8599        switch (hash) {
8600        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
8601        case 109780401: /*style*/ return new String[] {"CodeableConcept"};
8602        case -896505829: /*source*/ return new String[] {"CodeableConcept"};
8603        case 111972721: /*value*/ return new String[] {"markdown"};
8604        default: return super.getTypesForProperty(hash, name);
8605        }
8606
8607      }
8608
8609      @Override
8610      public Base addChild(String name) throws FHIRException {
8611        if (name.equals("type")) {
8612          this.type = new CodeableConcept();
8613          return this.type;
8614        }
8615        else if (name.equals("style")) {
8616          this.style = new CodeableConcept();
8617          return this.style;
8618        }
8619        else if (name.equals("source")) {
8620          this.source = new CodeableConcept();
8621          return this.source;
8622        }
8623        else if (name.equals("value")) {
8624          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.summary.value");
8625        }
8626        else
8627          return super.addChild(name);
8628      }
8629
8630      public CitationCitedArtifactContributorshipSummaryComponent copy() {
8631        CitationCitedArtifactContributorshipSummaryComponent dst = new CitationCitedArtifactContributorshipSummaryComponent();
8632        copyValues(dst);
8633        return dst;
8634      }
8635
8636      public void copyValues(CitationCitedArtifactContributorshipSummaryComponent dst) {
8637        super.copyValues(dst);
8638        dst.type = type == null ? null : type.copy();
8639        dst.style = style == null ? null : style.copy();
8640        dst.source = source == null ? null : source.copy();
8641        dst.value = value == null ? null : value.copy();
8642      }
8643
8644      @Override
8645      public boolean equalsDeep(Base other_) {
8646        if (!super.equalsDeep(other_))
8647          return false;
8648        if (!(other_ instanceof CitationCitedArtifactContributorshipSummaryComponent))
8649          return false;
8650        CitationCitedArtifactContributorshipSummaryComponent o = (CitationCitedArtifactContributorshipSummaryComponent) other_;
8651        return compareDeep(type, o.type, true) && compareDeep(style, o.style, true) && compareDeep(source, o.source, true)
8652           && compareDeep(value, o.value, true);
8653      }
8654
8655      @Override
8656      public boolean equalsShallow(Base other_) {
8657        if (!super.equalsShallow(other_))
8658          return false;
8659        if (!(other_ instanceof CitationCitedArtifactContributorshipSummaryComponent))
8660          return false;
8661        CitationCitedArtifactContributorshipSummaryComponent o = (CitationCitedArtifactContributorshipSummaryComponent) other_;
8662        return compareValues(value, o.value, true);
8663      }
8664
8665      public boolean isEmpty() {
8666        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, style, source, value
8667          );
8668      }
8669
8670  public String fhirType() {
8671    return "Citation.citedArtifact.contributorship.summary";
8672
8673  }
8674
8675  }
8676
8677    /**
8678     * An absolute URI that is used to identify this citation when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers.
8679     */
8680    @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true)
8681    @Description(shortDefinition="Canonical identifier for this citation, represented as a globally unique URI", formalDefinition="An absolute URI that is used to identify this citation when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers." )
8682    protected UriType url;
8683
8684    /**
8685     * A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance.
8686     */
8687    @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
8688    @Description(shortDefinition="Identifier for the Citation resource itself", formalDefinition="A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance." )
8689    protected List<Identifier> identifier;
8690
8691    /**
8692     * The identifier that is used to identify this version of the citation when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the citation author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
8693     */
8694    @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
8695    @Description(shortDefinition="Business version of the citation", formalDefinition="The identifier that is used to identify this version of the citation when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the citation author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence." )
8696    protected StringType version;
8697
8698    /**
8699     * A natural language name identifying the citation. This name should be usable as an identifier for the module by machine processing applications such as code generation.
8700     */
8701    @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
8702    @Description(shortDefinition="Name for this citation (computer friendly)", formalDefinition="A natural language name identifying the citation. This name should be usable as an identifier for the module by machine processing applications such as code generation." )
8703    protected StringType name;
8704
8705    /**
8706     * A short, descriptive, user-friendly title for the citation.
8707     */
8708    @Child(name = "title", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
8709    @Description(shortDefinition="Name for this citation (human friendly)", formalDefinition="A short, descriptive, user-friendly title for the citation." )
8710    protected StringType title;
8711
8712    /**
8713     * The status of this summary. Enables tracking the life-cycle of the content.
8714     */
8715    @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true)
8716    @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The status of this summary. Enables tracking the life-cycle of the content." )
8717    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
8718    protected Enumeration<PublicationStatus> status;
8719
8720    /**
8721     * A Boolean value to indicate that this citation is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
8722     */
8723    @Child(name = "experimental", type = {BooleanType.class}, order=6, min=0, max=1, modifier=false, summary=true)
8724    @Description(shortDefinition="For testing purposes, not real usage", formalDefinition="A Boolean value to indicate that this citation is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage." )
8725    protected BooleanType experimental;
8726
8727    /**
8728     * The date  (and optionally time) when the citation was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the citation changes.
8729     */
8730    @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
8731    @Description(shortDefinition="Date last changed", formalDefinition="The date  (and optionally time) when the citation was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the citation changes." )
8732    protected DateTimeType date;
8733
8734    /**
8735     * The name of the organization or individual that published the citation.
8736     */
8737    @Child(name = "publisher", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true)
8738    @Description(shortDefinition="The publisher of the Citation, not the publisher of the article or artifact being cited", formalDefinition="The name of the organization or individual that published the citation." )
8739    protected StringType publisher;
8740
8741    /**
8742     * Contact details to assist a user in finding and communicating with the publisher.
8743     */
8744    @Child(name = "contact", type = {ContactDetail.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
8745    @Description(shortDefinition="Contact details for the publisher of the Citation Resource", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." )
8746    protected List<ContactDetail> contact;
8747
8748    /**
8749     * A free text natural language description of the citation from a consumer's perspective.
8750     */
8751    @Child(name = "description", type = {MarkdownType.class}, order=10, min=0, max=1, modifier=false, summary=false)
8752    @Description(shortDefinition="Natural language description of the citation", formalDefinition="A free text natural language description of the citation from a consumer's perspective." )
8753    protected MarkdownType description;
8754
8755    /**
8756     * The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate citation instances.
8757     */
8758    @Child(name = "useContext", type = {UsageContext.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
8759    @Description(shortDefinition="The context that the Citation Resource content is intended to support", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate citation instances." )
8760    protected List<UsageContext> useContext;
8761
8762    /**
8763     * A legal or geographic region in which the citation is intended to be used.
8764     */
8765    @Child(name = "jurisdiction", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
8766    @Description(shortDefinition="Intended jurisdiction for citation (if applicable)", formalDefinition="A legal or geographic region in which the citation is intended to be used." )
8767    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction")
8768    protected List<CodeableConcept> jurisdiction;
8769
8770    /**
8771     * Explanation of why this citation is needed and why it has been designed as it has.
8772     */
8773    @Child(name = "purpose", type = {MarkdownType.class}, order=13, min=0, max=1, modifier=false, summary=false)
8774    @Description(shortDefinition="Why this citation is defined", formalDefinition="Explanation of why this citation is needed and why it has been designed as it has." )
8775    protected MarkdownType purpose;
8776
8777    /**
8778     * Use and/or publishing restrictions for the Citation, not for the cited artifact.
8779     */
8780    @Child(name = "copyright", type = {MarkdownType.class}, order=14, min=0, max=1, modifier=false, summary=false)
8781    @Description(shortDefinition="Use and/or publishing restrictions for the Citation, not for the cited artifact", formalDefinition="Use and/or publishing restrictions for the Citation, not for the cited artifact." )
8782    protected MarkdownType copyright;
8783
8784    /**
8785     * The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
8786     */
8787    @Child(name = "approvalDate", type = {DateType.class}, order=15, min=0, max=1, modifier=false, summary=false)
8788    @Description(shortDefinition="When the citation was approved by publisher", formalDefinition="The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage." )
8789    protected DateType approvalDate;
8790
8791    /**
8792     * The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
8793     */
8794    @Child(name = "lastReviewDate", type = {DateType.class}, order=16, min=0, max=1, modifier=false, summary=false)
8795    @Description(shortDefinition="When the citation was last reviewed", formalDefinition="The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date." )
8796    protected DateType lastReviewDate;
8797
8798    /**
8799     * The period during which the citation content was or is planned to be in active use.
8800     */
8801    @Child(name = "effectivePeriod", type = {Period.class}, order=17, min=0, max=1, modifier=false, summary=true)
8802    @Description(shortDefinition="When the citation is expected to be used", formalDefinition="The period during which the citation content was or is planned to be in active use." )
8803    protected Period effectivePeriod;
8804
8805    /**
8806     * Who authored the Citation.
8807     */
8808    @Child(name = "author", type = {ContactDetail.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8809    @Description(shortDefinition="Who authored the Citation", formalDefinition="Who authored the Citation." )
8810    protected List<ContactDetail> author;
8811
8812    /**
8813     * Who edited the Citation.
8814     */
8815    @Child(name = "editor", type = {ContactDetail.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8816    @Description(shortDefinition="Who edited the Citation", formalDefinition="Who edited the Citation." )
8817    protected List<ContactDetail> editor;
8818
8819    /**
8820     * Who reviewed the Citation.
8821     */
8822    @Child(name = "reviewer", type = {ContactDetail.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8823    @Description(shortDefinition="Who reviewed the Citation", formalDefinition="Who reviewed the Citation." )
8824    protected List<ContactDetail> reviewer;
8825
8826    /**
8827     * Who endorsed the Citation.
8828     */
8829    @Child(name = "endorser", type = {ContactDetail.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8830    @Description(shortDefinition="Who endorsed the Citation", formalDefinition="Who endorsed the Citation." )
8831    protected List<ContactDetail> endorser;
8832
8833    /**
8834     * A human-readable display of the citation.
8835     */
8836    @Child(name = "summary", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8837    @Description(shortDefinition="A human-readable display of the citation", formalDefinition="A human-readable display of the citation." )
8838    protected List<CitationSummaryComponent> summary;
8839
8840    /**
8841     * The assignment to an organizing scheme.
8842     */
8843    @Child(name = "classification", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8844    @Description(shortDefinition="The assignment to an organizing scheme", formalDefinition="The assignment to an organizing scheme." )
8845    protected List<CitationClassificationComponent> classification;
8846
8847    /**
8848     * Used for general notes and annotations not coded elsewhere.
8849     */
8850    @Child(name = "note", type = {Annotation.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8851    @Description(shortDefinition="Used for general notes and annotations not coded elsewhere", formalDefinition="Used for general notes and annotations not coded elsewhere." )
8852    protected List<Annotation> note;
8853
8854    /**
8855     * The status of the citation.
8856     */
8857    @Child(name = "currentState", type = {CodeableConcept.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8858    @Description(shortDefinition="The status of the citation", formalDefinition="The status of the citation." )
8859    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-status-type")
8860    protected List<CodeableConcept> currentState;
8861
8862    /**
8863     * An effective date or period for a status of the citation.
8864     */
8865    @Child(name = "statusDate", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8866    @Description(shortDefinition="An effective date or period for a status of the citation", formalDefinition="An effective date or period for a status of the citation." )
8867    protected List<CitationStatusDateComponent> statusDate;
8868
8869    /**
8870     * Artifact related to the Citation Resource.
8871     */
8872    @Child(name = "relatedArtifact", type = {RelatedArtifact.class}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8873    @Description(shortDefinition="Artifact related to the Citation Resource", formalDefinition="Artifact related to the Citation Resource." )
8874    protected List<RelatedArtifact> relatedArtifact;
8875
8876    /**
8877     * The article or artifact being described.
8878     */
8879    @Child(name = "citedArtifact", type = {}, order=28, min=0, max=1, modifier=false, summary=false)
8880    @Description(shortDefinition="The article or artifact being described", formalDefinition="The article or artifact being described." )
8881    protected CitationCitedArtifactComponent citedArtifact;
8882
8883    private static final long serialVersionUID = 3140818L;
8884
8885  /**
8886   * Constructor
8887   */
8888    public Citation() {
8889      super();
8890    }
8891
8892  /**
8893   * Constructor
8894   */
8895    public Citation(PublicationStatus status) {
8896      super();
8897      this.setStatus(status);
8898    }
8899
8900    /**
8901     * @return {@link #url} (An absolute URI that is used to identify this citation when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
8902     */
8903    public UriType getUrlElement() { 
8904      if (this.url == null)
8905        if (Configuration.errorOnAutoCreate())
8906          throw new Error("Attempt to auto-create Citation.url");
8907        else if (Configuration.doAutoCreate())
8908          this.url = new UriType(); // bb
8909      return this.url;
8910    }
8911
8912    public boolean hasUrlElement() { 
8913      return this.url != null && !this.url.isEmpty();
8914    }
8915
8916    public boolean hasUrl() { 
8917      return this.url != null && !this.url.isEmpty();
8918    }
8919
8920    /**
8921     * @param value {@link #url} (An absolute URI that is used to identify this citation when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
8922     */
8923    public Citation setUrlElement(UriType value) { 
8924      this.url = value;
8925      return this;
8926    }
8927
8928    /**
8929     * @return An absolute URI that is used to identify this citation when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers.
8930     */
8931    public String getUrl() { 
8932      return this.url == null ? null : this.url.getValue();
8933    }
8934
8935    /**
8936     * @param value An absolute URI that is used to identify this citation when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers.
8937     */
8938    public Citation setUrl(String value) { 
8939      if (Utilities.noString(value))
8940        this.url = null;
8941      else {
8942        if (this.url == null)
8943          this.url = new UriType();
8944        this.url.setValue(value);
8945      }
8946      return this;
8947    }
8948
8949    /**
8950     * @return {@link #identifier} (A formal identifier that is used to identify this citation when it is represented in other formats, or referenced in a specification, model, design or an instance.)
8951     */
8952    public List<Identifier> getIdentifier() { 
8953      if (this.identifier == null)
8954        this.identifier = new ArrayList<Identifier>();
8955      return this.identifier;
8956    }
8957
8958    /**
8959     * @return Returns a reference to <code>this</code> for easy method chaining
8960     */
8961    public Citation setIdentifier(List<Identifier> theIdentifier) { 
8962      this.identifier = theIdentifier;
8963      return this;
8964    }
8965
8966    public boolean hasIdentifier() { 
8967      if (this.identifier == null)
8968        return false;
8969      for (Identifier item : this.identifier)
8970        if (!item.isEmpty())
8971          return true;
8972      return false;
8973    }
8974
8975    public Identifier addIdentifier() { //3
8976      Identifier t = new Identifier();
8977      if (this.identifier == null)
8978        this.identifier = new ArrayList<Identifier>();
8979      this.identifier.add(t);
8980      return t;
8981    }
8982
8983    public Citation addIdentifier(Identifier t) { //3
8984      if (t == null)
8985        return this;
8986      if (this.identifier == null)
8987        this.identifier = new ArrayList<Identifier>();
8988      this.identifier.add(t);
8989      return this;
8990    }
8991
8992    /**
8993     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
8994     */
8995    public Identifier getIdentifierFirstRep() { 
8996      if (getIdentifier().isEmpty()) {
8997        addIdentifier();
8998      }
8999      return getIdentifier().get(0);
9000    }
9001
9002    /**
9003     * @return {@link #version} (The identifier that is used to identify this version of the citation when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the citation author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
9004     */
9005    public StringType getVersionElement() { 
9006      if (this.version == null)
9007        if (Configuration.errorOnAutoCreate())
9008          throw new Error("Attempt to auto-create Citation.version");
9009        else if (Configuration.doAutoCreate())
9010          this.version = new StringType(); // bb
9011      return this.version;
9012    }
9013
9014    public boolean hasVersionElement() { 
9015      return this.version != null && !this.version.isEmpty();
9016    }
9017
9018    public boolean hasVersion() { 
9019      return this.version != null && !this.version.isEmpty();
9020    }
9021
9022    /**
9023     * @param value {@link #version} (The identifier that is used to identify this version of the citation when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the citation author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
9024     */
9025    public Citation setVersionElement(StringType value) { 
9026      this.version = value;
9027      return this;
9028    }
9029
9030    /**
9031     * @return The identifier that is used to identify this version of the citation when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the citation author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
9032     */
9033    public String getVersion() { 
9034      return this.version == null ? null : this.version.getValue();
9035    }
9036
9037    /**
9038     * @param value The identifier that is used to identify this version of the citation when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the citation author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
9039     */
9040    public Citation setVersion(String value) { 
9041      if (Utilities.noString(value))
9042        this.version = null;
9043      else {
9044        if (this.version == null)
9045          this.version = new StringType();
9046        this.version.setValue(value);
9047      }
9048      return this;
9049    }
9050
9051    /**
9052     * @return {@link #name} (A natural language name identifying the citation. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
9053     */
9054    public StringType getNameElement() { 
9055      if (this.name == null)
9056        if (Configuration.errorOnAutoCreate())
9057          throw new Error("Attempt to auto-create Citation.name");
9058        else if (Configuration.doAutoCreate())
9059          this.name = new StringType(); // bb
9060      return this.name;
9061    }
9062
9063    public boolean hasNameElement() { 
9064      return this.name != null && !this.name.isEmpty();
9065    }
9066
9067    public boolean hasName() { 
9068      return this.name != null && !this.name.isEmpty();
9069    }
9070
9071    /**
9072     * @param value {@link #name} (A natural language name identifying the citation. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
9073     */
9074    public Citation setNameElement(StringType value) { 
9075      this.name = value;
9076      return this;
9077    }
9078
9079    /**
9080     * @return A natural language name identifying the citation. This name should be usable as an identifier for the module by machine processing applications such as code generation.
9081     */
9082    public String getName() { 
9083      return this.name == null ? null : this.name.getValue();
9084    }
9085
9086    /**
9087     * @param value A natural language name identifying the citation. This name should be usable as an identifier for the module by machine processing applications such as code generation.
9088     */
9089    public Citation setName(String value) { 
9090      if (Utilities.noString(value))
9091        this.name = null;
9092      else {
9093        if (this.name == null)
9094          this.name = new StringType();
9095        this.name.setValue(value);
9096      }
9097      return this;
9098    }
9099
9100    /**
9101     * @return {@link #title} (A short, descriptive, user-friendly title for the citation.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
9102     */
9103    public StringType getTitleElement() { 
9104      if (this.title == null)
9105        if (Configuration.errorOnAutoCreate())
9106          throw new Error("Attempt to auto-create Citation.title");
9107        else if (Configuration.doAutoCreate())
9108          this.title = new StringType(); // bb
9109      return this.title;
9110    }
9111
9112    public boolean hasTitleElement() { 
9113      return this.title != null && !this.title.isEmpty();
9114    }
9115
9116    public boolean hasTitle() { 
9117      return this.title != null && !this.title.isEmpty();
9118    }
9119
9120    /**
9121     * @param value {@link #title} (A short, descriptive, user-friendly title for the citation.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
9122     */
9123    public Citation setTitleElement(StringType value) { 
9124      this.title = value;
9125      return this;
9126    }
9127
9128    /**
9129     * @return A short, descriptive, user-friendly title for the citation.
9130     */
9131    public String getTitle() { 
9132      return this.title == null ? null : this.title.getValue();
9133    }
9134
9135    /**
9136     * @param value A short, descriptive, user-friendly title for the citation.
9137     */
9138    public Citation setTitle(String value) { 
9139      if (Utilities.noString(value))
9140        this.title = null;
9141      else {
9142        if (this.title == null)
9143          this.title = new StringType();
9144        this.title.setValue(value);
9145      }
9146      return this;
9147    }
9148
9149    /**
9150     * @return {@link #status} (The status of this summary. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
9151     */
9152    public Enumeration<PublicationStatus> getStatusElement() { 
9153      if (this.status == null)
9154        if (Configuration.errorOnAutoCreate())
9155          throw new Error("Attempt to auto-create Citation.status");
9156        else if (Configuration.doAutoCreate())
9157          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
9158      return this.status;
9159    }
9160
9161    public boolean hasStatusElement() { 
9162      return this.status != null && !this.status.isEmpty();
9163    }
9164
9165    public boolean hasStatus() { 
9166      return this.status != null && !this.status.isEmpty();
9167    }
9168
9169    /**
9170     * @param value {@link #status} (The status of this summary. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
9171     */
9172    public Citation setStatusElement(Enumeration<PublicationStatus> value) { 
9173      this.status = value;
9174      return this;
9175    }
9176
9177    /**
9178     * @return The status of this summary. Enables tracking the life-cycle of the content.
9179     */
9180    public PublicationStatus getStatus() { 
9181      return this.status == null ? null : this.status.getValue();
9182    }
9183
9184    /**
9185     * @param value The status of this summary. Enables tracking the life-cycle of the content.
9186     */
9187    public Citation setStatus(PublicationStatus value) { 
9188        if (this.status == null)
9189          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
9190        this.status.setValue(value);
9191      return this;
9192    }
9193
9194    /**
9195     * @return {@link #experimental} (A Boolean value to indicate that this citation is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
9196     */
9197    public BooleanType getExperimentalElement() { 
9198      if (this.experimental == null)
9199        if (Configuration.errorOnAutoCreate())
9200          throw new Error("Attempt to auto-create Citation.experimental");
9201        else if (Configuration.doAutoCreate())
9202          this.experimental = new BooleanType(); // bb
9203      return this.experimental;
9204    }
9205
9206    public boolean hasExperimentalElement() { 
9207      return this.experimental != null && !this.experimental.isEmpty();
9208    }
9209
9210    public boolean hasExperimental() { 
9211      return this.experimental != null && !this.experimental.isEmpty();
9212    }
9213
9214    /**
9215     * @param value {@link #experimental} (A Boolean value to indicate that this citation is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
9216     */
9217    public Citation setExperimentalElement(BooleanType value) { 
9218      this.experimental = value;
9219      return this;
9220    }
9221
9222    /**
9223     * @return A Boolean value to indicate that this citation is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
9224     */
9225    public boolean getExperimental() { 
9226      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
9227    }
9228
9229    /**
9230     * @param value A Boolean value to indicate that this citation is authored for testing purposes (or education/evaluation/marketi