001package org.hl7.fhir.r4b.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Fri, Dec 31, 2021 05:58+1100 for FHIR v4.3.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r4b.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * 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 DomainResource {
055
056    @Block()
057    public static class CitationClassificationComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * The kind of classifier (e.g. publication type, keyword).
060         */
061        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
062        @Description(shortDefinition="The kind of classifier (e.g. publication type, keyword)", formalDefinition="The kind of classifier (e.g. publication type, keyword)." )
063        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-classification-type")
064        protected CodeableConcept type;
065
066        /**
067         * The specific classification value.
068         */
069        @Child(name = "classifier", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
070        @Description(shortDefinition="The specific classification value", formalDefinition="The specific classification value." )
071        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-artifact-classifier")
072        protected List<CodeableConcept> classifier;
073
074        private static final long serialVersionUID = -283121869L;
075
076    /**
077     * Constructor
078     */
079      public CitationClassificationComponent() {
080        super();
081      }
082
083        /**
084         * @return {@link #type} (The kind of classifier (e.g. publication type, keyword).)
085         */
086        public CodeableConcept getType() { 
087          if (this.type == null)
088            if (Configuration.errorOnAutoCreate())
089              throw new Error("Attempt to auto-create CitationClassificationComponent.type");
090            else if (Configuration.doAutoCreate())
091              this.type = new CodeableConcept(); // cc
092          return this.type;
093        }
094
095        public boolean hasType() { 
096          return this.type != null && !this.type.isEmpty();
097        }
098
099        /**
100         * @param value {@link #type} (The kind of classifier (e.g. publication type, keyword).)
101         */
102        public CitationClassificationComponent setType(CodeableConcept value) { 
103          this.type = value;
104          return this;
105        }
106
107        /**
108         * @return {@link #classifier} (The specific classification value.)
109         */
110        public List<CodeableConcept> getClassifier() { 
111          if (this.classifier == null)
112            this.classifier = new ArrayList<CodeableConcept>();
113          return this.classifier;
114        }
115
116        /**
117         * @return Returns a reference to <code>this</code> for easy method chaining
118         */
119        public CitationClassificationComponent setClassifier(List<CodeableConcept> theClassifier) { 
120          this.classifier = theClassifier;
121          return this;
122        }
123
124        public boolean hasClassifier() { 
125          if (this.classifier == null)
126            return false;
127          for (CodeableConcept item : this.classifier)
128            if (!item.isEmpty())
129              return true;
130          return false;
131        }
132
133        public CodeableConcept addClassifier() { //3
134          CodeableConcept t = new CodeableConcept();
135          if (this.classifier == null)
136            this.classifier = new ArrayList<CodeableConcept>();
137          this.classifier.add(t);
138          return t;
139        }
140
141        public CitationClassificationComponent addClassifier(CodeableConcept t) { //3
142          if (t == null)
143            return this;
144          if (this.classifier == null)
145            this.classifier = new ArrayList<CodeableConcept>();
146          this.classifier.add(t);
147          return this;
148        }
149
150        /**
151         * @return The first repetition of repeating field {@link #classifier}, creating it if it does not already exist {3}
152         */
153        public CodeableConcept getClassifierFirstRep() { 
154          if (getClassifier().isEmpty()) {
155            addClassifier();
156          }
157          return getClassifier().get(0);
158        }
159
160        protected void listChildren(List<Property> children) {
161          super.listChildren(children);
162          children.add(new Property("type", "CodeableConcept", "The kind of classifier (e.g. publication type, keyword).", 0, 1, type));
163          children.add(new Property("classifier", "CodeableConcept", "The specific classification value.", 0, java.lang.Integer.MAX_VALUE, classifier));
164        }
165
166        @Override
167        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
168          switch (_hash) {
169          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of classifier (e.g. publication type, keyword).", 0, 1, type);
170          case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "The specific classification value.", 0, java.lang.Integer.MAX_VALUE, classifier);
171          default: return super.getNamedProperty(_hash, _name, _checkValid);
172          }
173
174        }
175
176      @Override
177      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
178        switch (hash) {
179        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
180        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : this.classifier.toArray(new Base[this.classifier.size()]); // CodeableConcept
181        default: return super.getProperty(hash, name, checkValid);
182        }
183
184      }
185
186      @Override
187      public Base setProperty(int hash, String name, Base value) throws FHIRException {
188        switch (hash) {
189        case 3575610: // type
190          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
191          return value;
192        case -281470431: // classifier
193          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
194          return value;
195        default: return super.setProperty(hash, name, value);
196        }
197
198      }
199
200      @Override
201      public Base setProperty(String name, Base value) throws FHIRException {
202        if (name.equals("type")) {
203          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
204        } else if (name.equals("classifier")) {
205          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value));
206        } else
207          return super.setProperty(name, value);
208        return value;
209      }
210
211      @Override
212      public Base makeProperty(int hash, String name) throws FHIRException {
213        switch (hash) {
214        case 3575610:  return getType();
215        case -281470431:  return addClassifier(); 
216        default: return super.makeProperty(hash, name);
217        }
218
219      }
220
221      @Override
222      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
223        switch (hash) {
224        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
225        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
226        default: return super.getTypesForProperty(hash, name);
227        }
228
229      }
230
231      @Override
232      public Base addChild(String name) throws FHIRException {
233        if (name.equals("type")) {
234          this.type = new CodeableConcept();
235          return this.type;
236        }
237        else if (name.equals("classifier")) {
238          return addClassifier();
239        }
240        else
241          return super.addChild(name);
242      }
243
244      public CitationClassificationComponent copy() {
245        CitationClassificationComponent dst = new CitationClassificationComponent();
246        copyValues(dst);
247        return dst;
248      }
249
250      public void copyValues(CitationClassificationComponent dst) {
251        super.copyValues(dst);
252        dst.type = type == null ? null : type.copy();
253        if (classifier != null) {
254          dst.classifier = new ArrayList<CodeableConcept>();
255          for (CodeableConcept i : classifier)
256            dst.classifier.add(i.copy());
257        };
258      }
259
260      @Override
261      public boolean equalsDeep(Base other_) {
262        if (!super.equalsDeep(other_))
263          return false;
264        if (!(other_ instanceof CitationClassificationComponent))
265          return false;
266        CitationClassificationComponent o = (CitationClassificationComponent) other_;
267        return compareDeep(type, o.type, true) && compareDeep(classifier, o.classifier, true);
268      }
269
270      @Override
271      public boolean equalsShallow(Base other_) {
272        if (!super.equalsShallow(other_))
273          return false;
274        if (!(other_ instanceof CitationClassificationComponent))
275          return false;
276        CitationClassificationComponent o = (CitationClassificationComponent) other_;
277        return true;
278      }
279
280      public boolean isEmpty() {
281        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, classifier);
282      }
283
284  public String fhirType() {
285    return "Citation.classification";
286
287  }
288
289  }
290
291    @Block()
292    public static class CitationStatusDateComponent extends BackboneElement implements IBaseBackboneElement {
293        /**
294         * Classification of the status.
295         */
296        @Child(name = "activity", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
297        @Description(shortDefinition="Classification of the status", formalDefinition="Classification of the status." )
298        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-status-type")
299        protected CodeableConcept activity;
300
301        /**
302         * Either occurred or expected.
303         */
304        @Child(name = "actual", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
305        @Description(shortDefinition="Either occurred or expected", formalDefinition="Either occurred or expected." )
306        protected BooleanType actual;
307
308        /**
309         * When the status started and/or ended.
310         */
311        @Child(name = "period", type = {Period.class}, order=3, min=1, max=1, modifier=false, summary=false)
312        @Description(shortDefinition="When the status started and/or ended", formalDefinition="When the status started and/or ended." )
313        protected Period period;
314
315        private static final long serialVersionUID = 1123586924L;
316
317    /**
318     * Constructor
319     */
320      public CitationStatusDateComponent() {
321        super();
322      }
323
324    /**
325     * Constructor
326     */
327      public CitationStatusDateComponent(CodeableConcept activity, Period period) {
328        super();
329        this.setActivity(activity);
330        this.setPeriod(period);
331      }
332
333        /**
334         * @return {@link #activity} (Classification of the status.)
335         */
336        public CodeableConcept getActivity() { 
337          if (this.activity == null)
338            if (Configuration.errorOnAutoCreate())
339              throw new Error("Attempt to auto-create CitationStatusDateComponent.activity");
340            else if (Configuration.doAutoCreate())
341              this.activity = new CodeableConcept(); // cc
342          return this.activity;
343        }
344
345        public boolean hasActivity() { 
346          return this.activity != null && !this.activity.isEmpty();
347        }
348
349        /**
350         * @param value {@link #activity} (Classification of the status.)
351         */
352        public CitationStatusDateComponent setActivity(CodeableConcept value) { 
353          this.activity = value;
354          return this;
355        }
356
357        /**
358         * @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
359         */
360        public BooleanType getActualElement() { 
361          if (this.actual == null)
362            if (Configuration.errorOnAutoCreate())
363              throw new Error("Attempt to auto-create CitationStatusDateComponent.actual");
364            else if (Configuration.doAutoCreate())
365              this.actual = new BooleanType(); // bb
366          return this.actual;
367        }
368
369        public boolean hasActualElement() { 
370          return this.actual != null && !this.actual.isEmpty();
371        }
372
373        public boolean hasActual() { 
374          return this.actual != null && !this.actual.isEmpty();
375        }
376
377        /**
378         * @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
379         */
380        public CitationStatusDateComponent setActualElement(BooleanType value) { 
381          this.actual = value;
382          return this;
383        }
384
385        /**
386         * @return Either occurred or expected.
387         */
388        public boolean getActual() { 
389          return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue();
390        }
391
392        /**
393         * @param value Either occurred or expected.
394         */
395        public CitationStatusDateComponent setActual(boolean value) { 
396            if (this.actual == null)
397              this.actual = new BooleanType();
398            this.actual.setValue(value);
399          return this;
400        }
401
402        /**
403         * @return {@link #period} (When the status started and/or ended.)
404         */
405        public Period getPeriod() { 
406          if (this.period == null)
407            if (Configuration.errorOnAutoCreate())
408              throw new Error("Attempt to auto-create CitationStatusDateComponent.period");
409            else if (Configuration.doAutoCreate())
410              this.period = new Period(); // cc
411          return this.period;
412        }
413
414        public boolean hasPeriod() { 
415          return this.period != null && !this.period.isEmpty();
416        }
417
418        /**
419         * @param value {@link #period} (When the status started and/or ended.)
420         */
421        public CitationStatusDateComponent setPeriod(Period value) { 
422          this.period = value;
423          return this;
424        }
425
426        protected void listChildren(List<Property> children) {
427          super.listChildren(children);
428          children.add(new Property("activity", "CodeableConcept", "Classification of the status.", 0, 1, activity));
429          children.add(new Property("actual", "boolean", "Either occurred or expected.", 0, 1, actual));
430          children.add(new Property("period", "Period", "When the status started and/or ended.", 0, 1, period));
431        }
432
433        @Override
434        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
435          switch (_hash) {
436          case -1655966961: /*activity*/  return new Property("activity", "CodeableConcept", "Classification of the status.", 0, 1, activity);
437          case -1422939762: /*actual*/  return new Property("actual", "boolean", "Either occurred or expected.", 0, 1, actual);
438          case -991726143: /*period*/  return new Property("period", "Period", "When the status started and/or ended.", 0, 1, period);
439          default: return super.getNamedProperty(_hash, _name, _checkValid);
440          }
441
442        }
443
444      @Override
445      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
446        switch (hash) {
447        case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : new Base[] {this.activity}; // CodeableConcept
448        case -1422939762: /*actual*/ return this.actual == null ? new Base[0] : new Base[] {this.actual}; // BooleanType
449        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
450        default: return super.getProperty(hash, name, checkValid);
451        }
452
453      }
454
455      @Override
456      public Base setProperty(int hash, String name, Base value) throws FHIRException {
457        switch (hash) {
458        case -1655966961: // activity
459          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
460          return value;
461        case -1422939762: // actual
462          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
463          return value;
464        case -991726143: // period
465          this.period = TypeConvertor.castToPeriod(value); // Period
466          return value;
467        default: return super.setProperty(hash, name, value);
468        }
469
470      }
471
472      @Override
473      public Base setProperty(String name, Base value) throws FHIRException {
474        if (name.equals("activity")) {
475          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
476        } else if (name.equals("actual")) {
477          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
478        } else if (name.equals("period")) {
479          this.period = TypeConvertor.castToPeriod(value); // Period
480        } else
481          return super.setProperty(name, value);
482        return value;
483      }
484
485      @Override
486      public Base makeProperty(int hash, String name) throws FHIRException {
487        switch (hash) {
488        case -1655966961:  return getActivity();
489        case -1422939762:  return getActualElement();
490        case -991726143:  return getPeriod();
491        default: return super.makeProperty(hash, name);
492        }
493
494      }
495
496      @Override
497      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
498        switch (hash) {
499        case -1655966961: /*activity*/ return new String[] {"CodeableConcept"};
500        case -1422939762: /*actual*/ return new String[] {"boolean"};
501        case -991726143: /*period*/ return new String[] {"Period"};
502        default: return super.getTypesForProperty(hash, name);
503        }
504
505      }
506
507      @Override
508      public Base addChild(String name) throws FHIRException {
509        if (name.equals("activity")) {
510          this.activity = new CodeableConcept();
511          return this.activity;
512        }
513        else if (name.equals("actual")) {
514          throw new FHIRException("Cannot call addChild on a primitive type Citation.statusDate.actual");
515        }
516        else if (name.equals("period")) {
517          this.period = new Period();
518          return this.period;
519        }
520        else
521          return super.addChild(name);
522      }
523
524      public CitationStatusDateComponent copy() {
525        CitationStatusDateComponent dst = new CitationStatusDateComponent();
526        copyValues(dst);
527        return dst;
528      }
529
530      public void copyValues(CitationStatusDateComponent dst) {
531        super.copyValues(dst);
532        dst.activity = activity == null ? null : activity.copy();
533        dst.actual = actual == null ? null : actual.copy();
534        dst.period = period == null ? null : period.copy();
535      }
536
537      @Override
538      public boolean equalsDeep(Base other_) {
539        if (!super.equalsDeep(other_))
540          return false;
541        if (!(other_ instanceof CitationStatusDateComponent))
542          return false;
543        CitationStatusDateComponent o = (CitationStatusDateComponent) other_;
544        return compareDeep(activity, o.activity, true) && compareDeep(actual, o.actual, true) && compareDeep(period, o.period, true)
545          ;
546      }
547
548      @Override
549      public boolean equalsShallow(Base other_) {
550        if (!super.equalsShallow(other_))
551          return false;
552        if (!(other_ instanceof CitationStatusDateComponent))
553          return false;
554        CitationStatusDateComponent o = (CitationStatusDateComponent) other_;
555        return compareValues(actual, o.actual, true);
556      }
557
558      public boolean isEmpty() {
559        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(activity, actual, period
560          );
561      }
562
563  public String fhirType() {
564    return "Citation.statusDate";
565
566  }
567
568  }
569
570    @Block()
571    public static class CitationRelatesToComponent extends BackboneElement implements IBaseBackboneElement {
572        /**
573         * How the Citation resource relates to the target artifact.
574         */
575        @Child(name = "relationshipType", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
576        @Description(shortDefinition="How the Citation resource relates to the target artifact", formalDefinition="How the Citation resource relates to the target artifact." )
577        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/artifact-relationship-type")
578        protected CodeableConcept relationshipType;
579
580        /**
581         * The clasification of the related artifact.
582         */
583        @Child(name = "targetClassifier", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
584        @Description(shortDefinition="The clasification of the related artifact", formalDefinition="The clasification of the related artifact." )
585        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-artifact-classifier")
586        protected List<CodeableConcept> targetClassifier;
587
588        /**
589         * The article or artifact that the Citation Resource is related to.
590         */
591        @Child(name = "target", type = {UriType.class, Identifier.class, Reference.class, Attachment.class}, order=3, min=1, max=1, modifier=false, summary=false)
592        @Description(shortDefinition="The article or artifact that the Citation Resource is related to", formalDefinition="The article or artifact that the Citation Resource is related to." )
593        protected DataType target;
594
595        private static final long serialVersionUID = 819025047L;
596
597    /**
598     * Constructor
599     */
600      public CitationRelatesToComponent() {
601        super();
602      }
603
604    /**
605     * Constructor
606     */
607      public CitationRelatesToComponent(CodeableConcept relationshipType, DataType target) {
608        super();
609        this.setRelationshipType(relationshipType);
610        this.setTarget(target);
611      }
612
613        /**
614         * @return {@link #relationshipType} (How the Citation resource relates to the target artifact.)
615         */
616        public CodeableConcept getRelationshipType() { 
617          if (this.relationshipType == null)
618            if (Configuration.errorOnAutoCreate())
619              throw new Error("Attempt to auto-create CitationRelatesToComponent.relationshipType");
620            else if (Configuration.doAutoCreate())
621              this.relationshipType = new CodeableConcept(); // cc
622          return this.relationshipType;
623        }
624
625        public boolean hasRelationshipType() { 
626          return this.relationshipType != null && !this.relationshipType.isEmpty();
627        }
628
629        /**
630         * @param value {@link #relationshipType} (How the Citation resource relates to the target artifact.)
631         */
632        public CitationRelatesToComponent setRelationshipType(CodeableConcept value) { 
633          this.relationshipType = value;
634          return this;
635        }
636
637        /**
638         * @return {@link #targetClassifier} (The clasification of the related artifact.)
639         */
640        public List<CodeableConcept> getTargetClassifier() { 
641          if (this.targetClassifier == null)
642            this.targetClassifier = new ArrayList<CodeableConcept>();
643          return this.targetClassifier;
644        }
645
646        /**
647         * @return Returns a reference to <code>this</code> for easy method chaining
648         */
649        public CitationRelatesToComponent setTargetClassifier(List<CodeableConcept> theTargetClassifier) { 
650          this.targetClassifier = theTargetClassifier;
651          return this;
652        }
653
654        public boolean hasTargetClassifier() { 
655          if (this.targetClassifier == null)
656            return false;
657          for (CodeableConcept item : this.targetClassifier)
658            if (!item.isEmpty())
659              return true;
660          return false;
661        }
662
663        public CodeableConcept addTargetClassifier() { //3
664          CodeableConcept t = new CodeableConcept();
665          if (this.targetClassifier == null)
666            this.targetClassifier = new ArrayList<CodeableConcept>();
667          this.targetClassifier.add(t);
668          return t;
669        }
670
671        public CitationRelatesToComponent addTargetClassifier(CodeableConcept t) { //3
672          if (t == null)
673            return this;
674          if (this.targetClassifier == null)
675            this.targetClassifier = new ArrayList<CodeableConcept>();
676          this.targetClassifier.add(t);
677          return this;
678        }
679
680        /**
681         * @return The first repetition of repeating field {@link #targetClassifier}, creating it if it does not already exist {3}
682         */
683        public CodeableConcept getTargetClassifierFirstRep() { 
684          if (getTargetClassifier().isEmpty()) {
685            addTargetClassifier();
686          }
687          return getTargetClassifier().get(0);
688        }
689
690        /**
691         * @return {@link #target} (The article or artifact that the Citation Resource is related to.)
692         */
693        public DataType getTarget() { 
694          return this.target;
695        }
696
697        /**
698         * @return {@link #target} (The article or artifact that the Citation Resource is related to.)
699         */
700        public UriType getTargetUriType() throws FHIRException { 
701          if (this.target == null)
702            this.target = new UriType();
703          if (!(this.target instanceof UriType))
704            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.target.getClass().getName()+" was encountered");
705          return (UriType) this.target;
706        }
707
708        public boolean hasTargetUriType() { 
709          return this != null && this.target instanceof UriType;
710        }
711
712        /**
713         * @return {@link #target} (The article or artifact that the Citation Resource is related to.)
714         */
715        public Identifier getTargetIdentifier() throws FHIRException { 
716          if (this.target == null)
717            this.target = new Identifier();
718          if (!(this.target instanceof Identifier))
719            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.target.getClass().getName()+" was encountered");
720          return (Identifier) this.target;
721        }
722
723        public boolean hasTargetIdentifier() { 
724          return this != null && this.target instanceof Identifier;
725        }
726
727        /**
728         * @return {@link #target} (The article or artifact that the Citation Resource is related to.)
729         */
730        public Reference getTargetReference() throws FHIRException { 
731          if (this.target == null)
732            this.target = new Reference();
733          if (!(this.target instanceof Reference))
734            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered");
735          return (Reference) this.target;
736        }
737
738        public boolean hasTargetReference() { 
739          return this != null && this.target instanceof Reference;
740        }
741
742        /**
743         * @return {@link #target} (The article or artifact that the Citation Resource is related to.)
744         */
745        public Attachment getTargetAttachment() throws FHIRException { 
746          if (this.target == null)
747            this.target = new Attachment();
748          if (!(this.target instanceof Attachment))
749            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.target.getClass().getName()+" was encountered");
750          return (Attachment) this.target;
751        }
752
753        public boolean hasTargetAttachment() { 
754          return this != null && this.target instanceof Attachment;
755        }
756
757        public boolean hasTarget() { 
758          return this.target != null && !this.target.isEmpty();
759        }
760
761        /**
762         * @param value {@link #target} (The article or artifact that the Citation Resource is related to.)
763         */
764        public CitationRelatesToComponent setTarget(DataType value) { 
765          if (value != null && !(value instanceof UriType || value instanceof Identifier || value instanceof Reference || value instanceof Attachment))
766            throw new Error("Not the right type for Citation.relatesTo.target[x]: "+value.fhirType());
767          this.target = value;
768          return this;
769        }
770
771        protected void listChildren(List<Property> children) {
772          super.listChildren(children);
773          children.add(new Property("relationshipType", "CodeableConcept", "How the Citation resource relates to the target artifact.", 0, 1, relationshipType));
774          children.add(new Property("targetClassifier", "CodeableConcept", "The clasification of the related artifact.", 0, java.lang.Integer.MAX_VALUE, targetClassifier));
775          children.add(new Property("target[x]", "uri|Identifier|Reference(Any)|Attachment", "The article or artifact that the Citation Resource is related to.", 0, 1, target));
776        }
777
778        @Override
779        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
780          switch (_hash) {
781          case -1602839150: /*relationshipType*/  return new Property("relationshipType", "CodeableConcept", "How the Citation resource relates to the target artifact.", 0, 1, relationshipType);
782          case -1267112302: /*targetClassifier*/  return new Property("targetClassifier", "CodeableConcept", "The clasification of the related artifact.", 0, java.lang.Integer.MAX_VALUE, targetClassifier);
783          case -815579825: /*target[x]*/  return new Property("target[x]", "uri|Identifier|Reference(Any)|Attachment", "The article or artifact that the Citation Resource is related to.", 0, 1, target);
784          case -880905839: /*target*/  return new Property("target[x]", "uri|Identifier|Reference(Any)|Attachment", "The article or artifact that the Citation Resource is related to.", 0, 1, target);
785          case -815585765: /*targetUri*/  return new Property("target[x]", "uri", "The article or artifact that the Citation Resource is related to.", 0, 1, target);
786          case 1690892570: /*targetIdentifier*/  return new Property("target[x]", "Identifier", "The article or artifact that the Citation Resource is related to.", 0, 1, target);
787          case 1259806906: /*targetReference*/  return new Property("target[x]", "Reference(Any)", "The article or artifact that the Citation Resource is related to.", 0, 1, target);
788          case 1345824148: /*targetAttachment*/  return new Property("target[x]", "Attachment", "The article or artifact that the Citation Resource is related to.", 0, 1, target);
789          default: return super.getNamedProperty(_hash, _name, _checkValid);
790          }
791
792        }
793
794      @Override
795      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
796        switch (hash) {
797        case -1602839150: /*relationshipType*/ return this.relationshipType == null ? new Base[0] : new Base[] {this.relationshipType}; // CodeableConcept
798        case -1267112302: /*targetClassifier*/ return this.targetClassifier == null ? new Base[0] : this.targetClassifier.toArray(new Base[this.targetClassifier.size()]); // CodeableConcept
799        case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // DataType
800        default: return super.getProperty(hash, name, checkValid);
801        }
802
803      }
804
805      @Override
806      public Base setProperty(int hash, String name, Base value) throws FHIRException {
807        switch (hash) {
808        case -1602839150: // relationshipType
809          this.relationshipType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
810          return value;
811        case -1267112302: // targetClassifier
812          this.getTargetClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
813          return value;
814        case -880905839: // target
815          this.target = TypeConvertor.castToType(value); // DataType
816          return value;
817        default: return super.setProperty(hash, name, value);
818        }
819
820      }
821
822      @Override
823      public Base setProperty(String name, Base value) throws FHIRException {
824        if (name.equals("relationshipType")) {
825          this.relationshipType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
826        } else if (name.equals("targetClassifier")) {
827          this.getTargetClassifier().add(TypeConvertor.castToCodeableConcept(value));
828        } else if (name.equals("target[x]")) {
829          this.target = TypeConvertor.castToType(value); // DataType
830        } else
831          return super.setProperty(name, value);
832        return value;
833      }
834
835      @Override
836      public Base makeProperty(int hash, String name) throws FHIRException {
837        switch (hash) {
838        case -1602839150:  return getRelationshipType();
839        case -1267112302:  return addTargetClassifier(); 
840        case -815579825:  return getTarget();
841        case -880905839:  return getTarget();
842        default: return super.makeProperty(hash, name);
843        }
844
845      }
846
847      @Override
848      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
849        switch (hash) {
850        case -1602839150: /*relationshipType*/ return new String[] {"CodeableConcept"};
851        case -1267112302: /*targetClassifier*/ return new String[] {"CodeableConcept"};
852        case -880905839: /*target*/ return new String[] {"uri", "Identifier", "Reference", "Attachment"};
853        default: return super.getTypesForProperty(hash, name);
854        }
855
856      }
857
858      @Override
859      public Base addChild(String name) throws FHIRException {
860        if (name.equals("relationshipType")) {
861          this.relationshipType = new CodeableConcept();
862          return this.relationshipType;
863        }
864        else if (name.equals("targetClassifier")) {
865          return addTargetClassifier();
866        }
867        else if (name.equals("targetUri")) {
868          this.target = new UriType();
869          return this.target;
870        }
871        else if (name.equals("targetIdentifier")) {
872          this.target = new Identifier();
873          return this.target;
874        }
875        else if (name.equals("targetReference")) {
876          this.target = new Reference();
877          return this.target;
878        }
879        else if (name.equals("targetAttachment")) {
880          this.target = new Attachment();
881          return this.target;
882        }
883        else
884          return super.addChild(name);
885      }
886
887      public CitationRelatesToComponent copy() {
888        CitationRelatesToComponent dst = new CitationRelatesToComponent();
889        copyValues(dst);
890        return dst;
891      }
892
893      public void copyValues(CitationRelatesToComponent dst) {
894        super.copyValues(dst);
895        dst.relationshipType = relationshipType == null ? null : relationshipType.copy();
896        if (targetClassifier != null) {
897          dst.targetClassifier = new ArrayList<CodeableConcept>();
898          for (CodeableConcept i : targetClassifier)
899            dst.targetClassifier.add(i.copy());
900        };
901        dst.target = target == null ? null : target.copy();
902      }
903
904      @Override
905      public boolean equalsDeep(Base other_) {
906        if (!super.equalsDeep(other_))
907          return false;
908        if (!(other_ instanceof CitationRelatesToComponent))
909          return false;
910        CitationRelatesToComponent o = (CitationRelatesToComponent) other_;
911        return compareDeep(relationshipType, o.relationshipType, true) && compareDeep(targetClassifier, o.targetClassifier, true)
912           && compareDeep(target, o.target, true);
913      }
914
915      @Override
916      public boolean equalsShallow(Base other_) {
917        if (!super.equalsShallow(other_))
918          return false;
919        if (!(other_ instanceof CitationRelatesToComponent))
920          return false;
921        CitationRelatesToComponent o = (CitationRelatesToComponent) other_;
922        return true;
923      }
924
925      public boolean isEmpty() {
926        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(relationshipType, targetClassifier
927          , target);
928      }
929
930  public String fhirType() {
931    return "Citation.relatesTo";
932
933  }
934
935  }
936
937    @Block()
938    public static class CitationCitedArtifactComponent extends BackboneElement implements IBaseBackboneElement {
939        /**
940         * 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.
941         */
942        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
943        @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." )
944        protected List<Identifier> identifier;
945
946        /**
947         * A formal identifier that is used to identify things closely related to this citation.
948         */
949        @Child(name = "relatedIdentifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
950        @Description(shortDefinition="May include trial registry identifiers", formalDefinition="A formal identifier that is used to identify things closely related to this citation." )
951        protected List<Identifier> relatedIdentifier;
952
953        /**
954         * When the cited artifact was accessed.
955         */
956        @Child(name = "dateAccessed", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
957        @Description(shortDefinition="When the cited artifact was accessed", formalDefinition="When the cited artifact was accessed." )
958        protected DateTimeType dateAccessed;
959
960        /**
961         * The defined version of the cited artifact.
962         */
963        @Child(name = "version", type = {}, order=4, min=0, max=1, modifier=false, summary=false)
964        @Description(shortDefinition="The defined version of the cited artifact", formalDefinition="The defined version of the cited artifact." )
965        protected CitationCitedArtifactVersionComponent version;
966
967        /**
968         * The status of the cited artifact.
969         */
970        @Child(name = "currentState", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
971        @Description(shortDefinition="The status of the cited artifact", formalDefinition="The status of the cited artifact." )
972        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-status-type")
973        protected List<CodeableConcept> currentState;
974
975        /**
976         * An effective date or period for a status of the cited artifact.
977         */
978        @Child(name = "statusDate", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
979        @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." )
980        protected List<CitationCitedArtifactStatusDateComponent> statusDate;
981
982        /**
983         * The title details of the article or artifact.
984         */
985        @Child(name = "title", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
986        @Description(shortDefinition="The title details of the article or artifact", formalDefinition="The title details of the article or artifact." )
987        protected List<CitationCitedArtifactTitleComponent> title;
988
989        /**
990         * Summary of the article or artifact.
991         */
992        @Child(name = "abstract", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
993        @Description(shortDefinition="Summary of the article or artifact", formalDefinition="Summary of the article or artifact." )
994        protected List<CitationCitedArtifactAbstractComponent> abstract_;
995
996        /**
997         * The component of the article or artifact.
998         */
999        @Child(name = "part", type = {}, order=9, min=0, max=1, modifier=false, summary=false)
1000        @Description(shortDefinition="The component of the article or artifact", formalDefinition="The component of the article or artifact." )
1001        protected CitationCitedArtifactPartComponent part;
1002
1003        /**
1004         * The artifact related to the cited artifact.
1005         */
1006        @Child(name = "relatesTo", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1007        @Description(shortDefinition="The artifact related to the cited artifact", formalDefinition="The artifact related to the cited artifact." )
1008        protected List<CitationCitedArtifactRelatesToComponent> relatesTo;
1009
1010        /**
1011         * If multiple, used to represent alternative forms of the article that are not separate citations.
1012         */
1013        @Child(name = "publicationForm", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1014        @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." )
1015        protected List<CitationCitedArtifactPublicationFormComponent> publicationForm;
1016
1017        /**
1018         * Used for any URL for the article or artifact cited.
1019         */
1020        @Child(name = "webLocation", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1021        @Description(shortDefinition="Used for any URL for the article or artifact cited", formalDefinition="Used for any URL for the article or artifact cited." )
1022        protected List<CitationCitedArtifactWebLocationComponent> webLocation;
1023
1024        /**
1025         * The assignment to an organizing scheme.
1026         */
1027        @Child(name = "classification", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1028        @Description(shortDefinition="The assignment to an organizing scheme", formalDefinition="The assignment to an organizing scheme." )
1029        protected List<CitationCitedArtifactClassificationComponent> classification;
1030
1031        /**
1032         * This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements.
1033         */
1034        @Child(name = "contributorship", type = {}, order=14, min=0, max=1, modifier=false, summary=false)
1035        @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." )
1036        protected CitationCitedArtifactContributorshipComponent contributorship;
1037
1038        /**
1039         * Any additional information or content for the article or artifact.
1040         */
1041        @Child(name = "note", type = {Annotation.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1042        @Description(shortDefinition="Any additional information or content for the article or artifact", formalDefinition="Any additional information or content for the article or artifact." )
1043        protected List<Annotation> note;
1044
1045        private static final long serialVersionUID = -1685890486L;
1046
1047    /**
1048     * Constructor
1049     */
1050      public CitationCitedArtifactComponent() {
1051        super();
1052      }
1053
1054        /**
1055         * @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.)
1056         */
1057        public List<Identifier> getIdentifier() { 
1058          if (this.identifier == null)
1059            this.identifier = new ArrayList<Identifier>();
1060          return this.identifier;
1061        }
1062
1063        /**
1064         * @return Returns a reference to <code>this</code> for easy method chaining
1065         */
1066        public CitationCitedArtifactComponent setIdentifier(List<Identifier> theIdentifier) { 
1067          this.identifier = theIdentifier;
1068          return this;
1069        }
1070
1071        public boolean hasIdentifier() { 
1072          if (this.identifier == null)
1073            return false;
1074          for (Identifier item : this.identifier)
1075            if (!item.isEmpty())
1076              return true;
1077          return false;
1078        }
1079
1080        public Identifier addIdentifier() { //3
1081          Identifier t = new Identifier();
1082          if (this.identifier == null)
1083            this.identifier = new ArrayList<Identifier>();
1084          this.identifier.add(t);
1085          return t;
1086        }
1087
1088        public CitationCitedArtifactComponent addIdentifier(Identifier t) { //3
1089          if (t == null)
1090            return this;
1091          if (this.identifier == null)
1092            this.identifier = new ArrayList<Identifier>();
1093          this.identifier.add(t);
1094          return this;
1095        }
1096
1097        /**
1098         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1099         */
1100        public Identifier getIdentifierFirstRep() { 
1101          if (getIdentifier().isEmpty()) {
1102            addIdentifier();
1103          }
1104          return getIdentifier().get(0);
1105        }
1106
1107        /**
1108         * @return {@link #relatedIdentifier} (A formal identifier that is used to identify things closely related to this citation.)
1109         */
1110        public List<Identifier> getRelatedIdentifier() { 
1111          if (this.relatedIdentifier == null)
1112            this.relatedIdentifier = new ArrayList<Identifier>();
1113          return this.relatedIdentifier;
1114        }
1115
1116        /**
1117         * @return Returns a reference to <code>this</code> for easy method chaining
1118         */
1119        public CitationCitedArtifactComponent setRelatedIdentifier(List<Identifier> theRelatedIdentifier) { 
1120          this.relatedIdentifier = theRelatedIdentifier;
1121          return this;
1122        }
1123
1124        public boolean hasRelatedIdentifier() { 
1125          if (this.relatedIdentifier == null)
1126            return false;
1127          for (Identifier item : this.relatedIdentifier)
1128            if (!item.isEmpty())
1129              return true;
1130          return false;
1131        }
1132
1133        public Identifier addRelatedIdentifier() { //3
1134          Identifier t = new Identifier();
1135          if (this.relatedIdentifier == null)
1136            this.relatedIdentifier = new ArrayList<Identifier>();
1137          this.relatedIdentifier.add(t);
1138          return t;
1139        }
1140
1141        public CitationCitedArtifactComponent addRelatedIdentifier(Identifier t) { //3
1142          if (t == null)
1143            return this;
1144          if (this.relatedIdentifier == null)
1145            this.relatedIdentifier = new ArrayList<Identifier>();
1146          this.relatedIdentifier.add(t);
1147          return this;
1148        }
1149
1150        /**
1151         * @return The first repetition of repeating field {@link #relatedIdentifier}, creating it if it does not already exist {3}
1152         */
1153        public Identifier getRelatedIdentifierFirstRep() { 
1154          if (getRelatedIdentifier().isEmpty()) {
1155            addRelatedIdentifier();
1156          }
1157          return getRelatedIdentifier().get(0);
1158        }
1159
1160        /**
1161         * @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
1162         */
1163        public DateTimeType getDateAccessedElement() { 
1164          if (this.dateAccessed == null)
1165            if (Configuration.errorOnAutoCreate())
1166              throw new Error("Attempt to auto-create CitationCitedArtifactComponent.dateAccessed");
1167            else if (Configuration.doAutoCreate())
1168              this.dateAccessed = new DateTimeType(); // bb
1169          return this.dateAccessed;
1170        }
1171
1172        public boolean hasDateAccessedElement() { 
1173          return this.dateAccessed != null && !this.dateAccessed.isEmpty();
1174        }
1175
1176        public boolean hasDateAccessed() { 
1177          return this.dateAccessed != null && !this.dateAccessed.isEmpty();
1178        }
1179
1180        /**
1181         * @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
1182         */
1183        public CitationCitedArtifactComponent setDateAccessedElement(DateTimeType value) { 
1184          this.dateAccessed = value;
1185          return this;
1186        }
1187
1188        /**
1189         * @return When the cited artifact was accessed.
1190         */
1191        public Date getDateAccessed() { 
1192          return this.dateAccessed == null ? null : this.dateAccessed.getValue();
1193        }
1194
1195        /**
1196         * @param value When the cited artifact was accessed.
1197         */
1198        public CitationCitedArtifactComponent setDateAccessed(Date value) { 
1199          if (value == null)
1200            this.dateAccessed = null;
1201          else {
1202            if (this.dateAccessed == null)
1203              this.dateAccessed = new DateTimeType();
1204            this.dateAccessed.setValue(value);
1205          }
1206          return this;
1207        }
1208
1209        /**
1210         * @return {@link #version} (The defined version of the cited artifact.)
1211         */
1212        public CitationCitedArtifactVersionComponent getVersion() { 
1213          if (this.version == null)
1214            if (Configuration.errorOnAutoCreate())
1215              throw new Error("Attempt to auto-create CitationCitedArtifactComponent.version");
1216            else if (Configuration.doAutoCreate())
1217              this.version = new CitationCitedArtifactVersionComponent(); // cc
1218          return this.version;
1219        }
1220
1221        public boolean hasVersion() { 
1222          return this.version != null && !this.version.isEmpty();
1223        }
1224
1225        /**
1226         * @param value {@link #version} (The defined version of the cited artifact.)
1227         */
1228        public CitationCitedArtifactComponent setVersion(CitationCitedArtifactVersionComponent value) { 
1229          this.version = value;
1230          return this;
1231        }
1232
1233        /**
1234         * @return {@link #currentState} (The status of the cited artifact.)
1235         */
1236        public List<CodeableConcept> getCurrentState() { 
1237          if (this.currentState == null)
1238            this.currentState = new ArrayList<CodeableConcept>();
1239          return this.currentState;
1240        }
1241
1242        /**
1243         * @return Returns a reference to <code>this</code> for easy method chaining
1244         */
1245        public CitationCitedArtifactComponent setCurrentState(List<CodeableConcept> theCurrentState) { 
1246          this.currentState = theCurrentState;
1247          return this;
1248        }
1249
1250        public boolean hasCurrentState() { 
1251          if (this.currentState == null)
1252            return false;
1253          for (CodeableConcept item : this.currentState)
1254            if (!item.isEmpty())
1255              return true;
1256          return false;
1257        }
1258
1259        public CodeableConcept addCurrentState() { //3
1260          CodeableConcept t = new CodeableConcept();
1261          if (this.currentState == null)
1262            this.currentState = new ArrayList<CodeableConcept>();
1263          this.currentState.add(t);
1264          return t;
1265        }
1266
1267        public CitationCitedArtifactComponent addCurrentState(CodeableConcept t) { //3
1268          if (t == null)
1269            return this;
1270          if (this.currentState == null)
1271            this.currentState = new ArrayList<CodeableConcept>();
1272          this.currentState.add(t);
1273          return this;
1274        }
1275
1276        /**
1277         * @return The first repetition of repeating field {@link #currentState}, creating it if it does not already exist {3}
1278         */
1279        public CodeableConcept getCurrentStateFirstRep() { 
1280          if (getCurrentState().isEmpty()) {
1281            addCurrentState();
1282          }
1283          return getCurrentState().get(0);
1284        }
1285
1286        /**
1287         * @return {@link #statusDate} (An effective date or period for a status of the cited artifact.)
1288         */
1289        public List<CitationCitedArtifactStatusDateComponent> getStatusDate() { 
1290          if (this.statusDate == null)
1291            this.statusDate = new ArrayList<CitationCitedArtifactStatusDateComponent>();
1292          return this.statusDate;
1293        }
1294
1295        /**
1296         * @return Returns a reference to <code>this</code> for easy method chaining
1297         */
1298        public CitationCitedArtifactComponent setStatusDate(List<CitationCitedArtifactStatusDateComponent> theStatusDate) { 
1299          this.statusDate = theStatusDate;
1300          return this;
1301        }
1302
1303        public boolean hasStatusDate() { 
1304          if (this.statusDate == null)
1305            return false;
1306          for (CitationCitedArtifactStatusDateComponent item : this.statusDate)
1307            if (!item.isEmpty())
1308              return true;
1309          return false;
1310        }
1311
1312        public CitationCitedArtifactStatusDateComponent addStatusDate() { //3
1313          CitationCitedArtifactStatusDateComponent t = new CitationCitedArtifactStatusDateComponent();
1314          if (this.statusDate == null)
1315            this.statusDate = new ArrayList<CitationCitedArtifactStatusDateComponent>();
1316          this.statusDate.add(t);
1317          return t;
1318        }
1319
1320        public CitationCitedArtifactComponent addStatusDate(CitationCitedArtifactStatusDateComponent t) { //3
1321          if (t == null)
1322            return this;
1323          if (this.statusDate == null)
1324            this.statusDate = new ArrayList<CitationCitedArtifactStatusDateComponent>();
1325          this.statusDate.add(t);
1326          return this;
1327        }
1328
1329        /**
1330         * @return The first repetition of repeating field {@link #statusDate}, creating it if it does not already exist {3}
1331         */
1332        public CitationCitedArtifactStatusDateComponent getStatusDateFirstRep() { 
1333          if (getStatusDate().isEmpty()) {
1334            addStatusDate();
1335          }
1336          return getStatusDate().get(0);
1337        }
1338
1339        /**
1340         * @return {@link #title} (The title details of the article or artifact.)
1341         */
1342        public List<CitationCitedArtifactTitleComponent> getTitle() { 
1343          if (this.title == null)
1344            this.title = new ArrayList<CitationCitedArtifactTitleComponent>();
1345          return this.title;
1346        }
1347
1348        /**
1349         * @return Returns a reference to <code>this</code> for easy method chaining
1350         */
1351        public CitationCitedArtifactComponent setTitle(List<CitationCitedArtifactTitleComponent> theTitle) { 
1352          this.title = theTitle;
1353          return this;
1354        }
1355
1356        public boolean hasTitle() { 
1357          if (this.title == null)
1358            return false;
1359          for (CitationCitedArtifactTitleComponent item : this.title)
1360            if (!item.isEmpty())
1361              return true;
1362          return false;
1363        }
1364
1365        public CitationCitedArtifactTitleComponent addTitle() { //3
1366          CitationCitedArtifactTitleComponent t = new CitationCitedArtifactTitleComponent();
1367          if (this.title == null)
1368            this.title = new ArrayList<CitationCitedArtifactTitleComponent>();
1369          this.title.add(t);
1370          return t;
1371        }
1372
1373        public CitationCitedArtifactComponent addTitle(CitationCitedArtifactTitleComponent t) { //3
1374          if (t == null)
1375            return this;
1376          if (this.title == null)
1377            this.title = new ArrayList<CitationCitedArtifactTitleComponent>();
1378          this.title.add(t);
1379          return this;
1380        }
1381
1382        /**
1383         * @return The first repetition of repeating field {@link #title}, creating it if it does not already exist {3}
1384         */
1385        public CitationCitedArtifactTitleComponent getTitleFirstRep() { 
1386          if (getTitle().isEmpty()) {
1387            addTitle();
1388          }
1389          return getTitle().get(0);
1390        }
1391
1392        /**
1393         * @return {@link #abstract_} (Summary of the article or artifact.)
1394         */
1395        public List<CitationCitedArtifactAbstractComponent> getAbstract() { 
1396          if (this.abstract_ == null)
1397            this.abstract_ = new ArrayList<CitationCitedArtifactAbstractComponent>();
1398          return this.abstract_;
1399        }
1400
1401        /**
1402         * @return Returns a reference to <code>this</code> for easy method chaining
1403         */
1404        public CitationCitedArtifactComponent setAbstract(List<CitationCitedArtifactAbstractComponent> theAbstract) { 
1405          this.abstract_ = theAbstract;
1406          return this;
1407        }
1408
1409        public boolean hasAbstract() { 
1410          if (this.abstract_ == null)
1411            return false;
1412          for (CitationCitedArtifactAbstractComponent item : this.abstract_)
1413            if (!item.isEmpty())
1414              return true;
1415          return false;
1416        }
1417
1418        public CitationCitedArtifactAbstractComponent addAbstract() { //3
1419          CitationCitedArtifactAbstractComponent t = new CitationCitedArtifactAbstractComponent();
1420          if (this.abstract_ == null)
1421            this.abstract_ = new ArrayList<CitationCitedArtifactAbstractComponent>();
1422          this.abstract_.add(t);
1423          return t;
1424        }
1425
1426        public CitationCitedArtifactComponent addAbstract(CitationCitedArtifactAbstractComponent t) { //3
1427          if (t == null)
1428            return this;
1429          if (this.abstract_ == null)
1430            this.abstract_ = new ArrayList<CitationCitedArtifactAbstractComponent>();
1431          this.abstract_.add(t);
1432          return this;
1433        }
1434
1435        /**
1436         * @return The first repetition of repeating field {@link #abstract_}, creating it if it does not already exist {3}
1437         */
1438        public CitationCitedArtifactAbstractComponent getAbstractFirstRep() { 
1439          if (getAbstract().isEmpty()) {
1440            addAbstract();
1441          }
1442          return getAbstract().get(0);
1443        }
1444
1445        /**
1446         * @return {@link #part} (The component of the article or artifact.)
1447         */
1448        public CitationCitedArtifactPartComponent getPart() { 
1449          if (this.part == null)
1450            if (Configuration.errorOnAutoCreate())
1451              throw new Error("Attempt to auto-create CitationCitedArtifactComponent.part");
1452            else if (Configuration.doAutoCreate())
1453              this.part = new CitationCitedArtifactPartComponent(); // cc
1454          return this.part;
1455        }
1456
1457        public boolean hasPart() { 
1458          return this.part != null && !this.part.isEmpty();
1459        }
1460
1461        /**
1462         * @param value {@link #part} (The component of the article or artifact.)
1463         */
1464        public CitationCitedArtifactComponent setPart(CitationCitedArtifactPartComponent value) { 
1465          this.part = value;
1466          return this;
1467        }
1468
1469        /**
1470         * @return {@link #relatesTo} (The artifact related to the cited artifact.)
1471         */
1472        public List<CitationCitedArtifactRelatesToComponent> getRelatesTo() { 
1473          if (this.relatesTo == null)
1474            this.relatesTo = new ArrayList<CitationCitedArtifactRelatesToComponent>();
1475          return this.relatesTo;
1476        }
1477
1478        /**
1479         * @return Returns a reference to <code>this</code> for easy method chaining
1480         */
1481        public CitationCitedArtifactComponent setRelatesTo(List<CitationCitedArtifactRelatesToComponent> theRelatesTo) { 
1482          this.relatesTo = theRelatesTo;
1483          return this;
1484        }
1485
1486        public boolean hasRelatesTo() { 
1487          if (this.relatesTo == null)
1488            return false;
1489          for (CitationCitedArtifactRelatesToComponent item : this.relatesTo)
1490            if (!item.isEmpty())
1491              return true;
1492          return false;
1493        }
1494
1495        public CitationCitedArtifactRelatesToComponent addRelatesTo() { //3
1496          CitationCitedArtifactRelatesToComponent t = new CitationCitedArtifactRelatesToComponent();
1497          if (this.relatesTo == null)
1498            this.relatesTo = new ArrayList<CitationCitedArtifactRelatesToComponent>();
1499          this.relatesTo.add(t);
1500          return t;
1501        }
1502
1503        public CitationCitedArtifactComponent addRelatesTo(CitationCitedArtifactRelatesToComponent t) { //3
1504          if (t == null)
1505            return this;
1506          if (this.relatesTo == null)
1507            this.relatesTo = new ArrayList<CitationCitedArtifactRelatesToComponent>();
1508          this.relatesTo.add(t);
1509          return this;
1510        }
1511
1512        /**
1513         * @return The first repetition of repeating field {@link #relatesTo}, creating it if it does not already exist {3}
1514         */
1515        public CitationCitedArtifactRelatesToComponent getRelatesToFirstRep() { 
1516          if (getRelatesTo().isEmpty()) {
1517            addRelatesTo();
1518          }
1519          return getRelatesTo().get(0);
1520        }
1521
1522        /**
1523         * @return {@link #publicationForm} (If multiple, used to represent alternative forms of the article that are not separate citations.)
1524         */
1525        public List<CitationCitedArtifactPublicationFormComponent> getPublicationForm() { 
1526          if (this.publicationForm == null)
1527            this.publicationForm = new ArrayList<CitationCitedArtifactPublicationFormComponent>();
1528          return this.publicationForm;
1529        }
1530
1531        /**
1532         * @return Returns a reference to <code>this</code> for easy method chaining
1533         */
1534        public CitationCitedArtifactComponent setPublicationForm(List<CitationCitedArtifactPublicationFormComponent> thePublicationForm) { 
1535          this.publicationForm = thePublicationForm;
1536          return this;
1537        }
1538
1539        public boolean hasPublicationForm() { 
1540          if (this.publicationForm == null)
1541            return false;
1542          for (CitationCitedArtifactPublicationFormComponent item : this.publicationForm)
1543            if (!item.isEmpty())
1544              return true;
1545          return false;
1546        }
1547
1548        public CitationCitedArtifactPublicationFormComponent addPublicationForm() { //3
1549          CitationCitedArtifactPublicationFormComponent t = new CitationCitedArtifactPublicationFormComponent();
1550          if (this.publicationForm == null)
1551            this.publicationForm = new ArrayList<CitationCitedArtifactPublicationFormComponent>();
1552          this.publicationForm.add(t);
1553          return t;
1554        }
1555
1556        public CitationCitedArtifactComponent addPublicationForm(CitationCitedArtifactPublicationFormComponent t) { //3
1557          if (t == null)
1558            return this;
1559          if (this.publicationForm == null)
1560            this.publicationForm = new ArrayList<CitationCitedArtifactPublicationFormComponent>();
1561          this.publicationForm.add(t);
1562          return this;
1563        }
1564
1565        /**
1566         * @return The first repetition of repeating field {@link #publicationForm}, creating it if it does not already exist {3}
1567         */
1568        public CitationCitedArtifactPublicationFormComponent getPublicationFormFirstRep() { 
1569          if (getPublicationForm().isEmpty()) {
1570            addPublicationForm();
1571          }
1572          return getPublicationForm().get(0);
1573        }
1574
1575        /**
1576         * @return {@link #webLocation} (Used for any URL for the article or artifact cited.)
1577         */
1578        public List<CitationCitedArtifactWebLocationComponent> getWebLocation() { 
1579          if (this.webLocation == null)
1580            this.webLocation = new ArrayList<CitationCitedArtifactWebLocationComponent>();
1581          return this.webLocation;
1582        }
1583
1584        /**
1585         * @return Returns a reference to <code>this</code> for easy method chaining
1586         */
1587        public CitationCitedArtifactComponent setWebLocation(List<CitationCitedArtifactWebLocationComponent> theWebLocation) { 
1588          this.webLocation = theWebLocation;
1589          return this;
1590        }
1591
1592        public boolean hasWebLocation() { 
1593          if (this.webLocation == null)
1594            return false;
1595          for (CitationCitedArtifactWebLocationComponent item : this.webLocation)
1596            if (!item.isEmpty())
1597              return true;
1598          return false;
1599        }
1600
1601        public CitationCitedArtifactWebLocationComponent addWebLocation() { //3
1602          CitationCitedArtifactWebLocationComponent t = new CitationCitedArtifactWebLocationComponent();
1603          if (this.webLocation == null)
1604            this.webLocation = new ArrayList<CitationCitedArtifactWebLocationComponent>();
1605          this.webLocation.add(t);
1606          return t;
1607        }
1608
1609        public CitationCitedArtifactComponent addWebLocation(CitationCitedArtifactWebLocationComponent t) { //3
1610          if (t == null)
1611            return this;
1612          if (this.webLocation == null)
1613            this.webLocation = new ArrayList<CitationCitedArtifactWebLocationComponent>();
1614          this.webLocation.add(t);
1615          return this;
1616        }
1617
1618        /**
1619         * @return The first repetition of repeating field {@link #webLocation}, creating it if it does not already exist {3}
1620         */
1621        public CitationCitedArtifactWebLocationComponent getWebLocationFirstRep() { 
1622          if (getWebLocation().isEmpty()) {
1623            addWebLocation();
1624          }
1625          return getWebLocation().get(0);
1626        }
1627
1628        /**
1629         * @return {@link #classification} (The assignment to an organizing scheme.)
1630         */
1631        public List<CitationCitedArtifactClassificationComponent> getClassification() { 
1632          if (this.classification == null)
1633            this.classification = new ArrayList<CitationCitedArtifactClassificationComponent>();
1634          return this.classification;
1635        }
1636
1637        /**
1638         * @return Returns a reference to <code>this</code> for easy method chaining
1639         */
1640        public CitationCitedArtifactComponent setClassification(List<CitationCitedArtifactClassificationComponent> theClassification) { 
1641          this.classification = theClassification;
1642          return this;
1643        }
1644
1645        public boolean hasClassification() { 
1646          if (this.classification == null)
1647            return false;
1648          for (CitationCitedArtifactClassificationComponent item : this.classification)
1649            if (!item.isEmpty())
1650              return true;
1651          return false;
1652        }
1653
1654        public CitationCitedArtifactClassificationComponent addClassification() { //3
1655          CitationCitedArtifactClassificationComponent t = new CitationCitedArtifactClassificationComponent();
1656          if (this.classification == null)
1657            this.classification = new ArrayList<CitationCitedArtifactClassificationComponent>();
1658          this.classification.add(t);
1659          return t;
1660        }
1661
1662        public CitationCitedArtifactComponent addClassification(CitationCitedArtifactClassificationComponent t) { //3
1663          if (t == null)
1664            return this;
1665          if (this.classification == null)
1666            this.classification = new ArrayList<CitationCitedArtifactClassificationComponent>();
1667          this.classification.add(t);
1668          return this;
1669        }
1670
1671        /**
1672         * @return The first repetition of repeating field {@link #classification}, creating it if it does not already exist {3}
1673         */
1674        public CitationCitedArtifactClassificationComponent getClassificationFirstRep() { 
1675          if (getClassification().isEmpty()) {
1676            addClassification();
1677          }
1678          return getClassification().get(0);
1679        }
1680
1681        /**
1682         * @return {@link #contributorship} (This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements.)
1683         */
1684        public CitationCitedArtifactContributorshipComponent getContributorship() { 
1685          if (this.contributorship == null)
1686            if (Configuration.errorOnAutoCreate())
1687              throw new Error("Attempt to auto-create CitationCitedArtifactComponent.contributorship");
1688            else if (Configuration.doAutoCreate())
1689              this.contributorship = new CitationCitedArtifactContributorshipComponent(); // cc
1690          return this.contributorship;
1691        }
1692
1693        public boolean hasContributorship() { 
1694          return this.contributorship != null && !this.contributorship.isEmpty();
1695        }
1696
1697        /**
1698         * @param value {@link #contributorship} (This element is used to list authors and other contributors, their contact information, specific contributions, and summary statements.)
1699         */
1700        public CitationCitedArtifactComponent setContributorship(CitationCitedArtifactContributorshipComponent value) { 
1701          this.contributorship = value;
1702          return this;
1703        }
1704
1705        /**
1706         * @return {@link #note} (Any additional information or content for the article or artifact.)
1707         */
1708        public List<Annotation> getNote() { 
1709          if (this.note == null)
1710            this.note = new ArrayList<Annotation>();
1711          return this.note;
1712        }
1713
1714        /**
1715         * @return Returns a reference to <code>this</code> for easy method chaining
1716         */
1717        public CitationCitedArtifactComponent setNote(List<Annotation> theNote) { 
1718          this.note = theNote;
1719          return this;
1720        }
1721
1722        public boolean hasNote() { 
1723          if (this.note == null)
1724            return false;
1725          for (Annotation item : this.note)
1726            if (!item.isEmpty())
1727              return true;
1728          return false;
1729        }
1730
1731        public Annotation addNote() { //3
1732          Annotation t = new Annotation();
1733          if (this.note == null)
1734            this.note = new ArrayList<Annotation>();
1735          this.note.add(t);
1736          return t;
1737        }
1738
1739        public CitationCitedArtifactComponent addNote(Annotation t) { //3
1740          if (t == null)
1741            return this;
1742          if (this.note == null)
1743            this.note = new ArrayList<Annotation>();
1744          this.note.add(t);
1745          return this;
1746        }
1747
1748        /**
1749         * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
1750         */
1751        public Annotation getNoteFirstRep() { 
1752          if (getNote().isEmpty()) {
1753            addNote();
1754          }
1755          return getNote().get(0);
1756        }
1757
1758        protected void listChildren(List<Property> children) {
1759          super.listChildren(children);
1760          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));
1761          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));
1762          children.add(new Property("dateAccessed", "dateTime", "When the cited artifact was accessed.", 0, 1, dateAccessed));
1763          children.add(new Property("version", "", "The defined version of the cited artifact.", 0, 1, version));
1764          children.add(new Property("currentState", "CodeableConcept", "The status of the cited artifact.", 0, java.lang.Integer.MAX_VALUE, currentState));
1765          children.add(new Property("statusDate", "", "An effective date or period for a status of the cited artifact.", 0, java.lang.Integer.MAX_VALUE, statusDate));
1766          children.add(new Property("title", "", "The title details of the article or artifact.", 0, java.lang.Integer.MAX_VALUE, title));
1767          children.add(new Property("abstract", "", "Summary of the article or artifact.", 0, java.lang.Integer.MAX_VALUE, abstract_));
1768          children.add(new Property("part", "", "The component of the article or artifact.", 0, 1, part));
1769          children.add(new Property("relatesTo", "", "The artifact related to the cited artifact.", 0, java.lang.Integer.MAX_VALUE, relatesTo));
1770          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));
1771          children.add(new Property("webLocation", "", "Used for any URL for the article or artifact cited.", 0, java.lang.Integer.MAX_VALUE, webLocation));
1772          children.add(new Property("classification", "", "The assignment to an organizing scheme.", 0, java.lang.Integer.MAX_VALUE, classification));
1773          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));
1774          children.add(new Property("note", "Annotation", "Any additional information or content for the article or artifact.", 0, java.lang.Integer.MAX_VALUE, note));
1775        }
1776
1777        @Override
1778        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1779          switch (_hash) {
1780          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);
1781          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);
1782          case 540917457: /*dateAccessed*/  return new Property("dateAccessed", "dateTime", "When the cited artifact was accessed.", 0, 1, dateAccessed);
1783          case 351608024: /*version*/  return new Property("version", "", "The defined version of the cited artifact.", 0, 1, version);
1784          case 1457822360: /*currentState*/  return new Property("currentState", "CodeableConcept", "The status of the cited artifact.", 0, java.lang.Integer.MAX_VALUE, currentState);
1785          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);
1786          case 110371416: /*title*/  return new Property("title", "", "The title details of the article or artifact.", 0, java.lang.Integer.MAX_VALUE, title);
1787          case 1732898850: /*abstract*/  return new Property("abstract", "", "Summary of the article or artifact.", 0, java.lang.Integer.MAX_VALUE, abstract_);
1788          case 3433459: /*part*/  return new Property("part", "", "The component of the article or artifact.", 0, 1, part);
1789          case -7765931: /*relatesTo*/  return new Property("relatesTo", "", "The artifact related to the cited artifact.", 0, java.lang.Integer.MAX_VALUE, relatesTo);
1790          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);
1791          case -828032215: /*webLocation*/  return new Property("webLocation", "", "Used for any URL for the article or artifact cited.", 0, java.lang.Integer.MAX_VALUE, webLocation);
1792          case 382350310: /*classification*/  return new Property("classification", "", "The assignment to an organizing scheme.", 0, java.lang.Integer.MAX_VALUE, classification);
1793          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);
1794          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);
1795          default: return super.getNamedProperty(_hash, _name, _checkValid);
1796          }
1797
1798        }
1799
1800      @Override
1801      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1802        switch (hash) {
1803        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1804        case -1007604940: /*relatedIdentifier*/ return this.relatedIdentifier == null ? new Base[0] : this.relatedIdentifier.toArray(new Base[this.relatedIdentifier.size()]); // Identifier
1805        case 540917457: /*dateAccessed*/ return this.dateAccessed == null ? new Base[0] : new Base[] {this.dateAccessed}; // DateTimeType
1806        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // CitationCitedArtifactVersionComponent
1807        case 1457822360: /*currentState*/ return this.currentState == null ? new Base[0] : this.currentState.toArray(new Base[this.currentState.size()]); // CodeableConcept
1808        case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : this.statusDate.toArray(new Base[this.statusDate.size()]); // CitationCitedArtifactStatusDateComponent
1809        case 110371416: /*title*/ return this.title == null ? new Base[0] : this.title.toArray(new Base[this.title.size()]); // CitationCitedArtifactTitleComponent
1810        case 1732898850: /*abstract*/ return this.abstract_ == null ? new Base[0] : this.abstract_.toArray(new Base[this.abstract_.size()]); // CitationCitedArtifactAbstractComponent
1811        case 3433459: /*part*/ return this.part == null ? new Base[0] : new Base[] {this.part}; // CitationCitedArtifactPartComponent
1812        case -7765931: /*relatesTo*/ return this.relatesTo == null ? new Base[0] : this.relatesTo.toArray(new Base[this.relatesTo.size()]); // CitationCitedArtifactRelatesToComponent
1813        case 1470639376: /*publicationForm*/ return this.publicationForm == null ? new Base[0] : this.publicationForm.toArray(new Base[this.publicationForm.size()]); // CitationCitedArtifactPublicationFormComponent
1814        case -828032215: /*webLocation*/ return this.webLocation == null ? new Base[0] : this.webLocation.toArray(new Base[this.webLocation.size()]); // CitationCitedArtifactWebLocationComponent
1815        case 382350310: /*classification*/ return this.classification == null ? new Base[0] : this.classification.toArray(new Base[this.classification.size()]); // CitationCitedArtifactClassificationComponent
1816        case 538727831: /*contributorship*/ return this.contributorship == null ? new Base[0] : new Base[] {this.contributorship}; // CitationCitedArtifactContributorshipComponent
1817        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1818        default: return super.getProperty(hash, name, checkValid);
1819        }
1820
1821      }
1822
1823      @Override
1824      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1825        switch (hash) {
1826        case -1618432855: // identifier
1827          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1828          return value;
1829        case -1007604940: // relatedIdentifier
1830          this.getRelatedIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1831          return value;
1832        case 540917457: // dateAccessed
1833          this.dateAccessed = TypeConvertor.castToDateTime(value); // DateTimeType
1834          return value;
1835        case 351608024: // version
1836          this.version = (CitationCitedArtifactVersionComponent) value; // CitationCitedArtifactVersionComponent
1837          return value;
1838        case 1457822360: // currentState
1839          this.getCurrentState().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1840          return value;
1841        case 247524032: // statusDate
1842          this.getStatusDate().add((CitationCitedArtifactStatusDateComponent) value); // CitationCitedArtifactStatusDateComponent
1843          return value;
1844        case 110371416: // title
1845          this.getTitle().add((CitationCitedArtifactTitleComponent) value); // CitationCitedArtifactTitleComponent
1846          return value;
1847        case 1732898850: // abstract
1848          this.getAbstract().add((CitationCitedArtifactAbstractComponent) value); // CitationCitedArtifactAbstractComponent
1849          return value;
1850        case 3433459: // part
1851          this.part = (CitationCitedArtifactPartComponent) value; // CitationCitedArtifactPartComponent
1852          return value;
1853        case -7765931: // relatesTo
1854          this.getRelatesTo().add((CitationCitedArtifactRelatesToComponent) value); // CitationCitedArtifactRelatesToComponent
1855          return value;
1856        case 1470639376: // publicationForm
1857          this.getPublicationForm().add((CitationCitedArtifactPublicationFormComponent) value); // CitationCitedArtifactPublicationFormComponent
1858          return value;
1859        case -828032215: // webLocation
1860          this.getWebLocation().add((CitationCitedArtifactWebLocationComponent) value); // CitationCitedArtifactWebLocationComponent
1861          return value;
1862        case 382350310: // classification
1863          this.getClassification().add((CitationCitedArtifactClassificationComponent) value); // CitationCitedArtifactClassificationComponent
1864          return value;
1865        case 538727831: // contributorship
1866          this.contributorship = (CitationCitedArtifactContributorshipComponent) value; // CitationCitedArtifactContributorshipComponent
1867          return value;
1868        case 3387378: // note
1869          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
1870          return value;
1871        default: return super.setProperty(hash, name, value);
1872        }
1873
1874      }
1875
1876      @Override
1877      public Base setProperty(String name, Base value) throws FHIRException {
1878        if (name.equals("identifier")) {
1879          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1880        } else if (name.equals("relatedIdentifier")) {
1881          this.getRelatedIdentifier().add(TypeConvertor.castToIdentifier(value));
1882        } else if (name.equals("dateAccessed")) {
1883          this.dateAccessed = TypeConvertor.castToDateTime(value); // DateTimeType
1884        } else if (name.equals("version")) {
1885          this.version = (CitationCitedArtifactVersionComponent) value; // CitationCitedArtifactVersionComponent
1886        } else if (name.equals("currentState")) {
1887          this.getCurrentState().add(TypeConvertor.castToCodeableConcept(value));
1888        } else if (name.equals("statusDate")) {
1889          this.getStatusDate().add((CitationCitedArtifactStatusDateComponent) value);
1890        } else if (name.equals("title")) {
1891          this.getTitle().add((CitationCitedArtifactTitleComponent) value);
1892        } else if (name.equals("abstract")) {
1893          this.getAbstract().add((CitationCitedArtifactAbstractComponent) value);
1894        } else if (name.equals("part")) {
1895          this.part = (CitationCitedArtifactPartComponent) value; // CitationCitedArtifactPartComponent
1896        } else if (name.equals("relatesTo")) {
1897          this.getRelatesTo().add((CitationCitedArtifactRelatesToComponent) value);
1898        } else if (name.equals("publicationForm")) {
1899          this.getPublicationForm().add((CitationCitedArtifactPublicationFormComponent) value);
1900        } else if (name.equals("webLocation")) {
1901          this.getWebLocation().add((CitationCitedArtifactWebLocationComponent) value);
1902        } else if (name.equals("classification")) {
1903          this.getClassification().add((CitationCitedArtifactClassificationComponent) value);
1904        } else if (name.equals("contributorship")) {
1905          this.contributorship = (CitationCitedArtifactContributorshipComponent) value; // CitationCitedArtifactContributorshipComponent
1906        } else if (name.equals("note")) {
1907          this.getNote().add(TypeConvertor.castToAnnotation(value));
1908        } else
1909          return super.setProperty(name, value);
1910        return value;
1911      }
1912
1913      @Override
1914      public Base makeProperty(int hash, String name) throws FHIRException {
1915        switch (hash) {
1916        case -1618432855:  return addIdentifier(); 
1917        case -1007604940:  return addRelatedIdentifier(); 
1918        case 540917457:  return getDateAccessedElement();
1919        case 351608024:  return getVersion();
1920        case 1457822360:  return addCurrentState(); 
1921        case 247524032:  return addStatusDate(); 
1922        case 110371416:  return addTitle(); 
1923        case 1732898850:  return addAbstract(); 
1924        case 3433459:  return getPart();
1925        case -7765931:  return addRelatesTo(); 
1926        case 1470639376:  return addPublicationForm(); 
1927        case -828032215:  return addWebLocation(); 
1928        case 382350310:  return addClassification(); 
1929        case 538727831:  return getContributorship();
1930        case 3387378:  return addNote(); 
1931        default: return super.makeProperty(hash, name);
1932        }
1933
1934      }
1935
1936      @Override
1937      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1938        switch (hash) {
1939        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1940        case -1007604940: /*relatedIdentifier*/ return new String[] {"Identifier"};
1941        case 540917457: /*dateAccessed*/ return new String[] {"dateTime"};
1942        case 351608024: /*version*/ return new String[] {};
1943        case 1457822360: /*currentState*/ return new String[] {"CodeableConcept"};
1944        case 247524032: /*statusDate*/ return new String[] {};
1945        case 110371416: /*title*/ return new String[] {};
1946        case 1732898850: /*abstract*/ return new String[] {};
1947        case 3433459: /*part*/ return new String[] {};
1948        case -7765931: /*relatesTo*/ return new String[] {};
1949        case 1470639376: /*publicationForm*/ return new String[] {};
1950        case -828032215: /*webLocation*/ return new String[] {};
1951        case 382350310: /*classification*/ return new String[] {};
1952        case 538727831: /*contributorship*/ return new String[] {};
1953        case 3387378: /*note*/ return new String[] {"Annotation"};
1954        default: return super.getTypesForProperty(hash, name);
1955        }
1956
1957      }
1958
1959      @Override
1960      public Base addChild(String name) throws FHIRException {
1961        if (name.equals("identifier")) {
1962          return addIdentifier();
1963        }
1964        else if (name.equals("relatedIdentifier")) {
1965          return addRelatedIdentifier();
1966        }
1967        else if (name.equals("dateAccessed")) {
1968          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.dateAccessed");
1969        }
1970        else if (name.equals("version")) {
1971          this.version = new CitationCitedArtifactVersionComponent();
1972          return this.version;
1973        }
1974        else if (name.equals("currentState")) {
1975          return addCurrentState();
1976        }
1977        else if (name.equals("statusDate")) {
1978          return addStatusDate();
1979        }
1980        else if (name.equals("title")) {
1981          return addTitle();
1982        }
1983        else if (name.equals("abstract")) {
1984          return addAbstract();
1985        }
1986        else if (name.equals("part")) {
1987          this.part = new CitationCitedArtifactPartComponent();
1988          return this.part;
1989        }
1990        else if (name.equals("relatesTo")) {
1991          return addRelatesTo();
1992        }
1993        else if (name.equals("publicationForm")) {
1994          return addPublicationForm();
1995        }
1996        else if (name.equals("webLocation")) {
1997          return addWebLocation();
1998        }
1999        else if (name.equals("classification")) {
2000          return addClassification();
2001        }
2002        else if (name.equals("contributorship")) {
2003          this.contributorship = new CitationCitedArtifactContributorshipComponent();
2004          return this.contributorship;
2005        }
2006        else if (name.equals("note")) {
2007          return addNote();
2008        }
2009        else
2010          return super.addChild(name);
2011      }
2012
2013      public CitationCitedArtifactComponent copy() {
2014        CitationCitedArtifactComponent dst = new CitationCitedArtifactComponent();
2015        copyValues(dst);
2016        return dst;
2017      }
2018
2019      public void copyValues(CitationCitedArtifactComponent dst) {
2020        super.copyValues(dst);
2021        if (identifier != null) {
2022          dst.identifier = new ArrayList<Identifier>();
2023          for (Identifier i : identifier)
2024            dst.identifier.add(i.copy());
2025        };
2026        if (relatedIdentifier != null) {
2027          dst.relatedIdentifier = new ArrayList<Identifier>();
2028          for (Identifier i : relatedIdentifier)
2029            dst.relatedIdentifier.add(i.copy());
2030        };
2031        dst.dateAccessed = dateAccessed == null ? null : dateAccessed.copy();
2032        dst.version = version == null ? null : version.copy();
2033        if (currentState != null) {
2034          dst.currentState = new ArrayList<CodeableConcept>();
2035          for (CodeableConcept i : currentState)
2036            dst.currentState.add(i.copy());
2037        };
2038        if (statusDate != null) {
2039          dst.statusDate = new ArrayList<CitationCitedArtifactStatusDateComponent>();
2040          for (CitationCitedArtifactStatusDateComponent i : statusDate)
2041            dst.statusDate.add(i.copy());
2042        };
2043        if (title != null) {
2044          dst.title = new ArrayList<CitationCitedArtifactTitleComponent>();
2045          for (CitationCitedArtifactTitleComponent i : title)
2046            dst.title.add(i.copy());
2047        };
2048        if (abstract_ != null) {
2049          dst.abstract_ = new ArrayList<CitationCitedArtifactAbstractComponent>();
2050          for (CitationCitedArtifactAbstractComponent i : abstract_)
2051            dst.abstract_.add(i.copy());
2052        };
2053        dst.part = part == null ? null : part.copy();
2054        if (relatesTo != null) {
2055          dst.relatesTo = new ArrayList<CitationCitedArtifactRelatesToComponent>();
2056          for (CitationCitedArtifactRelatesToComponent i : relatesTo)
2057            dst.relatesTo.add(i.copy());
2058        };
2059        if (publicationForm != null) {
2060          dst.publicationForm = new ArrayList<CitationCitedArtifactPublicationFormComponent>();
2061          for (CitationCitedArtifactPublicationFormComponent i : publicationForm)
2062            dst.publicationForm.add(i.copy());
2063        };
2064        if (webLocation != null) {
2065          dst.webLocation = new ArrayList<CitationCitedArtifactWebLocationComponent>();
2066          for (CitationCitedArtifactWebLocationComponent i : webLocation)
2067            dst.webLocation.add(i.copy());
2068        };
2069        if (classification != null) {
2070          dst.classification = new ArrayList<CitationCitedArtifactClassificationComponent>();
2071          for (CitationCitedArtifactClassificationComponent i : classification)
2072            dst.classification.add(i.copy());
2073        };
2074        dst.contributorship = contributorship == null ? null : contributorship.copy();
2075        if (note != null) {
2076          dst.note = new ArrayList<Annotation>();
2077          for (Annotation i : note)
2078            dst.note.add(i.copy());
2079        };
2080      }
2081
2082      @Override
2083      public boolean equalsDeep(Base other_) {
2084        if (!super.equalsDeep(other_))
2085          return false;
2086        if (!(other_ instanceof CitationCitedArtifactComponent))
2087          return false;
2088        CitationCitedArtifactComponent o = (CitationCitedArtifactComponent) other_;
2089        return compareDeep(identifier, o.identifier, true) && compareDeep(relatedIdentifier, o.relatedIdentifier, true)
2090           && compareDeep(dateAccessed, o.dateAccessed, true) && compareDeep(version, o.version, true) && compareDeep(currentState, o.currentState, true)
2091           && compareDeep(statusDate, o.statusDate, true) && compareDeep(title, o.title, true) && compareDeep(abstract_, o.abstract_, true)
2092           && compareDeep(part, o.part, true) && compareDeep(relatesTo, o.relatesTo, true) && compareDeep(publicationForm, o.publicationForm, true)
2093           && compareDeep(webLocation, o.webLocation, true) && compareDeep(classification, o.classification, true)
2094           && compareDeep(contributorship, o.contributorship, true) && compareDeep(note, o.note, true);
2095      }
2096
2097      @Override
2098      public boolean equalsShallow(Base other_) {
2099        if (!super.equalsShallow(other_))
2100          return false;
2101        if (!(other_ instanceof CitationCitedArtifactComponent))
2102          return false;
2103        CitationCitedArtifactComponent o = (CitationCitedArtifactComponent) other_;
2104        return compareValues(dateAccessed, o.dateAccessed, true);
2105      }
2106
2107      public boolean isEmpty() {
2108        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, relatedIdentifier
2109          , dateAccessed, version, currentState, statusDate, title, abstract_, part, relatesTo
2110          , publicationForm, webLocation, classification, contributorship, note);
2111      }
2112
2113  public String fhirType() {
2114    return "Citation.citedArtifact";
2115
2116  }
2117
2118  }
2119
2120    @Block()
2121    public static class CitationCitedArtifactVersionComponent extends BackboneElement implements IBaseBackboneElement {
2122        /**
2123         * The version number or other version identifier.
2124         */
2125        @Child(name = "value", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
2126        @Description(shortDefinition="The version number or other version identifier", formalDefinition="The version number or other version identifier." )
2127        protected StringType value;
2128
2129        /**
2130         * Citation for the main version of the cited artifact.
2131         */
2132        @Child(name = "baseCitation", type = {Citation.class}, order=2, min=0, max=1, modifier=false, summary=false)
2133        @Description(shortDefinition="Citation for the main version of the cited artifact", formalDefinition="Citation for the main version of the cited artifact." )
2134        protected Reference baseCitation;
2135
2136        private static final long serialVersionUID = 1437090319L;
2137
2138    /**
2139     * Constructor
2140     */
2141      public CitationCitedArtifactVersionComponent() {
2142        super();
2143      }
2144
2145    /**
2146     * Constructor
2147     */
2148      public CitationCitedArtifactVersionComponent(String value) {
2149        super();
2150        this.setValue(value);
2151      }
2152
2153        /**
2154         * @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
2155         */
2156        public StringType getValueElement() { 
2157          if (this.value == null)
2158            if (Configuration.errorOnAutoCreate())
2159              throw new Error("Attempt to auto-create CitationCitedArtifactVersionComponent.value");
2160            else if (Configuration.doAutoCreate())
2161              this.value = new StringType(); // bb
2162          return this.value;
2163        }
2164
2165        public boolean hasValueElement() { 
2166          return this.value != null && !this.value.isEmpty();
2167        }
2168
2169        public boolean hasValue() { 
2170          return this.value != null && !this.value.isEmpty();
2171        }
2172
2173        /**
2174         * @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
2175         */
2176        public CitationCitedArtifactVersionComponent setValueElement(StringType value) { 
2177          this.value = value;
2178          return this;
2179        }
2180
2181        /**
2182         * @return The version number or other version identifier.
2183         */
2184        public String getValue() { 
2185          return this.value == null ? null : this.value.getValue();
2186        }
2187
2188        /**
2189         * @param value The version number or other version identifier.
2190         */
2191        public CitationCitedArtifactVersionComponent setValue(String value) { 
2192            if (this.value == null)
2193              this.value = new StringType();
2194            this.value.setValue(value);
2195          return this;
2196        }
2197
2198        /**
2199         * @return {@link #baseCitation} (Citation for the main version of the cited artifact.)
2200         */
2201        public Reference getBaseCitation() { 
2202          if (this.baseCitation == null)
2203            if (Configuration.errorOnAutoCreate())
2204              throw new Error("Attempt to auto-create CitationCitedArtifactVersionComponent.baseCitation");
2205            else if (Configuration.doAutoCreate())
2206              this.baseCitation = new Reference(); // cc
2207          return this.baseCitation;
2208        }
2209
2210        public boolean hasBaseCitation() { 
2211          return this.baseCitation != null && !this.baseCitation.isEmpty();
2212        }
2213
2214        /**
2215         * @param value {@link #baseCitation} (Citation for the main version of the cited artifact.)
2216         */
2217        public CitationCitedArtifactVersionComponent setBaseCitation(Reference value) { 
2218          this.baseCitation = value;
2219          return this;
2220        }
2221
2222        protected void listChildren(List<Property> children) {
2223          super.listChildren(children);
2224          children.add(new Property("value", "string", "The version number or other version identifier.", 0, 1, value));
2225          children.add(new Property("baseCitation", "Reference(Citation)", "Citation for the main version of the cited artifact.", 0, 1, baseCitation));
2226        }
2227
2228        @Override
2229        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2230          switch (_hash) {
2231          case 111972721: /*value*/  return new Property("value", "string", "The version number or other version identifier.", 0, 1, value);
2232          case 1182995672: /*baseCitation*/  return new Property("baseCitation", "Reference(Citation)", "Citation for the main version of the cited artifact.", 0, 1, baseCitation);
2233          default: return super.getNamedProperty(_hash, _name, _checkValid);
2234          }
2235
2236        }
2237
2238      @Override
2239      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2240        switch (hash) {
2241        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
2242        case 1182995672: /*baseCitation*/ return this.baseCitation == null ? new Base[0] : new Base[] {this.baseCitation}; // Reference
2243        default: return super.getProperty(hash, name, checkValid);
2244        }
2245
2246      }
2247
2248      @Override
2249      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2250        switch (hash) {
2251        case 111972721: // value
2252          this.value = TypeConvertor.castToString(value); // StringType
2253          return value;
2254        case 1182995672: // baseCitation
2255          this.baseCitation = TypeConvertor.castToReference(value); // Reference
2256          return value;
2257        default: return super.setProperty(hash, name, value);
2258        }
2259
2260      }
2261
2262      @Override
2263      public Base setProperty(String name, Base value) throws FHIRException {
2264        if (name.equals("value")) {
2265          this.value = TypeConvertor.castToString(value); // StringType
2266        } else if (name.equals("baseCitation")) {
2267          this.baseCitation = TypeConvertor.castToReference(value); // Reference
2268        } else
2269          return super.setProperty(name, value);
2270        return value;
2271      }
2272
2273      @Override
2274      public Base makeProperty(int hash, String name) throws FHIRException {
2275        switch (hash) {
2276        case 111972721:  return getValueElement();
2277        case 1182995672:  return getBaseCitation();
2278        default: return super.makeProperty(hash, name);
2279        }
2280
2281      }
2282
2283      @Override
2284      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2285        switch (hash) {
2286        case 111972721: /*value*/ return new String[] {"string"};
2287        case 1182995672: /*baseCitation*/ return new String[] {"Reference"};
2288        default: return super.getTypesForProperty(hash, name);
2289        }
2290
2291      }
2292
2293      @Override
2294      public Base addChild(String name) throws FHIRException {
2295        if (name.equals("value")) {
2296          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.version.value");
2297        }
2298        else if (name.equals("baseCitation")) {
2299          this.baseCitation = new Reference();
2300          return this.baseCitation;
2301        }
2302        else
2303          return super.addChild(name);
2304      }
2305
2306      public CitationCitedArtifactVersionComponent copy() {
2307        CitationCitedArtifactVersionComponent dst = new CitationCitedArtifactVersionComponent();
2308        copyValues(dst);
2309        return dst;
2310      }
2311
2312      public void copyValues(CitationCitedArtifactVersionComponent dst) {
2313        super.copyValues(dst);
2314        dst.value = value == null ? null : value.copy();
2315        dst.baseCitation = baseCitation == null ? null : baseCitation.copy();
2316      }
2317
2318      @Override
2319      public boolean equalsDeep(Base other_) {
2320        if (!super.equalsDeep(other_))
2321          return false;
2322        if (!(other_ instanceof CitationCitedArtifactVersionComponent))
2323          return false;
2324        CitationCitedArtifactVersionComponent o = (CitationCitedArtifactVersionComponent) other_;
2325        return compareDeep(value, o.value, true) && compareDeep(baseCitation, o.baseCitation, true);
2326      }
2327
2328      @Override
2329      public boolean equalsShallow(Base other_) {
2330        if (!super.equalsShallow(other_))
2331          return false;
2332        if (!(other_ instanceof CitationCitedArtifactVersionComponent))
2333          return false;
2334        CitationCitedArtifactVersionComponent o = (CitationCitedArtifactVersionComponent) other_;
2335        return compareValues(value, o.value, true);
2336      }
2337
2338      public boolean isEmpty() {
2339        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value, baseCitation);
2340      }
2341
2342  public String fhirType() {
2343    return "Citation.citedArtifact.version";
2344
2345  }
2346
2347  }
2348
2349    @Block()
2350    public static class CitationCitedArtifactStatusDateComponent extends BackboneElement implements IBaseBackboneElement {
2351        /**
2352         * Classification of the status.
2353         */
2354        @Child(name = "activity", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
2355        @Description(shortDefinition="Classification of the status", formalDefinition="Classification of the status." )
2356        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-status-type")
2357        protected CodeableConcept activity;
2358
2359        /**
2360         * Either occurred or expected.
2361         */
2362        @Child(name = "actual", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2363        @Description(shortDefinition="Either occurred or expected", formalDefinition="Either occurred or expected." )
2364        protected BooleanType actual;
2365
2366        /**
2367         * When the status started and/or ended.
2368         */
2369        @Child(name = "period", type = {Period.class}, order=3, min=1, max=1, modifier=false, summary=false)
2370        @Description(shortDefinition="When the status started and/or ended", formalDefinition="When the status started and/or ended." )
2371        protected Period period;
2372
2373        private static final long serialVersionUID = 1123586924L;
2374
2375    /**
2376     * Constructor
2377     */
2378      public CitationCitedArtifactStatusDateComponent() {
2379        super();
2380      }
2381
2382    /**
2383     * Constructor
2384     */
2385      public CitationCitedArtifactStatusDateComponent(CodeableConcept activity, Period period) {
2386        super();
2387        this.setActivity(activity);
2388        this.setPeriod(period);
2389      }
2390
2391        /**
2392         * @return {@link #activity} (Classification of the status.)
2393         */
2394        public CodeableConcept getActivity() { 
2395          if (this.activity == null)
2396            if (Configuration.errorOnAutoCreate())
2397              throw new Error("Attempt to auto-create CitationCitedArtifactStatusDateComponent.activity");
2398            else if (Configuration.doAutoCreate())
2399              this.activity = new CodeableConcept(); // cc
2400          return this.activity;
2401        }
2402
2403        public boolean hasActivity() { 
2404          return this.activity != null && !this.activity.isEmpty();
2405        }
2406
2407        /**
2408         * @param value {@link #activity} (Classification of the status.)
2409         */
2410        public CitationCitedArtifactStatusDateComponent setActivity(CodeableConcept value) { 
2411          this.activity = value;
2412          return this;
2413        }
2414
2415        /**
2416         * @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
2417         */
2418        public BooleanType getActualElement() { 
2419          if (this.actual == null)
2420            if (Configuration.errorOnAutoCreate())
2421              throw new Error("Attempt to auto-create CitationCitedArtifactStatusDateComponent.actual");
2422            else if (Configuration.doAutoCreate())
2423              this.actual = new BooleanType(); // bb
2424          return this.actual;
2425        }
2426
2427        public boolean hasActualElement() { 
2428          return this.actual != null && !this.actual.isEmpty();
2429        }
2430
2431        public boolean hasActual() { 
2432          return this.actual != null && !this.actual.isEmpty();
2433        }
2434
2435        /**
2436         * @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
2437         */
2438        public CitationCitedArtifactStatusDateComponent setActualElement(BooleanType value) { 
2439          this.actual = value;
2440          return this;
2441        }
2442
2443        /**
2444         * @return Either occurred or expected.
2445         */
2446        public boolean getActual() { 
2447          return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue();
2448        }
2449
2450        /**
2451         * @param value Either occurred or expected.
2452         */
2453        public CitationCitedArtifactStatusDateComponent setActual(boolean value) { 
2454            if (this.actual == null)
2455              this.actual = new BooleanType();
2456            this.actual.setValue(value);
2457          return this;
2458        }
2459
2460        /**
2461         * @return {@link #period} (When the status started and/or ended.)
2462         */
2463        public Period getPeriod() { 
2464          if (this.period == null)
2465            if (Configuration.errorOnAutoCreate())
2466              throw new Error("Attempt to auto-create CitationCitedArtifactStatusDateComponent.period");
2467            else if (Configuration.doAutoCreate())
2468              this.period = new Period(); // cc
2469          return this.period;
2470        }
2471
2472        public boolean hasPeriod() { 
2473          return this.period != null && !this.period.isEmpty();
2474        }
2475
2476        /**
2477         * @param value {@link #period} (When the status started and/or ended.)
2478         */
2479        public CitationCitedArtifactStatusDateComponent setPeriod(Period value) { 
2480          this.period = value;
2481          return this;
2482        }
2483
2484        protected void listChildren(List<Property> children) {
2485          super.listChildren(children);
2486          children.add(new Property("activity", "CodeableConcept", "Classification of the status.", 0, 1, activity));
2487          children.add(new Property("actual", "boolean", "Either occurred or expected.", 0, 1, actual));
2488          children.add(new Property("period", "Period", "When the status started and/or ended.", 0, 1, period));
2489        }
2490
2491        @Override
2492        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2493          switch (_hash) {
2494          case -1655966961: /*activity*/  return new Property("activity", "CodeableConcept", "Classification of the status.", 0, 1, activity);
2495          case -1422939762: /*actual*/  return new Property("actual", "boolean", "Either occurred or expected.", 0, 1, actual);
2496          case -991726143: /*period*/  return new Property("period", "Period", "When the status started and/or ended.", 0, 1, period);
2497          default: return super.getNamedProperty(_hash, _name, _checkValid);
2498          }
2499
2500        }
2501
2502      @Override
2503      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2504        switch (hash) {
2505        case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : new Base[] {this.activity}; // CodeableConcept
2506        case -1422939762: /*actual*/ return this.actual == null ? new Base[0] : new Base[] {this.actual}; // BooleanType
2507        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
2508        default: return super.getProperty(hash, name, checkValid);
2509        }
2510
2511      }
2512
2513      @Override
2514      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2515        switch (hash) {
2516        case -1655966961: // activity
2517          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2518          return value;
2519        case -1422939762: // actual
2520          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
2521          return value;
2522        case -991726143: // period
2523          this.period = TypeConvertor.castToPeriod(value); // Period
2524          return value;
2525        default: return super.setProperty(hash, name, value);
2526        }
2527
2528      }
2529
2530      @Override
2531      public Base setProperty(String name, Base value) throws FHIRException {
2532        if (name.equals("activity")) {
2533          this.activity = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2534        } else if (name.equals("actual")) {
2535          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
2536        } else if (name.equals("period")) {
2537          this.period = TypeConvertor.castToPeriod(value); // Period
2538        } else
2539          return super.setProperty(name, value);
2540        return value;
2541      }
2542
2543      @Override
2544      public Base makeProperty(int hash, String name) throws FHIRException {
2545        switch (hash) {
2546        case -1655966961:  return getActivity();
2547        case -1422939762:  return getActualElement();
2548        case -991726143:  return getPeriod();
2549        default: return super.makeProperty(hash, name);
2550        }
2551
2552      }
2553
2554      @Override
2555      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2556        switch (hash) {
2557        case -1655966961: /*activity*/ return new String[] {"CodeableConcept"};
2558        case -1422939762: /*actual*/ return new String[] {"boolean"};
2559        case -991726143: /*period*/ return new String[] {"Period"};
2560        default: return super.getTypesForProperty(hash, name);
2561        }
2562
2563      }
2564
2565      @Override
2566      public Base addChild(String name) throws FHIRException {
2567        if (name.equals("activity")) {
2568          this.activity = new CodeableConcept();
2569          return this.activity;
2570        }
2571        else if (name.equals("actual")) {
2572          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.statusDate.actual");
2573        }
2574        else if (name.equals("period")) {
2575          this.period = new Period();
2576          return this.period;
2577        }
2578        else
2579          return super.addChild(name);
2580      }
2581
2582      public CitationCitedArtifactStatusDateComponent copy() {
2583        CitationCitedArtifactStatusDateComponent dst = new CitationCitedArtifactStatusDateComponent();
2584        copyValues(dst);
2585        return dst;
2586      }
2587
2588      public void copyValues(CitationCitedArtifactStatusDateComponent dst) {
2589        super.copyValues(dst);
2590        dst.activity = activity == null ? null : activity.copy();
2591        dst.actual = actual == null ? null : actual.copy();
2592        dst.period = period == null ? null : period.copy();
2593      }
2594
2595      @Override
2596      public boolean equalsDeep(Base other_) {
2597        if (!super.equalsDeep(other_))
2598          return false;
2599        if (!(other_ instanceof CitationCitedArtifactStatusDateComponent))
2600          return false;
2601        CitationCitedArtifactStatusDateComponent o = (CitationCitedArtifactStatusDateComponent) other_;
2602        return compareDeep(activity, o.activity, true) && compareDeep(actual, o.actual, true) && compareDeep(period, o.period, true)
2603          ;
2604      }
2605
2606      @Override
2607      public boolean equalsShallow(Base other_) {
2608        if (!super.equalsShallow(other_))
2609          return false;
2610        if (!(other_ instanceof CitationCitedArtifactStatusDateComponent))
2611          return false;
2612        CitationCitedArtifactStatusDateComponent o = (CitationCitedArtifactStatusDateComponent) other_;
2613        return compareValues(actual, o.actual, true);
2614      }
2615
2616      public boolean isEmpty() {
2617        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(activity, actual, period
2618          );
2619      }
2620
2621  public String fhirType() {
2622    return "Citation.citedArtifact.statusDate";
2623
2624  }
2625
2626  }
2627
2628    @Block()
2629    public static class CitationCitedArtifactTitleComponent extends BackboneElement implements IBaseBackboneElement {
2630        /**
2631         * Used to express the reason or specific aspect for the title.
2632         */
2633        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2634        @Description(shortDefinition="The kind of title", formalDefinition="Used to express the reason or specific aspect for the title." )
2635        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/title-type")
2636        protected List<CodeableConcept> type;
2637
2638        /**
2639         * Used to express the specific language.
2640         */
2641        @Child(name = "language", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
2642        @Description(shortDefinition="Used to express the specific language", formalDefinition="Used to express the specific language." )
2643        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
2644        protected CodeableConcept language;
2645
2646        /**
2647         * The title of the article or artifact.
2648         */
2649        @Child(name = "text", type = {MarkdownType.class}, order=3, min=1, max=1, modifier=false, summary=false)
2650        @Description(shortDefinition="The title of the article or artifact", formalDefinition="The title of the article or artifact." )
2651        protected MarkdownType text;
2652
2653        private static final long serialVersionUID = 1526221998L;
2654
2655    /**
2656     * Constructor
2657     */
2658      public CitationCitedArtifactTitleComponent() {
2659        super();
2660      }
2661
2662    /**
2663     * Constructor
2664     */
2665      public CitationCitedArtifactTitleComponent(String text) {
2666        super();
2667        this.setText(text);
2668      }
2669
2670        /**
2671         * @return {@link #type} (Used to express the reason or specific aspect for the title.)
2672         */
2673        public List<CodeableConcept> getType() { 
2674          if (this.type == null)
2675            this.type = new ArrayList<CodeableConcept>();
2676          return this.type;
2677        }
2678
2679        /**
2680         * @return Returns a reference to <code>this</code> for easy method chaining
2681         */
2682        public CitationCitedArtifactTitleComponent setType(List<CodeableConcept> theType) { 
2683          this.type = theType;
2684          return this;
2685        }
2686
2687        public boolean hasType() { 
2688          if (this.type == null)
2689            return false;
2690          for (CodeableConcept item : this.type)
2691            if (!item.isEmpty())
2692              return true;
2693          return false;
2694        }
2695
2696        public CodeableConcept addType() { //3
2697          CodeableConcept t = new CodeableConcept();
2698          if (this.type == null)
2699            this.type = new ArrayList<CodeableConcept>();
2700          this.type.add(t);
2701          return t;
2702        }
2703
2704        public CitationCitedArtifactTitleComponent addType(CodeableConcept t) { //3
2705          if (t == null)
2706            return this;
2707          if (this.type == null)
2708            this.type = new ArrayList<CodeableConcept>();
2709          this.type.add(t);
2710          return this;
2711        }
2712
2713        /**
2714         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
2715         */
2716        public CodeableConcept getTypeFirstRep() { 
2717          if (getType().isEmpty()) {
2718            addType();
2719          }
2720          return getType().get(0);
2721        }
2722
2723        /**
2724         * @return {@link #language} (Used to express the specific language.)
2725         */
2726        public CodeableConcept getLanguage() { 
2727          if (this.language == null)
2728            if (Configuration.errorOnAutoCreate())
2729              throw new Error("Attempt to auto-create CitationCitedArtifactTitleComponent.language");
2730            else if (Configuration.doAutoCreate())
2731              this.language = new CodeableConcept(); // cc
2732          return this.language;
2733        }
2734
2735        public boolean hasLanguage() { 
2736          return this.language != null && !this.language.isEmpty();
2737        }
2738
2739        /**
2740         * @param value {@link #language} (Used to express the specific language.)
2741         */
2742        public CitationCitedArtifactTitleComponent setLanguage(CodeableConcept value) { 
2743          this.language = value;
2744          return this;
2745        }
2746
2747        /**
2748         * @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
2749         */
2750        public MarkdownType getTextElement() { 
2751          if (this.text == null)
2752            if (Configuration.errorOnAutoCreate())
2753              throw new Error("Attempt to auto-create CitationCitedArtifactTitleComponent.text");
2754            else if (Configuration.doAutoCreate())
2755              this.text = new MarkdownType(); // bb
2756          return this.text;
2757        }
2758
2759        public boolean hasTextElement() { 
2760          return this.text != null && !this.text.isEmpty();
2761        }
2762
2763        public boolean hasText() { 
2764          return this.text != null && !this.text.isEmpty();
2765        }
2766
2767        /**
2768         * @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
2769         */
2770        public CitationCitedArtifactTitleComponent setTextElement(MarkdownType value) { 
2771          this.text = value;
2772          return this;
2773        }
2774
2775        /**
2776         * @return The title of the article or artifact.
2777         */
2778        public String getText() { 
2779          return this.text == null ? null : this.text.getValue();
2780        }
2781
2782        /**
2783         * @param value The title of the article or artifact.
2784         */
2785        public CitationCitedArtifactTitleComponent setText(String value) { 
2786            if (this.text == null)
2787              this.text = new MarkdownType();
2788            this.text.setValue(value);
2789          return this;
2790        }
2791
2792        protected void listChildren(List<Property> children) {
2793          super.listChildren(children);
2794          children.add(new Property("type", "CodeableConcept", "Used to express the reason or specific aspect for the title.", 0, java.lang.Integer.MAX_VALUE, type));
2795          children.add(new Property("language", "CodeableConcept", "Used to express the specific language.", 0, 1, language));
2796          children.add(new Property("text", "markdown", "The title of the article or artifact.", 0, 1, text));
2797        }
2798
2799        @Override
2800        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2801          switch (_hash) {
2802          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);
2803          case -1613589672: /*language*/  return new Property("language", "CodeableConcept", "Used to express the specific language.", 0, 1, language);
2804          case 3556653: /*text*/  return new Property("text", "markdown", "The title of the article or artifact.", 0, 1, text);
2805          default: return super.getNamedProperty(_hash, _name, _checkValid);
2806          }
2807
2808        }
2809
2810      @Override
2811      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2812        switch (hash) {
2813        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
2814        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept
2815        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // MarkdownType
2816        default: return super.getProperty(hash, name, checkValid);
2817        }
2818
2819      }
2820
2821      @Override
2822      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2823        switch (hash) {
2824        case 3575610: // type
2825          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2826          return value;
2827        case -1613589672: // language
2828          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2829          return value;
2830        case 3556653: // text
2831          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
2832          return value;
2833        default: return super.setProperty(hash, name, value);
2834        }
2835
2836      }
2837
2838      @Override
2839      public Base setProperty(String name, Base value) throws FHIRException {
2840        if (name.equals("type")) {
2841          this.getType().add(TypeConvertor.castToCodeableConcept(value));
2842        } else if (name.equals("language")) {
2843          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2844        } else if (name.equals("text")) {
2845          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
2846        } else
2847          return super.setProperty(name, value);
2848        return value;
2849      }
2850
2851      @Override
2852      public Base makeProperty(int hash, String name) throws FHIRException {
2853        switch (hash) {
2854        case 3575610:  return addType(); 
2855        case -1613589672:  return getLanguage();
2856        case 3556653:  return getTextElement();
2857        default: return super.makeProperty(hash, name);
2858        }
2859
2860      }
2861
2862      @Override
2863      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2864        switch (hash) {
2865        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2866        case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
2867        case 3556653: /*text*/ return new String[] {"markdown"};
2868        default: return super.getTypesForProperty(hash, name);
2869        }
2870
2871      }
2872
2873      @Override
2874      public Base addChild(String name) throws FHIRException {
2875        if (name.equals("type")) {
2876          return addType();
2877        }
2878        else if (name.equals("language")) {
2879          this.language = new CodeableConcept();
2880          return this.language;
2881        }
2882        else if (name.equals("text")) {
2883          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.title.text");
2884        }
2885        else
2886          return super.addChild(name);
2887      }
2888
2889      public CitationCitedArtifactTitleComponent copy() {
2890        CitationCitedArtifactTitleComponent dst = new CitationCitedArtifactTitleComponent();
2891        copyValues(dst);
2892        return dst;
2893      }
2894
2895      public void copyValues(CitationCitedArtifactTitleComponent dst) {
2896        super.copyValues(dst);
2897        if (type != null) {
2898          dst.type = new ArrayList<CodeableConcept>();
2899          for (CodeableConcept i : type)
2900            dst.type.add(i.copy());
2901        };
2902        dst.language = language == null ? null : language.copy();
2903        dst.text = text == null ? null : text.copy();
2904      }
2905
2906      @Override
2907      public boolean equalsDeep(Base other_) {
2908        if (!super.equalsDeep(other_))
2909          return false;
2910        if (!(other_ instanceof CitationCitedArtifactTitleComponent))
2911          return false;
2912        CitationCitedArtifactTitleComponent o = (CitationCitedArtifactTitleComponent) other_;
2913        return compareDeep(type, o.type, true) && compareDeep(language, o.language, true) && compareDeep(text, o.text, true)
2914          ;
2915      }
2916
2917      @Override
2918      public boolean equalsShallow(Base other_) {
2919        if (!super.equalsShallow(other_))
2920          return false;
2921        if (!(other_ instanceof CitationCitedArtifactTitleComponent))
2922          return false;
2923        CitationCitedArtifactTitleComponent o = (CitationCitedArtifactTitleComponent) other_;
2924        return compareValues(text, o.text, true);
2925      }
2926
2927      public boolean isEmpty() {
2928        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, language, text);
2929      }
2930
2931  public String fhirType() {
2932    return "Citation.citedArtifact.title";
2933
2934  }
2935
2936  }
2937
2938    @Block()
2939    public static class CitationCitedArtifactAbstractComponent extends BackboneElement implements IBaseBackboneElement {
2940        /**
2941         * Used to express the reason or specific aspect for the abstract.
2942         */
2943        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
2944        @Description(shortDefinition="The kind of abstract", formalDefinition="Used to express the reason or specific aspect for the abstract." )
2945        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-abstract-type")
2946        protected CodeableConcept type;
2947
2948        /**
2949         * Used to express the specific language.
2950         */
2951        @Child(name = "language", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
2952        @Description(shortDefinition="Used to express the specific language", formalDefinition="Used to express the specific language." )
2953        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
2954        protected CodeableConcept language;
2955
2956        /**
2957         * Abstract content.
2958         */
2959        @Child(name = "text", type = {MarkdownType.class}, order=3, min=1, max=1, modifier=false, summary=false)
2960        @Description(shortDefinition="Abstract content", formalDefinition="Abstract content." )
2961        protected MarkdownType text;
2962
2963        /**
2964         * Copyright notice for the abstract.
2965         */
2966        @Child(name = "copyright", type = {MarkdownType.class}, order=4, min=0, max=1, modifier=false, summary=false)
2967        @Description(shortDefinition="Copyright notice for the abstract", formalDefinition="Copyright notice for the abstract." )
2968        protected MarkdownType copyright;
2969
2970        private static final long serialVersionUID = -1882363442L;
2971
2972    /**
2973     * Constructor
2974     */
2975      public CitationCitedArtifactAbstractComponent() {
2976        super();
2977      }
2978
2979    /**
2980     * Constructor
2981     */
2982      public CitationCitedArtifactAbstractComponent(String text) {
2983        super();
2984        this.setText(text);
2985      }
2986
2987        /**
2988         * @return {@link #type} (Used to express the reason or specific aspect for the abstract.)
2989         */
2990        public CodeableConcept getType() { 
2991          if (this.type == null)
2992            if (Configuration.errorOnAutoCreate())
2993              throw new Error("Attempt to auto-create CitationCitedArtifactAbstractComponent.type");
2994            else if (Configuration.doAutoCreate())
2995              this.type = new CodeableConcept(); // cc
2996          return this.type;
2997        }
2998
2999        public boolean hasType() { 
3000          return this.type != null && !this.type.isEmpty();
3001        }
3002
3003        /**
3004         * @param value {@link #type} (Used to express the reason or specific aspect for the abstract.)
3005         */
3006        public CitationCitedArtifactAbstractComponent setType(CodeableConcept value) { 
3007          this.type = value;
3008          return this;
3009        }
3010
3011        /**
3012         * @return {@link #language} (Used to express the specific language.)
3013         */
3014        public CodeableConcept getLanguage() { 
3015          if (this.language == null)
3016            if (Configuration.errorOnAutoCreate())
3017              throw new Error("Attempt to auto-create CitationCitedArtifactAbstractComponent.language");
3018            else if (Configuration.doAutoCreate())
3019              this.language = new CodeableConcept(); // cc
3020          return this.language;
3021        }
3022
3023        public boolean hasLanguage() { 
3024          return this.language != null && !this.language.isEmpty();
3025        }
3026
3027        /**
3028         * @param value {@link #language} (Used to express the specific language.)
3029         */
3030        public CitationCitedArtifactAbstractComponent setLanguage(CodeableConcept value) { 
3031          this.language = value;
3032          return this;
3033        }
3034
3035        /**
3036         * @return {@link #text} (Abstract content.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
3037         */
3038        public MarkdownType getTextElement() { 
3039          if (this.text == null)
3040            if (Configuration.errorOnAutoCreate())
3041              throw new Error("Attempt to auto-create CitationCitedArtifactAbstractComponent.text");
3042            else if (Configuration.doAutoCreate())
3043              this.text = new MarkdownType(); // bb
3044          return this.text;
3045        }
3046
3047        public boolean hasTextElement() { 
3048          return this.text != null && !this.text.isEmpty();
3049        }
3050
3051        public boolean hasText() { 
3052          return this.text != null && !this.text.isEmpty();
3053        }
3054
3055        /**
3056         * @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
3057         */
3058        public CitationCitedArtifactAbstractComponent setTextElement(MarkdownType value) { 
3059          this.text = value;
3060          return this;
3061        }
3062
3063        /**
3064         * @return Abstract content.
3065         */
3066        public String getText() { 
3067          return this.text == null ? null : this.text.getValue();
3068        }
3069
3070        /**
3071         * @param value Abstract content.
3072         */
3073        public CitationCitedArtifactAbstractComponent setText(String value) { 
3074            if (this.text == null)
3075              this.text = new MarkdownType();
3076            this.text.setValue(value);
3077          return this;
3078        }
3079
3080        /**
3081         * @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
3082         */
3083        public MarkdownType getCopyrightElement() { 
3084          if (this.copyright == null)
3085            if (Configuration.errorOnAutoCreate())
3086              throw new Error("Attempt to auto-create CitationCitedArtifactAbstractComponent.copyright");
3087            else if (Configuration.doAutoCreate())
3088              this.copyright = new MarkdownType(); // bb
3089          return this.copyright;
3090        }
3091
3092        public boolean hasCopyrightElement() { 
3093          return this.copyright != null && !this.copyright.isEmpty();
3094        }
3095
3096        public boolean hasCopyright() { 
3097          return this.copyright != null && !this.copyright.isEmpty();
3098        }
3099
3100        /**
3101         * @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
3102         */
3103        public CitationCitedArtifactAbstractComponent setCopyrightElement(MarkdownType value) { 
3104          this.copyright = value;
3105          return this;
3106        }
3107
3108        /**
3109         * @return Copyright notice for the abstract.
3110         */
3111        public String getCopyright() { 
3112          return this.copyright == null ? null : this.copyright.getValue();
3113        }
3114
3115        /**
3116         * @param value Copyright notice for the abstract.
3117         */
3118        public CitationCitedArtifactAbstractComponent setCopyright(String value) { 
3119          if (value == null)
3120            this.copyright = null;
3121          else {
3122            if (this.copyright == null)
3123              this.copyright = new MarkdownType();
3124            this.copyright.setValue(value);
3125          }
3126          return this;
3127        }
3128
3129        protected void listChildren(List<Property> children) {
3130          super.listChildren(children);
3131          children.add(new Property("type", "CodeableConcept", "Used to express the reason or specific aspect for the abstract.", 0, 1, type));
3132          children.add(new Property("language", "CodeableConcept", "Used to express the specific language.", 0, 1, language));
3133          children.add(new Property("text", "markdown", "Abstract content.", 0, 1, text));
3134          children.add(new Property("copyright", "markdown", "Copyright notice for the abstract.", 0, 1, copyright));
3135        }
3136
3137        @Override
3138        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3139          switch (_hash) {
3140          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Used to express the reason or specific aspect for the abstract.", 0, 1, type);
3141          case -1613589672: /*language*/  return new Property("language", "CodeableConcept", "Used to express the specific language.", 0, 1, language);
3142          case 3556653: /*text*/  return new Property("text", "markdown", "Abstract content.", 0, 1, text);
3143          case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "Copyright notice for the abstract.", 0, 1, copyright);
3144          default: return super.getNamedProperty(_hash, _name, _checkValid);
3145          }
3146
3147        }
3148
3149      @Override
3150      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3151        switch (hash) {
3152        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3153        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept
3154        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // MarkdownType
3155        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
3156        default: return super.getProperty(hash, name, checkValid);
3157        }
3158
3159      }
3160
3161      @Override
3162      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3163        switch (hash) {
3164        case 3575610: // type
3165          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3166          return value;
3167        case -1613589672: // language
3168          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3169          return value;
3170        case 3556653: // text
3171          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
3172          return value;
3173        case 1522889671: // copyright
3174          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
3175          return value;
3176        default: return super.setProperty(hash, name, value);
3177        }
3178
3179      }
3180
3181      @Override
3182      public Base setProperty(String name, Base value) throws FHIRException {
3183        if (name.equals("type")) {
3184          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3185        } else if (name.equals("language")) {
3186          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3187        } else if (name.equals("text")) {
3188          this.text = TypeConvertor.castToMarkdown(value); // MarkdownType
3189        } else if (name.equals("copyright")) {
3190          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
3191        } else
3192          return super.setProperty(name, value);
3193        return value;
3194      }
3195
3196      @Override
3197      public Base makeProperty(int hash, String name) throws FHIRException {
3198        switch (hash) {
3199        case 3575610:  return getType();
3200        case -1613589672:  return getLanguage();
3201        case 3556653:  return getTextElement();
3202        case 1522889671:  return getCopyrightElement();
3203        default: return super.makeProperty(hash, name);
3204        }
3205
3206      }
3207
3208      @Override
3209      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3210        switch (hash) {
3211        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3212        case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
3213        case 3556653: /*text*/ return new String[] {"markdown"};
3214        case 1522889671: /*copyright*/ return new String[] {"markdown"};
3215        default: return super.getTypesForProperty(hash, name);
3216        }
3217
3218      }
3219
3220      @Override
3221      public Base addChild(String name) throws FHIRException {
3222        if (name.equals("type")) {
3223          this.type = new CodeableConcept();
3224          return this.type;
3225        }
3226        else if (name.equals("language")) {
3227          this.language = new CodeableConcept();
3228          return this.language;
3229        }
3230        else if (name.equals("text")) {
3231          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.abstract.text");
3232        }
3233        else if (name.equals("copyright")) {
3234          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.abstract.copyright");
3235        }
3236        else
3237          return super.addChild(name);
3238      }
3239
3240      public CitationCitedArtifactAbstractComponent copy() {
3241        CitationCitedArtifactAbstractComponent dst = new CitationCitedArtifactAbstractComponent();
3242        copyValues(dst);
3243        return dst;
3244      }
3245
3246      public void copyValues(CitationCitedArtifactAbstractComponent dst) {
3247        super.copyValues(dst);
3248        dst.type = type == null ? null : type.copy();
3249        dst.language = language == null ? null : language.copy();
3250        dst.text = text == null ? null : text.copy();
3251        dst.copyright = copyright == null ? null : copyright.copy();
3252      }
3253
3254      @Override
3255      public boolean equalsDeep(Base other_) {
3256        if (!super.equalsDeep(other_))
3257          return false;
3258        if (!(other_ instanceof CitationCitedArtifactAbstractComponent))
3259          return false;
3260        CitationCitedArtifactAbstractComponent o = (CitationCitedArtifactAbstractComponent) other_;
3261        return compareDeep(type, o.type, true) && compareDeep(language, o.language, true) && compareDeep(text, o.text, true)
3262           && compareDeep(copyright, o.copyright, true);
3263      }
3264
3265      @Override
3266      public boolean equalsShallow(Base other_) {
3267        if (!super.equalsShallow(other_))
3268          return false;
3269        if (!(other_ instanceof CitationCitedArtifactAbstractComponent))
3270          return false;
3271        CitationCitedArtifactAbstractComponent o = (CitationCitedArtifactAbstractComponent) other_;
3272        return compareValues(text, o.text, true) && compareValues(copyright, o.copyright, true);
3273      }
3274
3275      public boolean isEmpty() {
3276        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, language, text, copyright
3277          );
3278      }
3279
3280  public String fhirType() {
3281    return "Citation.citedArtifact.abstract";
3282
3283  }
3284
3285  }
3286
3287    @Block()
3288    public static class CitationCitedArtifactPartComponent extends BackboneElement implements IBaseBackboneElement {
3289        /**
3290         * The kind of component.
3291         */
3292        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
3293        @Description(shortDefinition="The kind of component", formalDefinition="The kind of component." )
3294        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-part-type")
3295        protected CodeableConcept type;
3296
3297        /**
3298         * The specification of the component.
3299         */
3300        @Child(name = "value", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
3301        @Description(shortDefinition="The specification of the component", formalDefinition="The specification of the component." )
3302        protected StringType value;
3303
3304        /**
3305         * The citation for the full article or artifact.
3306         */
3307        @Child(name = "baseCitation", type = {Citation.class}, order=3, min=0, max=1, modifier=false, summary=false)
3308        @Description(shortDefinition="The citation for the full article or artifact", formalDefinition="The citation for the full article or artifact." )
3309        protected Reference baseCitation;
3310
3311        private static final long serialVersionUID = -765350500L;
3312
3313    /**
3314     * Constructor
3315     */
3316      public CitationCitedArtifactPartComponent() {
3317        super();
3318      }
3319
3320        /**
3321         * @return {@link #type} (The kind of component.)
3322         */
3323        public CodeableConcept getType() { 
3324          if (this.type == null)
3325            if (Configuration.errorOnAutoCreate())
3326              throw new Error("Attempt to auto-create CitationCitedArtifactPartComponent.type");
3327            else if (Configuration.doAutoCreate())
3328              this.type = new CodeableConcept(); // cc
3329          return this.type;
3330        }
3331
3332        public boolean hasType() { 
3333          return this.type != null && !this.type.isEmpty();
3334        }
3335
3336        /**
3337         * @param value {@link #type} (The kind of component.)
3338         */
3339        public CitationCitedArtifactPartComponent setType(CodeableConcept value) { 
3340          this.type = value;
3341          return this;
3342        }
3343
3344        /**
3345         * @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
3346         */
3347        public StringType getValueElement() { 
3348          if (this.value == null)
3349            if (Configuration.errorOnAutoCreate())
3350              throw new Error("Attempt to auto-create CitationCitedArtifactPartComponent.value");
3351            else if (Configuration.doAutoCreate())
3352              this.value = new StringType(); // bb
3353          return this.value;
3354        }
3355
3356        public boolean hasValueElement() { 
3357          return this.value != null && !this.value.isEmpty();
3358        }
3359
3360        public boolean hasValue() { 
3361          return this.value != null && !this.value.isEmpty();
3362        }
3363
3364        /**
3365         * @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
3366         */
3367        public CitationCitedArtifactPartComponent setValueElement(StringType value) { 
3368          this.value = value;
3369          return this;
3370        }
3371
3372        /**
3373         * @return The specification of the component.
3374         */
3375        public String getValue() { 
3376          return this.value == null ? null : this.value.getValue();
3377        }
3378
3379        /**
3380         * @param value The specification of the component.
3381         */
3382        public CitationCitedArtifactPartComponent setValue(String value) { 
3383          if (Utilities.noString(value))
3384            this.value = null;
3385          else {
3386            if (this.value == null)
3387              this.value = new StringType();
3388            this.value.setValue(value);
3389          }
3390          return this;
3391        }
3392
3393        /**
3394         * @return {@link #baseCitation} (The citation for the full article or artifact.)
3395         */
3396        public Reference getBaseCitation() { 
3397          if (this.baseCitation == null)
3398            if (Configuration.errorOnAutoCreate())
3399              throw new Error("Attempt to auto-create CitationCitedArtifactPartComponent.baseCitation");
3400            else if (Configuration.doAutoCreate())
3401              this.baseCitation = new Reference(); // cc
3402          return this.baseCitation;
3403        }
3404
3405        public boolean hasBaseCitation() { 
3406          return this.baseCitation != null && !this.baseCitation.isEmpty();
3407        }
3408
3409        /**
3410         * @param value {@link #baseCitation} (The citation for the full article or artifact.)
3411         */
3412        public CitationCitedArtifactPartComponent setBaseCitation(Reference value) { 
3413          this.baseCitation = value;
3414          return this;
3415        }
3416
3417        protected void listChildren(List<Property> children) {
3418          super.listChildren(children);
3419          children.add(new Property("type", "CodeableConcept", "The kind of component.", 0, 1, type));
3420          children.add(new Property("value", "string", "The specification of the component.", 0, 1, value));
3421          children.add(new Property("baseCitation", "Reference(Citation)", "The citation for the full article or artifact.", 0, 1, baseCitation));
3422        }
3423
3424        @Override
3425        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3426          switch (_hash) {
3427          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of component.", 0, 1, type);
3428          case 111972721: /*value*/  return new Property("value", "string", "The specification of the component.", 0, 1, value);
3429          case 1182995672: /*baseCitation*/  return new Property("baseCitation", "Reference(Citation)", "The citation for the full article or artifact.", 0, 1, baseCitation);
3430          default: return super.getNamedProperty(_hash, _name, _checkValid);
3431          }
3432
3433        }
3434
3435      @Override
3436      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3437        switch (hash) {
3438        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3439        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
3440        case 1182995672: /*baseCitation*/ return this.baseCitation == null ? new Base[0] : new Base[] {this.baseCitation}; // Reference
3441        default: return super.getProperty(hash, name, checkValid);
3442        }
3443
3444      }
3445
3446      @Override
3447      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3448        switch (hash) {
3449        case 3575610: // type
3450          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3451          return value;
3452        case 111972721: // value
3453          this.value = TypeConvertor.castToString(value); // StringType
3454          return value;
3455        case 1182995672: // baseCitation
3456          this.baseCitation = TypeConvertor.castToReference(value); // Reference
3457          return value;
3458        default: return super.setProperty(hash, name, value);
3459        }
3460
3461      }
3462
3463      @Override
3464      public Base setProperty(String name, Base value) throws FHIRException {
3465        if (name.equals("type")) {
3466          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3467        } else if (name.equals("value")) {
3468          this.value = TypeConvertor.castToString(value); // StringType
3469        } else if (name.equals("baseCitation")) {
3470          this.baseCitation = TypeConvertor.castToReference(value); // Reference
3471        } else
3472          return super.setProperty(name, value);
3473        return value;
3474      }
3475
3476      @Override
3477      public Base makeProperty(int hash, String name) throws FHIRException {
3478        switch (hash) {
3479        case 3575610:  return getType();
3480        case 111972721:  return getValueElement();
3481        case 1182995672:  return getBaseCitation();
3482        default: return super.makeProperty(hash, name);
3483        }
3484
3485      }
3486
3487      @Override
3488      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3489        switch (hash) {
3490        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3491        case 111972721: /*value*/ return new String[] {"string"};
3492        case 1182995672: /*baseCitation*/ return new String[] {"Reference"};
3493        default: return super.getTypesForProperty(hash, name);
3494        }
3495
3496      }
3497
3498      @Override
3499      public Base addChild(String name) throws FHIRException {
3500        if (name.equals("type")) {
3501          this.type = new CodeableConcept();
3502          return this.type;
3503        }
3504        else if (name.equals("value")) {
3505          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.part.value");
3506        }
3507        else if (name.equals("baseCitation")) {
3508          this.baseCitation = new Reference();
3509          return this.baseCitation;
3510        }
3511        else
3512          return super.addChild(name);
3513      }
3514
3515      public CitationCitedArtifactPartComponent copy() {
3516        CitationCitedArtifactPartComponent dst = new CitationCitedArtifactPartComponent();
3517        copyValues(dst);
3518        return dst;
3519      }
3520
3521      public void copyValues(CitationCitedArtifactPartComponent dst) {
3522        super.copyValues(dst);
3523        dst.type = type == null ? null : type.copy();
3524        dst.value = value == null ? null : value.copy();
3525        dst.baseCitation = baseCitation == null ? null : baseCitation.copy();
3526      }
3527
3528      @Override
3529      public boolean equalsDeep(Base other_) {
3530        if (!super.equalsDeep(other_))
3531          return false;
3532        if (!(other_ instanceof CitationCitedArtifactPartComponent))
3533          return false;
3534        CitationCitedArtifactPartComponent o = (CitationCitedArtifactPartComponent) other_;
3535        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true) && compareDeep(baseCitation, o.baseCitation, true)
3536          ;
3537      }
3538
3539      @Override
3540      public boolean equalsShallow(Base other_) {
3541        if (!super.equalsShallow(other_))
3542          return false;
3543        if (!(other_ instanceof CitationCitedArtifactPartComponent))
3544          return false;
3545        CitationCitedArtifactPartComponent o = (CitationCitedArtifactPartComponent) other_;
3546        return compareValues(value, o.value, true);
3547      }
3548
3549      public boolean isEmpty() {
3550        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value, baseCitation
3551          );
3552      }
3553
3554  public String fhirType() {
3555    return "Citation.citedArtifact.part";
3556
3557  }
3558
3559  }
3560
3561    @Block()
3562    public static class CitationCitedArtifactRelatesToComponent extends BackboneElement implements IBaseBackboneElement {
3563        /**
3564         * How the cited artifact relates to the target artifact.
3565         */
3566        @Child(name = "relationshipType", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
3567        @Description(shortDefinition="How the cited artifact relates to the target artifact", formalDefinition="How the cited artifact relates to the target artifact." )
3568        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/artifact-relationship-type")
3569        protected CodeableConcept relationshipType;
3570
3571        /**
3572         * The clasification of the related artifact.
3573         */
3574        @Child(name = "targetClassifier", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3575        @Description(shortDefinition="The clasification of the related artifact", formalDefinition="The clasification of the related artifact." )
3576        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-artifact-classifier")
3577        protected List<CodeableConcept> targetClassifier;
3578
3579        /**
3580         * The article or artifact that the cited artifact is related to.
3581         */
3582        @Child(name = "target", type = {UriType.class, Identifier.class, Reference.class, Attachment.class}, order=3, min=1, max=1, modifier=false, summary=false)
3583        @Description(shortDefinition="The article or artifact that the cited artifact is related to", formalDefinition="The article or artifact that the cited artifact is related to." )
3584        protected DataType target;
3585
3586        private static final long serialVersionUID = 819025047L;
3587
3588    /**
3589     * Constructor
3590     */
3591      public CitationCitedArtifactRelatesToComponent() {
3592        super();
3593      }
3594
3595    /**
3596     * Constructor
3597     */
3598      public CitationCitedArtifactRelatesToComponent(CodeableConcept relationshipType, DataType target) {
3599        super();
3600        this.setRelationshipType(relationshipType);
3601        this.setTarget(target);
3602      }
3603
3604        /**
3605         * @return {@link #relationshipType} (How the cited artifact relates to the target artifact.)
3606         */
3607        public CodeableConcept getRelationshipType() { 
3608          if (this.relationshipType == null)
3609            if (Configuration.errorOnAutoCreate())
3610              throw new Error("Attempt to auto-create CitationCitedArtifactRelatesToComponent.relationshipType");
3611            else if (Configuration.doAutoCreate())
3612              this.relationshipType = new CodeableConcept(); // cc
3613          return this.relationshipType;
3614        }
3615
3616        public boolean hasRelationshipType() { 
3617          return this.relationshipType != null && !this.relationshipType.isEmpty();
3618        }
3619
3620        /**
3621         * @param value {@link #relationshipType} (How the cited artifact relates to the target artifact.)
3622         */
3623        public CitationCitedArtifactRelatesToComponent setRelationshipType(CodeableConcept value) { 
3624          this.relationshipType = value;
3625          return this;
3626        }
3627
3628        /**
3629         * @return {@link #targetClassifier} (The clasification of the related artifact.)
3630         */
3631        public List<CodeableConcept> getTargetClassifier() { 
3632          if (this.targetClassifier == null)
3633            this.targetClassifier = new ArrayList<CodeableConcept>();
3634          return this.targetClassifier;
3635        }
3636
3637        /**
3638         * @return Returns a reference to <code>this</code> for easy method chaining
3639         */
3640        public CitationCitedArtifactRelatesToComponent setTargetClassifier(List<CodeableConcept> theTargetClassifier) { 
3641          this.targetClassifier = theTargetClassifier;
3642          return this;
3643        }
3644
3645        public boolean hasTargetClassifier() { 
3646          if (this.targetClassifier == null)
3647            return false;
3648          for (CodeableConcept item : this.targetClassifier)
3649            if (!item.isEmpty())
3650              return true;
3651          return false;
3652        }
3653
3654        public CodeableConcept addTargetClassifier() { //3
3655          CodeableConcept t = new CodeableConcept();
3656          if (this.targetClassifier == null)
3657            this.targetClassifier = new ArrayList<CodeableConcept>();
3658          this.targetClassifier.add(t);
3659          return t;
3660        }
3661
3662        public CitationCitedArtifactRelatesToComponent addTargetClassifier(CodeableConcept t) { //3
3663          if (t == null)
3664            return this;
3665          if (this.targetClassifier == null)
3666            this.targetClassifier = new ArrayList<CodeableConcept>();
3667          this.targetClassifier.add(t);
3668          return this;
3669        }
3670
3671        /**
3672         * @return The first repetition of repeating field {@link #targetClassifier}, creating it if it does not already exist {3}
3673         */
3674        public CodeableConcept getTargetClassifierFirstRep() { 
3675          if (getTargetClassifier().isEmpty()) {
3676            addTargetClassifier();
3677          }
3678          return getTargetClassifier().get(0);
3679        }
3680
3681        /**
3682         * @return {@link #target} (The article or artifact that the cited artifact is related to.)
3683         */
3684        public DataType getTarget() { 
3685          return this.target;
3686        }
3687
3688        /**
3689         * @return {@link #target} (The article or artifact that the cited artifact is related to.)
3690         */
3691        public UriType getTargetUriType() throws FHIRException { 
3692          if (this.target == null)
3693            this.target = new UriType();
3694          if (!(this.target instanceof UriType))
3695            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.target.getClass().getName()+" was encountered");
3696          return (UriType) this.target;
3697        }
3698
3699        public boolean hasTargetUriType() { 
3700          return this != null && this.target instanceof UriType;
3701        }
3702
3703        /**
3704         * @return {@link #target} (The article or artifact that the cited artifact is related to.)
3705         */
3706        public Identifier getTargetIdentifier() throws FHIRException { 
3707          if (this.target == null)
3708            this.target = new Identifier();
3709          if (!(this.target instanceof Identifier))
3710            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.target.getClass().getName()+" was encountered");
3711          return (Identifier) this.target;
3712        }
3713
3714        public boolean hasTargetIdentifier() { 
3715          return this != null && this.target instanceof Identifier;
3716        }
3717
3718        /**
3719         * @return {@link #target} (The article or artifact that the cited artifact is related to.)
3720         */
3721        public Reference getTargetReference() throws FHIRException { 
3722          if (this.target == null)
3723            this.target = new Reference();
3724          if (!(this.target instanceof Reference))
3725            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered");
3726          return (Reference) this.target;
3727        }
3728
3729        public boolean hasTargetReference() { 
3730          return this != null && this.target instanceof Reference;
3731        }
3732
3733        /**
3734         * @return {@link #target} (The article or artifact that the cited artifact is related to.)
3735         */
3736        public Attachment getTargetAttachment() throws FHIRException { 
3737          if (this.target == null)
3738            this.target = new Attachment();
3739          if (!(this.target instanceof Attachment))
3740            throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.target.getClass().getName()+" was encountered");
3741          return (Attachment) this.target;
3742        }
3743
3744        public boolean hasTargetAttachment() { 
3745          return this != null && this.target instanceof Attachment;
3746        }
3747
3748        public boolean hasTarget() { 
3749          return this.target != null && !this.target.isEmpty();
3750        }
3751
3752        /**
3753         * @param value {@link #target} (The article or artifact that the cited artifact is related to.)
3754         */
3755        public CitationCitedArtifactRelatesToComponent setTarget(DataType value) { 
3756          if (value != null && !(value instanceof UriType || value instanceof Identifier || value instanceof Reference || value instanceof Attachment))
3757            throw new Error("Not the right type for Citation.citedArtifact.relatesTo.target[x]: "+value.fhirType());
3758          this.target = value;
3759          return this;
3760        }
3761
3762        protected void listChildren(List<Property> children) {
3763          super.listChildren(children);
3764          children.add(new Property("relationshipType", "CodeableConcept", "How the cited artifact relates to the target artifact.", 0, 1, relationshipType));
3765          children.add(new Property("targetClassifier", "CodeableConcept", "The clasification of the related artifact.", 0, java.lang.Integer.MAX_VALUE, targetClassifier));
3766          children.add(new Property("target[x]", "uri|Identifier|Reference(Any)|Attachment", "The article or artifact that the cited artifact is related to.", 0, 1, target));
3767        }
3768
3769        @Override
3770        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3771          switch (_hash) {
3772          case -1602839150: /*relationshipType*/  return new Property("relationshipType", "CodeableConcept", "How the cited artifact relates to the target artifact.", 0, 1, relationshipType);
3773          case -1267112302: /*targetClassifier*/  return new Property("targetClassifier", "CodeableConcept", "The clasification of the related artifact.", 0, java.lang.Integer.MAX_VALUE, targetClassifier);
3774          case -815579825: /*target[x]*/  return new Property("target[x]", "uri|Identifier|Reference(Any)|Attachment", "The article or artifact that the cited artifact is related to.", 0, 1, target);
3775          case -880905839: /*target*/  return new Property("target[x]", "uri|Identifier|Reference(Any)|Attachment", "The article or artifact that the cited artifact is related to.", 0, 1, target);
3776          case -815585765: /*targetUri*/  return new Property("target[x]", "uri", "The article or artifact that the cited artifact is related to.", 0, 1, target);
3777          case 1690892570: /*targetIdentifier*/  return new Property("target[x]", "Identifier", "The article or artifact that the cited artifact is related to.", 0, 1, target);
3778          case 1259806906: /*targetReference*/  return new Property("target[x]", "Reference(Any)", "The article or artifact that the cited artifact is related to.", 0, 1, target);
3779          case 1345824148: /*targetAttachment*/  return new Property("target[x]", "Attachment", "The article or artifact that the cited artifact is related to.", 0, 1, target);
3780          default: return super.getNamedProperty(_hash, _name, _checkValid);
3781          }
3782
3783        }
3784
3785      @Override
3786      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3787        switch (hash) {
3788        case -1602839150: /*relationshipType*/ return this.relationshipType == null ? new Base[0] : new Base[] {this.relationshipType}; // CodeableConcept
3789        case -1267112302: /*targetClassifier*/ return this.targetClassifier == null ? new Base[0] : this.targetClassifier.toArray(new Base[this.targetClassifier.size()]); // CodeableConcept
3790        case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // DataType
3791        default: return super.getProperty(hash, name, checkValid);
3792        }
3793
3794      }
3795
3796      @Override
3797      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3798        switch (hash) {
3799        case -1602839150: // relationshipType
3800          this.relationshipType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3801          return value;
3802        case -1267112302: // targetClassifier
3803          this.getTargetClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3804          return value;
3805        case -880905839: // target
3806          this.target = TypeConvertor.castToType(value); // DataType
3807          return value;
3808        default: return super.setProperty(hash, name, value);
3809        }
3810
3811      }
3812
3813      @Override
3814      public Base setProperty(String name, Base value) throws FHIRException {
3815        if (name.equals("relationshipType")) {
3816          this.relationshipType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3817        } else if (name.equals("targetClassifier")) {
3818          this.getTargetClassifier().add(TypeConvertor.castToCodeableConcept(value));
3819        } else if (name.equals("target[x]")) {
3820          this.target = TypeConvertor.castToType(value); // DataType
3821        } else
3822          return super.setProperty(name, value);
3823        return value;
3824      }
3825
3826      @Override
3827      public Base makeProperty(int hash, String name) throws FHIRException {
3828        switch (hash) {
3829        case -1602839150:  return getRelationshipType();
3830        case -1267112302:  return addTargetClassifier(); 
3831        case -815579825:  return getTarget();
3832        case -880905839:  return getTarget();
3833        default: return super.makeProperty(hash, name);
3834        }
3835
3836      }
3837
3838      @Override
3839      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3840        switch (hash) {
3841        case -1602839150: /*relationshipType*/ return new String[] {"CodeableConcept"};
3842        case -1267112302: /*targetClassifier*/ return new String[] {"CodeableConcept"};
3843        case -880905839: /*target*/ return new String[] {"uri", "Identifier", "Reference", "Attachment"};
3844        default: return super.getTypesForProperty(hash, name);
3845        }
3846
3847      }
3848
3849      @Override
3850      public Base addChild(String name) throws FHIRException {
3851        if (name.equals("relationshipType")) {
3852          this.relationshipType = new CodeableConcept();
3853          return this.relationshipType;
3854        }
3855        else if (name.equals("targetClassifier")) {
3856          return addTargetClassifier();
3857        }
3858        else if (name.equals("targetUri")) {
3859          this.target = new UriType();
3860          return this.target;
3861        }
3862        else if (name.equals("targetIdentifier")) {
3863          this.target = new Identifier();
3864          return this.target;
3865        }
3866        else if (name.equals("targetReference")) {
3867          this.target = new Reference();
3868          return this.target;
3869        }
3870        else if (name.equals("targetAttachment")) {
3871          this.target = new Attachment();
3872          return this.target;
3873        }
3874        else
3875          return super.addChild(name);
3876      }
3877
3878      public CitationCitedArtifactRelatesToComponent copy() {
3879        CitationCitedArtifactRelatesToComponent dst = new CitationCitedArtifactRelatesToComponent();
3880        copyValues(dst);
3881        return dst;
3882      }
3883
3884      public void copyValues(CitationCitedArtifactRelatesToComponent dst) {
3885        super.copyValues(dst);
3886        dst.relationshipType = relationshipType == null ? null : relationshipType.copy();
3887        if (targetClassifier != null) {
3888          dst.targetClassifier = new ArrayList<CodeableConcept>();
3889          for (CodeableConcept i : targetClassifier)
3890            dst.targetClassifier.add(i.copy());
3891        };
3892        dst.target = target == null ? null : target.copy();
3893      }
3894
3895      @Override
3896      public boolean equalsDeep(Base other_) {
3897        if (!super.equalsDeep(other_))
3898          return false;
3899        if (!(other_ instanceof CitationCitedArtifactRelatesToComponent))
3900          return false;
3901        CitationCitedArtifactRelatesToComponent o = (CitationCitedArtifactRelatesToComponent) other_;
3902        return compareDeep(relationshipType, o.relationshipType, true) && compareDeep(targetClassifier, o.targetClassifier, true)
3903           && compareDeep(target, o.target, true);
3904      }
3905
3906      @Override
3907      public boolean equalsShallow(Base other_) {
3908        if (!super.equalsShallow(other_))
3909          return false;
3910        if (!(other_ instanceof CitationCitedArtifactRelatesToComponent))
3911          return false;
3912        CitationCitedArtifactRelatesToComponent o = (CitationCitedArtifactRelatesToComponent) other_;
3913        return true;
3914      }
3915
3916      public boolean isEmpty() {
3917        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(relationshipType, targetClassifier
3918          , target);
3919      }
3920
3921  public String fhirType() {
3922    return "Citation.citedArtifact.relatesTo";
3923
3924  }
3925
3926  }
3927
3928    @Block()
3929    public static class CitationCitedArtifactPublicationFormComponent extends BackboneElement implements IBaseBackboneElement {
3930        /**
3931         * The collection the cited article or artifact is published in.
3932         */
3933        @Child(name = "publishedIn", type = {}, order=1, min=0, max=1, modifier=false, summary=false)
3934        @Description(shortDefinition="The collection the cited article or artifact is published in", formalDefinition="The collection the cited article or artifact is published in." )
3935        protected CitationCitedArtifactPublicationFormPublishedInComponent publishedIn;
3936
3937        /**
3938         * The specific issue in which the cited article resides.
3939         */
3940        @Child(name = "periodicRelease", type = {}, order=2, min=0, max=1, modifier=false, summary=false)
3941        @Description(shortDefinition="The specific issue in which the cited article resides", formalDefinition="The specific issue in which the cited article resides." )
3942        protected CitationCitedArtifactPublicationFormPeriodicReleaseComponent periodicRelease;
3943
3944        /**
3945         * 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).
3946         */
3947        @Child(name = "articleDate", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
3948        @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)." )
3949        protected DateTimeType articleDate;
3950
3951        /**
3952         * The date the article was last revised or updated in the database.
3953         */
3954        @Child(name = "lastRevisionDate", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false)
3955        @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." )
3956        protected DateTimeType lastRevisionDate;
3957
3958        /**
3959         * Language in which this form of the article is published.
3960         */
3961        @Child(name = "language", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3962        @Description(shortDefinition="Language in which this form of the article is published", formalDefinition="Language in which this form of the article is published." )
3963        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
3964        protected List<CodeableConcept> language;
3965
3966        /**
3967         * Entry number or identifier for inclusion in a database.
3968         */
3969        @Child(name = "accessionNumber", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
3970        @Description(shortDefinition="Entry number or identifier for inclusion in a database", formalDefinition="Entry number or identifier for inclusion in a database." )
3971        protected StringType accessionNumber;
3972
3973        /**
3974         * Used for full display of pagination.
3975         */
3976        @Child(name = "pageString", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
3977        @Description(shortDefinition="Used for full display of pagination", formalDefinition="Used for full display of pagination." )
3978        protected StringType pageString;
3979
3980        /**
3981         * Used for isolated representation of first page.
3982         */
3983        @Child(name = "firstPage", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
3984        @Description(shortDefinition="Used for isolated representation of first page", formalDefinition="Used for isolated representation of first page." )
3985        protected StringType firstPage;
3986
3987        /**
3988         * Used for isolated representation of last page.
3989         */
3990        @Child(name = "lastPage", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
3991        @Description(shortDefinition="Used for isolated representation of last page", formalDefinition="Used for isolated representation of last page." )
3992        protected StringType lastPage;
3993
3994        /**
3995         * Actual or approximate number of pages or screens.
3996         */
3997        @Child(name = "pageCount", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
3998        @Description(shortDefinition="Number of pages or screens", formalDefinition="Actual or approximate number of pages or screens." )
3999        protected StringType pageCount;
4000
4001        /**
4002         * Copyright notice for the full article or artifact.
4003         */
4004        @Child(name = "copyright", type = {MarkdownType.class}, order=11, min=0, max=1, modifier=false, summary=false)
4005        @Description(shortDefinition="Copyright notice for the full article or artifact", formalDefinition="Copyright notice for the full article or artifact." )
4006        protected MarkdownType copyright;
4007
4008        private static final long serialVersionUID = -191740896L;
4009
4010    /**
4011     * Constructor
4012     */
4013      public CitationCitedArtifactPublicationFormComponent() {
4014        super();
4015      }
4016
4017        /**
4018         * @return {@link #publishedIn} (The collection the cited article or artifact is published in.)
4019         */
4020        public CitationCitedArtifactPublicationFormPublishedInComponent getPublishedIn() { 
4021          if (this.publishedIn == null)
4022            if (Configuration.errorOnAutoCreate())
4023              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.publishedIn");
4024            else if (Configuration.doAutoCreate())
4025              this.publishedIn = new CitationCitedArtifactPublicationFormPublishedInComponent(); // cc
4026          return this.publishedIn;
4027        }
4028
4029        public boolean hasPublishedIn() { 
4030          return this.publishedIn != null && !this.publishedIn.isEmpty();
4031        }
4032
4033        /**
4034         * @param value {@link #publishedIn} (The collection the cited article or artifact is published in.)
4035         */
4036        public CitationCitedArtifactPublicationFormComponent setPublishedIn(CitationCitedArtifactPublicationFormPublishedInComponent value) { 
4037          this.publishedIn = value;
4038          return this;
4039        }
4040
4041        /**
4042         * @return {@link #periodicRelease} (The specific issue in which the cited article resides.)
4043         */
4044        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent getPeriodicRelease() { 
4045          if (this.periodicRelease == null)
4046            if (Configuration.errorOnAutoCreate())
4047              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.periodicRelease");
4048            else if (Configuration.doAutoCreate())
4049              this.periodicRelease = new CitationCitedArtifactPublicationFormPeriodicReleaseComponent(); // cc
4050          return this.periodicRelease;
4051        }
4052
4053        public boolean hasPeriodicRelease() { 
4054          return this.periodicRelease != null && !this.periodicRelease.isEmpty();
4055        }
4056
4057        /**
4058         * @param value {@link #periodicRelease} (The specific issue in which the cited article resides.)
4059         */
4060        public CitationCitedArtifactPublicationFormComponent setPeriodicRelease(CitationCitedArtifactPublicationFormPeriodicReleaseComponent value) { 
4061          this.periodicRelease = value;
4062          return this;
4063        }
4064
4065        /**
4066         * @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
4067         */
4068        public DateTimeType getArticleDateElement() { 
4069          if (this.articleDate == null)
4070            if (Configuration.errorOnAutoCreate())
4071              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.articleDate");
4072            else if (Configuration.doAutoCreate())
4073              this.articleDate = new DateTimeType(); // bb
4074          return this.articleDate;
4075        }
4076
4077        public boolean hasArticleDateElement() { 
4078          return this.articleDate != null && !this.articleDate.isEmpty();
4079        }
4080
4081        public boolean hasArticleDate() { 
4082          return this.articleDate != null && !this.articleDate.isEmpty();
4083        }
4084
4085        /**
4086         * @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
4087         */
4088        public CitationCitedArtifactPublicationFormComponent setArticleDateElement(DateTimeType value) { 
4089          this.articleDate = value;
4090          return this;
4091        }
4092
4093        /**
4094         * @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).
4095         */
4096        public Date getArticleDate() { 
4097          return this.articleDate == null ? null : this.articleDate.getValue();
4098        }
4099
4100        /**
4101         * @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).
4102         */
4103        public CitationCitedArtifactPublicationFormComponent setArticleDate(Date value) { 
4104          if (value == null)
4105            this.articleDate = null;
4106          else {
4107            if (this.articleDate == null)
4108              this.articleDate = new DateTimeType();
4109            this.articleDate.setValue(value);
4110          }
4111          return this;
4112        }
4113
4114        /**
4115         * @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
4116         */
4117        public DateTimeType getLastRevisionDateElement() { 
4118          if (this.lastRevisionDate == null)
4119            if (Configuration.errorOnAutoCreate())
4120              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.lastRevisionDate");
4121            else if (Configuration.doAutoCreate())
4122              this.lastRevisionDate = new DateTimeType(); // bb
4123          return this.lastRevisionDate;
4124        }
4125
4126        public boolean hasLastRevisionDateElement() { 
4127          return this.lastRevisionDate != null && !this.lastRevisionDate.isEmpty();
4128        }
4129
4130        public boolean hasLastRevisionDate() { 
4131          return this.lastRevisionDate != null && !this.lastRevisionDate.isEmpty();
4132        }
4133
4134        /**
4135         * @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
4136         */
4137        public CitationCitedArtifactPublicationFormComponent setLastRevisionDateElement(DateTimeType value) { 
4138          this.lastRevisionDate = value;
4139          return this;
4140        }
4141
4142        /**
4143         * @return The date the article was last revised or updated in the database.
4144         */
4145        public Date getLastRevisionDate() { 
4146          return this.lastRevisionDate == null ? null : this.lastRevisionDate.getValue();
4147        }
4148
4149        /**
4150         * @param value The date the article was last revised or updated in the database.
4151         */
4152        public CitationCitedArtifactPublicationFormComponent setLastRevisionDate(Date value) { 
4153          if (value == null)
4154            this.lastRevisionDate = null;
4155          else {
4156            if (this.lastRevisionDate == null)
4157              this.lastRevisionDate = new DateTimeType();
4158            this.lastRevisionDate.setValue(value);
4159          }
4160          return this;
4161        }
4162
4163        /**
4164         * @return {@link #language} (Language in which this form of the article is published.)
4165         */
4166        public List<CodeableConcept> getLanguage() { 
4167          if (this.language == null)
4168            this.language = new ArrayList<CodeableConcept>();
4169          return this.language;
4170        }
4171
4172        /**
4173         * @return Returns a reference to <code>this</code> for easy method chaining
4174         */
4175        public CitationCitedArtifactPublicationFormComponent setLanguage(List<CodeableConcept> theLanguage) { 
4176          this.language = theLanguage;
4177          return this;
4178        }
4179
4180        public boolean hasLanguage() { 
4181          if (this.language == null)
4182            return false;
4183          for (CodeableConcept item : this.language)
4184            if (!item.isEmpty())
4185              return true;
4186          return false;
4187        }
4188
4189        public CodeableConcept addLanguage() { //3
4190          CodeableConcept t = new CodeableConcept();
4191          if (this.language == null)
4192            this.language = new ArrayList<CodeableConcept>();
4193          this.language.add(t);
4194          return t;
4195        }
4196
4197        public CitationCitedArtifactPublicationFormComponent addLanguage(CodeableConcept t) { //3
4198          if (t == null)
4199            return this;
4200          if (this.language == null)
4201            this.language = new ArrayList<CodeableConcept>();
4202          this.language.add(t);
4203          return this;
4204        }
4205
4206        /**
4207         * @return The first repetition of repeating field {@link #language}, creating it if it does not already exist {3}
4208         */
4209        public CodeableConcept getLanguageFirstRep() { 
4210          if (getLanguage().isEmpty()) {
4211            addLanguage();
4212          }
4213          return getLanguage().get(0);
4214        }
4215
4216        /**
4217         * @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
4218         */
4219        public StringType getAccessionNumberElement() { 
4220          if (this.accessionNumber == null)
4221            if (Configuration.errorOnAutoCreate())
4222              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.accessionNumber");
4223            else if (Configuration.doAutoCreate())
4224              this.accessionNumber = new StringType(); // bb
4225          return this.accessionNumber;
4226        }
4227
4228        public boolean hasAccessionNumberElement() { 
4229          return this.accessionNumber != null && !this.accessionNumber.isEmpty();
4230        }
4231
4232        public boolean hasAccessionNumber() { 
4233          return this.accessionNumber != null && !this.accessionNumber.isEmpty();
4234        }
4235
4236        /**
4237         * @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
4238         */
4239        public CitationCitedArtifactPublicationFormComponent setAccessionNumberElement(StringType value) { 
4240          this.accessionNumber = value;
4241          return this;
4242        }
4243
4244        /**
4245         * @return Entry number or identifier for inclusion in a database.
4246         */
4247        public String getAccessionNumber() { 
4248          return this.accessionNumber == null ? null : this.accessionNumber.getValue();
4249        }
4250
4251        /**
4252         * @param value Entry number or identifier for inclusion in a database.
4253         */
4254        public CitationCitedArtifactPublicationFormComponent setAccessionNumber(String value) { 
4255          if (Utilities.noString(value))
4256            this.accessionNumber = null;
4257          else {
4258            if (this.accessionNumber == null)
4259              this.accessionNumber = new StringType();
4260            this.accessionNumber.setValue(value);
4261          }
4262          return this;
4263        }
4264
4265        /**
4266         * @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
4267         */
4268        public StringType getPageStringElement() { 
4269          if (this.pageString == null)
4270            if (Configuration.errorOnAutoCreate())
4271              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.pageString");
4272            else if (Configuration.doAutoCreate())
4273              this.pageString = new StringType(); // bb
4274          return this.pageString;
4275        }
4276
4277        public boolean hasPageStringElement() { 
4278          return this.pageString != null && !this.pageString.isEmpty();
4279        }
4280
4281        public boolean hasPageString() { 
4282          return this.pageString != null && !this.pageString.isEmpty();
4283        }
4284
4285        /**
4286         * @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
4287         */
4288        public CitationCitedArtifactPublicationFormComponent setPageStringElement(StringType value) { 
4289          this.pageString = value;
4290          return this;
4291        }
4292
4293        /**
4294         * @return Used for full display of pagination.
4295         */
4296        public String getPageString() { 
4297          return this.pageString == null ? null : this.pageString.getValue();
4298        }
4299
4300        /**
4301         * @param value Used for full display of pagination.
4302         */
4303        public CitationCitedArtifactPublicationFormComponent setPageString(String value) { 
4304          if (Utilities.noString(value))
4305            this.pageString = null;
4306          else {
4307            if (this.pageString == null)
4308              this.pageString = new StringType();
4309            this.pageString.setValue(value);
4310          }
4311          return this;
4312        }
4313
4314        /**
4315         * @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
4316         */
4317        public StringType getFirstPageElement() { 
4318          if (this.firstPage == null)
4319            if (Configuration.errorOnAutoCreate())
4320              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.firstPage");
4321            else if (Configuration.doAutoCreate())
4322              this.firstPage = new StringType(); // bb
4323          return this.firstPage;
4324        }
4325
4326        public boolean hasFirstPageElement() { 
4327          return this.firstPage != null && !this.firstPage.isEmpty();
4328        }
4329
4330        public boolean hasFirstPage() { 
4331          return this.firstPage != null && !this.firstPage.isEmpty();
4332        }
4333
4334        /**
4335         * @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
4336         */
4337        public CitationCitedArtifactPublicationFormComponent setFirstPageElement(StringType value) { 
4338          this.firstPage = value;
4339          return this;
4340        }
4341
4342        /**
4343         * @return Used for isolated representation of first page.
4344         */
4345        public String getFirstPage() { 
4346          return this.firstPage == null ? null : this.firstPage.getValue();
4347        }
4348
4349        /**
4350         * @param value Used for isolated representation of first page.
4351         */
4352        public CitationCitedArtifactPublicationFormComponent setFirstPage(String value) { 
4353          if (Utilities.noString(value))
4354            this.firstPage = null;
4355          else {
4356            if (this.firstPage == null)
4357              this.firstPage = new StringType();
4358            this.firstPage.setValue(value);
4359          }
4360          return this;
4361        }
4362
4363        /**
4364         * @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
4365         */
4366        public StringType getLastPageElement() { 
4367          if (this.lastPage == null)
4368            if (Configuration.errorOnAutoCreate())
4369              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.lastPage");
4370            else if (Configuration.doAutoCreate())
4371              this.lastPage = new StringType(); // bb
4372          return this.lastPage;
4373        }
4374
4375        public boolean hasLastPageElement() { 
4376          return this.lastPage != null && !this.lastPage.isEmpty();
4377        }
4378
4379        public boolean hasLastPage() { 
4380          return this.lastPage != null && !this.lastPage.isEmpty();
4381        }
4382
4383        /**
4384         * @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
4385         */
4386        public CitationCitedArtifactPublicationFormComponent setLastPageElement(StringType value) { 
4387          this.lastPage = value;
4388          return this;
4389        }
4390
4391        /**
4392         * @return Used for isolated representation of last page.
4393         */
4394        public String getLastPage() { 
4395          return this.lastPage == null ? null : this.lastPage.getValue();
4396        }
4397
4398        /**
4399         * @param value Used for isolated representation of last page.
4400         */
4401        public CitationCitedArtifactPublicationFormComponent setLastPage(String value) { 
4402          if (Utilities.noString(value))
4403            this.lastPage = null;
4404          else {
4405            if (this.lastPage == null)
4406              this.lastPage = new StringType();
4407            this.lastPage.setValue(value);
4408          }
4409          return this;
4410        }
4411
4412        /**
4413         * @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
4414         */
4415        public StringType getPageCountElement() { 
4416          if (this.pageCount == null)
4417            if (Configuration.errorOnAutoCreate())
4418              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.pageCount");
4419            else if (Configuration.doAutoCreate())
4420              this.pageCount = new StringType(); // bb
4421          return this.pageCount;
4422        }
4423
4424        public boolean hasPageCountElement() { 
4425          return this.pageCount != null && !this.pageCount.isEmpty();
4426        }
4427
4428        public boolean hasPageCount() { 
4429          return this.pageCount != null && !this.pageCount.isEmpty();
4430        }
4431
4432        /**
4433         * @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
4434         */
4435        public CitationCitedArtifactPublicationFormComponent setPageCountElement(StringType value) { 
4436          this.pageCount = value;
4437          return this;
4438        }
4439
4440        /**
4441         * @return Actual or approximate number of pages or screens.
4442         */
4443        public String getPageCount() { 
4444          return this.pageCount == null ? null : this.pageCount.getValue();
4445        }
4446
4447        /**
4448         * @param value Actual or approximate number of pages or screens.
4449         */
4450        public CitationCitedArtifactPublicationFormComponent setPageCount(String value) { 
4451          if (Utilities.noString(value))
4452            this.pageCount = null;
4453          else {
4454            if (this.pageCount == null)
4455              this.pageCount = new StringType();
4456            this.pageCount.setValue(value);
4457          }
4458          return this;
4459        }
4460
4461        /**
4462         * @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
4463         */
4464        public MarkdownType getCopyrightElement() { 
4465          if (this.copyright == null)
4466            if (Configuration.errorOnAutoCreate())
4467              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormComponent.copyright");
4468            else if (Configuration.doAutoCreate())
4469              this.copyright = new MarkdownType(); // bb
4470          return this.copyright;
4471        }
4472
4473        public boolean hasCopyrightElement() { 
4474          return this.copyright != null && !this.copyright.isEmpty();
4475        }
4476
4477        public boolean hasCopyright() { 
4478          return this.copyright != null && !this.copyright.isEmpty();
4479        }
4480
4481        /**
4482         * @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
4483         */
4484        public CitationCitedArtifactPublicationFormComponent setCopyrightElement(MarkdownType value) { 
4485          this.copyright = value;
4486          return this;
4487        }
4488
4489        /**
4490         * @return Copyright notice for the full article or artifact.
4491         */
4492        public String getCopyright() { 
4493          return this.copyright == null ? null : this.copyright.getValue();
4494        }
4495
4496        /**
4497         * @param value Copyright notice for the full article or artifact.
4498         */
4499        public CitationCitedArtifactPublicationFormComponent setCopyright(String value) { 
4500          if (value == null)
4501            this.copyright = null;
4502          else {
4503            if (this.copyright == null)
4504              this.copyright = new MarkdownType();
4505            this.copyright.setValue(value);
4506          }
4507          return this;
4508        }
4509
4510        protected void listChildren(List<Property> children) {
4511          super.listChildren(children);
4512          children.add(new Property("publishedIn", "", "The collection the cited article or artifact is published in.", 0, 1, publishedIn));
4513          children.add(new Property("periodicRelease", "", "The specific issue in which the cited article resides.", 0, 1, periodicRelease));
4514          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));
4515          children.add(new Property("lastRevisionDate", "dateTime", "The date the article was last revised or updated in the database.", 0, 1, lastRevisionDate));
4516          children.add(new Property("language", "CodeableConcept", "Language in which this form of the article is published.", 0, java.lang.Integer.MAX_VALUE, language));
4517          children.add(new Property("accessionNumber", "string", "Entry number or identifier for inclusion in a database.", 0, 1, accessionNumber));
4518          children.add(new Property("pageString", "string", "Used for full display of pagination.", 0, 1, pageString));
4519          children.add(new Property("firstPage", "string", "Used for isolated representation of first page.", 0, 1, firstPage));
4520          children.add(new Property("lastPage", "string", "Used for isolated representation of last page.", 0, 1, lastPage));
4521          children.add(new Property("pageCount", "string", "Actual or approximate number of pages or screens.", 0, 1, pageCount));
4522          children.add(new Property("copyright", "markdown", "Copyright notice for the full article or artifact.", 0, 1, copyright));
4523        }
4524
4525        @Override
4526        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4527          switch (_hash) {
4528          case -614144077: /*publishedIn*/  return new Property("publishedIn", "", "The collection the cited article or artifact is published in.", 0, 1, publishedIn);
4529          case 1726878956: /*periodicRelease*/  return new Property("periodicRelease", "", "The specific issue in which the cited article resides.", 0, 1, periodicRelease);
4530          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);
4531          case 2129161183: /*lastRevisionDate*/  return new Property("lastRevisionDate", "dateTime", "The date the article was last revised or updated in the database.", 0, 1, lastRevisionDate);
4532          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);
4533          case 1807963277: /*accessionNumber*/  return new Property("accessionNumber", "string", "Entry number or identifier for inclusion in a database.", 0, 1, accessionNumber);
4534          case 1287145344: /*pageString*/  return new Property("pageString", "string", "Used for full display of pagination.", 0, 1, pageString);
4535          case 132895071: /*firstPage*/  return new Property("firstPage", "string", "Used for isolated representation of first page.", 0, 1, firstPage);
4536          case -1459540411: /*lastPage*/  return new Property("lastPage", "string", "Used for isolated representation of last page.", 0, 1, lastPage);
4537          case 857882560: /*pageCount*/  return new Property("pageCount", "string", "Actual or approximate number of pages or screens.", 0, 1, pageCount);
4538          case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "Copyright notice for the full article or artifact.", 0, 1, copyright);
4539          default: return super.getNamedProperty(_hash, _name, _checkValid);
4540          }
4541
4542        }
4543
4544      @Override
4545      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4546        switch (hash) {
4547        case -614144077: /*publishedIn*/ return this.publishedIn == null ? new Base[0] : new Base[] {this.publishedIn}; // CitationCitedArtifactPublicationFormPublishedInComponent
4548        case 1726878956: /*periodicRelease*/ return this.periodicRelease == null ? new Base[0] : new Base[] {this.periodicRelease}; // CitationCitedArtifactPublicationFormPeriodicReleaseComponent
4549        case 817743300: /*articleDate*/ return this.articleDate == null ? new Base[0] : new Base[] {this.articleDate}; // DateTimeType
4550        case 2129161183: /*lastRevisionDate*/ return this.lastRevisionDate == null ? new Base[0] : new Base[] {this.lastRevisionDate}; // DateTimeType
4551        case -1613589672: /*language*/ return this.language == null ? new Base[0] : this.language.toArray(new Base[this.language.size()]); // CodeableConcept
4552        case 1807963277: /*accessionNumber*/ return this.accessionNumber == null ? new Base[0] : new Base[] {this.accessionNumber}; // StringType
4553        case 1287145344: /*pageString*/ return this.pageString == null ? new Base[0] : new Base[] {this.pageString}; // StringType
4554        case 132895071: /*firstPage*/ return this.firstPage == null ? new Base[0] : new Base[] {this.firstPage}; // StringType
4555        case -1459540411: /*lastPage*/ return this.lastPage == null ? new Base[0] : new Base[] {this.lastPage}; // StringType
4556        case 857882560: /*pageCount*/ return this.pageCount == null ? new Base[0] : new Base[] {this.pageCount}; // StringType
4557        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
4558        default: return super.getProperty(hash, name, checkValid);
4559        }
4560
4561      }
4562
4563      @Override
4564      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4565        switch (hash) {
4566        case -614144077: // publishedIn
4567          this.publishedIn = (CitationCitedArtifactPublicationFormPublishedInComponent) value; // CitationCitedArtifactPublicationFormPublishedInComponent
4568          return value;
4569        case 1726878956: // periodicRelease
4570          this.periodicRelease = (CitationCitedArtifactPublicationFormPeriodicReleaseComponent) value; // CitationCitedArtifactPublicationFormPeriodicReleaseComponent
4571          return value;
4572        case 817743300: // articleDate
4573          this.articleDate = TypeConvertor.castToDateTime(value); // DateTimeType
4574          return value;
4575        case 2129161183: // lastRevisionDate
4576          this.lastRevisionDate = TypeConvertor.castToDateTime(value); // DateTimeType
4577          return value;
4578        case -1613589672: // language
4579          this.getLanguage().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4580          return value;
4581        case 1807963277: // accessionNumber
4582          this.accessionNumber = TypeConvertor.castToString(value); // StringType
4583          return value;
4584        case 1287145344: // pageString
4585          this.pageString = TypeConvertor.castToString(value); // StringType
4586          return value;
4587        case 132895071: // firstPage
4588          this.firstPage = TypeConvertor.castToString(value); // StringType
4589          return value;
4590        case -1459540411: // lastPage
4591          this.lastPage = TypeConvertor.castToString(value); // StringType
4592          return value;
4593        case 857882560: // pageCount
4594          this.pageCount = TypeConvertor.castToString(value); // StringType
4595          return value;
4596        case 1522889671: // copyright
4597          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
4598          return value;
4599        default: return super.setProperty(hash, name, value);
4600        }
4601
4602      }
4603
4604      @Override
4605      public Base setProperty(String name, Base value) throws FHIRException {
4606        if (name.equals("publishedIn")) {
4607          this.publishedIn = (CitationCitedArtifactPublicationFormPublishedInComponent) value; // CitationCitedArtifactPublicationFormPublishedInComponent
4608        } else if (name.equals("periodicRelease")) {
4609          this.periodicRelease = (CitationCitedArtifactPublicationFormPeriodicReleaseComponent) value; // CitationCitedArtifactPublicationFormPeriodicReleaseComponent
4610        } else if (name.equals("articleDate")) {
4611          this.articleDate = TypeConvertor.castToDateTime(value); // DateTimeType
4612        } else if (name.equals("lastRevisionDate")) {
4613          this.lastRevisionDate = TypeConvertor.castToDateTime(value); // DateTimeType
4614        } else if (name.equals("language")) {
4615          this.getLanguage().add(TypeConvertor.castToCodeableConcept(value));
4616        } else if (name.equals("accessionNumber")) {
4617          this.accessionNumber = TypeConvertor.castToString(value); // StringType
4618        } else if (name.equals("pageString")) {
4619          this.pageString = TypeConvertor.castToString(value); // StringType
4620        } else if (name.equals("firstPage")) {
4621          this.firstPage = TypeConvertor.castToString(value); // StringType
4622        } else if (name.equals("lastPage")) {
4623          this.lastPage = TypeConvertor.castToString(value); // StringType
4624        } else if (name.equals("pageCount")) {
4625          this.pageCount = TypeConvertor.castToString(value); // StringType
4626        } else if (name.equals("copyright")) {
4627          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
4628        } else
4629          return super.setProperty(name, value);
4630        return value;
4631      }
4632
4633      @Override
4634      public Base makeProperty(int hash, String name) throws FHIRException {
4635        switch (hash) {
4636        case -614144077:  return getPublishedIn();
4637        case 1726878956:  return getPeriodicRelease();
4638        case 817743300:  return getArticleDateElement();
4639        case 2129161183:  return getLastRevisionDateElement();
4640        case -1613589672:  return addLanguage(); 
4641        case 1807963277:  return getAccessionNumberElement();
4642        case 1287145344:  return getPageStringElement();
4643        case 132895071:  return getFirstPageElement();
4644        case -1459540411:  return getLastPageElement();
4645        case 857882560:  return getPageCountElement();
4646        case 1522889671:  return getCopyrightElement();
4647        default: return super.makeProperty(hash, name);
4648        }
4649
4650      }
4651
4652      @Override
4653      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4654        switch (hash) {
4655        case -614144077: /*publishedIn*/ return new String[] {};
4656        case 1726878956: /*periodicRelease*/ return new String[] {};
4657        case 817743300: /*articleDate*/ return new String[] {"dateTime"};
4658        case 2129161183: /*lastRevisionDate*/ return new String[] {"dateTime"};
4659        case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
4660        case 1807963277: /*accessionNumber*/ return new String[] {"string"};
4661        case 1287145344: /*pageString*/ return new String[] {"string"};
4662        case 132895071: /*firstPage*/ return new String[] {"string"};
4663        case -1459540411: /*lastPage*/ return new String[] {"string"};
4664        case 857882560: /*pageCount*/ return new String[] {"string"};
4665        case 1522889671: /*copyright*/ return new String[] {"markdown"};
4666        default: return super.getTypesForProperty(hash, name);
4667        }
4668
4669      }
4670
4671      @Override
4672      public Base addChild(String name) throws FHIRException {
4673        if (name.equals("publishedIn")) {
4674          this.publishedIn = new CitationCitedArtifactPublicationFormPublishedInComponent();
4675          return this.publishedIn;
4676        }
4677        else if (name.equals("periodicRelease")) {
4678          this.periodicRelease = new CitationCitedArtifactPublicationFormPeriodicReleaseComponent();
4679          return this.periodicRelease;
4680        }
4681        else if (name.equals("articleDate")) {
4682          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.articleDate");
4683        }
4684        else if (name.equals("lastRevisionDate")) {
4685          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.lastRevisionDate");
4686        }
4687        else if (name.equals("language")) {
4688          return addLanguage();
4689        }
4690        else if (name.equals("accessionNumber")) {
4691          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.accessionNumber");
4692        }
4693        else if (name.equals("pageString")) {
4694          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.pageString");
4695        }
4696        else if (name.equals("firstPage")) {
4697          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.firstPage");
4698        }
4699        else if (name.equals("lastPage")) {
4700          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.lastPage");
4701        }
4702        else if (name.equals("pageCount")) {
4703          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.pageCount");
4704        }
4705        else if (name.equals("copyright")) {
4706          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.copyright");
4707        }
4708        else
4709          return super.addChild(name);
4710      }
4711
4712      public CitationCitedArtifactPublicationFormComponent copy() {
4713        CitationCitedArtifactPublicationFormComponent dst = new CitationCitedArtifactPublicationFormComponent();
4714        copyValues(dst);
4715        return dst;
4716      }
4717
4718      public void copyValues(CitationCitedArtifactPublicationFormComponent dst) {
4719        super.copyValues(dst);
4720        dst.publishedIn = publishedIn == null ? null : publishedIn.copy();
4721        dst.periodicRelease = periodicRelease == null ? null : periodicRelease.copy();
4722        dst.articleDate = articleDate == null ? null : articleDate.copy();
4723        dst.lastRevisionDate = lastRevisionDate == null ? null : lastRevisionDate.copy();
4724        if (language != null) {
4725          dst.language = new ArrayList<CodeableConcept>();
4726          for (CodeableConcept i : language)
4727            dst.language.add(i.copy());
4728        };
4729        dst.accessionNumber = accessionNumber == null ? null : accessionNumber.copy();
4730        dst.pageString = pageString == null ? null : pageString.copy();
4731        dst.firstPage = firstPage == null ? null : firstPage.copy();
4732        dst.lastPage = lastPage == null ? null : lastPage.copy();
4733        dst.pageCount = pageCount == null ? null : pageCount.copy();
4734        dst.copyright = copyright == null ? null : copyright.copy();
4735      }
4736
4737      @Override
4738      public boolean equalsDeep(Base other_) {
4739        if (!super.equalsDeep(other_))
4740          return false;
4741        if (!(other_ instanceof CitationCitedArtifactPublicationFormComponent))
4742          return false;
4743        CitationCitedArtifactPublicationFormComponent o = (CitationCitedArtifactPublicationFormComponent) other_;
4744        return compareDeep(publishedIn, o.publishedIn, true) && compareDeep(periodicRelease, o.periodicRelease, true)
4745           && compareDeep(articleDate, o.articleDate, true) && compareDeep(lastRevisionDate, o.lastRevisionDate, true)
4746           && compareDeep(language, o.language, true) && compareDeep(accessionNumber, o.accessionNumber, true)
4747           && compareDeep(pageString, o.pageString, true) && compareDeep(firstPage, o.firstPage, true) && compareDeep(lastPage, o.lastPage, true)
4748           && compareDeep(pageCount, o.pageCount, true) && compareDeep(copyright, o.copyright, true);
4749      }
4750
4751      @Override
4752      public boolean equalsShallow(Base other_) {
4753        if (!super.equalsShallow(other_))
4754          return false;
4755        if (!(other_ instanceof CitationCitedArtifactPublicationFormComponent))
4756          return false;
4757        CitationCitedArtifactPublicationFormComponent o = (CitationCitedArtifactPublicationFormComponent) other_;
4758        return compareValues(articleDate, o.articleDate, true) && compareValues(lastRevisionDate, o.lastRevisionDate, true)
4759           && compareValues(accessionNumber, o.accessionNumber, true) && compareValues(pageString, o.pageString, true)
4760           && compareValues(firstPage, o.firstPage, true) && compareValues(lastPage, o.lastPage, true) && compareValues(pageCount, o.pageCount, true)
4761           && compareValues(copyright, o.copyright, true);
4762      }
4763
4764      public boolean isEmpty() {
4765        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(publishedIn, periodicRelease
4766          , articleDate, lastRevisionDate, language, accessionNumber, pageString, firstPage
4767          , lastPage, pageCount, copyright);
4768      }
4769
4770  public String fhirType() {
4771    return "Citation.citedArtifact.publicationForm";
4772
4773  }
4774
4775  }
4776
4777    @Block()
4778    public static class CitationCitedArtifactPublicationFormPublishedInComponent extends BackboneElement implements IBaseBackboneElement {
4779        /**
4780         * Kind of container (e.g. Periodical, database, or book).
4781         */
4782        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
4783        @Description(shortDefinition="Kind of container (e.g. Periodical, database, or book)", formalDefinition="Kind of container (e.g. Periodical, database, or book)." )
4784        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/published-in-type")
4785        protected CodeableConcept type;
4786
4787        /**
4788         * Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN.
4789         */
4790        @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4791        @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." )
4792        protected List<Identifier> identifier;
4793
4794        /**
4795         * Name of the database or title of the book or journal.
4796         */
4797        @Child(name = "title", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
4798        @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." )
4799        protected StringType title;
4800
4801        /**
4802         * Name of the publisher.
4803         */
4804        @Child(name = "publisher", type = {Organization.class}, order=4, min=0, max=1, modifier=false, summary=false)
4805        @Description(shortDefinition="Name of the publisher", formalDefinition="Name of the publisher." )
4806        protected Reference publisher;
4807
4808        /**
4809         * Geographic location of the publisher.
4810         */
4811        @Child(name = "publisherLocation", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
4812        @Description(shortDefinition="Geographic location of the publisher", formalDefinition="Geographic location of the publisher." )
4813        protected StringType publisherLocation;
4814
4815        private static final long serialVersionUID = 1440066953L;
4816
4817    /**
4818     * Constructor
4819     */
4820      public CitationCitedArtifactPublicationFormPublishedInComponent() {
4821        super();
4822      }
4823
4824        /**
4825         * @return {@link #type} (Kind of container (e.g. Periodical, database, or book).)
4826         */
4827        public CodeableConcept getType() { 
4828          if (this.type == null)
4829            if (Configuration.errorOnAutoCreate())
4830              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPublishedInComponent.type");
4831            else if (Configuration.doAutoCreate())
4832              this.type = new CodeableConcept(); // cc
4833          return this.type;
4834        }
4835
4836        public boolean hasType() { 
4837          return this.type != null && !this.type.isEmpty();
4838        }
4839
4840        /**
4841         * @param value {@link #type} (Kind of container (e.g. Periodical, database, or book).)
4842         */
4843        public CitationCitedArtifactPublicationFormPublishedInComponent setType(CodeableConcept value) { 
4844          this.type = value;
4845          return this;
4846        }
4847
4848        /**
4849         * @return {@link #identifier} (Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; Book identifiers include ISBN.)
4850         */
4851        public List<Identifier> getIdentifier() { 
4852          if (this.identifier == null)
4853            this.identifier = new ArrayList<Identifier>();
4854          return this.identifier;
4855        }
4856
4857        /**
4858         * @return Returns a reference to <code>this</code> for easy method chaining
4859         */
4860        public CitationCitedArtifactPublicationFormPublishedInComponent setIdentifier(List<Identifier> theIdentifier) { 
4861          this.identifier = theIdentifier;
4862          return this;
4863        }
4864
4865        public boolean hasIdentifier() { 
4866          if (this.identifier == null)
4867            return false;
4868          for (Identifier item : this.identifier)
4869            if (!item.isEmpty())
4870              return true;
4871          return false;
4872        }
4873
4874        public Identifier addIdentifier() { //3
4875          Identifier t = new Identifier();
4876          if (this.identifier == null)
4877            this.identifier = new ArrayList<Identifier>();
4878          this.identifier.add(t);
4879          return t;
4880        }
4881
4882        public CitationCitedArtifactPublicationFormPublishedInComponent addIdentifier(Identifier t) { //3
4883          if (t == null)
4884            return this;
4885          if (this.identifier == null)
4886            this.identifier = new ArrayList<Identifier>();
4887          this.identifier.add(t);
4888          return this;
4889        }
4890
4891        /**
4892         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
4893         */
4894        public Identifier getIdentifierFirstRep() { 
4895          if (getIdentifier().isEmpty()) {
4896            addIdentifier();
4897          }
4898          return getIdentifier().get(0);
4899        }
4900
4901        /**
4902         * @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
4903         */
4904        public StringType getTitleElement() { 
4905          if (this.title == null)
4906            if (Configuration.errorOnAutoCreate())
4907              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPublishedInComponent.title");
4908            else if (Configuration.doAutoCreate())
4909              this.title = new StringType(); // bb
4910          return this.title;
4911        }
4912
4913        public boolean hasTitleElement() { 
4914          return this.title != null && !this.title.isEmpty();
4915        }
4916
4917        public boolean hasTitle() { 
4918          return this.title != null && !this.title.isEmpty();
4919        }
4920
4921        /**
4922         * @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
4923         */
4924        public CitationCitedArtifactPublicationFormPublishedInComponent setTitleElement(StringType value) { 
4925          this.title = value;
4926          return this;
4927        }
4928
4929        /**
4930         * @return Name of the database or title of the book or journal.
4931         */
4932        public String getTitle() { 
4933          return this.title == null ? null : this.title.getValue();
4934        }
4935
4936        /**
4937         * @param value Name of the database or title of the book or journal.
4938         */
4939        public CitationCitedArtifactPublicationFormPublishedInComponent setTitle(String value) { 
4940          if (Utilities.noString(value))
4941            this.title = null;
4942          else {
4943            if (this.title == null)
4944              this.title = new StringType();
4945            this.title.setValue(value);
4946          }
4947          return this;
4948        }
4949
4950        /**
4951         * @return {@link #publisher} (Name of the publisher.)
4952         */
4953        public Reference getPublisher() { 
4954          if (this.publisher == null)
4955            if (Configuration.errorOnAutoCreate())
4956              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPublishedInComponent.publisher");
4957            else if (Configuration.doAutoCreate())
4958              this.publisher = new Reference(); // cc
4959          return this.publisher;
4960        }
4961
4962        public boolean hasPublisher() { 
4963          return this.publisher != null && !this.publisher.isEmpty();
4964        }
4965
4966        /**
4967         * @param value {@link #publisher} (Name of the publisher.)
4968         */
4969        public CitationCitedArtifactPublicationFormPublishedInComponent setPublisher(Reference value) { 
4970          this.publisher = value;
4971          return this;
4972        }
4973
4974        /**
4975         * @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
4976         */
4977        public StringType getPublisherLocationElement() { 
4978          if (this.publisherLocation == null)
4979            if (Configuration.errorOnAutoCreate())
4980              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPublishedInComponent.publisherLocation");
4981            else if (Configuration.doAutoCreate())
4982              this.publisherLocation = new StringType(); // bb
4983          return this.publisherLocation;
4984        }
4985
4986        public boolean hasPublisherLocationElement() { 
4987          return this.publisherLocation != null && !this.publisherLocation.isEmpty();
4988        }
4989
4990        public boolean hasPublisherLocation() { 
4991          return this.publisherLocation != null && !this.publisherLocation.isEmpty();
4992        }
4993
4994        /**
4995         * @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
4996         */
4997        public CitationCitedArtifactPublicationFormPublishedInComponent setPublisherLocationElement(StringType value) { 
4998          this.publisherLocation = value;
4999          return this;
5000        }
5001
5002        /**
5003         * @return Geographic location of the publisher.
5004         */
5005        public String getPublisherLocation() { 
5006          return this.publisherLocation == null ? null : this.publisherLocation.getValue();
5007        }
5008
5009        /**
5010         * @param value Geographic location of the publisher.
5011         */
5012        public CitationCitedArtifactPublicationFormPublishedInComponent setPublisherLocation(String value) { 
5013          if (Utilities.noString(value))
5014            this.publisherLocation = null;
5015          else {
5016            if (this.publisherLocation == null)
5017              this.publisherLocation = new StringType();
5018            this.publisherLocation.setValue(value);
5019          }
5020          return this;
5021        }
5022
5023        protected void listChildren(List<Property> children) {
5024          super.listChildren(children);
5025          children.add(new Property("type", "CodeableConcept", "Kind of container (e.g. Periodical, database, or book).", 0, 1, type));
5026          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));
5027          children.add(new Property("title", "string", "Name of the database or title of the book or journal.", 0, 1, title));
5028          children.add(new Property("publisher", "Reference(Organization)", "Name of the publisher.", 0, 1, publisher));
5029          children.add(new Property("publisherLocation", "string", "Geographic location of the publisher.", 0, 1, publisherLocation));
5030        }
5031
5032        @Override
5033        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5034          switch (_hash) {
5035          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Kind of container (e.g. Periodical, database, or book).", 0, 1, type);
5036          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);
5037          case 110371416: /*title*/  return new Property("title", "string", "Name of the database or title of the book or journal.", 0, 1, title);
5038          case 1447404028: /*publisher*/  return new Property("publisher", "Reference(Organization)", "Name of the publisher.", 0, 1, publisher);
5039          case -1281627695: /*publisherLocation*/  return new Property("publisherLocation", "string", "Geographic location of the publisher.", 0, 1, publisherLocation);
5040          default: return super.getNamedProperty(_hash, _name, _checkValid);
5041          }
5042
5043        }
5044
5045      @Override
5046      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5047        switch (hash) {
5048        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
5049        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
5050        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
5051        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // Reference
5052        case -1281627695: /*publisherLocation*/ return this.publisherLocation == null ? new Base[0] : new Base[] {this.publisherLocation}; // StringType
5053        default: return super.getProperty(hash, name, checkValid);
5054        }
5055
5056      }
5057
5058      @Override
5059      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5060        switch (hash) {
5061        case 3575610: // type
5062          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5063          return value;
5064        case -1618432855: // identifier
5065          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
5066          return value;
5067        case 110371416: // title
5068          this.title = TypeConvertor.castToString(value); // StringType
5069          return value;
5070        case 1447404028: // publisher
5071          this.publisher = TypeConvertor.castToReference(value); // Reference
5072          return value;
5073        case -1281627695: // publisherLocation
5074          this.publisherLocation = TypeConvertor.castToString(value); // StringType
5075          return value;
5076        default: return super.setProperty(hash, name, value);
5077        }
5078
5079      }
5080
5081      @Override
5082      public Base setProperty(String name, Base value) throws FHIRException {
5083        if (name.equals("type")) {
5084          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5085        } else if (name.equals("identifier")) {
5086          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
5087        } else if (name.equals("title")) {
5088          this.title = TypeConvertor.castToString(value); // StringType
5089        } else if (name.equals("publisher")) {
5090          this.publisher = TypeConvertor.castToReference(value); // Reference
5091        } else if (name.equals("publisherLocation")) {
5092          this.publisherLocation = TypeConvertor.castToString(value); // StringType
5093        } else
5094          return super.setProperty(name, value);
5095        return value;
5096      }
5097
5098      @Override
5099      public Base makeProperty(int hash, String name) throws FHIRException {
5100        switch (hash) {
5101        case 3575610:  return getType();
5102        case -1618432855:  return addIdentifier(); 
5103        case 110371416:  return getTitleElement();
5104        case 1447404028:  return getPublisher();
5105        case -1281627695:  return getPublisherLocationElement();
5106        default: return super.makeProperty(hash, name);
5107        }
5108
5109      }
5110
5111      @Override
5112      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5113        switch (hash) {
5114        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
5115        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
5116        case 110371416: /*title*/ return new String[] {"string"};
5117        case 1447404028: /*publisher*/ return new String[] {"Reference"};
5118        case -1281627695: /*publisherLocation*/ return new String[] {"string"};
5119        default: return super.getTypesForProperty(hash, name);
5120        }
5121
5122      }
5123
5124      @Override
5125      public Base addChild(String name) throws FHIRException {
5126        if (name.equals("type")) {
5127          this.type = new CodeableConcept();
5128          return this.type;
5129        }
5130        else if (name.equals("identifier")) {
5131          return addIdentifier();
5132        }
5133        else if (name.equals("title")) {
5134          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.publishedIn.title");
5135        }
5136        else if (name.equals("publisher")) {
5137          this.publisher = new Reference();
5138          return this.publisher;
5139        }
5140        else if (name.equals("publisherLocation")) {
5141          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.publishedIn.publisherLocation");
5142        }
5143        else
5144          return super.addChild(name);
5145      }
5146
5147      public CitationCitedArtifactPublicationFormPublishedInComponent copy() {
5148        CitationCitedArtifactPublicationFormPublishedInComponent dst = new CitationCitedArtifactPublicationFormPublishedInComponent();
5149        copyValues(dst);
5150        return dst;
5151      }
5152
5153      public void copyValues(CitationCitedArtifactPublicationFormPublishedInComponent dst) {
5154        super.copyValues(dst);
5155        dst.type = type == null ? null : type.copy();
5156        if (identifier != null) {
5157          dst.identifier = new ArrayList<Identifier>();
5158          for (Identifier i : identifier)
5159            dst.identifier.add(i.copy());
5160        };
5161        dst.title = title == null ? null : title.copy();
5162        dst.publisher = publisher == null ? null : publisher.copy();
5163        dst.publisherLocation = publisherLocation == null ? null : publisherLocation.copy();
5164      }
5165
5166      @Override
5167      public boolean equalsDeep(Base other_) {
5168        if (!super.equalsDeep(other_))
5169          return false;
5170        if (!(other_ instanceof CitationCitedArtifactPublicationFormPublishedInComponent))
5171          return false;
5172        CitationCitedArtifactPublicationFormPublishedInComponent o = (CitationCitedArtifactPublicationFormPublishedInComponent) other_;
5173        return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(title, o.title, true)
5174           && compareDeep(publisher, o.publisher, true) && compareDeep(publisherLocation, o.publisherLocation, true)
5175          ;
5176      }
5177
5178      @Override
5179      public boolean equalsShallow(Base other_) {
5180        if (!super.equalsShallow(other_))
5181          return false;
5182        if (!(other_ instanceof CitationCitedArtifactPublicationFormPublishedInComponent))
5183          return false;
5184        CitationCitedArtifactPublicationFormPublishedInComponent o = (CitationCitedArtifactPublicationFormPublishedInComponent) other_;
5185        return compareValues(title, o.title, true) && compareValues(publisherLocation, o.publisherLocation, true)
5186          ;
5187      }
5188
5189      public boolean isEmpty() {
5190        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, identifier, title
5191          , publisher, publisherLocation);
5192      }
5193
5194  public String fhirType() {
5195    return "Citation.citedArtifact.publicationForm.publishedIn";
5196
5197  }
5198
5199  }
5200
5201    @Block()
5202    public static class CitationCitedArtifactPublicationFormPeriodicReleaseComponent extends BackboneElement implements IBaseBackboneElement {
5203        /**
5204         * Describes the form of the medium cited. Common codes are "Internet" or "Print".
5205         */
5206        @Child(name = "citedMedium", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
5207        @Description(shortDefinition="Internet or Print", formalDefinition="Describes the form of the medium cited. Common codes are \"Internet\" or \"Print\"." )
5208        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-medium")
5209        protected CodeableConcept citedMedium;
5210
5211        /**
5212         * Volume number of journal in which the article is published.
5213         */
5214        @Child(name = "volume", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5215        @Description(shortDefinition="Volume number of journal in which the article is published", formalDefinition="Volume number of journal in which the article is published." )
5216        protected StringType volume;
5217
5218        /**
5219         * Issue, part or supplement of journal in which the article is published.
5220         */
5221        @Child(name = "issue", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
5222        @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." )
5223        protected StringType issue;
5224
5225        /**
5226         * Defining the date on which the issue of the journal was published.
5227         */
5228        @Child(name = "dateOfPublication", type = {}, order=4, min=0, max=1, modifier=false, summary=false)
5229        @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." )
5230        protected CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent dateOfPublication;
5231
5232        private static final long serialVersionUID = -474554951L;
5233
5234    /**
5235     * Constructor
5236     */
5237      public CitationCitedArtifactPublicationFormPeriodicReleaseComponent() {
5238        super();
5239      }
5240
5241        /**
5242         * @return {@link #citedMedium} (Describes the form of the medium cited. Common codes are "Internet" or "Print".)
5243         */
5244        public CodeableConcept getCitedMedium() { 
5245          if (this.citedMedium == null)
5246            if (Configuration.errorOnAutoCreate())
5247              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseComponent.citedMedium");
5248            else if (Configuration.doAutoCreate())
5249              this.citedMedium = new CodeableConcept(); // cc
5250          return this.citedMedium;
5251        }
5252
5253        public boolean hasCitedMedium() { 
5254          return this.citedMedium != null && !this.citedMedium.isEmpty();
5255        }
5256
5257        /**
5258         * @param value {@link #citedMedium} (Describes the form of the medium cited. Common codes are "Internet" or "Print".)
5259         */
5260        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setCitedMedium(CodeableConcept value) { 
5261          this.citedMedium = value;
5262          return this;
5263        }
5264
5265        /**
5266         * @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
5267         */
5268        public StringType getVolumeElement() { 
5269          if (this.volume == null)
5270            if (Configuration.errorOnAutoCreate())
5271              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseComponent.volume");
5272            else if (Configuration.doAutoCreate())
5273              this.volume = new StringType(); // bb
5274          return this.volume;
5275        }
5276
5277        public boolean hasVolumeElement() { 
5278          return this.volume != null && !this.volume.isEmpty();
5279        }
5280
5281        public boolean hasVolume() { 
5282          return this.volume != null && !this.volume.isEmpty();
5283        }
5284
5285        /**
5286         * @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
5287         */
5288        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setVolumeElement(StringType value) { 
5289          this.volume = value;
5290          return this;
5291        }
5292
5293        /**
5294         * @return Volume number of journal in which the article is published.
5295         */
5296        public String getVolume() { 
5297          return this.volume == null ? null : this.volume.getValue();
5298        }
5299
5300        /**
5301         * @param value Volume number of journal in which the article is published.
5302         */
5303        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setVolume(String value) { 
5304          if (Utilities.noString(value))
5305            this.volume = null;
5306          else {
5307            if (this.volume == null)
5308              this.volume = new StringType();
5309            this.volume.setValue(value);
5310          }
5311          return this;
5312        }
5313
5314        /**
5315         * @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
5316         */
5317        public StringType getIssueElement() { 
5318          if (this.issue == null)
5319            if (Configuration.errorOnAutoCreate())
5320              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseComponent.issue");
5321            else if (Configuration.doAutoCreate())
5322              this.issue = new StringType(); // bb
5323          return this.issue;
5324        }
5325
5326        public boolean hasIssueElement() { 
5327          return this.issue != null && !this.issue.isEmpty();
5328        }
5329
5330        public boolean hasIssue() { 
5331          return this.issue != null && !this.issue.isEmpty();
5332        }
5333
5334        /**
5335         * @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
5336         */
5337        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setIssueElement(StringType value) { 
5338          this.issue = value;
5339          return this;
5340        }
5341
5342        /**
5343         * @return Issue, part or supplement of journal in which the article is published.
5344         */
5345        public String getIssue() { 
5346          return this.issue == null ? null : this.issue.getValue();
5347        }
5348
5349        /**
5350         * @param value Issue, part or supplement of journal in which the article is published.
5351         */
5352        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setIssue(String value) { 
5353          if (Utilities.noString(value))
5354            this.issue = null;
5355          else {
5356            if (this.issue == null)
5357              this.issue = new StringType();
5358            this.issue.setValue(value);
5359          }
5360          return this;
5361        }
5362
5363        /**
5364         * @return {@link #dateOfPublication} (Defining the date on which the issue of the journal was published.)
5365         */
5366        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent getDateOfPublication() { 
5367          if (this.dateOfPublication == null)
5368            if (Configuration.errorOnAutoCreate())
5369              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseComponent.dateOfPublication");
5370            else if (Configuration.doAutoCreate())
5371              this.dateOfPublication = new CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent(); // cc
5372          return this.dateOfPublication;
5373        }
5374
5375        public boolean hasDateOfPublication() { 
5376          return this.dateOfPublication != null && !this.dateOfPublication.isEmpty();
5377        }
5378
5379        /**
5380         * @param value {@link #dateOfPublication} (Defining the date on which the issue of the journal was published.)
5381         */
5382        public CitationCitedArtifactPublicationFormPeriodicReleaseComponent setDateOfPublication(CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent value) { 
5383          this.dateOfPublication = value;
5384          return this;
5385        }
5386
5387        protected void listChildren(List<Property> children) {
5388          super.listChildren(children);
5389          children.add(new Property("citedMedium", "CodeableConcept", "Describes the form of the medium cited. Common codes are \"Internet\" or \"Print\".", 0, 1, citedMedium));
5390          children.add(new Property("volume", "string", "Volume number of journal in which the article is published.", 0, 1, volume));
5391          children.add(new Property("issue", "string", "Issue, part or supplement of journal in which the article is published.", 0, 1, issue));
5392          children.add(new Property("dateOfPublication", "", "Defining the date on which the issue of the journal was published.", 0, 1, dateOfPublication));
5393        }
5394
5395        @Override
5396        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5397          switch (_hash) {
5398          case 612116418: /*citedMedium*/  return new Property("citedMedium", "CodeableConcept", "Describes the form of the medium cited. Common codes are \"Internet\" or \"Print\".", 0, 1, citedMedium);
5399          case -810883302: /*volume*/  return new Property("volume", "string", "Volume number of journal in which the article is published.", 0, 1, volume);
5400          case 100509913: /*issue*/  return new Property("issue", "string", "Issue, part or supplement of journal in which the article is published.", 0, 1, issue);
5401          case -1662473529: /*dateOfPublication*/  return new Property("dateOfPublication", "", "Defining the date on which the issue of the journal was published.", 0, 1, dateOfPublication);
5402          default: return super.getNamedProperty(_hash, _name, _checkValid);
5403          }
5404
5405        }
5406
5407      @Override
5408      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5409        switch (hash) {
5410        case 612116418: /*citedMedium*/ return this.citedMedium == null ? new Base[0] : new Base[] {this.citedMedium}; // CodeableConcept
5411        case -810883302: /*volume*/ return this.volume == null ? new Base[0] : new Base[] {this.volume}; // StringType
5412        case 100509913: /*issue*/ return this.issue == null ? new Base[0] : new Base[] {this.issue}; // StringType
5413        case -1662473529: /*dateOfPublication*/ return this.dateOfPublication == null ? new Base[0] : new Base[] {this.dateOfPublication}; // CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent
5414        default: return super.getProperty(hash, name, checkValid);
5415        }
5416
5417      }
5418
5419      @Override
5420      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5421        switch (hash) {
5422        case 612116418: // citedMedium
5423          this.citedMedium = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5424          return value;
5425        case -810883302: // volume
5426          this.volume = TypeConvertor.castToString(value); // StringType
5427          return value;
5428        case 100509913: // issue
5429          this.issue = TypeConvertor.castToString(value); // StringType
5430          return value;
5431        case -1662473529: // dateOfPublication
5432          this.dateOfPublication = (CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent) value; // CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent
5433          return value;
5434        default: return super.setProperty(hash, name, value);
5435        }
5436
5437      }
5438
5439      @Override
5440      public Base setProperty(String name, Base value) throws FHIRException {
5441        if (name.equals("citedMedium")) {
5442          this.citedMedium = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5443        } else if (name.equals("volume")) {
5444          this.volume = TypeConvertor.castToString(value); // StringType
5445        } else if (name.equals("issue")) {
5446          this.issue = TypeConvertor.castToString(value); // StringType
5447        } else if (name.equals("dateOfPublication")) {
5448          this.dateOfPublication = (CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent) value; // CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent
5449        } else
5450          return super.setProperty(name, value);
5451        return value;
5452      }
5453
5454      @Override
5455      public Base makeProperty(int hash, String name) throws FHIRException {
5456        switch (hash) {
5457        case 612116418:  return getCitedMedium();
5458        case -810883302:  return getVolumeElement();
5459        case 100509913:  return getIssueElement();
5460        case -1662473529:  return getDateOfPublication();
5461        default: return super.makeProperty(hash, name);
5462        }
5463
5464      }
5465
5466      @Override
5467      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5468        switch (hash) {
5469        case 612116418: /*citedMedium*/ return new String[] {"CodeableConcept"};
5470        case -810883302: /*volume*/ return new String[] {"string"};
5471        case 100509913: /*issue*/ return new String[] {"string"};
5472        case -1662473529: /*dateOfPublication*/ return new String[] {};
5473        default: return super.getTypesForProperty(hash, name);
5474        }
5475
5476      }
5477
5478      @Override
5479      public Base addChild(String name) throws FHIRException {
5480        if (name.equals("citedMedium")) {
5481          this.citedMedium = new CodeableConcept();
5482          return this.citedMedium;
5483        }
5484        else if (name.equals("volume")) {
5485          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.volume");
5486        }
5487        else if (name.equals("issue")) {
5488          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.issue");
5489        }
5490        else if (name.equals("dateOfPublication")) {
5491          this.dateOfPublication = new CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent();
5492          return this.dateOfPublication;
5493        }
5494        else
5495          return super.addChild(name);
5496      }
5497
5498      public CitationCitedArtifactPublicationFormPeriodicReleaseComponent copy() {
5499        CitationCitedArtifactPublicationFormPeriodicReleaseComponent dst = new CitationCitedArtifactPublicationFormPeriodicReleaseComponent();
5500        copyValues(dst);
5501        return dst;
5502      }
5503
5504      public void copyValues(CitationCitedArtifactPublicationFormPeriodicReleaseComponent dst) {
5505        super.copyValues(dst);
5506        dst.citedMedium = citedMedium == null ? null : citedMedium.copy();
5507        dst.volume = volume == null ? null : volume.copy();
5508        dst.issue = issue == null ? null : issue.copy();
5509        dst.dateOfPublication = dateOfPublication == null ? null : dateOfPublication.copy();
5510      }
5511
5512      @Override
5513      public boolean equalsDeep(Base other_) {
5514        if (!super.equalsDeep(other_))
5515          return false;
5516        if (!(other_ instanceof CitationCitedArtifactPublicationFormPeriodicReleaseComponent))
5517          return false;
5518        CitationCitedArtifactPublicationFormPeriodicReleaseComponent o = (CitationCitedArtifactPublicationFormPeriodicReleaseComponent) other_;
5519        return compareDeep(citedMedium, o.citedMedium, true) && compareDeep(volume, o.volume, true) && compareDeep(issue, o.issue, true)
5520           && compareDeep(dateOfPublication, o.dateOfPublication, true);
5521      }
5522
5523      @Override
5524      public boolean equalsShallow(Base other_) {
5525        if (!super.equalsShallow(other_))
5526          return false;
5527        if (!(other_ instanceof CitationCitedArtifactPublicationFormPeriodicReleaseComponent))
5528          return false;
5529        CitationCitedArtifactPublicationFormPeriodicReleaseComponent o = (CitationCitedArtifactPublicationFormPeriodicReleaseComponent) other_;
5530        return compareValues(volume, o.volume, true) && compareValues(issue, o.issue, true);
5531      }
5532
5533      public boolean isEmpty() {
5534        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(citedMedium, volume, issue
5535          , dateOfPublication);
5536      }
5537
5538  public String fhirType() {
5539    return "Citation.citedArtifact.publicationForm.periodicRelease";
5540
5541  }
5542
5543  }
5544
5545    @Block()
5546    public static class CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent extends BackboneElement implements IBaseBackboneElement {
5547        /**
5548         * Date on which the issue of the journal was published.
5549         */
5550        @Child(name = "date", type = {DateType.class}, order=1, min=0, max=1, modifier=false, summary=false)
5551        @Description(shortDefinition="Date on which the issue of the journal was published", formalDefinition="Date on which the issue of the journal was published." )
5552        protected DateType date;
5553
5554        /**
5555         * Year on which the issue of the journal was published.
5556         */
5557        @Child(name = "year", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5558        @Description(shortDefinition="Year on which the issue of the journal was published", formalDefinition="Year on which the issue of the journal was published." )
5559        protected StringType year;
5560
5561        /**
5562         * Month on which the issue of the journal was published.
5563         */
5564        @Child(name = "month", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
5565        @Description(shortDefinition="Month on which the issue of the journal was published", formalDefinition="Month on which the issue of the journal was published." )
5566        protected StringType month;
5567
5568        /**
5569         * Day on which the issue of the journal was published.
5570         */
5571        @Child(name = "day", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
5572        @Description(shortDefinition="Day on which the issue of the journal was published", formalDefinition="Day on which the issue of the journal was published." )
5573        protected StringType day;
5574
5575        /**
5576         * Spring, Summer, Fall/Autumn, Winter.
5577         */
5578        @Child(name = "season", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
5579        @Description(shortDefinition="Season on which the issue of the journal was published", formalDefinition="Spring, Summer, Fall/Autumn, Winter." )
5580        protected StringType season;
5581
5582        /**
5583         * Text representation of the date of which the issue of the journal was published.
5584         */
5585        @Child(name = "text", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
5586        @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." )
5587        protected StringType text;
5588
5589        private static final long serialVersionUID = 1585589146L;
5590
5591    /**
5592     * Constructor
5593     */
5594      public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent() {
5595        super();
5596      }
5597
5598        /**
5599         * @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
5600         */
5601        public DateType getDateElement() { 
5602          if (this.date == null)
5603            if (Configuration.errorOnAutoCreate())
5604              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.date");
5605            else if (Configuration.doAutoCreate())
5606              this.date = new DateType(); // bb
5607          return this.date;
5608        }
5609
5610        public boolean hasDateElement() { 
5611          return this.date != null && !this.date.isEmpty();
5612        }
5613
5614        public boolean hasDate() { 
5615          return this.date != null && !this.date.isEmpty();
5616        }
5617
5618        /**
5619         * @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
5620         */
5621        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setDateElement(DateType value) { 
5622          this.date = value;
5623          return this;
5624        }
5625
5626        /**
5627         * @return Date on which the issue of the journal was published.
5628         */
5629        public Date getDate() { 
5630          return this.date == null ? null : this.date.getValue();
5631        }
5632
5633        /**
5634         * @param value Date on which the issue of the journal was published.
5635         */
5636        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setDate(Date value) { 
5637          if (value == null)
5638            this.date = null;
5639          else {
5640            if (this.date == null)
5641              this.date = new DateType();
5642            this.date.setValue(value);
5643          }
5644          return this;
5645        }
5646
5647        /**
5648         * @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
5649         */
5650        public StringType getYearElement() { 
5651          if (this.year == null)
5652            if (Configuration.errorOnAutoCreate())
5653              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.year");
5654            else if (Configuration.doAutoCreate())
5655              this.year = new StringType(); // bb
5656          return this.year;
5657        }
5658
5659        public boolean hasYearElement() { 
5660          return this.year != null && !this.year.isEmpty();
5661        }
5662
5663        public boolean hasYear() { 
5664          return this.year != null && !this.year.isEmpty();
5665        }
5666
5667        /**
5668         * @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
5669         */
5670        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setYearElement(StringType value) { 
5671          this.year = value;
5672          return this;
5673        }
5674
5675        /**
5676         * @return Year on which the issue of the journal was published.
5677         */
5678        public String getYear() { 
5679          return this.year == null ? null : this.year.getValue();
5680        }
5681
5682        /**
5683         * @param value Year on which the issue of the journal was published.
5684         */
5685        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setYear(String value) { 
5686          if (Utilities.noString(value))
5687            this.year = null;
5688          else {
5689            if (this.year == null)
5690              this.year = new StringType();
5691            this.year.setValue(value);
5692          }
5693          return this;
5694        }
5695
5696        /**
5697         * @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
5698         */
5699        public StringType getMonthElement() { 
5700          if (this.month == null)
5701            if (Configuration.errorOnAutoCreate())
5702              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.month");
5703            else if (Configuration.doAutoCreate())
5704              this.month = new StringType(); // bb
5705          return this.month;
5706        }
5707
5708        public boolean hasMonthElement() { 
5709          return this.month != null && !this.month.isEmpty();
5710        }
5711
5712        public boolean hasMonth() { 
5713          return this.month != null && !this.month.isEmpty();
5714        }
5715
5716        /**
5717         * @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
5718         */
5719        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setMonthElement(StringType value) { 
5720          this.month = value;
5721          return this;
5722        }
5723
5724        /**
5725         * @return Month on which the issue of the journal was published.
5726         */
5727        public String getMonth() { 
5728          return this.month == null ? null : this.month.getValue();
5729        }
5730
5731        /**
5732         * @param value Month on which the issue of the journal was published.
5733         */
5734        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setMonth(String value) { 
5735          if (Utilities.noString(value))
5736            this.month = null;
5737          else {
5738            if (this.month == null)
5739              this.month = new StringType();
5740            this.month.setValue(value);
5741          }
5742          return this;
5743        }
5744
5745        /**
5746         * @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
5747         */
5748        public StringType getDayElement() { 
5749          if (this.day == null)
5750            if (Configuration.errorOnAutoCreate())
5751              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.day");
5752            else if (Configuration.doAutoCreate())
5753              this.day = new StringType(); // bb
5754          return this.day;
5755        }
5756
5757        public boolean hasDayElement() { 
5758          return this.day != null && !this.day.isEmpty();
5759        }
5760
5761        public boolean hasDay() { 
5762          return this.day != null && !this.day.isEmpty();
5763        }
5764
5765        /**
5766         * @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
5767         */
5768        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setDayElement(StringType value) { 
5769          this.day = value;
5770          return this;
5771        }
5772
5773        /**
5774         * @return Day on which the issue of the journal was published.
5775         */
5776        public String getDay() { 
5777          return this.day == null ? null : this.day.getValue();
5778        }
5779
5780        /**
5781         * @param value Day on which the issue of the journal was published.
5782         */
5783        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setDay(String value) { 
5784          if (Utilities.noString(value))
5785            this.day = null;
5786          else {
5787            if (this.day == null)
5788              this.day = new StringType();
5789            this.day.setValue(value);
5790          }
5791          return this;
5792        }
5793
5794        /**
5795         * @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
5796         */
5797        public StringType getSeasonElement() { 
5798          if (this.season == null)
5799            if (Configuration.errorOnAutoCreate())
5800              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.season");
5801            else if (Configuration.doAutoCreate())
5802              this.season = new StringType(); // bb
5803          return this.season;
5804        }
5805
5806        public boolean hasSeasonElement() { 
5807          return this.season != null && !this.season.isEmpty();
5808        }
5809
5810        public boolean hasSeason() { 
5811          return this.season != null && !this.season.isEmpty();
5812        }
5813
5814        /**
5815         * @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
5816         */
5817        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setSeasonElement(StringType value) { 
5818          this.season = value;
5819          return this;
5820        }
5821
5822        /**
5823         * @return Spring, Summer, Fall/Autumn, Winter.
5824         */
5825        public String getSeason() { 
5826          return this.season == null ? null : this.season.getValue();
5827        }
5828
5829        /**
5830         * @param value Spring, Summer, Fall/Autumn, Winter.
5831         */
5832        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setSeason(String value) { 
5833          if (Utilities.noString(value))
5834            this.season = null;
5835          else {
5836            if (this.season == null)
5837              this.season = new StringType();
5838            this.season.setValue(value);
5839          }
5840          return this;
5841        }
5842
5843        /**
5844         * @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
5845         */
5846        public StringType getTextElement() { 
5847          if (this.text == null)
5848            if (Configuration.errorOnAutoCreate())
5849              throw new Error("Attempt to auto-create CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent.text");
5850            else if (Configuration.doAutoCreate())
5851              this.text = new StringType(); // bb
5852          return this.text;
5853        }
5854
5855        public boolean hasTextElement() { 
5856          return this.text != null && !this.text.isEmpty();
5857        }
5858
5859        public boolean hasText() { 
5860          return this.text != null && !this.text.isEmpty();
5861        }
5862
5863        /**
5864         * @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
5865         */
5866        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setTextElement(StringType value) { 
5867          this.text = value;
5868          return this;
5869        }
5870
5871        /**
5872         * @return Text representation of the date of which the issue of the journal was published.
5873         */
5874        public String getText() { 
5875          return this.text == null ? null : this.text.getValue();
5876        }
5877
5878        /**
5879         * @param value Text representation of the date of which the issue of the journal was published.
5880         */
5881        public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent setText(String value) { 
5882          if (Utilities.noString(value))
5883            this.text = null;
5884          else {
5885            if (this.text == null)
5886              this.text = new StringType();
5887            this.text.setValue(value);
5888          }
5889          return this;
5890        }
5891
5892        protected void listChildren(List<Property> children) {
5893          super.listChildren(children);
5894          children.add(new Property("date", "date", "Date on which the issue of the journal was published.", 0, 1, date));
5895          children.add(new Property("year", "string", "Year on which the issue of the journal was published.", 0, 1, year));
5896          children.add(new Property("month", "string", "Month on which the issue of the journal was published.", 0, 1, month));
5897          children.add(new Property("day", "string", "Day on which the issue of the journal was published.", 0, 1, day));
5898          children.add(new Property("season", "string", "Spring, Summer, Fall/Autumn, Winter.", 0, 1, season));
5899          children.add(new Property("text", "string", "Text representation of the date of which the issue of the journal was published.", 0, 1, text));
5900        }
5901
5902        @Override
5903        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5904          switch (_hash) {
5905          case 3076014: /*date*/  return new Property("date", "date", "Date on which the issue of the journal was published.", 0, 1, date);
5906          case 3704893: /*year*/  return new Property("year", "string", "Year on which the issue of the journal was published.", 0, 1, year);
5907          case 104080000: /*month*/  return new Property("month", "string", "Month on which the issue of the journal was published.", 0, 1, month);
5908          case 99228: /*day*/  return new Property("day", "string", "Day on which the issue of the journal was published.", 0, 1, day);
5909          case -906335517: /*season*/  return new Property("season", "string", "Spring, Summer, Fall/Autumn, Winter.", 0, 1, season);
5910          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);
5911          default: return super.getNamedProperty(_hash, _name, _checkValid);
5912          }
5913
5914        }
5915
5916      @Override
5917      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5918        switch (hash) {
5919        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType
5920        case 3704893: /*year*/ return this.year == null ? new Base[0] : new Base[] {this.year}; // StringType
5921        case 104080000: /*month*/ return this.month == null ? new Base[0] : new Base[] {this.month}; // StringType
5922        case 99228: /*day*/ return this.day == null ? new Base[0] : new Base[] {this.day}; // StringType
5923        case -906335517: /*season*/ return this.season == null ? new Base[0] : new Base[] {this.season}; // StringType
5924        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
5925        default: return super.getProperty(hash, name, checkValid);
5926        }
5927
5928      }
5929
5930      @Override
5931      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5932        switch (hash) {
5933        case 3076014: // date
5934          this.date = TypeConvertor.castToDate(value); // DateType
5935          return value;
5936        case 3704893: // year
5937          this.year = TypeConvertor.castToString(value); // StringType
5938          return value;
5939        case 104080000: // month
5940          this.month = TypeConvertor.castToString(value); // StringType
5941          return value;
5942        case 99228: // day
5943          this.day = TypeConvertor.castToString(value); // StringType
5944          return value;
5945        case -906335517: // season
5946          this.season = TypeConvertor.castToString(value); // StringType
5947          return value;
5948        case 3556653: // text
5949          this.text = TypeConvertor.castToString(value); // StringType
5950          return value;
5951        default: return super.setProperty(hash, name, value);
5952        }
5953
5954      }
5955
5956      @Override
5957      public Base setProperty(String name, Base value) throws FHIRException {
5958        if (name.equals("date")) {
5959          this.date = TypeConvertor.castToDate(value); // DateType
5960        } else if (name.equals("year")) {
5961          this.year = TypeConvertor.castToString(value); // StringType
5962        } else if (name.equals("month")) {
5963          this.month = TypeConvertor.castToString(value); // StringType
5964        } else if (name.equals("day")) {
5965          this.day = TypeConvertor.castToString(value); // StringType
5966        } else if (name.equals("season")) {
5967          this.season = TypeConvertor.castToString(value); // StringType
5968        } else if (name.equals("text")) {
5969          this.text = TypeConvertor.castToString(value); // StringType
5970        } else
5971          return super.setProperty(name, value);
5972        return value;
5973      }
5974
5975      @Override
5976      public Base makeProperty(int hash, String name) throws FHIRException {
5977        switch (hash) {
5978        case 3076014:  return getDateElement();
5979        case 3704893:  return getYearElement();
5980        case 104080000:  return getMonthElement();
5981        case 99228:  return getDayElement();
5982        case -906335517:  return getSeasonElement();
5983        case 3556653:  return getTextElement();
5984        default: return super.makeProperty(hash, name);
5985        }
5986
5987      }
5988
5989      @Override
5990      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5991        switch (hash) {
5992        case 3076014: /*date*/ return new String[] {"date"};
5993        case 3704893: /*year*/ return new String[] {"string"};
5994        case 104080000: /*month*/ return new String[] {"string"};
5995        case 99228: /*day*/ return new String[] {"string"};
5996        case -906335517: /*season*/ return new String[] {"string"};
5997        case 3556653: /*text*/ return new String[] {"string"};
5998        default: return super.getTypesForProperty(hash, name);
5999        }
6000
6001      }
6002
6003      @Override
6004      public Base addChild(String name) throws FHIRException {
6005        if (name.equals("date")) {
6006          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.date");
6007        }
6008        else if (name.equals("year")) {
6009          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.year");
6010        }
6011        else if (name.equals("month")) {
6012          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.month");
6013        }
6014        else if (name.equals("day")) {
6015          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.day");
6016        }
6017        else if (name.equals("season")) {
6018          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.season");
6019        }
6020        else if (name.equals("text")) {
6021          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication.text");
6022        }
6023        else
6024          return super.addChild(name);
6025      }
6026
6027      public CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent copy() {
6028        CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent dst = new CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent();
6029        copyValues(dst);
6030        return dst;
6031      }
6032
6033      public void copyValues(CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent dst) {
6034        super.copyValues(dst);
6035        dst.date = date == null ? null : date.copy();
6036        dst.year = year == null ? null : year.copy();
6037        dst.month = month == null ? null : month.copy();
6038        dst.day = day == null ? null : day.copy();
6039        dst.season = season == null ? null : season.copy();
6040        dst.text = text == null ? null : text.copy();
6041      }
6042
6043      @Override
6044      public boolean equalsDeep(Base other_) {
6045        if (!super.equalsDeep(other_))
6046          return false;
6047        if (!(other_ instanceof CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent))
6048          return false;
6049        CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent o = (CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent) other_;
6050        return compareDeep(date, o.date, true) && compareDeep(year, o.year, true) && compareDeep(month, o.month, true)
6051           && compareDeep(day, o.day, true) && compareDeep(season, o.season, true) && compareDeep(text, o.text, true)
6052          ;
6053      }
6054
6055      @Override
6056      public boolean equalsShallow(Base other_) {
6057        if (!super.equalsShallow(other_))
6058          return false;
6059        if (!(other_ instanceof CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent))
6060          return false;
6061        CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent o = (CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent) other_;
6062        return compareValues(date, o.date, true) && compareValues(year, o.year, true) && compareValues(month, o.month, true)
6063           && compareValues(day, o.day, true) && compareValues(season, o.season, true) && compareValues(text, o.text, true)
6064          ;
6065      }
6066
6067      public boolean isEmpty() {
6068        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(date, year, month, day
6069          , season, text);
6070      }
6071
6072  public String fhirType() {
6073    return "Citation.citedArtifact.publicationForm.periodicRelease.dateOfPublication";
6074
6075  }
6076
6077  }
6078
6079    @Block()
6080    public static class CitationCitedArtifactWebLocationComponent extends BackboneElement implements IBaseBackboneElement {
6081        /**
6082         * Code the reason for different URLs, e.g. abstract and full-text.
6083         */
6084        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
6085        @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." )
6086        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/article-url-type")
6087        protected CodeableConcept type;
6088
6089        /**
6090         * The specific URL.
6091         */
6092        @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false)
6093        @Description(shortDefinition="The specific URL", formalDefinition="The specific URL." )
6094        protected UriType url;
6095
6096        private static final long serialVersionUID = 397204034L;
6097
6098    /**
6099     * Constructor
6100     */
6101      public CitationCitedArtifactWebLocationComponent() {
6102        super();
6103      }
6104
6105        /**
6106         * @return {@link #type} (Code the reason for different URLs, e.g. abstract and full-text.)
6107         */
6108        public CodeableConcept getType() { 
6109          if (this.type == null)
6110            if (Configuration.errorOnAutoCreate())
6111              throw new Error("Attempt to auto-create CitationCitedArtifactWebLocationComponent.type");
6112            else if (Configuration.doAutoCreate())
6113              this.type = new CodeableConcept(); // cc
6114          return this.type;
6115        }
6116
6117        public boolean hasType() { 
6118          return this.type != null && !this.type.isEmpty();
6119        }
6120
6121        /**
6122         * @param value {@link #type} (Code the reason for different URLs, e.g. abstract and full-text.)
6123         */
6124        public CitationCitedArtifactWebLocationComponent setType(CodeableConcept value) { 
6125          this.type = value;
6126          return this;
6127        }
6128
6129        /**
6130         * @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
6131         */
6132        public UriType getUrlElement() { 
6133          if (this.url == null)
6134            if (Configuration.errorOnAutoCreate())
6135              throw new Error("Attempt to auto-create CitationCitedArtifactWebLocationComponent.url");
6136            else if (Configuration.doAutoCreate())
6137              this.url = new UriType(); // bb
6138          return this.url;
6139        }
6140
6141        public boolean hasUrlElement() { 
6142          return this.url != null && !this.url.isEmpty();
6143        }
6144
6145        public boolean hasUrl() { 
6146          return this.url != null && !this.url.isEmpty();
6147        }
6148
6149        /**
6150         * @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
6151         */
6152        public CitationCitedArtifactWebLocationComponent setUrlElement(UriType value) { 
6153          this.url = value;
6154          return this;
6155        }
6156
6157        /**
6158         * @return The specific URL.
6159         */
6160        public String getUrl() { 
6161          return this.url == null ? null : this.url.getValue();
6162        }
6163
6164        /**
6165         * @param value The specific URL.
6166         */
6167        public CitationCitedArtifactWebLocationComponent setUrl(String value) { 
6168          if (Utilities.noString(value))
6169            this.url = null;
6170          else {
6171            if (this.url == null)
6172              this.url = new UriType();
6173            this.url.setValue(value);
6174          }
6175          return this;
6176        }
6177
6178        protected void listChildren(List<Property> children) {
6179          super.listChildren(children);
6180          children.add(new Property("type", "CodeableConcept", "Code the reason for different URLs, e.g. abstract and full-text.", 0, 1, type));
6181          children.add(new Property("url", "uri", "The specific URL.", 0, 1, url));
6182        }
6183
6184        @Override
6185        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6186          switch (_hash) {
6187          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Code the reason for different URLs, e.g. abstract and full-text.", 0, 1, type);
6188          case 116079: /*url*/  return new Property("url", "uri", "The specific URL.", 0, 1, url);
6189          default: return super.getNamedProperty(_hash, _name, _checkValid);
6190          }
6191
6192        }
6193
6194      @Override
6195      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6196        switch (hash) {
6197        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
6198        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
6199        default: return super.getProperty(hash, name, checkValid);
6200        }
6201
6202      }
6203
6204      @Override
6205      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6206        switch (hash) {
6207        case 3575610: // type
6208          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
6209          return value;
6210        case 116079: // url
6211          this.url = TypeConvertor.castToUri(value); // UriType
6212          return value;
6213        default: return super.setProperty(hash, name, value);
6214        }
6215
6216      }
6217
6218      @Override
6219      public Base setProperty(String name, Base value) throws FHIRException {
6220        if (name.equals("type")) {
6221          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
6222        } else if (name.equals("url")) {
6223          this.url = TypeConvertor.castToUri(value); // UriType
6224        } else
6225          return super.setProperty(name, value);
6226        return value;
6227      }
6228
6229      @Override
6230      public Base makeProperty(int hash, String name) throws FHIRException {
6231        switch (hash) {
6232        case 3575610:  return getType();
6233        case 116079:  return getUrlElement();
6234        default: return super.makeProperty(hash, name);
6235        }
6236
6237      }
6238
6239      @Override
6240      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6241        switch (hash) {
6242        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
6243        case 116079: /*url*/ return new String[] {"uri"};
6244        default: return super.getTypesForProperty(hash, name);
6245        }
6246
6247      }
6248
6249      @Override
6250      public Base addChild(String name) throws FHIRException {
6251        if (name.equals("type")) {
6252          this.type = new CodeableConcept();
6253          return this.type;
6254        }
6255        else if (name.equals("url")) {
6256          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.webLocation.url");
6257        }
6258        else
6259          return super.addChild(name);
6260      }
6261
6262      public CitationCitedArtifactWebLocationComponent copy() {
6263        CitationCitedArtifactWebLocationComponent dst = new CitationCitedArtifactWebLocationComponent();
6264        copyValues(dst);
6265        return dst;
6266      }
6267
6268      public void copyValues(CitationCitedArtifactWebLocationComponent dst) {
6269        super.copyValues(dst);
6270        dst.type = type == null ? null : type.copy();
6271        dst.url = url == null ? null : url.copy();
6272      }
6273
6274      @Override
6275      public boolean equalsDeep(Base other_) {
6276        if (!super.equalsDeep(other_))
6277          return false;
6278        if (!(other_ instanceof CitationCitedArtifactWebLocationComponent))
6279          return false;
6280        CitationCitedArtifactWebLocationComponent o = (CitationCitedArtifactWebLocationComponent) other_;
6281        return compareDeep(type, o.type, true) && compareDeep(url, o.url, true);
6282      }
6283
6284      @Override
6285      public boolean equalsShallow(Base other_) {
6286        if (!super.equalsShallow(other_))
6287          return false;
6288        if (!(other_ instanceof CitationCitedArtifactWebLocationComponent))
6289          return false;
6290        CitationCitedArtifactWebLocationComponent o = (CitationCitedArtifactWebLocationComponent) other_;
6291        return compareValues(url, o.url, true);
6292      }
6293
6294      public boolean isEmpty() {
6295        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, url);
6296      }
6297
6298  public String fhirType() {
6299    return "Citation.citedArtifact.webLocation";
6300
6301  }
6302
6303  }
6304
6305    @Block()
6306    public static class CitationCitedArtifactClassificationComponent extends BackboneElement implements IBaseBackboneElement {
6307        /**
6308         * The kind of classifier (e.g. publication type, keyword).
6309         */
6310        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
6311        @Description(shortDefinition="The kind of classifier (e.g. publication type, keyword)", formalDefinition="The kind of classifier (e.g. publication type, keyword)." )
6312        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/cited-artifact-classification-type")
6313        protected CodeableConcept type;
6314
6315        /**
6316         * The specific classification value.
6317         */
6318        @Child(name = "classifier", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6319        @Description(shortDefinition="The specific classification value", formalDefinition="The specific classification value." )
6320        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-artifact-classifier")
6321        protected List<CodeableConcept> classifier;
6322
6323        /**
6324         * Provenance and copyright of classification.
6325         */
6326        @Child(name = "whoClassified", type = {}, order=3, min=0, max=1, modifier=false, summary=false)
6327        @Description(shortDefinition="Provenance and copyright of classification", formalDefinition="Provenance and copyright of classification." )
6328        protected CitationCitedArtifactClassificationWhoClassifiedComponent whoClassified;
6329
6330        private static final long serialVersionUID = -1887617918L;
6331
6332    /**
6333     * Constructor
6334     */
6335      public CitationCitedArtifactClassificationComponent() {
6336        super();
6337      }
6338
6339        /**
6340         * @return {@link #type} (The kind of classifier (e.g. publication type, keyword).)
6341         */
6342        public CodeableConcept getType() { 
6343          if (this.type == null)
6344            if (Configuration.errorOnAutoCreate())
6345              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationComponent.type");
6346            else if (Configuration.doAutoCreate())
6347              this.type = new CodeableConcept(); // cc
6348          return this.type;
6349        }
6350
6351        public boolean hasType() { 
6352          return this.type != null && !this.type.isEmpty();
6353        }
6354
6355        /**
6356         * @param value {@link #type} (The kind of classifier (e.g. publication type, keyword).)
6357         */
6358        public CitationCitedArtifactClassificationComponent setType(CodeableConcept value) { 
6359          this.type = value;
6360          return this;
6361        }
6362
6363        /**
6364         * @return {@link #classifier} (The specific classification value.)
6365         */
6366        public List<CodeableConcept> getClassifier() { 
6367          if (this.classifier == null)
6368            this.classifier = new ArrayList<CodeableConcept>();
6369          return this.classifier;
6370        }
6371
6372        /**
6373         * @return Returns a reference to <code>this</code> for easy method chaining
6374         */
6375        public CitationCitedArtifactClassificationComponent setClassifier(List<CodeableConcept> theClassifier) { 
6376          this.classifier = theClassifier;
6377          return this;
6378        }
6379
6380        public boolean hasClassifier() { 
6381          if (this.classifier == null)
6382            return false;
6383          for (CodeableConcept item : this.classifier)
6384            if (!item.isEmpty())
6385              return true;
6386          return false;
6387        }
6388
6389        public CodeableConcept addClassifier() { //3
6390          CodeableConcept t = new CodeableConcept();
6391          if (this.classifier == null)
6392            this.classifier = new ArrayList<CodeableConcept>();
6393          this.classifier.add(t);
6394          return t;
6395        }
6396
6397        public CitationCitedArtifactClassificationComponent addClassifier(CodeableConcept t) { //3
6398          if (t == null)
6399            return this;
6400          if (this.classifier == null)
6401            this.classifier = new ArrayList<CodeableConcept>();
6402          this.classifier.add(t);
6403          return this;
6404        }
6405
6406        /**
6407         * @return The first repetition of repeating field {@link #classifier}, creating it if it does not already exist {3}
6408         */
6409        public CodeableConcept getClassifierFirstRep() { 
6410          if (getClassifier().isEmpty()) {
6411            addClassifier();
6412          }
6413          return getClassifier().get(0);
6414        }
6415
6416        /**
6417         * @return {@link #whoClassified} (Provenance and copyright of classification.)
6418         */
6419        public CitationCitedArtifactClassificationWhoClassifiedComponent getWhoClassified() { 
6420          if (this.whoClassified == null)
6421            if (Configuration.errorOnAutoCreate())
6422              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationComponent.whoClassified");
6423            else if (Configuration.doAutoCreate())
6424              this.whoClassified = new CitationCitedArtifactClassificationWhoClassifiedComponent(); // cc
6425          return this.whoClassified;
6426        }
6427
6428        public boolean hasWhoClassified() { 
6429          return this.whoClassified != null && !this.whoClassified.isEmpty();
6430        }
6431
6432        /**
6433         * @param value {@link #whoClassified} (Provenance and copyright of classification.)
6434         */
6435        public CitationCitedArtifactClassificationComponent setWhoClassified(CitationCitedArtifactClassificationWhoClassifiedComponent value) { 
6436          this.whoClassified = value;
6437          return this;
6438        }
6439
6440        protected void listChildren(List<Property> children) {
6441          super.listChildren(children);
6442          children.add(new Property("type", "CodeableConcept", "The kind of classifier (e.g. publication type, keyword).", 0, 1, type));
6443          children.add(new Property("classifier", "CodeableConcept", "The specific classification value.", 0, java.lang.Integer.MAX_VALUE, classifier));
6444          children.add(new Property("whoClassified", "", "Provenance and copyright of classification.", 0, 1, whoClassified));
6445        }
6446
6447        @Override
6448        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6449          switch (_hash) {
6450          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of classifier (e.g. publication type, keyword).", 0, 1, type);
6451          case -281470431: /*classifier*/  return new Property("classifier", "CodeableConcept", "The specific classification value.", 0, java.lang.Integer.MAX_VALUE, classifier);
6452          case -196629391: /*whoClassified*/  return new Property("whoClassified", "", "Provenance and copyright of classification.", 0, 1, whoClassified);
6453          default: return super.getNamedProperty(_hash, _name, _checkValid);
6454          }
6455
6456        }
6457
6458      @Override
6459      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6460        switch (hash) {
6461        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
6462        case -281470431: /*classifier*/ return this.classifier == null ? new Base[0] : this.classifier.toArray(new Base[this.classifier.size()]); // CodeableConcept
6463        case -196629391: /*whoClassified*/ return this.whoClassified == null ? new Base[0] : new Base[] {this.whoClassified}; // CitationCitedArtifactClassificationWhoClassifiedComponent
6464        default: return super.getProperty(hash, name, checkValid);
6465        }
6466
6467      }
6468
6469      @Override
6470      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6471        switch (hash) {
6472        case 3575610: // type
6473          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
6474          return value;
6475        case -281470431: // classifier
6476          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
6477          return value;
6478        case -196629391: // whoClassified
6479          this.whoClassified = (CitationCitedArtifactClassificationWhoClassifiedComponent) value; // CitationCitedArtifactClassificationWhoClassifiedComponent
6480          return value;
6481        default: return super.setProperty(hash, name, value);
6482        }
6483
6484      }
6485
6486      @Override
6487      public Base setProperty(String name, Base value) throws FHIRException {
6488        if (name.equals("type")) {
6489          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
6490        } else if (name.equals("classifier")) {
6491          this.getClassifier().add(TypeConvertor.castToCodeableConcept(value));
6492        } else if (name.equals("whoClassified")) {
6493          this.whoClassified = (CitationCitedArtifactClassificationWhoClassifiedComponent) value; // CitationCitedArtifactClassificationWhoClassifiedComponent
6494        } else
6495          return super.setProperty(name, value);
6496        return value;
6497      }
6498
6499      @Override
6500      public Base makeProperty(int hash, String name) throws FHIRException {
6501        switch (hash) {
6502        case 3575610:  return getType();
6503        case -281470431:  return addClassifier(); 
6504        case -196629391:  return getWhoClassified();
6505        default: return super.makeProperty(hash, name);
6506        }
6507
6508      }
6509
6510      @Override
6511      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6512        switch (hash) {
6513        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
6514        case -281470431: /*classifier*/ return new String[] {"CodeableConcept"};
6515        case -196629391: /*whoClassified*/ return new String[] {};
6516        default: return super.getTypesForProperty(hash, name);
6517        }
6518
6519      }
6520
6521      @Override
6522      public Base addChild(String name) throws FHIRException {
6523        if (name.equals("type")) {
6524          this.type = new CodeableConcept();
6525          return this.type;
6526        }
6527        else if (name.equals("classifier")) {
6528          return addClassifier();
6529        }
6530        else if (name.equals("whoClassified")) {
6531          this.whoClassified = new CitationCitedArtifactClassificationWhoClassifiedComponent();
6532          return this.whoClassified;
6533        }
6534        else
6535          return super.addChild(name);
6536      }
6537
6538      public CitationCitedArtifactClassificationComponent copy() {
6539        CitationCitedArtifactClassificationComponent dst = new CitationCitedArtifactClassificationComponent();
6540        copyValues(dst);
6541        return dst;
6542      }
6543
6544      public void copyValues(CitationCitedArtifactClassificationComponent dst) {
6545        super.copyValues(dst);
6546        dst.type = type == null ? null : type.copy();
6547        if (classifier != null) {
6548          dst.classifier = new ArrayList<CodeableConcept>();
6549          for (CodeableConcept i : classifier)
6550            dst.classifier.add(i.copy());
6551        };
6552        dst.whoClassified = whoClassified == null ? null : whoClassified.copy();
6553      }
6554
6555      @Override
6556      public boolean equalsDeep(Base other_) {
6557        if (!super.equalsDeep(other_))
6558          return false;
6559        if (!(other_ instanceof CitationCitedArtifactClassificationComponent))
6560          return false;
6561        CitationCitedArtifactClassificationComponent o = (CitationCitedArtifactClassificationComponent) other_;
6562        return compareDeep(type, o.type, true) && compareDeep(classifier, o.classifier, true) && compareDeep(whoClassified, o.whoClassified, true)
6563          ;
6564      }
6565
6566      @Override
6567      public boolean equalsShallow(Base other_) {
6568        if (!super.equalsShallow(other_))
6569          return false;
6570        if (!(other_ instanceof CitationCitedArtifactClassificationComponent))
6571          return false;
6572        CitationCitedArtifactClassificationComponent o = (CitationCitedArtifactClassificationComponent) other_;
6573        return true;
6574      }
6575
6576      public boolean isEmpty() {
6577        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, classifier, whoClassified
6578          );
6579      }
6580
6581  public String fhirType() {
6582    return "Citation.citedArtifact.classification";
6583
6584  }
6585
6586  }
6587
6588    @Block()
6589    public static class CitationCitedArtifactClassificationWhoClassifiedComponent extends BackboneElement implements IBaseBackboneElement {
6590        /**
6591         * Person who created the classification.
6592         */
6593        @Child(name = "person", type = {Person.class, Practitioner.class}, order=1, min=0, max=1, modifier=false, summary=false)
6594        @Description(shortDefinition="Person who created the classification", formalDefinition="Person who created the classification." )
6595        protected Reference person;
6596
6597        /**
6598         * Organization who created the classification.
6599         */
6600        @Child(name = "organization", type = {Organization.class}, order=2, min=0, max=1, modifier=false, summary=false)
6601        @Description(shortDefinition="Organization who created the classification", formalDefinition="Organization who created the classification." )
6602        protected Reference organization;
6603
6604        /**
6605         * The publisher of the classification, not the publisher of the article or artifact being cited.
6606         */
6607        @Child(name = "publisher", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=false)
6608        @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." )
6609        protected Reference publisher;
6610
6611        /**
6612         * Rights management statement for the classification.
6613         */
6614        @Child(name = "classifierCopyright", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
6615        @Description(shortDefinition="Rights management statement for the classification", formalDefinition="Rights management statement for the classification." )
6616        protected StringType classifierCopyright;
6617
6618        /**
6619         * Acceptable to re-use the classification.
6620         */
6621        @Child(name = "freeToShare", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=false)
6622        @Description(shortDefinition="Acceptable to re-use the classification", formalDefinition="Acceptable to re-use the classification." )
6623        protected BooleanType freeToShare;
6624
6625        private static final long serialVersionUID = -1835300032L;
6626
6627    /**
6628     * Constructor
6629     */
6630      public CitationCitedArtifactClassificationWhoClassifiedComponent() {
6631        super();
6632      }
6633
6634        /**
6635         * @return {@link #person} (Person who created the classification.)
6636         */
6637        public Reference getPerson() { 
6638          if (this.person == null)
6639            if (Configuration.errorOnAutoCreate())
6640              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationWhoClassifiedComponent.person");
6641            else if (Configuration.doAutoCreate())
6642              this.person = new Reference(); // cc
6643          return this.person;
6644        }
6645
6646        public boolean hasPerson() { 
6647          return this.person != null && !this.person.isEmpty();
6648        }
6649
6650        /**
6651         * @param value {@link #person} (Person who created the classification.)
6652         */
6653        public CitationCitedArtifactClassificationWhoClassifiedComponent setPerson(Reference value) { 
6654          this.person = value;
6655          return this;
6656        }
6657
6658        /**
6659         * @return {@link #organization} (Organization who created the classification.)
6660         */
6661        public Reference getOrganization() { 
6662          if (this.organization == null)
6663            if (Configuration.errorOnAutoCreate())
6664              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationWhoClassifiedComponent.organization");
6665            else if (Configuration.doAutoCreate())
6666              this.organization = new Reference(); // cc
6667          return this.organization;
6668        }
6669
6670        public boolean hasOrganization() { 
6671          return this.organization != null && !this.organization.isEmpty();
6672        }
6673
6674        /**
6675         * @param value {@link #organization} (Organization who created the classification.)
6676         */
6677        public CitationCitedArtifactClassificationWhoClassifiedComponent setOrganization(Reference value) { 
6678          this.organization = value;
6679          return this;
6680        }
6681
6682        /**
6683         * @return {@link #publisher} (The publisher of the classification, not the publisher of the article or artifact being cited.)
6684         */
6685        public Reference getPublisher() { 
6686          if (this.publisher == null)
6687            if (Configuration.errorOnAutoCreate())
6688              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationWhoClassifiedComponent.publisher");
6689            else if (Configuration.doAutoCreate())
6690              this.publisher = new Reference(); // cc
6691          return this.publisher;
6692        }
6693
6694        public boolean hasPublisher() { 
6695          return this.publisher != null && !this.publisher.isEmpty();
6696        }
6697
6698        /**
6699         * @param value {@link #publisher} (The publisher of the classification, not the publisher of the article or artifact being cited.)
6700         */
6701        public CitationCitedArtifactClassificationWhoClassifiedComponent setPublisher(Reference value) { 
6702          this.publisher = value;
6703          return this;
6704        }
6705
6706        /**
6707         * @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
6708         */
6709        public StringType getClassifierCopyrightElement() { 
6710          if (this.classifierCopyright == null)
6711            if (Configuration.errorOnAutoCreate())
6712              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationWhoClassifiedComponent.classifierCopyright");
6713            else if (Configuration.doAutoCreate())
6714              this.classifierCopyright = new StringType(); // bb
6715          return this.classifierCopyright;
6716        }
6717
6718        public boolean hasClassifierCopyrightElement() { 
6719          return this.classifierCopyright != null && !this.classifierCopyright.isEmpty();
6720        }
6721
6722        public boolean hasClassifierCopyright() { 
6723          return this.classifierCopyright != null && !this.classifierCopyright.isEmpty();
6724        }
6725
6726        /**
6727         * @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
6728         */
6729        public CitationCitedArtifactClassificationWhoClassifiedComponent setClassifierCopyrightElement(StringType value) { 
6730          this.classifierCopyright = value;
6731          return this;
6732        }
6733
6734        /**
6735         * @return Rights management statement for the classification.
6736         */
6737        public String getClassifierCopyright() { 
6738          return this.classifierCopyright == null ? null : this.classifierCopyright.getValue();
6739        }
6740
6741        /**
6742         * @param value Rights management statement for the classification.
6743         */
6744        public CitationCitedArtifactClassificationWhoClassifiedComponent setClassifierCopyright(String value) { 
6745          if (Utilities.noString(value))
6746            this.classifierCopyright = null;
6747          else {
6748            if (this.classifierCopyright == null)
6749              this.classifierCopyright = new StringType();
6750            this.classifierCopyright.setValue(value);
6751          }
6752          return this;
6753        }
6754
6755        /**
6756         * @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
6757         */
6758        public BooleanType getFreeToShareElement() { 
6759          if (this.freeToShare == null)
6760            if (Configuration.errorOnAutoCreate())
6761              throw new Error("Attempt to auto-create CitationCitedArtifactClassificationWhoClassifiedComponent.freeToShare");
6762            else if (Configuration.doAutoCreate())
6763              this.freeToShare = new BooleanType(); // bb
6764          return this.freeToShare;
6765        }
6766
6767        public boolean hasFreeToShareElement() { 
6768          return this.freeToShare != null && !this.freeToShare.isEmpty();
6769        }
6770
6771        public boolean hasFreeToShare() { 
6772          return this.freeToShare != null && !this.freeToShare.isEmpty();
6773        }
6774
6775        /**
6776         * @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
6777         */
6778        public CitationCitedArtifactClassificationWhoClassifiedComponent setFreeToShareElement(BooleanType value) { 
6779          this.freeToShare = value;
6780          return this;
6781        }
6782
6783        /**
6784         * @return Acceptable to re-use the classification.
6785         */
6786        public boolean getFreeToShare() { 
6787          return this.freeToShare == null || this.freeToShare.isEmpty() ? false : this.freeToShare.getValue();
6788        }
6789
6790        /**
6791         * @param value Acceptable to re-use the classification.
6792         */
6793        public CitationCitedArtifactClassificationWhoClassifiedComponent setFreeToShare(boolean value) { 
6794            if (this.freeToShare == null)
6795              this.freeToShare = new BooleanType();
6796            this.freeToShare.setValue(value);
6797          return this;
6798        }
6799
6800        protected void listChildren(List<Property> children) {
6801          super.listChildren(children);
6802          children.add(new Property("person", "Reference(Person|Practitioner)", "Person who created the classification.", 0, 1, person));
6803          children.add(new Property("organization", "Reference(Organization)", "Organization who created the classification.", 0, 1, organization));
6804          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));
6805          children.add(new Property("classifierCopyright", "string", "Rights management statement for the classification.", 0, 1, classifierCopyright));
6806          children.add(new Property("freeToShare", "boolean", "Acceptable to re-use the classification.", 0, 1, freeToShare));
6807        }
6808
6809        @Override
6810        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6811          switch (_hash) {
6812          case -991716523: /*person*/  return new Property("person", "Reference(Person|Practitioner)", "Person who created the classification.", 0, 1, person);
6813          case 1178922291: /*organization*/  return new Property("organization", "Reference(Organization)", "Organization who created the classification.", 0, 1, organization);
6814          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);
6815          case -434942298: /*classifierCopyright*/  return new Property("classifierCopyright", "string", "Rights management statement for the classification.", 0, 1, classifierCopyright);
6816          case -1268656616: /*freeToShare*/  return new Property("freeToShare", "boolean", "Acceptable to re-use the classification.", 0, 1, freeToShare);
6817          default: return super.getNamedProperty(_hash, _name, _checkValid);
6818          }
6819
6820        }
6821
6822      @Override
6823      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6824        switch (hash) {
6825        case -991716523: /*person*/ return this.person == null ? new Base[0] : new Base[] {this.person}; // Reference
6826        case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference
6827        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // Reference
6828        case -434942298: /*classifierCopyright*/ return this.classifierCopyright == null ? new Base[0] : new Base[] {this.classifierCopyright}; // StringType
6829        case -1268656616: /*freeToShare*/ return this.freeToShare == null ? new Base[0] : new Base[] {this.freeToShare}; // BooleanType
6830        default: return super.getProperty(hash, name, checkValid);
6831        }
6832
6833      }
6834
6835      @Override
6836      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6837        switch (hash) {
6838        case -991716523: // person
6839          this.person = TypeConvertor.castToReference(value); // Reference
6840          return value;
6841        case 1178922291: // organization
6842          this.organization = TypeConvertor.castToReference(value); // Reference
6843          return value;
6844        case 1447404028: // publisher
6845          this.publisher = TypeConvertor.castToReference(value); // Reference
6846          return value;
6847        case -434942298: // classifierCopyright
6848          this.classifierCopyright = TypeConvertor.castToString(value); // StringType
6849          return value;
6850        case -1268656616: // freeToShare
6851          this.freeToShare = TypeConvertor.castToBoolean(value); // BooleanType
6852          return value;
6853        default: return super.setProperty(hash, name, value);
6854        }
6855
6856      }
6857
6858      @Override
6859      public Base setProperty(String name, Base value) throws FHIRException {
6860        if (name.equals("person")) {
6861          this.person = TypeConvertor.castToReference(value); // Reference
6862        } else if (name.equals("organization")) {
6863          this.organization = TypeConvertor.castToReference(value); // Reference
6864        } else if (name.equals("publisher")) {
6865          this.publisher = TypeConvertor.castToReference(value); // Reference
6866        } else if (name.equals("classifierCopyright")) {
6867          this.classifierCopyright = TypeConvertor.castToString(value); // StringType
6868        } else if (name.equals("freeToShare")) {
6869          this.freeToShare = TypeConvertor.castToBoolean(value); // BooleanType
6870        } else
6871          return super.setProperty(name, value);
6872        return value;
6873      }
6874
6875      @Override
6876      public Base makeProperty(int hash, String name) throws FHIRException {
6877        switch (hash) {
6878        case -991716523:  return getPerson();
6879        case 1178922291:  return getOrganization();
6880        case 1447404028:  return getPublisher();
6881        case -434942298:  return getClassifierCopyrightElement();
6882        case -1268656616:  return getFreeToShareElement();
6883        default: return super.makeProperty(hash, name);
6884        }
6885
6886      }
6887
6888      @Override
6889      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6890        switch (hash) {
6891        case -991716523: /*person*/ return new String[] {"Reference"};
6892        case 1178922291: /*organization*/ return new String[] {"Reference"};
6893        case 1447404028: /*publisher*/ return new String[] {"Reference"};
6894        case -434942298: /*classifierCopyright*/ return new String[] {"string"};
6895        case -1268656616: /*freeToShare*/ return new String[] {"boolean"};
6896        default: return super.getTypesForProperty(hash, name);
6897        }
6898
6899      }
6900
6901      @Override
6902      public Base addChild(String name) throws FHIRException {
6903        if (name.equals("person")) {
6904          this.person = new Reference();
6905          return this.person;
6906        }
6907        else if (name.equals("organization")) {
6908          this.organization = new Reference();
6909          return this.organization;
6910        }
6911        else if (name.equals("publisher")) {
6912          this.publisher = new Reference();
6913          return this.publisher;
6914        }
6915        else if (name.equals("classifierCopyright")) {
6916          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.classification.whoClassified.classifierCopyright");
6917        }
6918        else if (name.equals("freeToShare")) {
6919          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.classification.whoClassified.freeToShare");
6920        }
6921        else
6922          return super.addChild(name);
6923      }
6924
6925      public CitationCitedArtifactClassificationWhoClassifiedComponent copy() {
6926        CitationCitedArtifactClassificationWhoClassifiedComponent dst = new CitationCitedArtifactClassificationWhoClassifiedComponent();
6927        copyValues(dst);
6928        return dst;
6929      }
6930
6931      public void copyValues(CitationCitedArtifactClassificationWhoClassifiedComponent dst) {
6932        super.copyValues(dst);
6933        dst.person = person == null ? null : person.copy();
6934        dst.organization = organization == null ? null : organization.copy();
6935        dst.publisher = publisher == null ? null : publisher.copy();
6936        dst.classifierCopyright = classifierCopyright == null ? null : classifierCopyright.copy();
6937        dst.freeToShare = freeToShare == null ? null : freeToShare.copy();
6938      }
6939
6940      @Override
6941      public boolean equalsDeep(Base other_) {
6942        if (!super.equalsDeep(other_))
6943          return false;
6944        if (!(other_ instanceof CitationCitedArtifactClassificationWhoClassifiedComponent))
6945          return false;
6946        CitationCitedArtifactClassificationWhoClassifiedComponent o = (CitationCitedArtifactClassificationWhoClassifiedComponent) other_;
6947        return compareDeep(person, o.person, true) && compareDeep(organization, o.organization, true) && compareDeep(publisher, o.publisher, true)
6948           && compareDeep(classifierCopyright, o.classifierCopyright, true) && compareDeep(freeToShare, o.freeToShare, true)
6949          ;
6950      }
6951
6952      @Override
6953      public boolean equalsShallow(Base other_) {
6954        if (!super.equalsShallow(other_))
6955          return false;
6956        if (!(other_ instanceof CitationCitedArtifactClassificationWhoClassifiedComponent))
6957          return false;
6958        CitationCitedArtifactClassificationWhoClassifiedComponent o = (CitationCitedArtifactClassificationWhoClassifiedComponent) other_;
6959        return compareValues(classifierCopyright, o.classifierCopyright, true) && compareValues(freeToShare, o.freeToShare, true)
6960          ;
6961      }
6962
6963      public boolean isEmpty() {
6964        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(person, organization, publisher
6965          , classifierCopyright, freeToShare);
6966      }
6967
6968  public String fhirType() {
6969    return "Citation.citedArtifact.classification.whoClassified";
6970
6971  }
6972
6973  }
6974
6975    @Block()
6976    public static class CitationCitedArtifactContributorshipComponent extends BackboneElement implements IBaseBackboneElement {
6977        /**
6978         * Indicates if the list includes all authors and/or contributors.
6979         */
6980        @Child(name = "complete", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false)
6981        @Description(shortDefinition="Indicates if the list includes all authors and/or contributors", formalDefinition="Indicates if the list includes all authors and/or contributors." )
6982        protected BooleanType complete;
6983
6984        /**
6985         * An individual entity named in the author list or contributor list.
6986         */
6987        @Child(name = "entry", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6988        @Description(shortDefinition="An individual entity named in the list", formalDefinition="An individual entity named in the author list or contributor list." )
6989        protected List<CitationCitedArtifactContributorshipEntryComponent> entry;
6990
6991        /**
6992         * Used to record a display of the author/contributor list without separate coding for each list member.
6993         */
6994        @Child(name = "summary", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
6995        @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." )
6996        protected List<CitationCitedArtifactContributorshipSummaryComponent> summary;
6997
6998        private static final long serialVersionUID = 78346599L;
6999
7000    /**
7001     * Constructor
7002     */
7003      public CitationCitedArtifactContributorshipComponent() {
7004        super();
7005      }
7006
7007        /**
7008         * @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
7009         */
7010        public BooleanType getCompleteElement() { 
7011          if (this.complete == null)
7012            if (Configuration.errorOnAutoCreate())
7013              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipComponent.complete");
7014            else if (Configuration.doAutoCreate())
7015              this.complete = new BooleanType(); // bb
7016          return this.complete;
7017        }
7018
7019        public boolean hasCompleteElement() { 
7020          return this.complete != null && !this.complete.isEmpty();
7021        }
7022
7023        public boolean hasComplete() { 
7024          return this.complete != null && !this.complete.isEmpty();
7025        }
7026
7027        /**
7028         * @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
7029         */
7030        public CitationCitedArtifactContributorshipComponent setCompleteElement(BooleanType value) { 
7031          this.complete = value;
7032          return this;
7033        }
7034
7035        /**
7036         * @return Indicates if the list includes all authors and/or contributors.
7037         */
7038        public boolean getComplete() { 
7039          return this.complete == null || this.complete.isEmpty() ? false : this.complete.getValue();
7040        }
7041
7042        /**
7043         * @param value Indicates if the list includes all authors and/or contributors.
7044         */
7045        public CitationCitedArtifactContributorshipComponent setComplete(boolean value) { 
7046            if (this.complete == null)
7047              this.complete = new BooleanType();
7048            this.complete.setValue(value);
7049          return this;
7050        }
7051
7052        /**
7053         * @return {@link #entry} (An individual entity named in the author list or contributor list.)
7054         */
7055        public List<CitationCitedArtifactContributorshipEntryComponent> getEntry() { 
7056          if (this.entry == null)
7057            this.entry = new ArrayList<CitationCitedArtifactContributorshipEntryComponent>();
7058          return this.entry;
7059        }
7060
7061        /**
7062         * @return Returns a reference to <code>this</code> for easy method chaining
7063         */
7064        public CitationCitedArtifactContributorshipComponent setEntry(List<CitationCitedArtifactContributorshipEntryComponent> theEntry) { 
7065          this.entry = theEntry;
7066          return this;
7067        }
7068
7069        public boolean hasEntry() { 
7070          if (this.entry == null)
7071            return false;
7072          for (CitationCitedArtifactContributorshipEntryComponent item : this.entry)
7073            if (!item.isEmpty())
7074              return true;
7075          return false;
7076        }
7077
7078        public CitationCitedArtifactContributorshipEntryComponent addEntry() { //3
7079          CitationCitedArtifactContributorshipEntryComponent t = new CitationCitedArtifactContributorshipEntryComponent();
7080          if (this.entry == null)
7081            this.entry = new ArrayList<CitationCitedArtifactContributorshipEntryComponent>();
7082          this.entry.add(t);
7083          return t;
7084        }
7085
7086        public CitationCitedArtifactContributorshipComponent addEntry(CitationCitedArtifactContributorshipEntryComponent t) { //3
7087          if (t == null)
7088            return this;
7089          if (this.entry == null)
7090            this.entry = new ArrayList<CitationCitedArtifactContributorshipEntryComponent>();
7091          this.entry.add(t);
7092          return this;
7093        }
7094
7095        /**
7096         * @return The first repetition of repeating field {@link #entry}, creating it if it does not already exist {3}
7097         */
7098        public CitationCitedArtifactContributorshipEntryComponent getEntryFirstRep() { 
7099          if (getEntry().isEmpty()) {
7100            addEntry();
7101          }
7102          return getEntry().get(0);
7103        }
7104
7105        /**
7106         * @return {@link #summary} (Used to record a display of the author/contributor list without separate coding for each list member.)
7107         */
7108        public List<CitationCitedArtifactContributorshipSummaryComponent> getSummary() { 
7109          if (this.summary == null)
7110            this.summary = new ArrayList<CitationCitedArtifactContributorshipSummaryComponent>();
7111          return this.summary;
7112        }
7113
7114        /**
7115         * @return Returns a reference to <code>this</code> for easy method chaining
7116         */
7117        public CitationCitedArtifactContributorshipComponent setSummary(List<CitationCitedArtifactContributorshipSummaryComponent> theSummary) { 
7118          this.summary = theSummary;
7119          return this;
7120        }
7121
7122        public boolean hasSummary() { 
7123          if (this.summary == null)
7124            return false;
7125          for (CitationCitedArtifactContributorshipSummaryComponent item : this.summary)
7126            if (!item.isEmpty())
7127              return true;
7128          return false;
7129        }
7130
7131        public CitationCitedArtifactContributorshipSummaryComponent addSummary() { //3
7132          CitationCitedArtifactContributorshipSummaryComponent t = new CitationCitedArtifactContributorshipSummaryComponent();
7133          if (this.summary == null)
7134            this.summary = new ArrayList<CitationCitedArtifactContributorshipSummaryComponent>();
7135          this.summary.add(t);
7136          return t;
7137        }
7138
7139        public CitationCitedArtifactContributorshipComponent addSummary(CitationCitedArtifactContributorshipSummaryComponent t) { //3
7140          if (t == null)
7141            return this;
7142          if (this.summary == null)
7143            this.summary = new ArrayList<CitationCitedArtifactContributorshipSummaryComponent>();
7144          this.summary.add(t);
7145          return this;
7146        }
7147
7148        /**
7149         * @return The first repetition of repeating field {@link #summary}, creating it if it does not already exist {3}
7150         */
7151        public CitationCitedArtifactContributorshipSummaryComponent getSummaryFirstRep() { 
7152          if (getSummary().isEmpty()) {
7153            addSummary();
7154          }
7155          return getSummary().get(0);
7156        }
7157
7158        protected void listChildren(List<Property> children) {
7159          super.listChildren(children);
7160          children.add(new Property("complete", "boolean", "Indicates if the list includes all authors and/or contributors.", 0, 1, complete));
7161          children.add(new Property("entry", "", "An individual entity named in the author list or contributor list.", 0, java.lang.Integer.MAX_VALUE, entry));
7162          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));
7163        }
7164
7165        @Override
7166        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7167          switch (_hash) {
7168          case -599445191: /*complete*/  return new Property("complete", "boolean", "Indicates if the list includes all authors and/or contributors.", 0, 1, complete);
7169          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);
7170          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);
7171          default: return super.getNamedProperty(_hash, _name, _checkValid);
7172          }
7173
7174        }
7175
7176      @Override
7177      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7178        switch (hash) {
7179        case -599445191: /*complete*/ return this.complete == null ? new Base[0] : new Base[] {this.complete}; // BooleanType
7180        case 96667762: /*entry*/ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // CitationCitedArtifactContributorshipEntryComponent
7181        case -1857640538: /*summary*/ return this.summary == null ? new Base[0] : this.summary.toArray(new Base[this.summary.size()]); // CitationCitedArtifactContributorshipSummaryComponent
7182        default: return super.getProperty(hash, name, checkValid);
7183        }
7184
7185      }
7186
7187      @Override
7188      public Base setProperty(int hash, String name, Base value) throws FHIRException {
7189        switch (hash) {
7190        case -599445191: // complete
7191          this.complete = TypeConvertor.castToBoolean(value); // BooleanType
7192          return value;
7193        case 96667762: // entry
7194          this.getEntry().add((CitationCitedArtifactContributorshipEntryComponent) value); // CitationCitedArtifactContributorshipEntryComponent
7195          return value;
7196        case -1857640538: // summary
7197          this.getSummary().add((CitationCitedArtifactContributorshipSummaryComponent) value); // CitationCitedArtifactContributorshipSummaryComponent
7198          return value;
7199        default: return super.setProperty(hash, name, value);
7200        }
7201
7202      }
7203
7204      @Override
7205      public Base setProperty(String name, Base value) throws FHIRException {
7206        if (name.equals("complete")) {
7207          this.complete = TypeConvertor.castToBoolean(value); // BooleanType
7208        } else if (name.equals("entry")) {
7209          this.getEntry().add((CitationCitedArtifactContributorshipEntryComponent) value);
7210        } else if (name.equals("summary")) {
7211          this.getSummary().add((CitationCitedArtifactContributorshipSummaryComponent) value);
7212        } else
7213          return super.setProperty(name, value);
7214        return value;
7215      }
7216
7217      @Override
7218      public Base makeProperty(int hash, String name) throws FHIRException {
7219        switch (hash) {
7220        case -599445191:  return getCompleteElement();
7221        case 96667762:  return addEntry(); 
7222        case -1857640538:  return addSummary(); 
7223        default: return super.makeProperty(hash, name);
7224        }
7225
7226      }
7227
7228      @Override
7229      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
7230        switch (hash) {
7231        case -599445191: /*complete*/ return new String[] {"boolean"};
7232        case 96667762: /*entry*/ return new String[] {};
7233        case -1857640538: /*summary*/ return new String[] {};
7234        default: return super.getTypesForProperty(hash, name);
7235        }
7236
7237      }
7238
7239      @Override
7240      public Base addChild(String name) throws FHIRException {
7241        if (name.equals("complete")) {
7242          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.complete");
7243        }
7244        else if (name.equals("entry")) {
7245          return addEntry();
7246        }
7247        else if (name.equals("summary")) {
7248          return addSummary();
7249        }
7250        else
7251          return super.addChild(name);
7252      }
7253
7254      public CitationCitedArtifactContributorshipComponent copy() {
7255        CitationCitedArtifactContributorshipComponent dst = new CitationCitedArtifactContributorshipComponent();
7256        copyValues(dst);
7257        return dst;
7258      }
7259
7260      public void copyValues(CitationCitedArtifactContributorshipComponent dst) {
7261        super.copyValues(dst);
7262        dst.complete = complete == null ? null : complete.copy();
7263        if (entry != null) {
7264          dst.entry = new ArrayList<CitationCitedArtifactContributorshipEntryComponent>();
7265          for (CitationCitedArtifactContributorshipEntryComponent i : entry)
7266            dst.entry.add(i.copy());
7267        };
7268        if (summary != null) {
7269          dst.summary = new ArrayList<CitationCitedArtifactContributorshipSummaryComponent>();
7270          for (CitationCitedArtifactContributorshipSummaryComponent i : summary)
7271            dst.summary.add(i.copy());
7272        };
7273      }
7274
7275      @Override
7276      public boolean equalsDeep(Base other_) {
7277        if (!super.equalsDeep(other_))
7278          return false;
7279        if (!(other_ instanceof CitationCitedArtifactContributorshipComponent))
7280          return false;
7281        CitationCitedArtifactContributorshipComponent o = (CitationCitedArtifactContributorshipComponent) other_;
7282        return compareDeep(complete, o.complete, true) && compareDeep(entry, o.entry, true) && compareDeep(summary, o.summary, true)
7283          ;
7284      }
7285
7286      @Override
7287      public boolean equalsShallow(Base other_) {
7288        if (!super.equalsShallow(other_))
7289          return false;
7290        if (!(other_ instanceof CitationCitedArtifactContributorshipComponent))
7291          return false;
7292        CitationCitedArtifactContributorshipComponent o = (CitationCitedArtifactContributorshipComponent) other_;
7293        return compareValues(complete, o.complete, true);
7294      }
7295
7296      public boolean isEmpty() {
7297        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(complete, entry, summary
7298          );
7299      }
7300
7301  public String fhirType() {
7302    return "Citation.citedArtifact.contributorship";
7303
7304  }
7305
7306  }
7307
7308    @Block()
7309    public static class CitationCitedArtifactContributorshipEntryComponent extends BackboneElement implements IBaseBackboneElement {
7310        /**
7311         * A name associated with the individual.
7312         */
7313        @Child(name = "name", type = {HumanName.class}, order=1, min=0, max=1, modifier=false, summary=false)
7314        @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the individual." )
7315        protected HumanName name;
7316
7317        /**
7318         * Initials for forename.
7319         */
7320        @Child(name = "initials", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
7321        @Description(shortDefinition="Initials for forename", formalDefinition="Initials for forename." )
7322        protected StringType initials;
7323
7324        /**
7325         * Used for collective or corporate name as an author.
7326         */
7327        @Child(name = "collectiveName", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
7328        @Description(shortDefinition="Used for collective or corporate name as an author", formalDefinition="Used for collective or corporate name as an author." )
7329        protected StringType collectiveName;
7330
7331        /**
7332         * Unique person identifier.
7333         */
7334        @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7335        @Description(shortDefinition="Author identifier, eg ORCID", formalDefinition="Unique person identifier." )
7336        protected List<Identifier> identifier;
7337
7338        /**
7339         * Organization affiliated with the entity.
7340         */
7341        @Child(name = "affiliationInfo", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7342        @Description(shortDefinition="Organizational affiliation", formalDefinition="Organization affiliated with the entity." )
7343        protected List<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent> affiliationInfo;
7344
7345        /**
7346         * Physical mailing address for the author or contributor.
7347         */
7348        @Child(name = "address", type = {Address.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7349        @Description(shortDefinition="Physical mailing address", formalDefinition="Physical mailing address for the author or contributor." )
7350        protected List<Address> address;
7351
7352        /**
7353         * Email or telephone contact methods for the author or contributor.
7354         */
7355        @Child(name = "telecom", type = {ContactPoint.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7356        @Description(shortDefinition="Email or telephone contact methods for the author or contributor", formalDefinition="Email or telephone contact methods for the author or contributor." )
7357        protected List<ContactPoint> telecom;
7358
7359        /**
7360         * This element identifies the specific nature of an individual’s contribution with respect to the cited work.
7361         */
7362        @Child(name = "contributionType", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7363        @Description(shortDefinition="The specific contribution", formalDefinition="This element identifies the specific nature of an individual’s contribution with respect to the cited work." )
7364        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/artifact-contribution-type")
7365        protected List<CodeableConcept> contributionType;
7366
7367        /**
7368         * The role of the contributor (e.g. author, editor, reviewer).
7369         */
7370        @Child(name = "role", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false)
7371        @Description(shortDefinition="The role of the contributor (e.g. author, editor, reviewer)", formalDefinition="The role of the contributor (e.g. author, editor, reviewer)." )
7372        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contributor-role")
7373        protected CodeableConcept role;
7374
7375        /**
7376         * Contributions with accounting for time or number.
7377         */
7378        @Child(name = "contributionInstance", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7379        @Description(shortDefinition="Contributions with accounting for time or number", formalDefinition="Contributions with accounting for time or number." )
7380        protected List<CitationCitedArtifactContributorshipEntryContributionInstanceComponent> contributionInstance;
7381
7382        /**
7383         * Indication of which contributor is the corresponding contributor for the role.
7384         */
7385        @Child(name = "correspondingContact", type = {BooleanType.class}, order=11, min=0, max=1, modifier=false, summary=false)
7386        @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." )
7387        protected BooleanType correspondingContact;
7388
7389        /**
7390         * Used to code order of authors.
7391         */
7392        @Child(name = "listOrder", type = {PositiveIntType.class}, order=12, min=0, max=1, modifier=false, summary=false)
7393        @Description(shortDefinition="Used to code order of authors", formalDefinition="Used to code order of authors." )
7394        protected PositiveIntType listOrder;
7395
7396        private static final long serialVersionUID = -1994433623L;
7397
7398    /**
7399     * Constructor
7400     */
7401      public CitationCitedArtifactContributorshipEntryComponent() {
7402        super();
7403      }
7404
7405        /**
7406         * @return {@link #name} (A name associated with the individual.)
7407         */
7408        public HumanName getName() { 
7409          if (this.name == null)
7410            if (Configuration.errorOnAutoCreate())
7411              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.name");
7412            else if (Configuration.doAutoCreate())
7413              this.name = new HumanName(); // cc
7414          return this.name;
7415        }
7416
7417        public boolean hasName() { 
7418          return this.name != null && !this.name.isEmpty();
7419        }
7420
7421        /**
7422         * @param value {@link #name} (A name associated with the individual.)
7423         */
7424        public CitationCitedArtifactContributorshipEntryComponent setName(HumanName value) { 
7425          this.name = value;
7426          return this;
7427        }
7428
7429        /**
7430         * @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
7431         */
7432        public StringType getInitialsElement() { 
7433          if (this.initials == null)
7434            if (Configuration.errorOnAutoCreate())
7435              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.initials");
7436            else if (Configuration.doAutoCreate())
7437              this.initials = new StringType(); // bb
7438          return this.initials;
7439        }
7440
7441        public boolean hasInitialsElement() { 
7442          return this.initials != null && !this.initials.isEmpty();
7443        }
7444
7445        public boolean hasInitials() { 
7446          return this.initials != null && !this.initials.isEmpty();
7447        }
7448
7449        /**
7450         * @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
7451         */
7452        public CitationCitedArtifactContributorshipEntryComponent setInitialsElement(StringType value) { 
7453          this.initials = value;
7454          return this;
7455        }
7456
7457        /**
7458         * @return Initials for forename.
7459         */
7460        public String getInitials() { 
7461          return this.initials == null ? null : this.initials.getValue();
7462        }
7463
7464        /**
7465         * @param value Initials for forename.
7466         */
7467        public CitationCitedArtifactContributorshipEntryComponent setInitials(String value) { 
7468          if (Utilities.noString(value))
7469            this.initials = null;
7470          else {
7471            if (this.initials == null)
7472              this.initials = new StringType();
7473            this.initials.setValue(value);
7474          }
7475          return this;
7476        }
7477
7478        /**
7479         * @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
7480         */
7481        public StringType getCollectiveNameElement() { 
7482          if (this.collectiveName == null)
7483            if (Configuration.errorOnAutoCreate())
7484              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.collectiveName");
7485            else if (Configuration.doAutoCreate())
7486              this.collectiveName = new StringType(); // bb
7487          return this.collectiveName;
7488        }
7489
7490        public boolean hasCollectiveNameElement() { 
7491          return this.collectiveName != null && !this.collectiveName.isEmpty();
7492        }
7493
7494        public boolean hasCollectiveName() { 
7495          return this.collectiveName != null && !this.collectiveName.isEmpty();
7496        }
7497
7498        /**
7499         * @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
7500         */
7501        public CitationCitedArtifactContributorshipEntryComponent setCollectiveNameElement(StringType value) { 
7502          this.collectiveName = value;
7503          return this;
7504        }
7505
7506        /**
7507         * @return Used for collective or corporate name as an author.
7508         */
7509        public String getCollectiveName() { 
7510          return this.collectiveName == null ? null : this.collectiveName.getValue();
7511        }
7512
7513        /**
7514         * @param value Used for collective or corporate name as an author.
7515         */
7516        public CitationCitedArtifactContributorshipEntryComponent setCollectiveName(String value) { 
7517          if (Utilities.noString(value))
7518            this.collectiveName = null;
7519          else {
7520            if (this.collectiveName == null)
7521              this.collectiveName = new StringType();
7522            this.collectiveName.setValue(value);
7523          }
7524          return this;
7525        }
7526
7527        /**
7528         * @return {@link #identifier} (Unique person identifier.)
7529         */
7530        public List<Identifier> getIdentifier() { 
7531          if (this.identifier == null)
7532            this.identifier = new ArrayList<Identifier>();
7533          return this.identifier;
7534        }
7535
7536        /**
7537         * @return Returns a reference to <code>this</code> for easy method chaining
7538         */
7539        public CitationCitedArtifactContributorshipEntryComponent setIdentifier(List<Identifier> theIdentifier) { 
7540          this.identifier = theIdentifier;
7541          return this;
7542        }
7543
7544        public boolean hasIdentifier() { 
7545          if (this.identifier == null)
7546            return false;
7547          for (Identifier item : this.identifier)
7548            if (!item.isEmpty())
7549              return true;
7550          return false;
7551        }
7552
7553        public Identifier addIdentifier() { //3
7554          Identifier t = new Identifier();
7555          if (this.identifier == null)
7556            this.identifier = new ArrayList<Identifier>();
7557          this.identifier.add(t);
7558          return t;
7559        }
7560
7561        public CitationCitedArtifactContributorshipEntryComponent addIdentifier(Identifier t) { //3
7562          if (t == null)
7563            return this;
7564          if (this.identifier == null)
7565            this.identifier = new ArrayList<Identifier>();
7566          this.identifier.add(t);
7567          return this;
7568        }
7569
7570        /**
7571         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
7572         */
7573        public Identifier getIdentifierFirstRep() { 
7574          if (getIdentifier().isEmpty()) {
7575            addIdentifier();
7576          }
7577          return getIdentifier().get(0);
7578        }
7579
7580        /**
7581         * @return {@link #affiliationInfo} (Organization affiliated with the entity.)
7582         */
7583        public List<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent> getAffiliationInfo() { 
7584          if (this.affiliationInfo == null)
7585            this.affiliationInfo = new ArrayList<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent>();
7586          return this.affiliationInfo;
7587        }
7588
7589        /**
7590         * @return Returns a reference to <code>this</code> for easy method chaining
7591         */
7592        public CitationCitedArtifactContributorshipEntryComponent setAffiliationInfo(List<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent> theAffiliationInfo) { 
7593          this.affiliationInfo = theAffiliationInfo;
7594          return this;
7595        }
7596
7597        public boolean hasAffiliationInfo() { 
7598          if (this.affiliationInfo == null)
7599            return false;
7600          for (CitationCitedArtifactContributorshipEntryAffiliationInfoComponent item : this.affiliationInfo)
7601            if (!item.isEmpty())
7602              return true;
7603          return false;
7604        }
7605
7606        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent addAffiliationInfo() { //3
7607          CitationCitedArtifactContributorshipEntryAffiliationInfoComponent t = new CitationCitedArtifactContributorshipEntryAffiliationInfoComponent();
7608          if (this.affiliationInfo == null)
7609            this.affiliationInfo = new ArrayList<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent>();
7610          this.affiliationInfo.add(t);
7611          return t;
7612        }
7613
7614        public CitationCitedArtifactContributorshipEntryComponent addAffiliationInfo(CitationCitedArtifactContributorshipEntryAffiliationInfoComponent t) { //3
7615          if (t == null)
7616            return this;
7617          if (this.affiliationInfo == null)
7618            this.affiliationInfo = new ArrayList<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent>();
7619          this.affiliationInfo.add(t);
7620          return this;
7621        }
7622
7623        /**
7624         * @return The first repetition of repeating field {@link #affiliationInfo}, creating it if it does not already exist {3}
7625         */
7626        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent getAffiliationInfoFirstRep() { 
7627          if (getAffiliationInfo().isEmpty()) {
7628            addAffiliationInfo();
7629          }
7630          return getAffiliationInfo().get(0);
7631        }
7632
7633        /**
7634         * @return {@link #address} (Physical mailing address for the author or contributor.)
7635         */
7636        public List<Address> getAddress() { 
7637          if (this.address == null)
7638            this.address = new ArrayList<Address>();
7639          return this.address;
7640        }
7641
7642        /**
7643         * @return Returns a reference to <code>this</code> for easy method chaining
7644         */
7645        public CitationCitedArtifactContributorshipEntryComponent setAddress(List<Address> theAddress) { 
7646          this.address = theAddress;
7647          return this;
7648        }
7649
7650        public boolean hasAddress() { 
7651          if (this.address == null)
7652            return false;
7653          for (Address item : this.address)
7654            if (!item.isEmpty())
7655              return true;
7656          return false;
7657        }
7658
7659        public Address addAddress() { //3
7660          Address t = new Address();
7661          if (this.address == null)
7662            this.address = new ArrayList<Address>();
7663          this.address.add(t);
7664          return t;
7665        }
7666
7667        public CitationCitedArtifactContributorshipEntryComponent addAddress(Address t) { //3
7668          if (t == null)
7669            return this;
7670          if (this.address == null)
7671            this.address = new ArrayList<Address>();
7672          this.address.add(t);
7673          return this;
7674        }
7675
7676        /**
7677         * @return The first repetition of repeating field {@link #address}, creating it if it does not already exist {3}
7678         */
7679        public Address getAddressFirstRep() { 
7680          if (getAddress().isEmpty()) {
7681            addAddress();
7682          }
7683          return getAddress().get(0);
7684        }
7685
7686        /**
7687         * @return {@link #telecom} (Email or telephone contact methods for the author or contributor.)
7688         */
7689        public List<ContactPoint> getTelecom() { 
7690          if (this.telecom == null)
7691            this.telecom = new ArrayList<ContactPoint>();
7692          return this.telecom;
7693        }
7694
7695        /**
7696         * @return Returns a reference to <code>this</code> for easy method chaining
7697         */
7698        public CitationCitedArtifactContributorshipEntryComponent setTelecom(List<ContactPoint> theTelecom) { 
7699          this.telecom = theTelecom;
7700          return this;
7701        }
7702
7703        public boolean hasTelecom() { 
7704          if (this.telecom == null)
7705            return false;
7706          for (ContactPoint item : this.telecom)
7707            if (!item.isEmpty())
7708              return true;
7709          return false;
7710        }
7711
7712        public ContactPoint addTelecom() { //3
7713          ContactPoint t = new ContactPoint();
7714          if (this.telecom == null)
7715            this.telecom = new ArrayList<ContactPoint>();
7716          this.telecom.add(t);
7717          return t;
7718        }
7719
7720        public CitationCitedArtifactContributorshipEntryComponent addTelecom(ContactPoint t) { //3
7721          if (t == null)
7722            return this;
7723          if (this.telecom == null)
7724            this.telecom = new ArrayList<ContactPoint>();
7725          this.telecom.add(t);
7726          return this;
7727        }
7728
7729        /**
7730         * @return The first repetition of repeating field {@link #telecom}, creating it if it does not already exist {3}
7731         */
7732        public ContactPoint getTelecomFirstRep() { 
7733          if (getTelecom().isEmpty()) {
7734            addTelecom();
7735          }
7736          return getTelecom().get(0);
7737        }
7738
7739        /**
7740         * @return {@link #contributionType} (This element identifies the specific nature of an individual’s contribution with respect to the cited work.)
7741         */
7742        public List<CodeableConcept> getContributionType() { 
7743          if (this.contributionType == null)
7744            this.contributionType = new ArrayList<CodeableConcept>();
7745          return this.contributionType;
7746        }
7747
7748        /**
7749         * @return Returns a reference to <code>this</code> for easy method chaining
7750         */
7751        public CitationCitedArtifactContributorshipEntryComponent setContributionType(List<CodeableConcept> theContributionType) { 
7752          this.contributionType = theContributionType;
7753          return this;
7754        }
7755
7756        public boolean hasContributionType() { 
7757          if (this.contributionType == null)
7758            return false;
7759          for (CodeableConcept item : this.contributionType)
7760            if (!item.isEmpty())
7761              return true;
7762          return false;
7763        }
7764
7765        public CodeableConcept addContributionType() { //3
7766          CodeableConcept t = new CodeableConcept();
7767          if (this.contributionType == null)
7768            this.contributionType = new ArrayList<CodeableConcept>();
7769          this.contributionType.add(t);
7770          return t;
7771        }
7772
7773        public CitationCitedArtifactContributorshipEntryComponent addContributionType(CodeableConcept t) { //3
7774          if (t == null)
7775            return this;
7776          if (this.contributionType == null)
7777            this.contributionType = new ArrayList<CodeableConcept>();
7778          this.contributionType.add(t);
7779          return this;
7780        }
7781
7782        /**
7783         * @return The first repetition of repeating field {@link #contributionType}, creating it if it does not already exist {3}
7784         */
7785        public CodeableConcept getContributionTypeFirstRep() { 
7786          if (getContributionType().isEmpty()) {
7787            addContributionType();
7788          }
7789          return getContributionType().get(0);
7790        }
7791
7792        /**
7793         * @return {@link #role} (The role of the contributor (e.g. author, editor, reviewer).)
7794         */
7795        public CodeableConcept getRole() { 
7796          if (this.role == null)
7797            if (Configuration.errorOnAutoCreate())
7798              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.role");
7799            else if (Configuration.doAutoCreate())
7800              this.role = new CodeableConcept(); // cc
7801          return this.role;
7802        }
7803
7804        public boolean hasRole() { 
7805          return this.role != null && !this.role.isEmpty();
7806        }
7807
7808        /**
7809         * @param value {@link #role} (The role of the contributor (e.g. author, editor, reviewer).)
7810         */
7811        public CitationCitedArtifactContributorshipEntryComponent setRole(CodeableConcept value) { 
7812          this.role = value;
7813          return this;
7814        }
7815
7816        /**
7817         * @return {@link #contributionInstance} (Contributions with accounting for time or number.)
7818         */
7819        public List<CitationCitedArtifactContributorshipEntryContributionInstanceComponent> getContributionInstance() { 
7820          if (this.contributionInstance == null)
7821            this.contributionInstance = new ArrayList<CitationCitedArtifactContributorshipEntryContributionInstanceComponent>();
7822          return this.contributionInstance;
7823        }
7824
7825        /**
7826         * @return Returns a reference to <code>this</code> for easy method chaining
7827         */
7828        public CitationCitedArtifactContributorshipEntryComponent setContributionInstance(List<CitationCitedArtifactContributorshipEntryContributionInstanceComponent> theContributionInstance) { 
7829          this.contributionInstance = theContributionInstance;
7830          return this;
7831        }
7832
7833        public boolean hasContributionInstance() { 
7834          if (this.contributionInstance == null)
7835            return false;
7836          for (CitationCitedArtifactContributorshipEntryContributionInstanceComponent item : this.contributionInstance)
7837            if (!item.isEmpty())
7838              return true;
7839          return false;
7840        }
7841
7842        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent addContributionInstance() { //3
7843          CitationCitedArtifactContributorshipEntryContributionInstanceComponent t = new CitationCitedArtifactContributorshipEntryContributionInstanceComponent();
7844          if (this.contributionInstance == null)
7845            this.contributionInstance = new ArrayList<CitationCitedArtifactContributorshipEntryContributionInstanceComponent>();
7846          this.contributionInstance.add(t);
7847          return t;
7848        }
7849
7850        public CitationCitedArtifactContributorshipEntryComponent addContributionInstance(CitationCitedArtifactContributorshipEntryContributionInstanceComponent t) { //3
7851          if (t == null)
7852            return this;
7853          if (this.contributionInstance == null)
7854            this.contributionInstance = new ArrayList<CitationCitedArtifactContributorshipEntryContributionInstanceComponent>();
7855          this.contributionInstance.add(t);
7856          return this;
7857        }
7858
7859        /**
7860         * @return The first repetition of repeating field {@link #contributionInstance}, creating it if it does not already exist {3}
7861         */
7862        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent getContributionInstanceFirstRep() { 
7863          if (getContributionInstance().isEmpty()) {
7864            addContributionInstance();
7865          }
7866          return getContributionInstance().get(0);
7867        }
7868
7869        /**
7870         * @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
7871         */
7872        public BooleanType getCorrespondingContactElement() { 
7873          if (this.correspondingContact == null)
7874            if (Configuration.errorOnAutoCreate())
7875              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.correspondingContact");
7876            else if (Configuration.doAutoCreate())
7877              this.correspondingContact = new BooleanType(); // bb
7878          return this.correspondingContact;
7879        }
7880
7881        public boolean hasCorrespondingContactElement() { 
7882          return this.correspondingContact != null && !this.correspondingContact.isEmpty();
7883        }
7884
7885        public boolean hasCorrespondingContact() { 
7886          return this.correspondingContact != null && !this.correspondingContact.isEmpty();
7887        }
7888
7889        /**
7890         * @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
7891         */
7892        public CitationCitedArtifactContributorshipEntryComponent setCorrespondingContactElement(BooleanType value) { 
7893          this.correspondingContact = value;
7894          return this;
7895        }
7896
7897        /**
7898         * @return Indication of which contributor is the corresponding contributor for the role.
7899         */
7900        public boolean getCorrespondingContact() { 
7901          return this.correspondingContact == null || this.correspondingContact.isEmpty() ? false : this.correspondingContact.getValue();
7902        }
7903
7904        /**
7905         * @param value Indication of which contributor is the corresponding contributor for the role.
7906         */
7907        public CitationCitedArtifactContributorshipEntryComponent setCorrespondingContact(boolean value) { 
7908            if (this.correspondingContact == null)
7909              this.correspondingContact = new BooleanType();
7910            this.correspondingContact.setValue(value);
7911          return this;
7912        }
7913
7914        /**
7915         * @return {@link #listOrder} (Used to code order of authors.). This is the underlying object with id, value and extensions. The accessor "getListOrder" gives direct access to the value
7916         */
7917        public PositiveIntType getListOrderElement() { 
7918          if (this.listOrder == null)
7919            if (Configuration.errorOnAutoCreate())
7920              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryComponent.listOrder");
7921            else if (Configuration.doAutoCreate())
7922              this.listOrder = new PositiveIntType(); // bb
7923          return this.listOrder;
7924        }
7925
7926        public boolean hasListOrderElement() { 
7927          return this.listOrder != null && !this.listOrder.isEmpty();
7928        }
7929
7930        public boolean hasListOrder() { 
7931          return this.listOrder != null && !this.listOrder.isEmpty();
7932        }
7933
7934        /**
7935         * @param value {@link #listOrder} (Used to code order of authors.). This is the underlying object with id, value and extensions. The accessor "getListOrder" gives direct access to the value
7936         */
7937        public CitationCitedArtifactContributorshipEntryComponent setListOrderElement(PositiveIntType value) { 
7938          this.listOrder = value;
7939          return this;
7940        }
7941
7942        /**
7943         * @return Used to code order of authors.
7944         */
7945        public int getListOrder() { 
7946          return this.listOrder == null || this.listOrder.isEmpty() ? 0 : this.listOrder.getValue();
7947        }
7948
7949        /**
7950         * @param value Used to code order of authors.
7951         */
7952        public CitationCitedArtifactContributorshipEntryComponent setListOrder(int value) { 
7953            if (this.listOrder == null)
7954              this.listOrder = new PositiveIntType();
7955            this.listOrder.setValue(value);
7956          return this;
7957        }
7958
7959        protected void listChildren(List<Property> children) {
7960          super.listChildren(children);
7961          children.add(new Property("name", "HumanName", "A name associated with the individual.", 0, 1, name));
7962          children.add(new Property("initials", "string", "Initials for forename.", 0, 1, initials));
7963          children.add(new Property("collectiveName", "string", "Used for collective or corporate name as an author.", 0, 1, collectiveName));
7964          children.add(new Property("identifier", "Identifier", "Unique person identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
7965          children.add(new Property("affiliationInfo", "", "Organization affiliated with the entity.", 0, java.lang.Integer.MAX_VALUE, affiliationInfo));
7966          children.add(new Property("address", "Address", "Physical mailing address for the author or contributor.", 0, java.lang.Integer.MAX_VALUE, address));
7967          children.add(new Property("telecom", "ContactPoint", "Email or telephone contact methods for the author or contributor.", 0, java.lang.Integer.MAX_VALUE, telecom));
7968          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));
7969          children.add(new Property("role", "CodeableConcept", "The role of the contributor (e.g. author, editor, reviewer).", 0, 1, role));
7970          children.add(new Property("contributionInstance", "", "Contributions with accounting for time or number.", 0, java.lang.Integer.MAX_VALUE, contributionInstance));
7971          children.add(new Property("correspondingContact", "boolean", "Indication of which contributor is the corresponding contributor for the role.", 0, 1, correspondingContact));
7972          children.add(new Property("listOrder", "positiveInt", "Used to code order of authors.", 0, 1, listOrder));
7973        }
7974
7975        @Override
7976        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7977          switch (_hash) {
7978          case 3373707: /*name*/  return new Property("name", "HumanName", "A name associated with the individual.", 0, 1, name);
7979          case 269062575: /*initials*/  return new Property("initials", "string", "Initials for forename.", 0, 1, initials);
7980          case 502871833: /*collectiveName*/  return new Property("collectiveName", "string", "Used for collective or corporate name as an author.", 0, 1, collectiveName);
7981          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique person identifier.", 0, java.lang.Integer.MAX_VALUE, identifier);
7982          case -215129154: /*affiliationInfo*/  return new Property("affiliationInfo", "", "Organization affiliated with the entity.", 0, java.lang.Integer.MAX_VALUE, affiliationInfo);
7983          case -1147692044: /*address*/  return new Property("address", "Address", "Physical mailing address for the author or contributor.", 0, java.lang.Integer.MAX_VALUE, address);
7984          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);
7985          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);
7986          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "The role of the contributor (e.g. author, editor, reviewer).", 0, 1, role);
7987          case -547910459: /*contributionInstance*/  return new Property("contributionInstance", "", "Contributions with accounting for time or number.", 0, java.lang.Integer.MAX_VALUE, contributionInstance);
7988          case -1816008851: /*correspondingContact*/  return new Property("correspondingContact", "boolean", "Indication of which contributor is the corresponding contributor for the role.", 0, 1, correspondingContact);
7989          case -1238918832: /*listOrder*/  return new Property("listOrder", "positiveInt", "Used to code order of authors.", 0, 1, listOrder);
7990          default: return super.getNamedProperty(_hash, _name, _checkValid);
7991          }
7992
7993        }
7994
7995      @Override
7996      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7997        switch (hash) {
7998        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // HumanName
7999        case 269062575: /*initials*/ return this.initials == null ? new Base[0] : new Base[] {this.initials}; // StringType
8000        case 502871833: /*collectiveName*/ return this.collectiveName == null ? new Base[0] : new Base[] {this.collectiveName}; // StringType
8001        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
8002        case -215129154: /*affiliationInfo*/ return this.affiliationInfo == null ? new Base[0] : this.affiliationInfo.toArray(new Base[this.affiliationInfo.size()]); // CitationCitedArtifactContributorshipEntryAffiliationInfoComponent
8003        case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address
8004        case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
8005        case -1600446614: /*contributionType*/ return this.contributionType == null ? new Base[0] : this.contributionType.toArray(new Base[this.contributionType.size()]); // CodeableConcept
8006        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
8007        case -547910459: /*contributionInstance*/ return this.contributionInstance == null ? new Base[0] : this.contributionInstance.toArray(new Base[this.contributionInstance.size()]); // CitationCitedArtifactContributorshipEntryContributionInstanceComponent
8008        case -1816008851: /*correspondingContact*/ return this.correspondingContact == null ? new Base[0] : new Base[] {this.correspondingContact}; // BooleanType
8009        case -1238918832: /*listOrder*/ return this.listOrder == null ? new Base[0] : new Base[] {this.listOrder}; // PositiveIntType
8010        default: return super.getProperty(hash, name, checkValid);
8011        }
8012
8013      }
8014
8015      @Override
8016      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8017        switch (hash) {
8018        case 3373707: // name
8019          this.name = TypeConvertor.castToHumanName(value); // HumanName
8020          return value;
8021        case 269062575: // initials
8022          this.initials = TypeConvertor.castToString(value); // StringType
8023          return value;
8024        case 502871833: // collectiveName
8025          this.collectiveName = TypeConvertor.castToString(value); // StringType
8026          return value;
8027        case -1618432855: // identifier
8028          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
8029          return value;
8030        case -215129154: // affiliationInfo
8031          this.getAffiliationInfo().add((CitationCitedArtifactContributorshipEntryAffiliationInfoComponent) value); // CitationCitedArtifactContributorshipEntryAffiliationInfoComponent
8032          return value;
8033        case -1147692044: // address
8034          this.getAddress().add(TypeConvertor.castToAddress(value)); // Address
8035          return value;
8036        case -1429363305: // telecom
8037          this.getTelecom().add(TypeConvertor.castToContactPoint(value)); // ContactPoint
8038          return value;
8039        case -1600446614: // contributionType
8040          this.getContributionType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
8041          return value;
8042        case 3506294: // role
8043          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8044          return value;
8045        case -547910459: // contributionInstance
8046          this.getContributionInstance().add((CitationCitedArtifactContributorshipEntryContributionInstanceComponent) value); // CitationCitedArtifactContributorshipEntryContributionInstanceComponent
8047          return value;
8048        case -1816008851: // correspondingContact
8049          this.correspondingContact = TypeConvertor.castToBoolean(value); // BooleanType
8050          return value;
8051        case -1238918832: // listOrder
8052          this.listOrder = TypeConvertor.castToPositiveInt(value); // PositiveIntType
8053          return value;
8054        default: return super.setProperty(hash, name, value);
8055        }
8056
8057      }
8058
8059      @Override
8060      public Base setProperty(String name, Base value) throws FHIRException {
8061        if (name.equals("name")) {
8062          this.name = TypeConvertor.castToHumanName(value); // HumanName
8063        } else if (name.equals("initials")) {
8064          this.initials = TypeConvertor.castToString(value); // StringType
8065        } else if (name.equals("collectiveName")) {
8066          this.collectiveName = TypeConvertor.castToString(value); // StringType
8067        } else if (name.equals("identifier")) {
8068          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
8069        } else if (name.equals("affiliationInfo")) {
8070          this.getAffiliationInfo().add((CitationCitedArtifactContributorshipEntryAffiliationInfoComponent) value);
8071        } else if (name.equals("address")) {
8072          this.getAddress().add(TypeConvertor.castToAddress(value));
8073        } else if (name.equals("telecom")) {
8074          this.getTelecom().add(TypeConvertor.castToContactPoint(value));
8075        } else if (name.equals("contributionType")) {
8076          this.getContributionType().add(TypeConvertor.castToCodeableConcept(value));
8077        } else if (name.equals("role")) {
8078          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8079        } else if (name.equals("contributionInstance")) {
8080          this.getContributionInstance().add((CitationCitedArtifactContributorshipEntryContributionInstanceComponent) value);
8081        } else if (name.equals("correspondingContact")) {
8082          this.correspondingContact = TypeConvertor.castToBoolean(value); // BooleanType
8083        } else if (name.equals("listOrder")) {
8084          this.listOrder = TypeConvertor.castToPositiveInt(value); // PositiveIntType
8085        } else
8086          return super.setProperty(name, value);
8087        return value;
8088      }
8089
8090      @Override
8091      public Base makeProperty(int hash, String name) throws FHIRException {
8092        switch (hash) {
8093        case 3373707:  return getName();
8094        case 269062575:  return getInitialsElement();
8095        case 502871833:  return getCollectiveNameElement();
8096        case -1618432855:  return addIdentifier(); 
8097        case -215129154:  return addAffiliationInfo(); 
8098        case -1147692044:  return addAddress(); 
8099        case -1429363305:  return addTelecom(); 
8100        case -1600446614:  return addContributionType(); 
8101        case 3506294:  return getRole();
8102        case -547910459:  return addContributionInstance(); 
8103        case -1816008851:  return getCorrespondingContactElement();
8104        case -1238918832:  return getListOrderElement();
8105        default: return super.makeProperty(hash, name);
8106        }
8107
8108      }
8109
8110      @Override
8111      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8112        switch (hash) {
8113        case 3373707: /*name*/ return new String[] {"HumanName"};
8114        case 269062575: /*initials*/ return new String[] {"string"};
8115        case 502871833: /*collectiveName*/ return new String[] {"string"};
8116        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
8117        case -215129154: /*affiliationInfo*/ return new String[] {};
8118        case -1147692044: /*address*/ return new String[] {"Address"};
8119        case -1429363305: /*telecom*/ return new String[] {"ContactPoint"};
8120        case -1600446614: /*contributionType*/ return new String[] {"CodeableConcept"};
8121        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
8122        case -547910459: /*contributionInstance*/ return new String[] {};
8123        case -1816008851: /*correspondingContact*/ return new String[] {"boolean"};
8124        case -1238918832: /*listOrder*/ return new String[] {"positiveInt"};
8125        default: return super.getTypesForProperty(hash, name);
8126        }
8127
8128      }
8129
8130      @Override
8131      public Base addChild(String name) throws FHIRException {
8132        if (name.equals("name")) {
8133          this.name = new HumanName();
8134          return this.name;
8135        }
8136        else if (name.equals("initials")) {
8137          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.initials");
8138        }
8139        else if (name.equals("collectiveName")) {
8140          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.collectiveName");
8141        }
8142        else if (name.equals("identifier")) {
8143          return addIdentifier();
8144        }
8145        else if (name.equals("affiliationInfo")) {
8146          return addAffiliationInfo();
8147        }
8148        else if (name.equals("address")) {
8149          return addAddress();
8150        }
8151        else if (name.equals("telecom")) {
8152          return addTelecom();
8153        }
8154        else if (name.equals("contributionType")) {
8155          return addContributionType();
8156        }
8157        else if (name.equals("role")) {
8158          this.role = new CodeableConcept();
8159          return this.role;
8160        }
8161        else if (name.equals("contributionInstance")) {
8162          return addContributionInstance();
8163        }
8164        else if (name.equals("correspondingContact")) {
8165          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.correspondingContact");
8166        }
8167        else if (name.equals("listOrder")) {
8168          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.listOrder");
8169        }
8170        else
8171          return super.addChild(name);
8172      }
8173
8174      public CitationCitedArtifactContributorshipEntryComponent copy() {
8175        CitationCitedArtifactContributorshipEntryComponent dst = new CitationCitedArtifactContributorshipEntryComponent();
8176        copyValues(dst);
8177        return dst;
8178      }
8179
8180      public void copyValues(CitationCitedArtifactContributorshipEntryComponent dst) {
8181        super.copyValues(dst);
8182        dst.name = name == null ? null : name.copy();
8183        dst.initials = initials == null ? null : initials.copy();
8184        dst.collectiveName = collectiveName == null ? null : collectiveName.copy();
8185        if (identifier != null) {
8186          dst.identifier = new ArrayList<Identifier>();
8187          for (Identifier i : identifier)
8188            dst.identifier.add(i.copy());
8189        };
8190        if (affiliationInfo != null) {
8191          dst.affiliationInfo = new ArrayList<CitationCitedArtifactContributorshipEntryAffiliationInfoComponent>();
8192          for (CitationCitedArtifactContributorshipEntryAffiliationInfoComponent i : affiliationInfo)
8193            dst.affiliationInfo.add(i.copy());
8194        };
8195        if (address != null) {
8196          dst.address = new ArrayList<Address>();
8197          for (Address i : address)
8198            dst.address.add(i.copy());
8199        };
8200        if (telecom != null) {
8201          dst.telecom = new ArrayList<ContactPoint>();
8202          for (ContactPoint i : telecom)
8203            dst.telecom.add(i.copy());
8204        };
8205        if (contributionType != null) {
8206          dst.contributionType = new ArrayList<CodeableConcept>();
8207          for (CodeableConcept i : contributionType)
8208            dst.contributionType.add(i.copy());
8209        };
8210        dst.role = role == null ? null : role.copy();
8211        if (contributionInstance != null) {
8212          dst.contributionInstance = new ArrayList<CitationCitedArtifactContributorshipEntryContributionInstanceComponent>();
8213          for (CitationCitedArtifactContributorshipEntryContributionInstanceComponent i : contributionInstance)
8214            dst.contributionInstance.add(i.copy());
8215        };
8216        dst.correspondingContact = correspondingContact == null ? null : correspondingContact.copy();
8217        dst.listOrder = listOrder == null ? null : listOrder.copy();
8218      }
8219
8220      @Override
8221      public boolean equalsDeep(Base other_) {
8222        if (!super.equalsDeep(other_))
8223          return false;
8224        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryComponent))
8225          return false;
8226        CitationCitedArtifactContributorshipEntryComponent o = (CitationCitedArtifactContributorshipEntryComponent) other_;
8227        return compareDeep(name, o.name, true) && compareDeep(initials, o.initials, true) && compareDeep(collectiveName, o.collectiveName, true)
8228           && compareDeep(identifier, o.identifier, true) && compareDeep(affiliationInfo, o.affiliationInfo, true)
8229           && compareDeep(address, o.address, true) && compareDeep(telecom, o.telecom, true) && compareDeep(contributionType, o.contributionType, true)
8230           && compareDeep(role, o.role, true) && compareDeep(contributionInstance, o.contributionInstance, true)
8231           && compareDeep(correspondingContact, o.correspondingContact, true) && compareDeep(listOrder, o.listOrder, true)
8232          ;
8233      }
8234
8235      @Override
8236      public boolean equalsShallow(Base other_) {
8237        if (!super.equalsShallow(other_))
8238          return false;
8239        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryComponent))
8240          return false;
8241        CitationCitedArtifactContributorshipEntryComponent o = (CitationCitedArtifactContributorshipEntryComponent) other_;
8242        return compareValues(initials, o.initials, true) && compareValues(collectiveName, o.collectiveName, true)
8243           && compareValues(correspondingContact, o.correspondingContact, true) && compareValues(listOrder, o.listOrder, true)
8244          ;
8245      }
8246
8247      public boolean isEmpty() {
8248        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, initials, collectiveName
8249          , identifier, affiliationInfo, address, telecom, contributionType, role, contributionInstance
8250          , correspondingContact, listOrder);
8251      }
8252
8253  public String fhirType() {
8254    return "Citation.citedArtifact.contributorship.entry";
8255
8256  }
8257
8258  }
8259
8260    @Block()
8261    public static class CitationCitedArtifactContributorshipEntryAffiliationInfoComponent extends BackboneElement implements IBaseBackboneElement {
8262        /**
8263         * Display for the organization.
8264         */
8265        @Child(name = "affiliation", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
8266        @Description(shortDefinition="Display for the organization", formalDefinition="Display for the organization." )
8267        protected StringType affiliation;
8268
8269        /**
8270         * Role within the organization, such as professional title.
8271         */
8272        @Child(name = "role", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
8273        @Description(shortDefinition="Role within the organization, such as professional title", formalDefinition="Role within the organization, such as professional title." )
8274        protected StringType role;
8275
8276        /**
8277         * Identifier for the organization.
8278         */
8279        @Child(name = "identifier", type = {Identifier.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8280        @Description(shortDefinition="Identifier for the organization", formalDefinition="Identifier for the organization." )
8281        protected List<Identifier> identifier;
8282
8283        private static final long serialVersionUID = 548335522L;
8284
8285    /**
8286     * Constructor
8287     */
8288      public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent() {
8289        super();
8290      }
8291
8292        /**
8293         * @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
8294         */
8295        public StringType getAffiliationElement() { 
8296          if (this.affiliation == null)
8297            if (Configuration.errorOnAutoCreate())
8298              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryAffiliationInfoComponent.affiliation");
8299            else if (Configuration.doAutoCreate())
8300              this.affiliation = new StringType(); // bb
8301          return this.affiliation;
8302        }
8303
8304        public boolean hasAffiliationElement() { 
8305          return this.affiliation != null && !this.affiliation.isEmpty();
8306        }
8307
8308        public boolean hasAffiliation() { 
8309          return this.affiliation != null && !this.affiliation.isEmpty();
8310        }
8311
8312        /**
8313         * @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
8314         */
8315        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent setAffiliationElement(StringType value) { 
8316          this.affiliation = value;
8317          return this;
8318        }
8319
8320        /**
8321         * @return Display for the organization.
8322         */
8323        public String getAffiliation() { 
8324          return this.affiliation == null ? null : this.affiliation.getValue();
8325        }
8326
8327        /**
8328         * @param value Display for the organization.
8329         */
8330        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent setAffiliation(String value) { 
8331          if (Utilities.noString(value))
8332            this.affiliation = null;
8333          else {
8334            if (this.affiliation == null)
8335              this.affiliation = new StringType();
8336            this.affiliation.setValue(value);
8337          }
8338          return this;
8339        }
8340
8341        /**
8342         * @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
8343         */
8344        public StringType getRoleElement() { 
8345          if (this.role == null)
8346            if (Configuration.errorOnAutoCreate())
8347              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryAffiliationInfoComponent.role");
8348            else if (Configuration.doAutoCreate())
8349              this.role = new StringType(); // bb
8350          return this.role;
8351        }
8352
8353        public boolean hasRoleElement() { 
8354          return this.role != null && !this.role.isEmpty();
8355        }
8356
8357        public boolean hasRole() { 
8358          return this.role != null && !this.role.isEmpty();
8359        }
8360
8361        /**
8362         * @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
8363         */
8364        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent setRoleElement(StringType value) { 
8365          this.role = value;
8366          return this;
8367        }
8368
8369        /**
8370         * @return Role within the organization, such as professional title.
8371         */
8372        public String getRole() { 
8373          return this.role == null ? null : this.role.getValue();
8374        }
8375
8376        /**
8377         * @param value Role within the organization, such as professional title.
8378         */
8379        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent setRole(String value) { 
8380          if (Utilities.noString(value))
8381            this.role = null;
8382          else {
8383            if (this.role == null)
8384              this.role = new StringType();
8385            this.role.setValue(value);
8386          }
8387          return this;
8388        }
8389
8390        /**
8391         * @return {@link #identifier} (Identifier for the organization.)
8392         */
8393        public List<Identifier> getIdentifier() { 
8394          if (this.identifier == null)
8395            this.identifier = new ArrayList<Identifier>();
8396          return this.identifier;
8397        }
8398
8399        /**
8400         * @return Returns a reference to <code>this</code> for easy method chaining
8401         */
8402        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent setIdentifier(List<Identifier> theIdentifier) { 
8403          this.identifier = theIdentifier;
8404          return this;
8405        }
8406
8407        public boolean hasIdentifier() { 
8408          if (this.identifier == null)
8409            return false;
8410          for (Identifier item : this.identifier)
8411            if (!item.isEmpty())
8412              return true;
8413          return false;
8414        }
8415
8416        public Identifier addIdentifier() { //3
8417          Identifier t = new Identifier();
8418          if (this.identifier == null)
8419            this.identifier = new ArrayList<Identifier>();
8420          this.identifier.add(t);
8421          return t;
8422        }
8423
8424        public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent addIdentifier(Identifier t) { //3
8425          if (t == null)
8426            return this;
8427          if (this.identifier == null)
8428            this.identifier = new ArrayList<Identifier>();
8429          this.identifier.add(t);
8430          return this;
8431        }
8432
8433        /**
8434         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
8435         */
8436        public Identifier getIdentifierFirstRep() { 
8437          if (getIdentifier().isEmpty()) {
8438            addIdentifier();
8439          }
8440          return getIdentifier().get(0);
8441        }
8442
8443        protected void listChildren(List<Property> children) {
8444          super.listChildren(children);
8445          children.add(new Property("affiliation", "string", "Display for the organization.", 0, 1, affiliation));
8446          children.add(new Property("role", "string", "Role within the organization, such as professional title.", 0, 1, role));
8447          children.add(new Property("identifier", "Identifier", "Identifier for the organization.", 0, java.lang.Integer.MAX_VALUE, identifier));
8448        }
8449
8450        @Override
8451        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8452          switch (_hash) {
8453          case 2019918576: /*affiliation*/  return new Property("affiliation", "string", "Display for the organization.", 0, 1, affiliation);
8454          case 3506294: /*role*/  return new Property("role", "string", "Role within the organization, such as professional title.", 0, 1, role);
8455          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifier for the organization.", 0, java.lang.Integer.MAX_VALUE, identifier);
8456          default: return super.getNamedProperty(_hash, _name, _checkValid);
8457          }
8458
8459        }
8460
8461      @Override
8462      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8463        switch (hash) {
8464        case 2019918576: /*affiliation*/ return this.affiliation == null ? new Base[0] : new Base[] {this.affiliation}; // StringType
8465        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // StringType
8466        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
8467        default: return super.getProperty(hash, name, checkValid);
8468        }
8469
8470      }
8471
8472      @Override
8473      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8474        switch (hash) {
8475        case 2019918576: // affiliation
8476          this.affiliation = TypeConvertor.castToString(value); // StringType
8477          return value;
8478        case 3506294: // role
8479          this.role = TypeConvertor.castToString(value); // StringType
8480          return value;
8481        case -1618432855: // identifier
8482          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
8483          return value;
8484        default: return super.setProperty(hash, name, value);
8485        }
8486
8487      }
8488
8489      @Override
8490      public Base setProperty(String name, Base value) throws FHIRException {
8491        if (name.equals("affiliation")) {
8492          this.affiliation = TypeConvertor.castToString(value); // StringType
8493        } else if (name.equals("role")) {
8494          this.role = TypeConvertor.castToString(value); // StringType
8495        } else if (name.equals("identifier")) {
8496          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
8497        } else
8498          return super.setProperty(name, value);
8499        return value;
8500      }
8501
8502      @Override
8503      public Base makeProperty(int hash, String name) throws FHIRException {
8504        switch (hash) {
8505        case 2019918576:  return getAffiliationElement();
8506        case 3506294:  return getRoleElement();
8507        case -1618432855:  return addIdentifier(); 
8508        default: return super.makeProperty(hash, name);
8509        }
8510
8511      }
8512
8513      @Override
8514      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8515        switch (hash) {
8516        case 2019918576: /*affiliation*/ return new String[] {"string"};
8517        case 3506294: /*role*/ return new String[] {"string"};
8518        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
8519        default: return super.getTypesForProperty(hash, name);
8520        }
8521
8522      }
8523
8524      @Override
8525      public Base addChild(String name) throws FHIRException {
8526        if (name.equals("affiliation")) {
8527          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.affiliationInfo.affiliation");
8528        }
8529        else if (name.equals("role")) {
8530          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.affiliationInfo.role");
8531        }
8532        else if (name.equals("identifier")) {
8533          return addIdentifier();
8534        }
8535        else
8536          return super.addChild(name);
8537      }
8538
8539      public CitationCitedArtifactContributorshipEntryAffiliationInfoComponent copy() {
8540        CitationCitedArtifactContributorshipEntryAffiliationInfoComponent dst = new CitationCitedArtifactContributorshipEntryAffiliationInfoComponent();
8541        copyValues(dst);
8542        return dst;
8543      }
8544
8545      public void copyValues(CitationCitedArtifactContributorshipEntryAffiliationInfoComponent dst) {
8546        super.copyValues(dst);
8547        dst.affiliation = affiliation == null ? null : affiliation.copy();
8548        dst.role = role == null ? null : role.copy();
8549        if (identifier != null) {
8550          dst.identifier = new ArrayList<Identifier>();
8551          for (Identifier i : identifier)
8552            dst.identifier.add(i.copy());
8553        };
8554      }
8555
8556      @Override
8557      public boolean equalsDeep(Base other_) {
8558        if (!super.equalsDeep(other_))
8559          return false;
8560        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryAffiliationInfoComponent))
8561          return false;
8562        CitationCitedArtifactContributorshipEntryAffiliationInfoComponent o = (CitationCitedArtifactContributorshipEntryAffiliationInfoComponent) other_;
8563        return compareDeep(affiliation, o.affiliation, true) && compareDeep(role, o.role, true) && compareDeep(identifier, o.identifier, true)
8564          ;
8565      }
8566
8567      @Override
8568      public boolean equalsShallow(Base other_) {
8569        if (!super.equalsShallow(other_))
8570          return false;
8571        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryAffiliationInfoComponent))
8572          return false;
8573        CitationCitedArtifactContributorshipEntryAffiliationInfoComponent o = (CitationCitedArtifactContributorshipEntryAffiliationInfoComponent) other_;
8574        return compareValues(affiliation, o.affiliation, true) && compareValues(role, o.role, true);
8575      }
8576
8577      public boolean isEmpty() {
8578        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(affiliation, role, identifier
8579          );
8580      }
8581
8582  public String fhirType() {
8583    return "Citation.citedArtifact.contributorship.entry.affiliationInfo";
8584
8585  }
8586
8587  }
8588
8589    @Block()
8590    public static class CitationCitedArtifactContributorshipEntryContributionInstanceComponent extends BackboneElement implements IBaseBackboneElement {
8591        /**
8592         * The specific contribution.
8593         */
8594        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
8595        @Description(shortDefinition="The specific contribution", formalDefinition="The specific contribution." )
8596        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/artifact-contribution-instance-type")
8597        protected CodeableConcept type;
8598
8599        /**
8600         * The time that the contribution was made.
8601         */
8602        @Child(name = "time", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
8603        @Description(shortDefinition="The time that the contribution was made", formalDefinition="The time that the contribution was made." )
8604        protected DateTimeType time;
8605
8606        private static final long serialVersionUID = -196837729L;
8607
8608    /**
8609     * Constructor
8610     */
8611      public CitationCitedArtifactContributorshipEntryContributionInstanceComponent() {
8612        super();
8613      }
8614
8615    /**
8616     * Constructor
8617     */
8618      public CitationCitedArtifactContributorshipEntryContributionInstanceComponent(CodeableConcept type) {
8619        super();
8620        this.setType(type);
8621      }
8622
8623        /**
8624         * @return {@link #type} (The specific contribution.)
8625         */
8626        public CodeableConcept getType() { 
8627          if (this.type == null)
8628            if (Configuration.errorOnAutoCreate())
8629              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryContributionInstanceComponent.type");
8630            else if (Configuration.doAutoCreate())
8631              this.type = new CodeableConcept(); // cc
8632          return this.type;
8633        }
8634
8635        public boolean hasType() { 
8636          return this.type != null && !this.type.isEmpty();
8637        }
8638
8639        /**
8640         * @param value {@link #type} (The specific contribution.)
8641         */
8642        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent setType(CodeableConcept value) { 
8643          this.type = value;
8644          return this;
8645        }
8646
8647        /**
8648         * @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
8649         */
8650        public DateTimeType getTimeElement() { 
8651          if (this.time == null)
8652            if (Configuration.errorOnAutoCreate())
8653              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipEntryContributionInstanceComponent.time");
8654            else if (Configuration.doAutoCreate())
8655              this.time = new DateTimeType(); // bb
8656          return this.time;
8657        }
8658
8659        public boolean hasTimeElement() { 
8660          return this.time != null && !this.time.isEmpty();
8661        }
8662
8663        public boolean hasTime() { 
8664          return this.time != null && !this.time.isEmpty();
8665        }
8666
8667        /**
8668         * @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
8669         */
8670        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent setTimeElement(DateTimeType value) { 
8671          this.time = value;
8672          return this;
8673        }
8674
8675        /**
8676         * @return The time that the contribution was made.
8677         */
8678        public Date getTime() { 
8679          return this.time == null ? null : this.time.getValue();
8680        }
8681
8682        /**
8683         * @param value The time that the contribution was made.
8684         */
8685        public CitationCitedArtifactContributorshipEntryContributionInstanceComponent setTime(Date value) { 
8686          if (value == null)
8687            this.time = null;
8688          else {
8689            if (this.time == null)
8690              this.time = new DateTimeType();
8691            this.time.setValue(value);
8692          }
8693          return this;
8694        }
8695
8696        protected void listChildren(List<Property> children) {
8697          super.listChildren(children);
8698          children.add(new Property("type", "CodeableConcept", "The specific contribution.", 0, 1, type));
8699          children.add(new Property("time", "dateTime", "The time that the contribution was made.", 0, 1, time));
8700        }
8701
8702        @Override
8703        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8704          switch (_hash) {
8705          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The specific contribution.", 0, 1, type);
8706          case 3560141: /*time*/  return new Property("time", "dateTime", "The time that the contribution was made.", 0, 1, time);
8707          default: return super.getNamedProperty(_hash, _name, _checkValid);
8708          }
8709
8710        }
8711
8712      @Override
8713      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8714        switch (hash) {
8715        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
8716        case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // DateTimeType
8717        default: return super.getProperty(hash, name, checkValid);
8718        }
8719
8720      }
8721
8722      @Override
8723      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8724        switch (hash) {
8725        case 3575610: // type
8726          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8727          return value;
8728        case 3560141: // time
8729          this.time = TypeConvertor.castToDateTime(value); // DateTimeType
8730          return value;
8731        default: return super.setProperty(hash, name, value);
8732        }
8733
8734      }
8735
8736      @Override
8737      public Base setProperty(String name, Base value) throws FHIRException {
8738        if (name.equals("type")) {
8739          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8740        } else if (name.equals("time")) {
8741          this.time = TypeConvertor.castToDateTime(value); // DateTimeType
8742        } else
8743          return super.setProperty(name, value);
8744        return value;
8745      }
8746
8747      @Override
8748      public Base makeProperty(int hash, String name) throws FHIRException {
8749        switch (hash) {
8750        case 3575610:  return getType();
8751        case 3560141:  return getTimeElement();
8752        default: return super.makeProperty(hash, name);
8753        }
8754
8755      }
8756
8757      @Override
8758      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8759        switch (hash) {
8760        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
8761        case 3560141: /*time*/ return new String[] {"dateTime"};
8762        default: return super.getTypesForProperty(hash, name);
8763        }
8764
8765      }
8766
8767      @Override
8768      public Base addChild(String name) throws FHIRException {
8769        if (name.equals("type")) {
8770          this.type = new CodeableConcept();
8771          return this.type;
8772        }
8773        else if (name.equals("time")) {
8774          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.entry.contributionInstance.time");
8775        }
8776        else
8777          return super.addChild(name);
8778      }
8779
8780      public CitationCitedArtifactContributorshipEntryContributionInstanceComponent copy() {
8781        CitationCitedArtifactContributorshipEntryContributionInstanceComponent dst = new CitationCitedArtifactContributorshipEntryContributionInstanceComponent();
8782        copyValues(dst);
8783        return dst;
8784      }
8785
8786      public void copyValues(CitationCitedArtifactContributorshipEntryContributionInstanceComponent dst) {
8787        super.copyValues(dst);
8788        dst.type = type == null ? null : type.copy();
8789        dst.time = time == null ? null : time.copy();
8790      }
8791
8792      @Override
8793      public boolean equalsDeep(Base other_) {
8794        if (!super.equalsDeep(other_))
8795          return false;
8796        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryContributionInstanceComponent))
8797          return false;
8798        CitationCitedArtifactContributorshipEntryContributionInstanceComponent o = (CitationCitedArtifactContributorshipEntryContributionInstanceComponent) other_;
8799        return compareDeep(type, o.type, true) && compareDeep(time, o.time, true);
8800      }
8801
8802      @Override
8803      public boolean equalsShallow(Base other_) {
8804        if (!super.equalsShallow(other_))
8805          return false;
8806        if (!(other_ instanceof CitationCitedArtifactContributorshipEntryContributionInstanceComponent))
8807          return false;
8808        CitationCitedArtifactContributorshipEntryContributionInstanceComponent o = (CitationCitedArtifactContributorshipEntryContributionInstanceComponent) other_;
8809        return compareValues(time, o.time, true);
8810      }
8811
8812      public boolean isEmpty() {
8813        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, time);
8814      }
8815
8816  public String fhirType() {
8817    return "Citation.citedArtifact.contributorship.entry.contributionInstance";
8818
8819  }
8820
8821  }
8822
8823    @Block()
8824    public static class CitationCitedArtifactContributorshipSummaryComponent extends BackboneElement implements IBaseBackboneElement {
8825        /**
8826         * Used most commonly to express an author list or a contributorship statement.
8827         */
8828        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
8829        @Description(shortDefinition="Either authorList or contributorshipStatement", formalDefinition="Used most commonly to express an author list or a contributorship statement." )
8830        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contributor-summary-type")
8831        protected CodeableConcept type;
8832
8833        /**
8834         * The format for the display string.
8835         */
8836        @Child(name = "style", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
8837        @Description(shortDefinition="The format for the display string", formalDefinition="The format for the display string." )
8838        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contributor-summary-style")
8839        protected CodeableConcept style;
8840
8841        /**
8842         * Used to code the producer or rule for creating the display string.
8843         */
8844        @Child(name = "source", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
8845        @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." )
8846        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contributor-summary-source")
8847        protected CodeableConcept source;
8848
8849        /**
8850         * The display string for the author list, contributor list, or contributorship statement.
8851         */
8852        @Child(name = "value", type = {MarkdownType.class}, order=4, min=1, max=1, modifier=false, summary=false)
8853        @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." )
8854        protected MarkdownType value;
8855
8856        private static final long serialVersionUID = 1353383781L;
8857
8858    /**
8859     * Constructor
8860     */
8861      public CitationCitedArtifactContributorshipSummaryComponent() {
8862        super();
8863      }
8864
8865    /**
8866     * Constructor
8867     */
8868      public CitationCitedArtifactContributorshipSummaryComponent(String value) {
8869        super();
8870        this.setValue(value);
8871      }
8872
8873        /**
8874         * @return {@link #type} (Used most commonly to express an author list or a contributorship statement.)
8875         */
8876        public CodeableConcept getType() { 
8877          if (this.type == null)
8878            if (Configuration.errorOnAutoCreate())
8879              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipSummaryComponent.type");
8880            else if (Configuration.doAutoCreate())
8881              this.type = new CodeableConcept(); // cc
8882          return this.type;
8883        }
8884
8885        public boolean hasType() { 
8886          return this.type != null && !this.type.isEmpty();
8887        }
8888
8889        /**
8890         * @param value {@link #type} (Used most commonly to express an author list or a contributorship statement.)
8891         */
8892        public CitationCitedArtifactContributorshipSummaryComponent setType(CodeableConcept value) { 
8893          this.type = value;
8894          return this;
8895        }
8896
8897        /**
8898         * @return {@link #style} (The format for the display string.)
8899         */
8900        public CodeableConcept getStyle() { 
8901          if (this.style == null)
8902            if (Configuration.errorOnAutoCreate())
8903              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipSummaryComponent.style");
8904            else if (Configuration.doAutoCreate())
8905              this.style = new CodeableConcept(); // cc
8906          return this.style;
8907        }
8908
8909        public boolean hasStyle() { 
8910          return this.style != null && !this.style.isEmpty();
8911        }
8912
8913        /**
8914         * @param value {@link #style} (The format for the display string.)
8915         */
8916        public CitationCitedArtifactContributorshipSummaryComponent setStyle(CodeableConcept value) { 
8917          this.style = value;
8918          return this;
8919        }
8920
8921        /**
8922         * @return {@link #source} (Used to code the producer or rule for creating the display string.)
8923         */
8924        public CodeableConcept getSource() { 
8925          if (this.source == null)
8926            if (Configuration.errorOnAutoCreate())
8927              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipSummaryComponent.source");
8928            else if (Configuration.doAutoCreate())
8929              this.source = new CodeableConcept(); // cc
8930          return this.source;
8931        }
8932
8933        public boolean hasSource() { 
8934          return this.source != null && !this.source.isEmpty();
8935        }
8936
8937        /**
8938         * @param value {@link #source} (Used to code the producer or rule for creating the display string.)
8939         */
8940        public CitationCitedArtifactContributorshipSummaryComponent setSource(CodeableConcept value) { 
8941          this.source = value;
8942          return this;
8943        }
8944
8945        /**
8946         * @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
8947         */
8948        public MarkdownType getValueElement() { 
8949          if (this.value == null)
8950            if (Configuration.errorOnAutoCreate())
8951              throw new Error("Attempt to auto-create CitationCitedArtifactContributorshipSummaryComponent.value");
8952            else if (Configuration.doAutoCreate())
8953              this.value = new MarkdownType(); // bb
8954          return this.value;
8955        }
8956
8957        public boolean hasValueElement() { 
8958          return this.value != null && !this.value.isEmpty();
8959        }
8960
8961        public boolean hasValue() { 
8962          return this.value != null && !this.value.isEmpty();
8963        }
8964
8965        /**
8966         * @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
8967         */
8968        public CitationCitedArtifactContributorshipSummaryComponent setValueElement(MarkdownType value) { 
8969          this.value = value;
8970          return this;
8971        }
8972
8973        /**
8974         * @return The display string for the author list, contributor list, or contributorship statement.
8975         */
8976        public String getValue() { 
8977          return this.value == null ? null : this.value.getValue();
8978        }
8979
8980        /**
8981         * @param value The display string for the author list, contributor list, or contributorship statement.
8982         */
8983        public CitationCitedArtifactContributorshipSummaryComponent setValue(String value) { 
8984            if (this.value == null)
8985              this.value = new MarkdownType();
8986            this.value.setValue(value);
8987          return this;
8988        }
8989
8990        protected void listChildren(List<Property> children) {
8991          super.listChildren(children);
8992          children.add(new Property("type", "CodeableConcept", "Used most commonly to express an author list or a contributorship statement.", 0, 1, type));
8993          children.add(new Property("style", "CodeableConcept", "The format for the display string.", 0, 1, style));
8994          children.add(new Property("source", "CodeableConcept", "Used to code the producer or rule for creating the display string.", 0, 1, source));
8995          children.add(new Property("value", "markdown", "The display string for the author list, contributor list, or contributorship statement.", 0, 1, value));
8996        }
8997
8998        @Override
8999        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
9000          switch (_hash) {
9001          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Used most commonly to express an author list or a contributorship statement.", 0, 1, type);
9002          case 109780401: /*style*/  return new Property("style", "CodeableConcept", "The format for the display string.", 0, 1, style);
9003          case -896505829: /*source*/  return new Property("source", "CodeableConcept", "Used to code the producer or rule for creating the display string.", 0, 1, source);
9004          case 111972721: /*value*/  return new Property("value", "markdown", "The display string for the author list, contributor list, or contributorship statement.", 0, 1, value);
9005          default: return super.getNamedProperty(_hash, _name, _checkValid);
9006          }
9007
9008        }
9009
9010      @Override
9011      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
9012        switch (hash) {
9013        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
9014        case 109780401: /*style*/ return this.style == null ? new Base[0] : new Base[] {this.style}; // CodeableConcept
9015        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // CodeableConcept
9016        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // MarkdownType
9017        default: return super.getProperty(hash, name, checkValid);
9018        }
9019
9020      }
9021
9022      @Override
9023      public Base setProperty(int hash, String name, Base value) throws FHIRException {
9024        switch (hash) {
9025        case 3575610: // type
9026          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
9027          return value;
9028        case 109780401: // style
9029          this.style = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
9030          return value;
9031        case -896505829: // source
9032          this.source = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
9033          return value;
9034        case 111972721: // value
9035          this.value = TypeConvertor.castToMarkdown(value); // MarkdownType
9036          return value;
9037        default: return super.setProperty(hash, name, value);
9038        }
9039
9040      }
9041
9042      @Override
9043      public Base setProperty(String name, Base value) throws FHIRException {
9044        if (name.equals("type")) {
9045          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
9046        } else if (name.equals("style")) {
9047          this.style = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
9048        } else if (name.equals("source")) {
9049          this.source = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
9050        } else if (name.equals("value")) {
9051          this.value = TypeConvertor.castToMarkdown(value); // MarkdownType
9052        } else
9053          return super.setProperty(name, value);
9054        return value;
9055      }
9056
9057      @Override
9058      public Base makeProperty(int hash, String name) throws FHIRException {
9059        switch (hash) {
9060        case 3575610:  return getType();
9061        case 109780401:  return getStyle();
9062        case -896505829:  return getSource();
9063        case 111972721:  return getValueElement();
9064        default: return super.makeProperty(hash, name);
9065        }
9066
9067      }
9068
9069      @Override
9070      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
9071        switch (hash) {
9072        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
9073        case 109780401: /*style*/ return new String[] {"CodeableConcept"};
9074        case -896505829: /*source*/ return new String[] {"CodeableConcept"};
9075        case 111972721: /*value*/ return new String[] {"markdown"};
9076        default: return super.getTypesForProperty(hash, name);
9077        }
9078
9079      }
9080
9081      @Override
9082      public Base addChild(String name) throws FHIRException {
9083        if (name.equals("type")) {
9084          this.type = new CodeableConcept();
9085          return this.type;
9086        }
9087        else if (name.equals("style")) {
9088          this.style = new CodeableConcept();
9089          return this.style;
9090        }
9091        else if (name.equals("source")) {
9092          this.source = new CodeableConcept();
9093          return this.source;
9094        }
9095        else if (name.equals("value")) {
9096          throw new FHIRException("Cannot call addChild on a primitive type Citation.citedArtifact.contributorship.summary.value");
9097        }
9098        else
9099          return super.addChild(name);
9100      }
9101
9102      public CitationCitedArtifactContributorshipSummaryComponent copy() {
9103        CitationCitedArtifactContributorshipSummaryComponent dst = new CitationCitedArtifactContributorshipSummaryComponent();
9104        copyValues(dst);
9105        return dst;
9106      }
9107
9108      public void copyValues(CitationCitedArtifactContributorshipSummaryComponent dst) {
9109        super.copyValues(dst);
9110        dst.type = type == null ? null : type.copy();
9111        dst.style = style == null ? null : style.copy();
9112        dst.source = source == null ? null : source.copy();
9113        dst.value = value == null ? null : value.copy();
9114      }
9115
9116      @Override
9117      public boolean equalsDeep(Base other_) {
9118        if (!super.equalsDeep(other_))
9119          return false;
9120        if (!(other_ instanceof CitationCitedArtifactContributorshipSummaryComponent))
9121          return false;
9122        CitationCitedArtifactContributorshipSummaryComponent o = (CitationCitedArtifactContributorshipSummaryComponent) other_;
9123        return compareDeep(type, o.type, true) && compareDeep(style, o.style, true) && compareDeep(source, o.source, true)
9124           && compareDeep(value, o.value, true);
9125      }
9126
9127      @Override
9128      public boolean equalsShallow(Base other_) {
9129        if (!super.equalsShallow(other_))
9130          return false;
9131        if (!(other_ instanceof CitationCitedArtifactContributorshipSummaryComponent))
9132          return false;
9133        CitationCitedArtifactContributorshipSummaryComponent o = (CitationCitedArtifactContributorshipSummaryComponent) other_;
9134        return compareValues(value, o.value, true);
9135      }
9136
9137      public boolean isEmpty() {
9138        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, style, source, value
9139          );
9140      }
9141
9142  public String fhirType() {
9143    return "Citation.citedArtifact.contributorship.summary";
9144
9145  }
9146
9147  }
9148
9149    /**
9150     * 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.
9151     */
9152    @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true)
9153    @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." )
9154    protected UriType url;
9155
9156    /**
9157     * 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.
9158     */
9159    @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9160    @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." )
9161    protected List<Identifier> identifier;
9162
9163    /**
9164     * 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.
9165     */
9166    @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
9167    @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." )
9168    protected StringType version;
9169
9170    /**
9171     * 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.
9172     */
9173    @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
9174    @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." )
9175    protected StringType name;
9176
9177    /**
9178     * A short, descriptive, user-friendly title for the citation.
9179     */
9180    @Child(name = "title", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
9181    @Description(shortDefinition="Name for this citation (human friendly)", formalDefinition="A short, descriptive, user-friendly title for the citation." )
9182    protected StringType title;
9183
9184    /**
9185     * The status of this summary. Enables tracking the life-cycle of the content.
9186     */
9187    @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true)
9188    @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The status of this summary. Enables tracking the life-cycle of the content." )
9189    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
9190    protected Enumeration<PublicationStatus> status;
9191
9192    /**
9193     * 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.
9194     */
9195    @Child(name = "experimental", type = {BooleanType.class}, order=6, min=0, max=1, modifier=false, summary=true)
9196    @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." )
9197    protected BooleanType experimental;
9198
9199    /**
9200     * 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.
9201     */
9202    @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
9203    @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." )
9204    protected DateTimeType date;
9205
9206    /**
9207     * The name of the organization or individual that published the citation.
9208     */
9209    @Child(name = "publisher", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true)
9210    @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." )
9211    protected StringType publisher;
9212
9213    /**
9214     * Contact details to assist a user in finding and communicating with the publisher.
9215     */
9216    @Child(name = "contact", type = {ContactDetail.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9217    @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." )
9218    protected List<ContactDetail> contact;
9219
9220    /**
9221     * A free text natural language description of the citation from a consumer's perspective.
9222     */
9223    @Child(name = "description", type = {MarkdownType.class}, order=10, min=0, max=1, modifier=false, summary=false)
9224    @Description(shortDefinition="Natural language description of the citation", formalDefinition="A free text natural language description of the citation from a consumer's perspective." )
9225    protected MarkdownType description;
9226
9227    /**
9228     * 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.
9229     */
9230    @Child(name = "useContext", type = {UsageContext.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9231    @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." )
9232    protected List<UsageContext> useContext;
9233
9234    /**
9235     * A legal or geographic region in which the citation is intended to be used.
9236     */
9237    @Child(name = "jurisdiction", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
9238    @Description(shortDefinition="Intended jurisdiction for citation (if applicable)", formalDefinition="A legal or geographic region in which the citation is intended to be used." )
9239    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/jurisdiction")
9240    protected List<CodeableConcept> jurisdiction;
9241
9242    /**
9243     * Explanation of why this citation is needed and why it has been designed as it has.
9244     */
9245    @Child(name = "purpose", type = {MarkdownType.class}, order=13, min=0, max=1, modifier=false, summary=false)
9246    @Description(shortDefinition="Why this citation is defined", formalDefinition="Explanation of why this citation is needed and why it has been designed as it has." )
9247    protected MarkdownType purpose;
9248
9249    /**
9250     * Use and/or publishing restrictions for the Citation, not for the cited artifact.
9251     */
9252    @Child(name = "copyright", type = {MarkdownType.class}, order=14, min=0, max=1, modifier=false, summary=false)
9253    @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." )
9254    protected MarkdownType copyright;
9255
9256    /**
9257     * The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
9258     */
9259    @Child(name = "approvalDate", type = {DateType.class}, order=15, min=0, max=1, modifier=false, summary=false)
9260    @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." )
9261    protected DateType approvalDate;
9262
9263    /**
9264     * The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
9265     */
9266    @Child(name = "lastReviewDate", type = {DateType.class}, order=16, min=0, max=1, modifier=false, summary=false)
9267    @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." )
9268    protected DateType lastReviewDate;
9269
9270    /**
9271     * The period during which the citation content was or is planned to be in active use.
9272     */
9273    @Child(name = "effectivePeriod", type = {Period.class}, order=17, min=0, max=1, modifier=false, summary=true)
9274    @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." )
9275    protected Period effectivePeriod;
9276
9277    /**
9278     * Who authored the Citation.
9279     */
9280    @Child(name = "author", type = {ContactDetail.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9281    @Description(shortDefinition="Who authored the Citation", formalDefinition="Who authored the Citation." )
9282    protected List<ContactDetail> author;
9283
9284    /**
9285     * Who edited the Citation.
9286     */
9287    @Child(name = "editor", type = {ContactDetail.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9288    @Description(shortDefinition="Who edited the Citation", formalDefinition="Who edited the Citation." )
9289    protected List<ContactDetail> editor;
9290
9291    /**
9292     * Who reviewed the Citation.
9293     */
9294    @Child(name = "reviewer", type = {ContactDetail.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9295    @Description(shortDefinition="Who reviewed the Citation", formalDefinition="Who reviewed the Citation." )
9296    protected List<ContactDetail> reviewer;
9297
9298    /**
9299     * Who endorsed the Citation.
9300     */
9301    @Child(name = "endorser", type = {ContactDetail.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9302    @Description(shortDefinition="Who endorsed the Citation", formalDefinition="Who endorsed the Citation." )
9303    protected List<ContactDetail> endorser;
9304
9305    /**
9306     * A human-readable display of the citation.
9307     */
9308    @Child(name = "summary", type = {ContactDetail.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9309    @Description(shortDefinition="A human-readable display of the citation", formalDefinition="A human-readable display of the citation." )
9310    protected List<ContactDetail> summary;
9311
9312    /**
9313     * The assignment to an organizing scheme.
9314     */
9315    @Child(name = "classification", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9316    @Description(shortDefinition="The assignment to an organizing scheme", formalDefinition="The assignment to an organizing scheme." )
9317    protected List<CitationClassificationComponent> classification;
9318
9319    /**
9320     * Used for general notes and annotations not coded elsewhere.
9321     */
9322    @Child(name = "note", type = {Annotation.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9323    @Description(shortDefinition="Used for general notes and annotations not coded elsewhere", formalDefinition="Used for general notes and annotations not coded elsewhere." )
9324    protected List<Annotation> note;
9325
9326    /**
9327     * The status of the citation.
9328     */
9329    @Child(name = "currentState", type = {CodeableConcept.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9330    @Description(shortDefinition="The status of the citation", formalDefinition="The status of the citation." )
9331    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/citation-status-type")
9332    protected List<CodeableConcept> currentState;
9333
9334    /**
9335     * An effective date or period for a status of the citation.
9336     */
9337    @Child(name = "statusDate", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9338    @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." )
9339    protected List<CitationStatusDateComponent> statusDate;
9340
9341    /**
9342     * Artifact related to the Citation Resource.
9343     */
9344    @Child(name = "relatesTo", type = {}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9345    @Description(shortDefinition="Artifact related to the Citation Resource", formalDefinition="Artifact related to the Citation Resource." )
9346    protected List<CitationRelatesToComponent> relatesTo;
9347
9348    /**
9349     * The article or artifact being described.
9350     */
9351    @Child(name = "citedArtifact", type = {}, order=28, min=0, max=1, modifier=false, summary=false)
9352    @Description(shortDefinition="The article or artifact being described", formalDefinition="The article or artifact being described." )
9353    protected CitationCitedArtifactComponent citedArtifact;
9354
9355    private static final long serialVersionUID = 2083863417L;
9356
9357  /**
9358   * Constructor
9359   */
9360    public Citation() {
9361      super();
9362    }
9363
9364  /**
9365   * Constructor
9366   */
9367    public Citation(PublicationStatus status) {
9368      super();
9369      this.setStatus(status);
9370    }
9371
9372    /**
9373     * @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
9374     */
9375    public UriType getUrlElement() { 
9376      if (this.url == null)
9377        if (Configuration.errorOnAutoCreate())
9378          throw new Error("Attempt to auto-create Citation.url");
9379        else if (Configuration.doAutoCreate())
9380          this.url = new UriType(); // bb
9381      return this.url;
9382    }
9383
9384    public boolean hasUrlElement() { 
9385      return this.url != null && !this.url.isEmpty();
9386    }
9387
9388    public boolean hasUrl() { 
9389      return this.url != null && !this.url.isEmpty();
9390    }
9391
9392    /**
9393     * @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
9394     */
9395    public Citation setUrlElement(UriType value) { 
9396      this.url = value;
9397      return this;
9398    }
9399
9400    /**
9401     * @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.
9402     */
9403    public String getUrl() { 
9404      return this.url == null ? null : this.url.getValue();
9405    }
9406
9407    /**
9408     * @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.
9409     */
9410    public Citation setUrl(String value) { 
9411      if (Utilities.noString(value))
9412        this.url = null;
9413      else {
9414        if (this.url == null)
9415          this.url = new UriType();
9416        this.url.setValue(value);
9417      }
9418      return this;
9419    }
9420
9421    /**
9422     * @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.)
9423     */
9424    public List<Identifier> getIdentifier() { 
9425      if (this.identifier == null)
9426        this.identifier = new ArrayList<Identifier>();
9427      return this.identifier;
9428    }
9429
9430    /**
9431     * @return Returns a reference to <code>this</code> for easy method chaining
9432     */
9433    public Citation setIdentifier(List<Identifier> theIdentifier) { 
9434      this.identifier = theIdentifier;
9435      return this;
9436    }
9437
9438    public boolean hasIdentifier() { 
9439      if (this.identifier == null)
9440        return false;
9441      for (Identifier item : this.identifier)
9442        if (!item.isEmpty())
9443          return true;
9444      return false;
9445    }
9446
9447    public Identifier addIdentifier() { //3
9448      Identifier t = new Identifier();
9449      if (this.identifier == null)
9450        this.identifier = new ArrayList<Identifier>();
9451      this.identifier.add(t);
9452      return t;
9453    }
9454
9455    public Citation addIdentifier(Identifier t) { //3
9456      if (t == null)
9457        return this;
9458      if (this.identifier == null)
9459        this.identifier = new ArrayList<Identifier>();
9460      this.identifier.add(t);
9461      return this;
9462    }
9463
9464    /**
9465     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
9466     */
9467    public Identifier getIdentifierFirstRep() { 
9468      if (getIdentifier().isEmpty()) {
9469        addIdentifier();
9470      }
9471      return getIdentifier().get(0);
9472    }
9473
9474    /**
9475     * @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
9476     */
9477    public StringType getVersionElement() { 
9478      if (this.version == null)
9479        if (Configuration.errorOnAutoCreate())
9480          throw new Error("Attempt to auto-create Citation.version");
9481        else if (Configuration.doAutoCreate())
9482          this.version = new StringType(); // bb
9483      return this.version;
9484    }
9485
9486    public boolean hasVersionElement() { 
9487      return this.version != null && !this.version.isEmpty();
9488    }
9489
9490    public boolean hasVersion() { 
9491      return this.version != null && !this.version.isEmpty();
9492    }
9493
9494    /**
9495     * @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
9496     */
9497    public Citation setVersionElement(StringType value) { 
9498      this.version = value;
9499      return this;
9500    }
9501
9502    /**
9503     * @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.
9504     */
9505    public String getVersion() { 
9506      return this.version == null ? null : this.version.getValue();
9507    }
9508
9509    /**
9510     * @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.
9511     */
9512    public Citation setVersion(String value) { 
9513      if (Utilities.noString(value))
9514        this.version = null;
9515      else {
9516        if (this.version == null)
9517          this.version = new StringType();
9518        this.version.setValue(value);
9519      }
9520      return this;
9521    }
9522
9523    /**
9524     * @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
9525     */
9526    public StringType getNameElement() { 
9527      if (this.name == null)
9528        if (Configuration.errorOnAutoCreate())
9529          throw new Error("Attempt to auto-create Citation.name");
9530        else if (Configuration.doAutoCreate())
9531          this.name = new StringType(); // bb
9532      return this.name;
9533    }
9534
9535    public boolean hasNameElement() { 
9536      return this.name != null && !this.name.isEmpty();
9537    }
9538
9539    public boolean hasName() { 
9540      return this.name != null && !this.name.isEmpty();
9541    }
9542
9543    /**
9544     * @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
9545     */
9546    public Citation setNameElement(StringType value) { 
9547      this.name = value;
9548      return this;
9549    }
9550
9551    /**
9552     * @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.
9553     */
9554    public String getName() { 
9555      return this.name == null ? null : this.name.getValue();
9556    }
9557
9558    /**
9559     * @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.
9560     */
9561    public Citation setName(String value) { 
9562      if (Utilities.noString(value))
9563        this.name = null;
9564      else {
9565        if (this.name == null)
9566          this.name = new StringType();
9567        this.name.setValue(value);
9568      }
9569      return this;
9570    }
9571
9572    /**
9573     * @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
9574     */
9575    public StringType getTitleElement() { 
9576      if (this.title == null)
9577        if (Configuration.errorOnAutoCreate())
9578          throw new Error("Attempt to auto-create Citation.title");
9579        else if (Configuration.doAutoCreate())
9580          this.title = new StringType(); // bb
9581      return this.title;
9582    }
9583
9584    public boolean hasTitleElement() { 
9585      return this.title != null && !this.title.isEmpty();
9586    }
9587
9588    public boolean hasTitle() { 
9589      return this.title != null && !this.title.isEmpty();
9590    }
9591
9592    /**
9593     * @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
9594     */
9595    public Citation setTitleElement(StringType value) { 
9596      this.title = value;
9597      return this;
9598    }
9599
9600    /**
9601     * @return A short, descriptive, user-friendly title for the citation.
9602     */
9603    public String getTitle() { 
9604      return this.title == null ? null : this.title.getValue();
9605    }
9606
9607    /**
9608     * @param value A short, descriptive, user-friendly title for the citation.
9609     */
9610    public Citation setTitle(String value) { 
9611      if (Utilities.noString(value))
9612        this.title = null;
9613      else {
9614        if (this.title == null)
9615          this.title = new StringType();
9616        this.title.setValue(value);
9617      }
9618      return this;
9619    }
9620
9621    /**
9622     * @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
9623     */
9624    public Enumeration<PublicationStatus> getStatusElement() { 
9625      if (this.status == null)
9626        if (Configuration.errorOnAutoCreate())
9627          throw new Error("Attempt to auto-create Citation.status");
9628        else if (Configuration.doAutoCreate())
9629          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
9630      return this.status;
9631    }
9632
9633    public boolean hasStatusElement() { 
9634      return this.status != null && !this.status.isEmpty();
9635    }
9636
9637    public boolean hasStatus() { 
9638      return this.status != null && !this.status.isEmpty();
9639    }
9640
9641    /**
9642     * @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
9643     */
9644    public Citation setStatusElement(Enumeration<PublicationStatus> value) { 
9645      this.status = value;
9646      return this;
9647    }
9648
9649    /**
9650     * @return The status of this summary. Enables tracking the life-cycle of the content.
9651     */
9652    public PublicationStatus getStatus() { 
9653      return this.status == null ? null : this.status.getValue();
9654    }
9655
9656    /**
9657     * @param value The status of this summary. Enables tracking the life-cycle of the content.
9658     */
9659    public Citation setStatus(PublicationStatus value) { 
9660        if (this.status == null)
9661          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
9662        this.status.setValue(value);
9663      return this;
9664    }
9665
9666    /**
9667     * @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
9668     */
9669    public BooleanType getExperimentalElement() { 
9670      if (this.experimental == null)
9671        if (Configuration.errorOnAutoCreate())
9672          throw new Error("Attempt to auto-create Citation.experimental");
9673        else if (Configuration.doAutoCreate())
9674          this.experimental = new BooleanType(); // bb
9675      return this.experimental;
9676    }
9677
9678    public boolean hasExperimentalElement() { 
9679      return this.experimental != null && !this.experimental.isEmpty();
9680    }
9681
9682    public boolean hasExperimental() { 
9683      return this.experimental != null && !this.experimental.isEmpty();
9684    }
9685
9686    /**
9687     * @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
9688     */
9689    public Citation setExperimentalElement(BooleanType value) { 
9690      this.experimental = value;
9691      return this;
9692    }
9693
9694    /**
9695     * @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.
9696     */
9697    public boolean getExperimental() { 
9698      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
9699    }
9700
9701    /**
9702     * @param value 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.
9703     */
9704    public Citation setExperimental(boolean value) { 
9705        if (this.experimental == null)
9706          this.experimental = new BooleanType();
9707        this.experimental.setValue(value);
9708      return this;
9709    }
9710
9711    /**
9712     * @return {@link #date} (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.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
9713     */
9714    public DateTimeType getDateElement() { 
9715      if (this.date == null)
9716        if (Configuration.errorOnAutoCreate())
9717          throw new Error("Attempt to auto-create Citation.date");
9718        else if (Configuration.doAutoCreate())
9719          this.date = new DateTimeType(); // bb
9720      return this.date;
9721    }
9722
9723    public boolean hasDateElement() { 
9724      return this.date != null && !this.date.isEmpty();
9725    }
9726
9727    public boolean hasDate() { 
9728      return this.date != null && !this.date.isEmpty();
9729    }
9730
9731    /**
9732     * @param value {@link #date} (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.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
9733     */
9734    public Citation setDateElement(DateTimeType value) { 
9735      this.date = value;
9736      return this;
9737    }
9738
9739    /**
9740     * @return 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.
9741     */
9742    public Date getDate() { 
9743      return this.date == null ? null : this.date.getValue();
9744    }
9745
9746    /**
9747     * @param value 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.
9748     */
9749    public Citation setDate(Date value) { 
9750      if (value == null)
9751        this.date = null;
9752      else {
9753        if (this.date == null)
9754          this.date = new DateTimeType();
9755        this.date.setValue(value);
9756      }
9757      return this;
9758    }
9759
9760    /**
9761     * @return {@link #publisher} (The name of the organization or individual that published the citation.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
9762     */
9763    public StringType getPublisherElement() { 
9764      if (this.publisher == null)
9765        if (Configuration.errorOnAutoCreate())
9766          throw new Error("Attempt to auto-create Citation.publisher");
9767        else if (Configuration.doAutoCreate())
9768          this.publisher = new StringType(); // bb
9769      return this.publisher;
9770    }
9771
9772    public boolean hasPublisherElement() { 
9773      return this.publisher != null && !this.publisher.isEmpty();
9774    }
9775
9776    public boolean hasPublisher() { 
9777      return this.publisher != null && !this.publisher.isEmpty();
9778    }
9779
9780    /**
9781     * @param value {@link #publisher} (The name of the organization or individual that published the citation.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
9782     */
9783    public Citation setPublisherElement(StringType value) { 
9784      this.publisher = value;
9785      return this;
9786    }
9787
9788    /**
9789     * @return The name of the organization or individual that published the citation.
9790     */
9791    public String getPublisher() { 
9792      return this.publisher == null ? null : this.publisher.getValue();
9793    }
9794
9795    /**
9796     * @param value The name of the organization or individual that published the citation.
9797     */
9798    public Citation setPublisher(String value) { 
9799      if (Utilities.noString(value))
9800        this.publisher = null;
9801      else {
9802        if (this.publisher == null)
9803          this.publisher = new StringType();
9804        this.publisher.setValue(value);
9805      }
9806      return this;
9807    }
9808
9809    /**
9810     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
9811     */
9812    public List<ContactDetail> getContact() { 
9813      if (this.contact == null)
9814        this.contact = new ArrayList<ContactDetail>();
9815      return this.contact;
9816    }
9817
9818    /**
9819     * @return Returns a reference to <code>this</code> for easy method chaining
9820     */
9821    public Citation setContact(List<ContactDetail> theContact) { 
9822      this.contact = theContact;
9823      return this;
9824    }
9825
9826    public boolean hasContact() { 
9827      if (this.contact == null)
9828        return false;
9829      for (ContactDetail item : this.contact)
9830        if (!item.isEmpty())
9831          return true;
9832      return false;
9833    }
9834
9835    public ContactDetail addContact() { //3
9836      ContactDetail t = new ContactDetail();
9837      if (this.contact == null)
9838        this.contact = new ArrayList<ContactDetail>();
9839      this.contact.add(t);
9840      return t;
9841    }
9842
9843    public Citation addContact(ContactDetail t) { //3
9844      if (t == null)
9845        return this;
9846      if (this.contact == null)
9847        this.contact = new ArrayList<ContactDetail>();
9848      this.contact.add(t);
9849      return this;
9850    }
9851
9852    /**
9853     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist {3}
9854     */
9855    public ContactDetail getContactFirstRep() { 
9856      if (getContact().isEmpty()) {
9857        addContact();
9858      }
9859      return getContact().get(0);
9860    }
9861
9862    /**
9863     * @return {@link #description} (A free text natural language description of the citation from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
9864     */
9865    public MarkdownType getDescriptionElement() { 
9866      if (this.description == null)
9867        if (Configuration.errorOnAutoCreate())
9868          throw new Error("Attempt to auto-create Citation.description");
9869        else if (Configuration.doAutoCreate())
9870          this.description = new MarkdownType(); // bb
9871      return this.description;
9872    }
9873
9874    public boolean hasDescriptionElement() { 
9875      return this.description != null && !this.description.isEmpty();
9876    }
9877
9878    public boolean hasDescription() { 
9879      return this.description != null && !this.description.isEmpty();
9880    }
9881
9882    /**
9883     * @param value {@link #description} (A free text natural language description of the citation from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
9884     */
9885    public Citation setDescriptionElement(MarkdownType value) { 
9886      this.description = value;
9887      return this;
9888    }
9889
9890    /**
9891     * @return A free text natural language description of the citation from a consumer's perspective.
9892     */
9893    public String getDescription() { 
9894      return this.description == null ? null : this.description.getValue();
9895    }
9896
9897    /**
9898     * @param value A free text natural language description of the citation from a consumer's perspective.
9899     */
9900    public Citation setDescription(String value) { 
9901      if (value == null)
9902        this.description = null;
9903      else {
9904        if (this.description == null)
9905          this.description = new MarkdownType();
9906        this.description.setValue(value);
9907      }
9908      return this;
9909    }
9910
9911    /**
9912     * @return {@link #useContext} (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.)
9913     */
9914    public List<UsageContext> getUseContext() { 
9915      if (this.useContext == null)
9916        this.useContext = new ArrayList<UsageContext>();
9917      return this.useContext;
9918    }
9919
9920    /**
9921     * @return Returns a reference to <code>this</code> for easy method chaining
9922     */
9923    public Citation setUseContext(List<UsageContext> theUseContext) { 
9924      this.useContext = theUseContext;
9925      return this;
9926    }
9927
9928    public boolean hasUseContext() { 
9929      if (this.useContext == null)
9930        return false;
9931      for (UsageContext item : this.useContext)
9932        if (!item.isEmpty())
9933          return true;
9934      return false;
9935    }
9936
9937    public UsageContext addUseContext() { //3
9938      UsageContext t = new UsageContext();
9939      if (this.useContext == null)
9940        this.useContext = new ArrayList<UsageContext>();
9941      this.useContext.add(t);
9942      return t;
9943    }
9944
9945    public Citation addUseContext(UsageContext t) { //3
9946      if (t == null)
9947        return this;
9948      if (this.useContext == null)
9949        this.useContext = new ArrayList<UsageContext>();
9950      this.useContext.add(t);
9951      return this;
9952    }
9953
9954    /**
9955     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist {3}
9956     */
9957    public UsageContext getUseContextFirstRep() { 
9958      if (getUseContext().isEmpty()) {
9959        addUseContext();
9960      }
9961      return getUseContext().get(0);
9962    }
9963
9964    /**
9965     * @return {@link #jurisdiction} (A legal or geographic region in which the citation is intended to be used.)
9966     */
9967    public List<CodeableConcept> getJurisdiction() { 
9968      if (this.jurisdiction == null)
9969        this.jurisdiction = new ArrayList<CodeableConcept>();
9970      return this.jurisdiction;
9971    }
9972
9973    /**
9974     * @return Returns a reference to <code>this</code> for easy method chaining
9975     */
9976    public Citation setJurisdiction(List<CodeableConcept> theJurisdiction) { 
9977      this.jurisdiction = theJurisdiction;
9978      return this;
9979    }
9980
9981    public boolean hasJurisdiction() { 
9982      if (this.jurisdiction == null)
9983        return false;
9984      for (CodeableConcept item : this.jurisdiction)
9985        if (!item.isEmpty())
9986          return true;
9987      return false;
9988    }
9989
9990    public CodeableConcept addJurisdiction() { //3
9991      CodeableConcept t = new CodeableConcept();
9992      if (this.jurisdiction == null)
9993        this.jurisdiction = new ArrayList<CodeableConcept>();
9994      this.jurisdiction.add(t);
9995      return t;
9996    }
9997
9998    public Citation addJurisdiction(CodeableConcept t) { //3
9999      if (t == null)
10000        return this;
10001      if (this.jurisdiction == null)
10002        this.jurisdiction = new ArrayList<CodeableConcept>();
10003      this.jurisdiction.add(t);
10004      return this;
10005    }
10006
10007    /**
10008     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist {3}
10009     */
10010    public CodeableConcept getJurisdictionFirstRep() { 
10011      if (getJurisdiction().isEmpty()) {
10012        addJurisdiction();
10013      }
10014      return getJurisdiction().get(0);
10015    }
10016
10017    /**
10018     * @return {@link #purpose} (Explanation of why this citation is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
10019     */
10020    public MarkdownType getPurposeElement() { 
10021      if (this.purpose == null)
10022        if (Configuration.errorOnAutoCreate())
10023          throw new Error("Attempt to auto-create Citation.purpose");
10024        else if (Configuration.doAutoCreate())
10025          this.purpose = new MarkdownType(); // bb
10026      return this.purpose;
10027    }
10028
10029    public boolean hasPurposeElement() { 
10030      return this.purpose != null && !this.purpose.isEmpty();
10031    }
10032
10033    public boolean hasPurpose() { 
10034      return this.purpose != null && !this.purpose.isEmpty();
10035    }
10036
10037    /**
10038     * @param value {@link #purpose} (Explanation of why this citation is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
10039     */
10040    public Citation setPurposeElement(MarkdownType value) { 
10041      this.purpose = value;
10042      return this;
10043    }
10044
10045    /**
10046     * @return Explanation of why this citation is needed and why it has been designed as it has.
10047     */
10048    public String getPurpose() { 
10049      return this.purpose == null ? null : this.purpose.getValue();
10050    }
10051
10052    /**
10053     * @param value Explanation of why this citation is needed and why it has been designed as it has.
10054     */
10055    public Citation setPurpose(String value) { 
10056      if (value == null)
10057        this.purpose = null;
10058      else {
10059        if (this.purpose == null)
10060          this.purpose = new MarkdownType();
10061        this.purpose.setValue(value);
10062      }
10063      return this;
10064    }
10065
10066    /**
10067     * @return {@link #copyright} (Use and/or publishing restrictions for the Citation, not for the cited artifact.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
10068     */
10069    public MarkdownType getCopyrightElement() { 
10070      if (this.copyright == null)
10071        if (Configuration.errorOnAutoCreate())
10072          throw new Error("Attempt to auto-create Citation.copyright");
10073        else if (Configuration.doAutoCreate())
10074          this.copyright = new MarkdownType(); // bb
10075      return this.copyright;
10076    }
10077
10078    public boolean hasCopyrightElement() { 
10079      return this.copyright != null && !this.copyright.isEmpty();
10080    }
10081
10082    public boolean hasCopyright() { 
10083      return this.copyright != null && !this.copyright.isEmpty();
10084    }
10085
10086    /**
10087     * @param value {@link #copyright} (Use and/or publishing restrictions for the Citation, not for the cited artifact.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
10088     */
10089    public Citation setCopyrightElement(MarkdownType value) { 
10090      this.copyright = value;
10091      return this;
10092    }
10093
10094    /**
10095     * @return Use and/or publishing restrictions for the Citation, not for the cited artifact.
10096     */
10097    public String getCopyright() { 
10098      return this.copyright == null ? null : this.copyright.getValue();
10099    }
10100
10101    /**
10102     * @param value Use and/or publishing restrictions for the Citation, not for the cited artifact.
10103     */
10104    public Citation setCopyright(String value) { 
10105      if (value == null)
10106        this.copyright = null;
10107      else {
10108        if (this.copyright == null)
10109          this.copyright = new MarkdownType();
10110        this.copyright.setValue(value);
10111      }
10112      return this;
10113    }
10114
10115    /**
10116     * @return {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
10117     */
10118    public DateType getApprovalDateElement() { 
10119      if (this.approvalDate == null)
10120        if (Configuration.errorOnAutoCreate())
10121          throw new Error("Attempt to auto-create Citation.approvalDate");
10122        else if (Configuration.doAutoCreate())
10123          this.approvalDate = new DateType(); // bb
10124      return this.approvalDate;
10125    }
10126
10127    public boolean hasApprovalDateElement() { 
10128      return this.approvalDate != null && !this.approvalDate.isEmpty();
10129    }
10130
10131    public boolean hasApprovalDate() { 
10132      return this.approvalDate != null && !this.approvalDate.isEmpty();
10133    }
10134
10135    /**
10136     * @param value {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
10137     */
10138    public Citation setApprovalDateElement(DateType value) { 
10139      this.approvalDate = value;
10140      return this;
10141    }
10142
10143    /**
10144     * @return The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
10145     */
10146    public Date getApprovalDate() { 
10147      return this.approvalDate == null ? null : this.approvalDate.getValue();
10148    }
10149
10150    /**
10151     * @param value The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
10152     */
10153    public Citation setApprovalDate(Date value) { 
10154      if (value == null)
10155        this.approvalDate = null;
10156      else {
10157        if (this.approvalDate == null)
10158          this.approvalDate = new DateType();
10159        this.approvalDate.setValue(value);
10160      }
10161      return this;
10162    }
10163
10164    /**
10165     * @return {@link #lastReviewDate} (The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
10166     */
10167    public DateType getLastReviewDateElement() { 
10168      if (this.lastReviewDate == null)
10169        if (Configuration.errorOnAutoCreate())
10170          throw new Error("Attempt to auto-create Citation.lastReviewDate");
10171        else if (Configuration.doAutoCreate())
10172          this.lastReviewDate = new DateType(); // bb
10173      return this.lastReviewDate;
10174    }
10175
10176    public boolean hasLastReviewDateElement() { 
10177      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
10178    }
10179
10180    public boolean hasLastReviewDate() { 
10181      return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
10182    }
10183
10184    /**
10185     * @param value {@link #lastReviewDate} (The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
10186     */
10187    public Citation setLastReviewDateElement(DateType value) { 
10188      this.lastReviewDate = value;
10189      return this;
10190    }
10191
10192    /**
10193     * @return The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
10194     */
10195    public Date getLastReviewDate() { 
10196      return this.lastReviewDate == null ? null : this.lastReviewDate.getValue();
10197    }
10198
10199    /**
10200     * @param value The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
10201     */
10202    public Citation setLastReviewDate(Date value) { 
10203      if (value == null)
10204        this.lastReviewDate = null;
10205      else {
10206        if (this.lastReviewDate == null)
10207          this.lastReviewDate = new DateType();
10208        this.lastReviewDate.setValue(value);
10209      }
10210      return this;
10211    }
10212
10213    /**
10214     * @return {@link #effectivePeriod} (The period during which the citation content was or is planned to be in active use.)
10215     */
10216    public Period getEffectivePeriod() { 
10217      if (this.effectivePeriod == null)
10218        if (Configuration.errorOnAutoCreate())
10219          throw new Error("Attempt to auto-create Citation.effectivePeriod");
10220        else if (Configuration.doAutoCreate())
10221          this.effectivePeriod = new Period(); // cc
10222      return this.effectivePeriod;
10223    }
10224
10225    public boolean hasEffectivePeriod() { 
10226      return this.effectivePeriod != null && !this.effectivePeriod.isEmpty();
10227    }
10228
10229    /**
10230     * @param value {@link #effectivePeriod} (The period during which the citation content was or is planned to be in active use.)
10231     */
10232    public Citation setEffectivePeriod(Period value) { 
10233      this.effectivePeriod = value;
10234      return this;
10235    }
10236
10237    /**
10238     * @return {@link #author} (Who authored the Citation.)
10239     */
10240    public List<ContactDetail> getAuthor() { 
10241      if (this.author == null)
10242        this.author = new ArrayList<ContactDetail>();
10243      return this.author;
10244    }
10245
10246    /**
10247     * @return Returns a reference to <code>this</code> for easy method chaining
10248     */
10249    public Citation setAuthor(List<ContactDetail> theAuthor) { 
10250      this.author = theAuthor;
10251      return this;
10252    }
10253
10254    public boolean hasAuthor() { 
10255      if (this.author == null)
10256        return false;
10257      for (ContactDetail item : this.author)
10258        if (!item.isEmpty())
10259          return true;
10260      return false;
10261    }
10262
10263    public ContactDetail addAuthor() { //3
10264      ContactDetail t = new ContactDetail();
10265      if (this.author == null)
10266        this.author = new ArrayList<ContactDetail>();
10267      this.author.add(t);
10268      return t;
10269    }
10270
10271    public Citation addAuthor(ContactDetail t) { //3
10272      if (t == null)
10273        return this;
10274      if (this.author == null)
10275        this.author = new ArrayList<ContactDetail>();
10276      this.author.add(t);
10277      return this;
10278    }
10279
10280    /**
10281     * @return The first repetition of repeating field {@link #author}, creating it if it does not already exist {3}
10282     */
10283    public ContactDetail getAuthorFirstRep() { 
10284      if (getAuthor().isEmpty()) {
10285        addAuthor();
10286      }
10287      return getAuthor().get(0);
10288    }
10289
10290    /**
10291     * @return {@link #editor} (Who edited the Citation.)
10292     */
10293    public List<ContactDetail> getEditor() { 
10294      if (this.editor == null)
10295        this.editor = new ArrayList<ContactDetail>();
10296      return this.editor;
10297    }
10298
10299    /**
10300     * @return Returns a reference to <code>this</code> for easy method chaining
10301     */
10302    public Citation setEditor(List<ContactDetail> theEditor) { 
10303      this.editor = theEditor;
10304      return this;
10305    }
10306
10307    public boolean hasEditor() { 
10308      if (this.editor == null)
10309        return false;
10310      for (ContactDetail item : this.editor)
10311        if (!item.isEmpty())
10312          return true;
10313      return false;
10314    }
10315
10316    public ContactDetail addEditor() { //3
10317      ContactDetail t = new ContactDetail();
10318      if (this.editor == null)
10319        this.editor = new ArrayList<ContactDetail>();
10320      this.editor.add(t);
10321      return t;
10322    }
10323
10324    public Citation addEditor(ContactDetail t) { //3
10325      if (t == null)
10326        return this;
10327      if (this.editor == null)
10328        this.editor = new ArrayList<ContactDetail>();
10329      this.editor.add(t);
10330      return this;
10331    }
10332
10333    /**
10334     * @return The first repetition of repeating field {@link #editor}, creating it if it does not already exist {3}
10335     */
10336    public ContactDetail getEditorFirstRep() { 
10337      if (getEditor().isEmpty()) {
10338        addEditor();
10339      }
10340      return getEditor().get(0);
10341    }
10342
10343    /**
10344     * @return {@link #reviewer} (Who reviewed the Citation.)
10345     */
10346    public List<ContactDetail> getReviewer() { 
10347      if (this.reviewer == null)
10348        this.reviewer = new ArrayList<ContactDetail>();
10349      return this.reviewer;
10350    }
10351
10352    /**
10353     * @return Returns a reference to <code>this</code> for easy method chaining
10354     */
10355    public Citation setReviewer(List<ContactDetail> theReviewer) { 
10356      this.reviewer = theReviewer;
10357      return this;
10358    }
10359
10360    public boolean hasReviewer() { 
10361      if (this.reviewer == null)
10362        return false;
10363      for (ContactDetail item : this.reviewer)
10364        if (!item.isEmpty())
10365          return true;
10366      return false;
10367    }
10368
10369    public ContactDetail addReviewer() { //3
10370      ContactDetail t = new ContactDetail();
10371      if (this.reviewer == null)
10372        this.reviewer = new ArrayList<ContactDetail>();
10373      this.reviewer.add(t);
10374      return t;
10375    }
10376
10377    public Citation addReviewer(ContactDetail t) { //3
10378      if (t == null)
10379        return this;
10380      if (this.reviewer == null)
10381        this.reviewer = new ArrayList<ContactDetail>();
10382      this.reviewer.add(t);
10383      return this;
10384    }
10385
10386    /**
10387     * @return The first repetition of repeating field {@link #reviewer}, creating it if it does not already exist {3}
10388     */
10389    public ContactDetail getReviewerFirstRep() { 
10390      if (getReviewer().isEmpty()) {
10391        addReviewer();
10392      }
10393      return getReviewer().get(0);
10394    }
10395
10396    /**
10397     * @return {@link #endorser} (Who endorsed the Citation.)
10398     */
10399    public List<ContactDetail> getEndorser() { 
10400      if (this.endorser == null)
10401        this.endorser = new ArrayList<ContactDetail>();
10402      return this.endorser;
10403    }
10404
10405    /**
10406     * @return Returns a reference to <code>this</code> for easy method chaining
10407     */
10408    public Citation setEndorser(List<ContactDetail> theEndorser) { 
10409      this.endorser = theEndorser;
10410      return this;
10411    }
10412
10413    public boolean hasEndorser() { 
10414      if (this.endorser == null)
10415        return false;
10416      for (ContactDetail item : this.endorser)
10417        if (!item.isEmpty())
10418          return true;
10419      return false;
10420    }
10421
10422    public ContactDetail addEndorser() { //3
10423      ContactDetail t = new ContactDetail();
10424      if (this.endorser == null)
10425        this.endorser = new ArrayList<ContactDetail>();
10426      this.endorser.add(t);
10427      return t;
10428    }
10429
10430    public Citation addEndorser(ContactDetail t) { //3
10431      if (t == null)
10432        return this;
10433      if (this.endorser == null)
10434        this.endorser = new ArrayList<ContactDetail>();
10435      this.endorser.add(t);
10436      return this;
10437    }
10438
10439    /**
10440     * @return The first repetition of repeating field {@link #endorser}, creating it if it does not already exist {3}
10441     */
10442    public ContactDetail getEndorserFirstRep() { 
10443      if (getEndorser().isEmpty()) {
10444        addEndorser();
10445      }
10446      return getEndorser().get(0);
10447    }
10448
10449    /**
10450     * @return {@link #summary} (A human-readable display of the citation.)
10451     */
10452    public List<ContactDetail> getSummary() { 
10453      if (this.summary == null)
10454        this.summary = new ArrayList<ContactDetail>();
10455      return this.summary;
10456    }
10457
10458    /**
10459     * @return Returns a reference to <code>this</code> for easy method chaining
10460     */
10461    public Citation setSummary(List<ContactDetail> theSummary) { 
10462      this.summary = theSummary;
10463      return this;
10464    }
10465
10466    public boolean hasSummary() { 
10467      if (this.summary == null)
10468        return false;
10469      for (ContactDetail item : this.summary)
10470        if (!item.isEmpty())
10471          return true;
10472      return false;
10473    }
10474
10475    public ContactDetail addSummary() { //3
10476      ContactDetail t = new ContactDetail();
10477      if (this.summary == null)
10478        this.summary = new ArrayList<ContactDetail>();
10479      this.summary.add(t);
10480      return t;
10481    }
10482
10483    public Citation addSummary(ContactDetail t) { //3
10484      if (t == null)
10485        return this;
10486      if (this.summary == null)
10487        this.summary = new ArrayList<ContactDetail>();
10488      this.summary.add(t);
10489      return this;
10490    }
10491
10492    /**
10493     * @return The first repetition of repeating field {@link #summary}, creating it if it does not already exist {3}
10494     */
10495    public ContactDetail getSummaryFirstRep() { 
10496      if (getSummary().isEmpty()) {
10497        addSummary();
10498      }
10499      return getSummary().get(0);
10500    }
10501
10502    /**
10503     * @return {@link #classification} (The assignment to an organizing scheme.)
10504     */
10505    public List<CitationClassificationComponent> getClassification() { 
10506      if (this.classification == null)
10507        this.classification = new ArrayList<CitationClassificationComponent>();
10508      return this.classification;
10509    }
10510
10511    /**
10512     * @return Returns a reference to <code>this</code> for easy method chaining
10513     */
10514    public Citation setClassification(List<CitationClassificationComponent> theClassification) { 
10515      this.classification = theClassification;
10516      return this;
10517    }
10518
10519    public boolean hasClassification() { 
10520      if (this.classification == null)
10521        return false;
10522      for (CitationClassificationComponent item : this.classification)
10523        if (!item.isEmpty())
10524          return true;
10525      return false;
10526    }
10527
10528    public CitationClassificationComponent addClassification() { //3
10529      CitationClassificationComponent t = new CitationClassificationComponent();
10530      if (this.classification == null)
10531        this.classification = new ArrayList<CitationClassificationComponent>();
10532      this.classification.add(t);
10533      return t;
10534    }
10535
10536    public Citation addClassification(CitationClassificationComponent t) { //3
10537      if (t == null)
10538        return this;
10539      if (this.classification == null)
10540        this.classification = new ArrayList<CitationClassificationComponent>();
10541      this.classification.add(t);
10542      return this;
10543    }
10544
10545    /**
10546     * @return The first repetition of repeating field {@link #classification}, creating it if it does not already exist {3}
10547     */
10548    public CitationClassificationComponent getClassificationFirstRep() { 
10549      if (getClassification().isEmpty()) {
10550        addClassification();
10551      }
10552      return getClassification().get(0);
10553    }
10554
10555    /**
10556     * @return {@link #note} (Used for general notes and annotations not coded elsewhere.)
10557     */
10558    public List<Annotation> getNote() { 
10559      if (this.note == null)
10560        this.note = new ArrayList<Annotation>();
10561      return this.note;
10562    }
10563
10564    /**
10565     * @return Returns a reference to <code>this</code> for easy method chaining
10566     */
10567    public Citation setNote(List<Annotation> theNote) { 
10568      this.note = theNote;
10569      return this;
10570    }
10571
10572    public boolean hasNote() { 
10573      if (this.note == null)
10574        return false;
10575      for (Annotation item : this.note)
10576        if (!item.isEmpty())
10577          return true;
10578      return false;
10579    }
10580
10581    public Annotation addNote() { //3
10582      Annotation t = new Annotation();
10583      if (this.note == null)
10584        this.note = new ArrayList<Annotation>();
10585      this.note.add(t);
10586      return t;
10587    }
10588
10589    public Citation addNote(Annotation t) { //3
10590      if (t == null)
10591        return this;
10592      if (this.note == null)
10593        this.note = new ArrayList<Annotation>();
10594      this.note.add(t);
10595      return this;
10596    }
10597
10598    /**
10599     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
10600     */
10601    public Annotation getNoteFirstRep() { 
10602      if (getNote().isEmpty()) {
10603        addNote();
10604      }
10605      return getNote().get(0);
10606    }
10607
10608    /**
10609     * @return {@link #currentState} (The status of the citation.)
10610     */
10611    public List<CodeableConcept> getCurrentState() { 
10612      if (this.currentState == null)
10613        this.currentState = new ArrayList<CodeableConcept>();
10614      return this.currentState;
10615    }
10616
10617    /**
10618     * @return Returns a reference to <code>this</code> for easy method chaining
10619     */
10620    public Citation setCurrentState(List<CodeableConcept> theCurrentState) { 
10621      this.currentState = theCurrentState;
10622      return this;
10623    }
10624
10625    public boolean hasCurrentState() { 
10626      if (this.currentState == null)
10627        return false;
10628      for (CodeableConcept item : this.currentState)
10629        if (!item.isEmpty())
10630          return true;
10631      return false;
10632    }
10633
10634    public CodeableConcept addCurrentState() { //3
10635      CodeableConcept t = new CodeableConcept();
10636      if (this.currentState == null)
10637        this.currentState = new ArrayList<CodeableConcept>();
10638      this.currentState.add(t);
10639      return t;
10640    }
10641
10642    public Citation addCurrentState(CodeableConcept t) { //3
10643      if (t == null)
10644        return this;
10645      if (this.currentState == null)
10646        this.currentState = new ArrayList<CodeableConcept>();
10647      this.currentState.add(t);
10648      return this;
10649    }
10650
10651    /**
10652     * @return The first repetition of repeating field {@link #currentState}, creating it if it does not already exist {3}
10653     */
10654    public CodeableConcept getCurrentStateFirstRep() { 
10655      if (getCurrentState().isEmpty()) {
10656        addCurrentState();
10657      }
10658      return getCurrentState().get(0);
10659    }
10660
10661    /**
10662     * @return {@link #statusDate} (An effective date or period for a status of the citation.)
10663     */
10664    public List<CitationStatusDateComponent> getStatusDate() { 
10665      if (this.statusDate == null)
10666        this.statusDate = new ArrayList<CitationStatusDateComponent>();
10667      return this.statusDate;
10668    }
10669
10670    /**
10671     * @return Returns a reference to <code>this</code> for easy method chaining
10672     */
10673    public Citation setStatusDate(List<CitationStatusDateComponent> theStatusDate) { 
10674      this.statusDate = theStatusDate;
10675      return this;
10676    }
10677
10678    public boolean hasStatusDate() { 
10679      if (this.statusDate == null)
10680        return false;
10681      for (CitationStatusDateComponent item : this.statusDate)
10682        if (!item.isEmpty())
10683          return true;
10684      return false;
10685    }
10686
10687    public CitationStatusDateComponent addStatusDate() { //3
10688      CitationStatusDateComponent t = new CitationStatusDateComponent();
10689      if (this.statusDate == null)
10690        this.statusDate = new ArrayList<CitationStatusDateComponent>();
10691      this.statusDate.add(t);
10692      return t;
10693    }
10694
10695    public Citation addStatusDate(CitationStatusDateComponent t) { //3
10696      if (t == null)
10697        return this;
10698      if (this.statusDate == null)
10699        this.statusDate = new ArrayList<CitationStatusDateComponent>();
10700      this.statusDate.add(t);
10701      return this;
10702    }
10703
10704    /**
10705     * @return The first repetition of repeating field {@link #statusDate}, creating it if it does not already exist {3}
10706     */
10707    public CitationStatusDateComponent getStatusDateFirstRep() { 
10708      if (getStatusDate().isEmpty()) {
10709        addStatusDate();
10710      }
10711      return getStatusDate().get(0);
10712    }
10713
10714    /**
10715     * @return {@link #relatesTo} (Artifact related to the Citation Resource.)
10716     */
10717    public List<CitationRelatesToComponent> getRelatesTo() { 
10718      if (this.relatesTo == null)
10719        this.relatesTo = new ArrayList<CitationRelatesToComponent>();
10720      return this.relatesTo;
10721    }
10722
10723    /**
10724     * @return Returns a reference to <code>this</code> for easy method chaining
10725     */
10726    public Citation setRelatesTo(List<CitationRelatesToComponent> theRelatesTo) { 
10727      this.relatesTo = theRelatesTo;
10728      return this;
10729    }
10730
10731    public boolean hasRelatesTo() { 
10732      if (this.relatesTo == null)
10733        return false;
10734      for (CitationRelatesToComponent item : this.relatesTo)
10735        if (!item.isEmpty())
10736          return true;
10737      return false;
10738    }
10739
10740    public CitationRelatesToComponent addRelatesTo() { //3
10741      CitationRelatesToComponent t = new CitationRelatesToComponent();
10742      if (this.relatesTo == null)
10743        this.relatesTo = new ArrayList<CitationRelatesToComponent>();
10744      this.relatesTo.add(t);
10745      return t;
10746    }
10747
10748    public Citation addRelatesTo(CitationRelatesToComponent t) { //3
10749      if (t == null)
10750        return this;
10751      if (this.relatesTo == null)
10752        this.relatesTo = new ArrayList<CitationRelatesToComponent>();
10753      this.relatesTo.add(t);
10754      return this;
10755    }
10756
10757    /**
10758     * @return The first repetition of repeating field {@link #relatesTo}, creating it if it does not already exist {3}
10759     */
10760    public CitationRelatesToComponent getRelatesToFirstRep() { 
10761      if (getRelatesTo().isEmpty()) {
10762        addRelatesTo();
10763      }
10764      return getRelatesTo().get(0);
10765    }
10766
10767    /**
10768     * @return {@link #citedArtifact} (The article or artifact being described.)
10769     */
10770    public CitationCitedArtifactComponent getCitedArtifact() { 
10771      if (this.citedArtifact == null)
10772        if (Configuration.errorOnAutoCreate())
10773          throw new Error("Attempt to auto-create Citation.citedArtifact");
10774        else if (Configuration.doAutoCreate())
10775          this.citedArtifact = new CitationCitedArtifactComponent(); // cc
10776      return this.citedArtifact;
10777    }
10778
10779    public boolean hasCitedArtifact() { 
10780      return this.citedArtifact != null && !this.citedArtifact.isEmpty();
10781    }
10782
10783    /**
10784     * @param value {@link #citedArtifact} (The article or artifact being described.)
10785     */
10786    public Citation setCitedArtifact(CitationCitedArtifactComponent value) { 
10787      this.citedArtifact = value;
10788      return this;
10789    }
10790
10791      protected void listChildren(List<Property> children) {
10792        super.listChildren(children);
10793        children.add(new Property("url", "uri", "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.", 0, 1, url));
10794        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));
10795        children.add(new Property("version", "string", "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.", 0, 1, version));
10796        children.add(new Property("name", "string", "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.", 0, 1, name));
10797        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the citation.", 0, 1, title));
10798        children.add(new Property("status", "code", "The status of this summary. Enables tracking the life-cycle of the content.", 0, 1, status));
10799        children.add(new Property("experimental", "boolean", "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.", 0, 1, experimental));
10800        children.add(new Property("date", "dateTime", "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.", 0, 1, date));
10801        children.add(new Property("publisher", "string", "The name of the organization or individual that published the citation.", 0, 1, publisher));
10802        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
10803        children.add(new Property("description", "markdown", "A free text natural language description of the citation from a consumer's perspective.", 0, 1, description));
10804        children.add(new Property("useContext", "UsageContext", "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.", 0, java.lang.Integer.MAX_VALUE, useContext));
10805        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the citation is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
10806        children.add(new Property("purpose", "markdown", "Explanation of why this citation is needed and why it has been designed as it has.", 0, 1, purpose));
10807        children.add(new Property("copyright", "markdown", "Use and/or publishing restrictions for the Citation, not for the cited artifact.", 0, 1, copyright));
10808        children.add(new Property("approvalDate", "date", "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.", 0, 1, approvalDate));
10809        children.add(new Property("lastReviewDate", "date", "The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.", 0, 1, lastReviewDate));
10810        children.add(new Property("effectivePeriod", "Period", "The period during which the citation content was or is planned to be in active use.", 0, 1, effectivePeriod));
10811        children.add(new Property("author", "ContactDetail", "Who authored the Citation.", 0, java.lang.Integer.MAX_VALUE, author));
10812        children.add(new Property("editor", "ContactDetail", "Who edited the Citation.", 0, java.lang.Integer.MAX_VALUE, editor));
10813        children.add(new Property("reviewer", "ContactDetail", "Who reviewed the Citation.", 0, java.lang.Integer.MAX_VALUE, reviewer));
10814        children.add(new Property("endorser", "ContactDetail", "Who endorsed the Citation.", 0, java.lang.Integer.MAX_VALUE, endorser));
10815        children.add(new Property("summary", "ContactDetail", "A human-readable display of the citation.", 0, java.lang.Integer.MAX_VALUE, summary));
10816        children.add(new Property("classification", "", "The assignment to an organizing scheme.", 0, java.lang.Integer.MAX_VALUE, classification));
10817        children.add(new Property("note", "Annotation", "Used for general notes and annotations not coded elsewhere.", 0, java.lang.Integer.MAX_VALUE, note));
10818        children.add(new Property("currentState", "CodeableConcept", "The status of the citation.", 0, java.lang.Integer.MAX_VALUE, currentState));
10819        children.add(new Property("statusDate", "", "An effective date or period for a status of the citation.", 0, java.lang.Integer.MAX_VALUE, statusDate));
10820        children.add(new Property("relatesTo", "", "Artifact related to the Citation Resource.", 0, java.lang.Integer.MAX_VALUE, relatesTo));
10821        children.add(new Property("citedArtifact", "", "The article or artifact being described.", 0, 1, citedArtifact));
10822      }
10823
10824      @Override
10825      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
10826        switch (_hash) {
10827        case 116079: /*url*/  return new Property("url", "uri", "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.", 0, 1, url);
10828        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);
10829        case 351608024: /*version*/  return new Property("version", "string", "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.", 0, 1, version);
10830        case 3373707: /*name*/  return new Property("name", "string", "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.", 0, 1, name);
10831        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the citation.", 0, 1, title);
10832        case -892481550: /*status*/  return new Property("status", "code", "The status of this summary. Enables tracking the life-cycle of the content.", 0, 1, status);
10833        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "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.", 0, 1, experimental);
10834        case 3076014: /*date*/  return new Property("date", "dateTime", "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.", 0, 1, date);
10835        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the organization or individual that published the citation.", 0, 1, publisher);
10836        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
10837        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the citation from a consumer's perspective.", 0, 1, description);
10838        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "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.", 0, java.lang.Integer.MAX_VALUE, useContext);
10839        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the citation is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
10840        case -220463842: /*purpose*/  return new Property("purpose", "markdown", "Explanation of why this citation is needed and why it has been designed as it has.", 0, 1, purpose);
10841        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "Use and/or publishing restrictions for the Citation, not for the cited artifact.", 0, 1, copyright);
10842        case 223539345: /*approvalDate*/  return new Property("approvalDate", "date", "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.", 0, 1, approvalDate);
10843        case -1687512484: /*lastReviewDate*/  return new Property("lastReviewDate", "date", "The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.", 0, 1, lastReviewDate);
10844        case -403934648: /*effectivePeriod*/  return new Property("effectivePeriod", "Period", "The period during which the citation content was or is planned to be in active use.", 0, 1, effectivePeriod);
10845        case -1406328437: /*author*/  return new Property("author", "ContactDetail", "Who authored the Citation.", 0, java.lang.Integer.MAX_VALUE, author);
10846        case -1307827859: /*editor*/  return new Property("editor", "ContactDetail", "Who edited the Citation.", 0, java.lang.Integer.MAX_VALUE, editor);
10847        case -261190139: /*reviewer*/  return new Property("reviewer", "ContactDetail", "Who reviewed the Citation.", 0, java.lang.Integer.MAX_VALUE, reviewer);
10848        case 1740277666: /*endorser*/  return new Property("endorser", "ContactDetail", "Who endorsed the Citation.", 0, java.lang.Integer.MAX_VALUE, endorser);
10849        case -1857640538: /*summary*/  return new Property("summary", "ContactDetail", "A human-readable display of the citation.", 0, java.lang.Integer.MAX_VALUE, summary);
10850        case 382350310: /*classification*/  return new Property("classification", "", "The assignment to an organizing scheme.", 0, java.lang.Integer.MAX_VALUE, classification);
10851        case 3387378: /*note*/  return new Property("note", "Annotation", "Used for general notes and annotations not coded elsewhere.", 0, java.lang.Integer.MAX_VALUE, note);
10852        case 1457822360: /*currentState*/  return new Property("currentState", "CodeableConcept", "The status of the citation.", 0, java.lang.Integer.MAX_VALUE, currentState);
10853        case 247524032: /*statusDate*/  return new Property("statusDate", "", "An effective date or period for a status of the citation.", 0, java.lang.Integer.MAX_VALUE, statusDate);
10854        case -7765931: /*relatesTo*/  return new Property("relatesTo", "", "Artifact related to the Citation Resource.", 0, java.lang.Integer.MAX_VALUE, relatesTo);
10855        case -495272225: /*citedArtifact*/  return new Property("citedArtifact", "", "The article or artifact being described.", 0, 1, citedArtifact);
10856        default: return super.getNamedProperty(_hash, _name, _checkValid);
10857        }
10858
10859      }
10860
10861      @Override
10862      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
10863        switch (hash) {
10864        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
10865        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
10866        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
10867        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
10868        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
10869        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
10870        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
10871        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
10872        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
10873        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
10874        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
10875        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
10876        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
10877        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
10878        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
10879        case 223539345: /*approvalDate*/ return this.approvalDate == null ? new Base[0] : new Base[] {this.approvalDate}; // DateType
10880        case -1687512484: /*lastReviewDate*/ return this.lastReviewDate == null ? new Base[0] : new Base[] {this.lastReviewDate}; // DateType
10881        case -403934648: /*effectivePeriod*/ return this.effectivePeriod == null ? new Base[0] : new Base[] {this.effectivePeriod}; // Period
10882        case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // ContactDetail
10883        case -1307827859: /*editor*/ return this.editor == null ? new Base[0] : this.editor.toArray(new Base[this.editor.size()]); // ContactDetail
10884        case -261190139: /*reviewer*/ return this.reviewer == null ? new Base[0] : this.reviewer.toArray(new Base[this.reviewer.size()]); // ContactDetail
10885        case 1740277666: /*endorser*/ return this.endorser == null ? new Base[0] : this.endorser.toArray(new Base[this.endorser.size()]); // ContactDetail
10886        case -1857640538: /*summary*/ return this.summary == null ? new Base[0] : this.summary.toArray(new Base[this.summary.size()]); // ContactDetail
10887        case 382350310: /*classification*/ return this.classification == null ? new Base[0] : this.classification.toArray(new Base[this.classification.size()]); // CitationClassificationComponent
10888        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
10889        case 1457822360: /*currentState*/ return this.currentState == null ? new Base[0] : this.currentState.toArray(new Base[this.currentState.size()]); // CodeableConcept
10890        case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : this.statusDate.toArray(new Base[this.statusDate.size()]); // CitationStatusDateComponent
10891        case -7765931: /*relatesTo*/ return this.relatesTo == null ? new Base[0] : this.relatesTo.toArray(new Base[this.relatesTo.size()]); // CitationRelatesToComponent
10892        case -495272225: /*citedArtifact*/ return this.citedArtifact == null ? new Base[0] : new Base[] {this.citedArtifact}; // CitationCitedArtifactComponent
10893        default: return super.getProperty(hash, name, checkValid);
10894        }
10895
10896      }
10897
10898      @Override
10899      public Base setProperty(int hash, String name, Base value) throws FHIRException {
10900        switch (hash) {
10901        case 116079: // url
10902          this.url = TypeConvertor.castToUri(value); // UriType
10903          return value;
10904        case -1618432855: // identifier
10905          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
10906          return value;
10907        case 351608024: // version
10908          this.version = TypeConvertor.castToString(value); // StringType
10909          return value;
10910        case 3373707: // name
10911          this.name = TypeConvertor.castToString(value); // StringType
10912          return value;
10913        case 110371416: // title
10914          this.title = TypeConvertor.castToString(value); // StringType
10915          return value;
10916        case -892481550: // status
10917          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
10918          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
10919          return value;
10920        case -404562712: // experimental
10921          this.experimental = TypeConvertor.castToBoolean(value); // BooleanType
10922          return value;
10923        case 3076014: // date
10924          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
10925          return value;
10926        case 1447404028: // publisher
10927          this.publisher = TypeConvertor.castToString(value); // StringType
10928          return value;
10929        case 951526432: // contact
10930          this.getContact().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
10931          return value;
10932        case -1724546052: // description
10933          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
10934          return value;
10935        case -669707736: // useContext
10936          this.getUseContext().add(TypeConvertor.castToUsageContext(value)); // UsageContext
10937          return value;
10938        case -507075711: // jurisdiction
10939          this.getJurisdiction().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
10940          return value;
10941        case -220463842: // purpose
10942          this.purpose = TypeConvertor.castToMarkdown(value); // MarkdownType
10943          return value;
10944        case 1522889671: // copyright
10945          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
10946          return value;
10947        case 223539345: // approvalDate
10948          this.approvalDate = TypeConvertor.castToDate(value); // DateType
10949          return value;
10950        case -1687512484: // lastReviewDate
10951          this.lastReviewDate = TypeConvertor.castToDate(value); // DateType
10952          return value;
10953        case -403934648: // effectivePeriod
10954          this.effectivePeriod = TypeConvertor.castToPeriod(value); // Period
10955          return value;
10956        case -1406328437: // author
10957          this.getAuthor().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
10958          return value;
10959        case -1307827859: // editor
10960          this.getEditor().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
10961          return value;
10962        case -261190139: // reviewer
10963          this.getReviewer().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
10964          return value;
10965        case 1740277666: // endorser
10966          this.getEndorser().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
10967          return value;
10968        case -1857640538: // summary
10969          this.getSummary().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
10970          return value;
10971        case 382350310: // classification
10972          this.getClassification().add((CitationClassificationComponent) value); // CitationClassificationComponent
10973          return value;
10974        case 3387378: // note
10975          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
10976          return value;
10977        case 1457822360: // currentState
10978          this.getCurrentState().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
10979          return value;
10980        case 247524032: // statusDate
10981          this.getStatusDate().add((CitationStatusDateComponent) value); // CitationStatusDateComponent
10982          return value;
10983        case -7765931: // relatesTo
10984          this.getRelatesTo().add((CitationRelatesToComponent) value); // CitationRelatesToComponent
10985          return value;
10986        case -495272225: // citedArtifact
10987          this.citedArtifact = (CitationCitedArtifactComponent) value; // CitationCitedArtifactComponent
10988          return value;
10989        default: return super.setProperty(hash, name, value);
10990        }
10991
10992      }
10993
10994      @Override
10995      public Base setProperty(String name, Base value) throws FHIRException {
10996        if (name.equals("url")) {
10997          this.url = TypeConvertor.castToUri(value); // UriType
10998        } else if (name.equals("identifier")) {
10999          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
11000        } else if (name.equals("version")) {
11001          this.version = TypeConvertor.castToString(value); // StringType
11002        } else if (name.equals("name")) {
11003          this.name = TypeConvertor.castToString(value); // StringType
11004        } else if (name.equals("title")) {
11005          this.title = TypeConvertor.castToString(value); // StringType
11006        } else if (name.equals("status")) {
11007          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
11008          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
11009        } else if (name.equals("experimental")) {
11010          this.experimental = TypeConvertor.castToBoolean(value); // BooleanType
11011        } else if (name.equals("date")) {
11012          this.date = TypeConvertor.castToDateTime(value); // DateTimeType
11013        } else if (name.equals("publisher")) {
11014          this.publisher = TypeConvertor.castToString(value); // StringType
11015        } else if (name.equals("contact")) {
11016          this.getContact().add(TypeConvertor.castToContactDetail(value));
11017        } else if (name.equals("description")) {
11018          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
11019        } else if (name.equals("useContext")) {
11020          this.getUseContext().add(TypeConvertor.castToUsageContext(value));
11021        } else if (name.equals("jurisdiction")) {
11022          this.getJurisdiction().add(TypeConvertor.castToCodeableConcept(value));
11023        } else if (name.equals("purpose")) {
11024          this.purpose = TypeConvertor.castToMarkdown(value); // MarkdownType
11025        } else if (name.equals("copyright")) {
11026          this.copyright = TypeConvertor.castToMarkdown(value); // MarkdownType
11027        } else if (name.equals("approvalDate")) {
11028          this.approvalDate = TypeConvertor.castToDate(value); // DateType
11029        } else if (name.equals("lastReviewDate")) {
11030          this.lastReviewDate = TypeConvertor.castToDate(value); // DateType
11031        } else if (name.equals("effectivePeriod")) {
11032          this.effectivePeriod = TypeConvertor.castToPeriod(value); // Period
11033        } else if (name.equals("author")) {
11034          this.getAuthor().add(TypeConvertor.castToContactDetail(value));
11035        } else if (name.equals("editor")) {
11036          this.getEditor().add(TypeConvertor.castToContactDetail(value));
11037        } else if (name.equals("reviewer")) {
11038          this.getReviewer().add(TypeConvertor.castToContactDetail(value));
11039        } else if (name.equals("endorser")) {
11040          this.getEndorser().add(TypeConvertor.castToContactDetail(value));
11041        } else if (name.equals("summary")) {
11042          this.getSummary().add(TypeConvertor.castToContactDetail(value));
11043        } else if (name.equals("classification")) {
11044          this.getClassification().add((CitationClassificationComponent) value);
11045        } else if (name.equals("note")) {
11046          this.getNote().add(TypeConvertor.castToAnnotation(value));
11047        } else if (name.equals("currentState")) {
11048          this.getCurrentState().add(TypeConvertor.castToCodeableConcept(value));
11049        } else if (name.equals("statusDate")) {
11050          this.getStatusDate().add((CitationStatusDateComponent) value);
11051        } else if (name.equals("relatesTo")) {
11052          this.getRelatesTo().add((CitationRelatesToComponent) value);
11053        } else if (name.equals("citedArtifact")) {
11054          this.citedArtifact = (CitationCitedArtifactComponent) value; // CitationCitedArtifactComponent
11055        } else
11056          return super.setProperty(name, value);
11057        return value;
11058      }
11059
11060      @Override
11061      public Base makeProperty(int hash, String name) throws FHIRException {
11062        switch (hash) {
11063        case 116079:  return getUrlElement();
11064        case -1618432855:  return addIdentifier(); 
11065        case 351608024:  return getVersionElement();
11066        case 3373707:  return getNameElement();
11067        case 110371416:  return getTitleElement();
11068        case -892481550:  return getStatusElement();
11069        case -404562712:  return getExperimentalElement();
11070        case 3076014:  return getDateElement();
11071        case 1447404028:  return getPublisherElement();
11072        case 951526432:  return addContact(); 
11073        case -1724546052:  return getDescriptionElement();
11074        case -669707736:  return addUseContext(); 
11075        case -507075711:  return addJurisdiction(); 
11076        case -220463842:  return getPurposeElement();
11077        case 1522889671:  return getCopyrightElement();
11078        case 223539345:  return getApprovalDateElement();
11079        case -1687512484:  return getLastReviewDateElement();
11080        case -403934648:  return getEffectivePeriod();
11081        case -1406328437:  return addAuthor(); 
11082        case -1307827859:  return addEditor(); 
11083        case -261190139:  return addReviewer(); 
11084        case 1740277666:  return addEndorser(); 
11085        case -1857640538:  return addSummary(); 
11086        case 382350310:  return addClassification(); 
11087        case 3387378:  return addNote(); 
11088        case 1457822360:  return addCurrentState(); 
11089        case 247524032:  return addStatusDate(); 
11090        case -7765931:  return addRelatesTo(); 
11091        case -495272225:  return getCitedArtifact();
11092        default: return super.makeProperty(hash, name);
11093        }
11094
11095      }
11096
11097      @Override
11098      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
11099        switch (hash) {
11100        case 116079: /*url*/ return new String[] {"uri"};
11101        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
11102        case 351608024: /*version*/ return new String[] {"string"};
11103        case 3373707: /*name*/ return new String[] {"string"};
11104        case 110371416: /*title*/ return new String[] {"string"};
11105        case -892481550: /*status*/ return new String[] {"code"};
11106        case -404562712: /*experimental*/ return new String[] {"boolean"};
11107        case 3076014: /*date*/ return new String[] {"dateTime"};
11108        case 1447404028: /*publisher*/ return new String[] {"string"};
11109        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
11110        case -1724546052: /*description*/ return new String[] {"markdown"};
11111        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
11112        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
11113        case -220463842: /*purpose*/ return new String[] {"markdown"};
11114        case 1522889671: /*copyright*/ return new String[] {"markdown"};
11115        case 223539345: /*approvalDate*/ return new String[] {"date"};
11116        case -1687512484: /*lastReviewDate*/ return new String[] {"date"};
11117        case -403934648: /*effectivePeriod*/ return new String[] {"Period"};
11118        case -1406328437: /*author*/ return new String[] {"ContactDetail"};
11119        case -1307827859: /*editor*/ return new String[] {"ContactDetail"};
11120        case -261190139: /*reviewer*/ return new String[] {"ContactDetail"};
11121        case 1740277666: /*endorser*/ return new String[] {"ContactDetail"};
11122        case -1857640538: /*summary*/ return new String[] {"ContactDetail"};
11123        case 382350310: /*classification*/ return new String[] {};
11124        case 3387378: /*note*/ return new String[] {"Annotation"};
11125        case 1457822360: /*currentState*/ return new String[] {"CodeableConcept"};
11126        case 247524032: /*statusDate*/ return new String[] {};
11127        case -7765931: /*relatesTo*/ return new String[] {};
11128        case -495272225: /*citedArtifact*/ return new String[] {};
11129        default: return super.getTypesForProperty(hash, name);
11130        }
11131
11132      }
11133
11134      @Override
11135      public Base addChild(String name) throws FHIRException {
11136        if (name.equals("url")) {
11137          throw new FHIRException("Cannot call addChild on a primitive type Citation.url");
11138        }
11139        else if (name.equals("identifier")) {
11140          return addIdentifier();
11141        }
11142        else if (name.equals("version")) {
11143          throw new FHIRException("Cannot call addChild on a primitive type Citation.version");
11144        }
11145        else if (name.equals("name")) {
11146          throw new FHIRException("Cannot call addChild on a primitive type Citation.name");
11147        }
11148        else if (name.equals("title")) {
11149          throw new FHIRException("Cannot call addChild on a primitive type Citation.title");
11150        }
11151        else if (name.equals("status")) {
11152          throw new FHIRException("Cannot call addChild on a primitive type Citation.status");
11153        }
11154        else if (name.equals("experimental")) {
11155          throw new FHIRException("Cannot call addChild on a primitive type Citation.experimental");
11156        }
11157        else if (name.equals("date")) {
11158          throw new FHIRException("Cannot call addChild on a primitive type Citation.date");
11159        }
11160        else if (name.equals("publisher")) {
11161          throw new FHIRException("Cannot call addChild on a primitive type Citation.publisher");
11162        }
11163        else if (name.equals("contact")) {
11164          return addContact();
11165        }
11166        else if (name.equals("description")) {
11167          throw new FHIRException("Cannot call addChild on a primitive type Citation.description");
11168        }
11169        else if (name.equals("useContext")) {
11170          return addUseContext();
11171        }
11172        else if (name.equals("jurisdiction")) {
11173          return addJurisdiction();
11174        }
11175        else if (name.equals("purpose")) {
11176          throw new FHIRException("Cannot call addChild on a primitive type Citation.purpose");
11177        }
11178        else if (name.equals("copyright")) {
11179          throw new FHIRException("Cannot call addChild on a primitive type Citation.copyright");
11180        }
11181        else if (name.equals("approvalDate")) {
11182          throw new FHIRException("Cannot call addChild on a primitive type Citation.approvalDate");
11183        }
11184        else if (name.equals("lastReviewDate")) {
11185          throw new FHIRException("Cannot call addChild on a primitive type Citation.lastReviewDate");
11186        }
11187        else if (name.equals("effectivePeriod")) {
11188          this.effectivePeriod = new Period();
11189          return this.effectivePeriod;
11190        }
11191        else if (name.equals("author")) {
11192          return addAuthor();
11193        }
11194        else if (name.equals("editor")) {
11195          return addEditor();
11196        }
11197        else if (name.equals("reviewer")) {
11198          return addReviewer();
11199        }
11200        else if (name.equals("endorser")) {
11201          return addEndorser();
11202        }
11203        else if (name.equals("summary")) {
11204          return addSummary();
11205        }
11206        else if (name.equals("classification")) {
11207          return addClassification();
11208        }
11209        else if (name.equals("note")) {
11210          return addNote();
11211        }
11212        else if (name.equals("currentState")) {
11213          return addCurrentState();
11214        }
11215        else if (name.equals("statusDate")) {
11216          return addStatusDate();
11217        }
11218        else if (name.equals("relatesTo")) {
11219          return addRelatesTo();
11220        }
11221        else if (name.equals("citedArtifact")) {
11222          this.citedArtifact = new CitationCitedArtifactComponent();
11223          return this.citedArtifact;
11224        }
11225        else
11226          return super.addChild(name);
11227      }
11228
11229  public String fhirType() {
11230    return "Citation";
11231
11232  }
11233
11234      public Citation copy() {
11235        Citation dst = new Citation();
11236        copyValues(dst);
11237        return dst;
11238      }
11239
11240      public void copyValues(Citation dst) {
11241        super.copyValues(dst);
11242        dst.url = url == null ? null : url.copy();
11243        if (identifier != null) {
11244          dst.identifier = new ArrayList<Identifier>();
11245          for (Identifier i : identifier)
11246            dst.identifier.add(i.copy());
11247        };
11248        dst.version = version == null ? null : version.copy();
11249        dst.name = name == null ? null : name.copy();
11250        dst.title = title == null ? null : title.copy();
11251        dst.status = status == null ? null : status.copy();
11252        dst.experimental = experimental == null ? null : experimental.copy();
11253        dst.date = date == null ? null : date.copy();
11254        dst.publisher = publisher == null ? null : publisher.copy();
11255        if (contact != null) {
11256          dst.contact = new ArrayList<ContactDetail>();
11257          for (ContactDetail i : contact)
11258            dst.contact.add(i.copy());
11259        };
11260        dst.description = description == null ? null : description.copy();
11261        if (useContext != null) {
11262          dst.useContext = new ArrayList<UsageContext>();
11263          for (UsageContext i : useContext)
11264            dst.useContext.add(i.copy());
11265        };
11266        if (jurisdiction != null) {
11267          dst.jurisdiction = new ArrayList<CodeableConcept>();
11268          for (CodeableConcept i : jurisdiction)
11269            dst.jurisdiction.add(i.copy());
11270        };
11271        dst.purpose = purpose == null ? null : purpose.copy();
11272        dst.copyright = copyright == null ? null : copyright.copy();
11273        dst.approvalDate = approvalDate == null ? null : approvalDate.copy();
11274        dst.lastReviewDate = lastReviewDate == null ? null : lastReviewDate.copy();
11275        dst.effectivePeriod = effectivePeriod == null ? null : effectivePeriod.copy();
11276        if (author != null) {
11277          dst.author = new ArrayList<ContactDetail>();
11278          for (ContactDetail i : author)
11279            dst.author.add(i.copy());
11280        };
11281        if (editor != null) {
11282          dst.editor = new ArrayList<ContactDetail>();
11283          for (ContactDetail i : editor)
11284            dst.editor.add(i.copy());
11285        };
11286        if (reviewer != null) {
11287          dst.reviewer = new ArrayList<ContactDetail>();
11288          for (ContactDetail i : reviewer)
11289            dst.reviewer.add(i.copy());
11290        };
11291        if (endorser != null) {
11292          dst.endorser = new ArrayList<ContactDetail>();
11293          for (ContactDetail i : endorser)
11294            dst.endorser.add(i.copy());
11295        };
11296        if (summary != null) {
11297          dst.summary = new ArrayList<ContactDetail>();
11298          for (ContactDetail i : summary)
11299            dst.summary.add(i.copy());
11300        };
11301        if (classification != null) {
11302          dst.classification = new ArrayList<CitationClassificationComponent>();
11303          for (CitationClassificationComponent i : classification)
11304            dst.classification.add(i.copy());
11305        };
11306        if (note != null) {
11307          dst.note = new ArrayList<Annotation>();
11308          for (Annotation i : note)
11309            dst.note.add(i.copy());
11310        };
11311        if (currentState != null) {
11312          dst.currentState = new ArrayList<CodeableConcept>();
11313          for (CodeableConcept i : currentState)
11314            dst.currentState.add(i.copy());
11315        };
11316        if (statusDate != null) {
11317          dst.statusDate = new ArrayList<CitationStatusDateComponent>();
11318          for (CitationStatusDateComponent i : statusDate)
11319            dst.statusDate.add(i.copy());
11320        };
11321        if (relatesTo != null) {
11322          dst.relatesTo = new ArrayList<CitationRelatesToComponent>();
11323          for (CitationRelatesToComponent i : relatesTo)
11324            dst.relatesTo.add(i.copy());
11325        };
11326        dst.citedArtifact = citedArtifact == null ? null : citedArtifact.copy();
11327      }
11328
11329      protected Citation typedCopy() {
11330        return copy();
11331      }
11332
11333      @Override
11334      public boolean equalsDeep(Base other_) {
11335        if (!super.equalsDeep(other_))
11336          return false;
11337        if (!(other_ instanceof Citation))
11338          return false;
11339        Citation o = (Citation) other_;
11340        return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true)
11341           && compareDeep(name, o.name, true) && compareDeep(title, o.title, true) && compareDeep(status, o.status, true)
11342           && compareDeep(experimental, o.experimental, true) && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true)
11343           && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true)
11344           && compareDeep(jurisdiction, o.jurisdiction, true) && compareDeep(purpose, o.purpose, true) && compareDeep(copyright, o.copyright, true)
11345           && compareDeep(approvalDate, o.approvalDate, true) && compareDeep(lastReviewDate, o.lastReviewDate, true)
11346           && compareDeep(effectivePeriod, o.effectivePeriod, true) && compareDeep(author, o.author, true)
11347           && compareDeep(editor, o.editor, true) && compareDeep(reviewer, o.reviewer, true) && compareDeep(endorser, o.endorser, true)
11348           && compareDeep(summary, o.summary, true) && compareDeep(classification, o.classification, true)
11349           && compareDeep(note, o.note, true) && compareDeep(currentState, o.currentState, true) && compareDeep(statusDate, o.statusDate, true)
11350           && compareDeep(relatesTo, o.relatesTo, true) && compareDeep(citedArtifact, o.citedArtifact, true)
11351          ;
11352      }
11353
11354      @Override
11355      public boolean equalsShallow(Base other_) {
11356        if (!super.equalsShallow(other_))
11357          return false;
11358        if (!(other_ instanceof Citation))
11359          return false;
11360        Citation o = (Citation) other_;
11361        return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true)
11362           && compareValues(title, o.title, true) && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true)
11363           && compareValues(date, o.date, true) && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true)
11364           && compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true) && compareValues(approvalDate, o.approvalDate, true)
11365           && compareValues(lastReviewDate, o.lastReviewDate, true);
11366      }
11367
11368      public boolean isEmpty() {
11369        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, identifier, version
11370          , name, title, status, experimental, date, publisher, contact, description, useContext
11371          , jurisdiction, purpose, copyright, approvalDate, lastReviewDate, effectivePeriod
11372          , author, editor, reviewer, endorser, summary, classification, note, currentState
11373          , statusDate, relatesTo, citedArtifact);
11374      }
11375
11376  @Override
11377  public ResourceType getResourceType() {
11378    return ResourceType.Citation;
11379   }
11380
11381 /**
11382   * Search parameter: <b>context-quantity</b>
11383   * <p>
11384   * Description: <b>A quantity- or range-valued use context assigned to the citation</b><br>
11385   * Type: <b>quantity</b><br>
11386   * Path: <b>(Citation.useContext.value as Quantity) | (Citation.useContext.value as Range)</b><br>
11387   * </p>
11388   */
11389  @SearchParamDefinition(name="context-quantity", path="(Citation.useContext.value as Quantity) | (Citation.useContext.value as Range)", description="A quantity- or range-valued use context assigned to the citation", type="quantity" )
11390  public static final String SP_CONTEXT_QUANTITY = "context-quantity";
11391 /**
11392   * <b>Fluent Client</b> search parameter constant for <b>context-quantity</b>
11393   * <p>
11394   * Description: <b>A quantity- or range-valued use context assigned to the citation</b><br>
11395   * Type: <b>quantity</b><br>
11396   * Path: <b>(Citation.useContext.value as Quantity) | (Citation.useContext.value as Range)</b><br>
11397   * </p>
11398   */
11399  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam CONTEXT_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_CONTEXT_QUANTITY);
11400
11401 /**
11402   * Search parameter: <b>context-type-quantity</b>
11403   * <p>
11404   * Description: <b>A use context type and quantity- or range-based value assigned to the citation</b><br>
11405   * Type: <b>composite</b><br>
11406   * Path: <b>Citation.useContext</b><br>
11407   * </p>
11408   */
11409  @SearchParamDefinition(name="context-type-quantity", path="Citation.useContext", description="A use context type and quantity- or range-based value assigned to the citation", type="composite", compositeOf={"context-type", "context-quantity"} )
11410  public static final String SP_CONTEXT_TYPE_QUANTITY = "context-type-quantity";
11411 /**
11412   * <b>Fluent Client</b> search parameter constant for <b>context-type-quantity</b>
11413   * <p>
11414   * Description: <b>A use context type and quantity- or range-based value assigned to the citation</b><br>
11415   * Type: <b>composite</b><br>
11416   * Path: <b>Citation.useContext</b><br>
11417   * </p>
11418   */
11419  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam> CONTEXT_TYPE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam>(SP_CONTEXT_TYPE_QUANTITY);
11420
11421 /**
11422   * Search parameter: <b>context-type-value</b>
11423   * <p>
11424   * Description: <b>A use context type and value assigned to the citation</b><br>
11425   * Type: <b>composite</b><br>
11426   * Path: <b>Citation.useContext</b><br>
11427   * </p>
11428   */
11429  @SearchParamDefinition(name="context-type-value", path="Citation.useContext", description="A use context type and value assigned to the citation", type="composite", compositeOf={"context-type", "context"} )
11430  public static final String SP_CONTEXT_TYPE_VALUE = "context-type-value";
11431 /**
11432   * <b>Fluent Client</b> search parameter constant for <b>context-type-value</b>
11433   * <p>
11434   * Description: <b>A use context type and value assigned to the citation</b><br>
11435   * Type: <b>composite</b><br>
11436   * Path: <b>Citation.useContext</b><br>
11437   * </p>
11438   */
11439  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> CONTEXT_TYPE_VALUE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(SP_CONTEXT_TYPE_VALUE);
11440
11441 /**
11442   * Search parameter: <b>context-type</b>
11443   * <p>
11444   * Description: <b>A type of use context assigned to the citation</b><br>
11445   * Type: <b>token</b><br>
11446   * Path: <b>Citation.useContext.code</b><br>
11447   * </p>
11448   */
11449  @SearchParamDefinition(name="context-type", path="Citation.useContext.code", description="A type of use context assigned to the citation", type="token" )
11450  public static final String SP_CONTEXT_TYPE = "context-type";
11451 /**
11452   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
11453   * <p>
11454   * Description: <b>A type of use context assigned to the citation</b><br>
11455   * Type: <b>token</b><br>
11456   * Path: <b>Citation.useContext.code</b><br>
11457   * </p>
11458   */
11459  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT_TYPE);
11460
11461 /**
11462   * Search parameter: <b>context</b>
11463   * <p>
11464   * Description: <b>A use context assigned to the citation</b><br>
11465   * Type: <b>token</b><br>
11466   * Path: <b>(Citation.useContext.value as CodeableConcept)</b><br>
11467   * </p>
11468   */
11469  @SearchParamDefinition(name="context", path="(Citation.useContext.value as CodeableConcept)", description="A use context assigned to the citation", type="token" )
11470  public static final String SP_CONTEXT = "context";
11471 /**
11472   * <b>Fluent Client</b> search parameter constant for <b>context</b>
11473   * <p>
11474   * Description: <b>A use context assigned to the citation</b><br>
11475   * Type: <b>token</b><br>
11476   * Path: <b>(Citation.useContext.value as CodeableConcept)</b><br>
11477   * </p>
11478   */
11479  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT);
11480
11481 /**
11482   * Search parameter: <b>date</b>
11483   * <p>
11484   * Description: <b>The citation publication date</b><br>
11485   * Type: <b>date</b><br>
11486   * Path: <b>Citation.date</b><br>
11487   * </p>
11488   */
11489  @SearchParamDefinition(name="date", path="Citation.date", description="The citation publication date", type="date" )
11490  public static final String SP_DATE = "date";
11491 /**
11492   * <b>Fluent Client</b> search parameter constant for <b>date</b>
11493   * <p>
11494   * Description: <b>The citation publication date</b><br>
11495   * Type: <b>date</b><br>
11496   * Path: <b>Citation.date</b><br>
11497   * </p>
11498   */
11499  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
11500
11501 /**
11502   * Search parameter: <b>description</b>
11503   * <p>
11504   * Description: <b>The description of the citation</b><br>
11505   * Type: <b>string</b><br>
11506   * Path: <b>Citation.description</b><br>
11507   * </p>
11508   */
11509  @SearchParamDefinition(name="description", path="Citation.description", description="The description of the citation", type="string" )
11510  public static final String SP_DESCRIPTION = "description";
11511 /**
11512   * <b>Fluent Client</b> search parameter constant for <b>description</b>
11513   * <p>
11514   * Description: <b>The description of the citation</b><br>
11515   * Type: <b>string</b><br>
11516   * Path: <b>Citation.description</b><br>
11517   * </p>
11518   */
11519  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
11520
11521 /**
11522   * Search parameter: <b>effective</b>
11523   * <p>
11524   * Description: <b>The time during which the citation is intended to be in use</b><br>
11525   * Type: <b>date</b><br>
11526   * Path: <b>Citation.effectivePeriod</b><br>
11527   * </p>
11528   */
11529  @SearchParamDefinition(name="effective", path="Citation.effectivePeriod", description="The time during which the citation is intended to be in use", type="date" )
11530  public static final String SP_EFFECTIVE = "effective";
11531 /**
11532   * <b>Fluent Client</b> search parameter constant for <b>effective</b>
11533   * <p>
11534   * Description: <b>The time during which the citation is intended to be in use</b><br>
11535   * Type: <b>date</b><br>
11536   * Path: <b>Citation.effectivePeriod</b><br>
11537   * </p>
11538   */
11539  public static final ca.uhn.fhir.rest.gclient.DateClientParam EFFECTIVE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EFFECTIVE);
11540
11541 /**
11542   * Search parameter: <b>identifier</b>
11543   * <p>
11544   * Description: <b>External identifier for the citation</b><br>
11545   * Type: <b>token</b><br>
11546   * Path: <b>Citation.identifier</b><br>
11547   * </p>
11548   */
11549  @SearchParamDefinition(name="identifier", path="Citation.identifier", description="External identifier for the citation", type="token" )
11550  public static final String SP_IDENTIFIER = "identifier";
11551 /**
11552   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
11553   * <p>
11554   * Description: <b>External identifier for the citation</b><br>
11555   * Type: <b>token</b><br>
11556   * Path: <b>Citation.identifier</b><br>
11557   * </p>
11558   */
11559  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
11560
11561 /**
11562   * Search parameter: <b>jurisdiction</b>
11563   * <p>
11564   * Description: <b>Intended jurisdiction for the citation</b><br>
11565   * Type: <b>token</b><br>
11566   * Path: <b>Citation.jurisdiction</b><br>
11567   * </p>
11568   */
11569  @SearchParamDefinition(name="jurisdiction", path="Citation.jurisdiction", description="Intended jurisdiction for the citation", type="token" )
11570  public static final String SP_JURISDICTION = "jurisdiction";
11571 /**
11572   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
11573   * <p>
11574   * Description: <b>Intended jurisdiction for the citation</b><br>
11575   * Type: <b>token</b><br>
11576   * Path: <b>Citation.jurisdiction</b><br>
11577   * </p>
11578   */
11579  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
11580
11581 /**
11582   * Search parameter: <b>name</b>
11583   * <p>
11584   * Description: <b>Computationally friendly name of the citation</b><br>
11585   * Type: <b>string</b><br>
11586   * Path: <b>Citation.name</b><br>
11587   * </p>
11588   */
11589  @SearchParamDefinition(name="name", path="Citation.name", description="Computationally friendly name of the citation", type="string" )
11590  public static final String SP_NAME = "name";
11591 /**
11592   * <b>Fluent Client</b> search parameter constant for <b>name</b>
11593   * <p>
11594   * Description: <b>Computationally friendly name of the citation</b><br>
11595   * Type: <b>string</b><br>
11596   * Path: <b>Citation.name</b><br>
11597   * </p>
11598   */
11599  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
11600
11601 /**
11602   * Search parameter: <b>publisher</b>
11603   * <p>
11604   * Description: <b>Name of the publisher of the citation</b><br>
11605   * Type: <b>string</b><br>
11606   * Path: <b>Citation.publisher</b><br>
11607   * </p>
11608   */
11609  @SearchParamDefinition(name="publisher", path="Citation.publisher", description="Name of the publisher of the citation", type="string" )
11610  public static final String SP_PUBLISHER = "publisher";
11611 /**
11612   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
11613   * <p>
11614   * Description: <b>Name of the publisher of the citation</b><br>
11615   * Type: <b>string</b><br>
11616   * Path: <b>Citation.publisher</b><br>
11617   * </p>
11618   */
11619  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
11620
11621 /**
11622   * Search parameter: <b>status</b>
11623   * <p>
11624   * Description: <b>The current status of the citation</b><br>
11625   * Type: <b>token</b><br>
11626   * Path: <b>Citation.status</b><br>
11627   * </p>
11628   */
11629  @SearchParamDefinition(name="status", path="Citation.status", description="The current status of the citation", type="token" )
11630  public static final String SP_STATUS = "status";
11631 /**
11632   * <b>Fluent Client</b> search parameter constant for <b>status</b>
11633   * <p>
11634   * Description: <b>The current status of the citation</b><br>
11635   * Type: <b>token</b><br>
11636   * Path: <b>Citation.status</b><br>
11637   * </p>
11638   */
11639  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
11640
11641 /**
11642   * Search parameter: <b>title</b>
11643   * <p>
11644   * Description: <b>The human-friendly name of the citation</b><br>
11645   * Type: <b>string</b><br>
11646   * Path: <b>Citation.title</b><br>
11647   * </p>
11648   */
11649  @SearchParamDefinition(name="title", path="Citation.title", description="The human-friendly name of the citation", type="string" )
11650  public static final String SP_TITLE = "title";
11651 /**
11652   * <b>Fluent Client</b> search parameter constant for <b>title</b>
11653   * <p>
11654   * Description: <b>The human-friendly name of the citation</b><br>
11655   * Type: <b>string</b><br>
11656   * Path: <b>Citation.title</b><br>
11657   * </p>
11658   */
11659  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
11660
11661 /**
11662   * Search parameter: <b>url</b>
11663   * <p>
11664   * Description: <b>The uri that identifies the citation</b><br>
11665   * Type: <b>uri</b><br>
11666   * Path: <b>Citation.url</b><br>
11667   * </p>
11668   */
11669  @SearchParamDefinition(name="url", path="Citation.url", description="The uri that identifies the citation", type="uri" )
11670  public static final String SP_URL = "url";
11671 /**
11672   * <b>Fluent Client</b> search parameter constant for <b>url</b>
11673   * <p>
11674   * Description: <b>The uri that identifies the citation</b><br>
11675   * Type: <b>uri</b><br>
11676   * Path: <b>Citation.url</b><br>
11677   * </p>
11678   */
11679  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
11680
11681 /**
11682   * Search parameter: <b>version</b>
11683   * <p>
11684   * Description: <b>The business version of the citation</b><br>
11685   * Type: <b>token</b><br>
11686   * Path: <b>Citation.version</b><br>
11687   * </p>
11688   */
11689  @SearchParamDefinition(name="version", path="Citation.version", description="The business version of the citation", type="token" )
11690  public static final String SP_VERSION = "version";
11691 /**
11692   * <b>Fluent Client</b> search parameter constant for <b>version</b>
11693   * <p>
11694   * Description: <b>The business version of the citation</b><br>
11695   * Type: <b>token</b><br>
11696   * Path: <b>Citation.version</b><br>
11697   * </p>
11698   */
11699  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
11700
11701
11702}
11703