001package org.hl7.fhir.dstu3.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.1
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.dstu3.model.Enumerations.*;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046import org.hl7.fhir.exceptions.FHIRFormatError;
047/**
048 * A set of rules of how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.
049 */
050@ResourceDef(name="ImplementationGuide", profile="http://hl7.org/fhir/StructureDefinition/ImplementationGuide")
051@ChildOrder(names={"url", "version", "name", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "copyright", "fhirVersion", "dependency", "package", "global", "binary", "page"})
052public class ImplementationGuide extends MetadataResource {
053
054    public enum GuideDependencyType {
055        /**
056         * The guide is referred to by URL.
057         */
058        REFERENCE, 
059        /**
060         * The guide is embedded in this guide when published.
061         */
062        INCLUSION, 
063        /**
064         * added to help the parsers with the generic types
065         */
066        NULL;
067        public static GuideDependencyType fromCode(String codeString) throws FHIRException {
068            if (codeString == null || "".equals(codeString))
069                return null;
070        if ("reference".equals(codeString))
071          return REFERENCE;
072        if ("inclusion".equals(codeString))
073          return INCLUSION;
074        if (Configuration.isAcceptInvalidEnums())
075          return null;
076        else
077          throw new FHIRException("Unknown GuideDependencyType code '"+codeString+"'");
078        }
079        public String toCode() {
080          switch (this) {
081            case REFERENCE: return "reference";
082            case INCLUSION: return "inclusion";
083            default: return "?";
084          }
085        }
086        public String getSystem() {
087          switch (this) {
088            case REFERENCE: return "http://hl7.org/fhir/guide-dependency-type";
089            case INCLUSION: return "http://hl7.org/fhir/guide-dependency-type";
090            default: return "?";
091          }
092        }
093        public String getDefinition() {
094          switch (this) {
095            case REFERENCE: return "The guide is referred to by URL.";
096            case INCLUSION: return "The guide is embedded in this guide when published.";
097            default: return "?";
098          }
099        }
100        public String getDisplay() {
101          switch (this) {
102            case REFERENCE: return "Reference";
103            case INCLUSION: return "Inclusion";
104            default: return "?";
105          }
106        }
107    }
108
109  public static class GuideDependencyTypeEnumFactory implements EnumFactory<GuideDependencyType> {
110    public GuideDependencyType fromCode(String codeString) throws IllegalArgumentException {
111      if (codeString == null || "".equals(codeString))
112            if (codeString == null || "".equals(codeString))
113                return null;
114        if ("reference".equals(codeString))
115          return GuideDependencyType.REFERENCE;
116        if ("inclusion".equals(codeString))
117          return GuideDependencyType.INCLUSION;
118        throw new IllegalArgumentException("Unknown GuideDependencyType code '"+codeString+"'");
119        }
120        public Enumeration<GuideDependencyType> fromType(Base code) throws FHIRException {
121          if (code == null)
122            return null;
123          if (code.isEmpty())
124            return new Enumeration<GuideDependencyType>(this);
125          String codeString = ((PrimitiveType) code).asStringValue();
126          if (codeString == null || "".equals(codeString))
127            return null;
128        if ("reference".equals(codeString))
129          return new Enumeration<GuideDependencyType>(this, GuideDependencyType.REFERENCE);
130        if ("inclusion".equals(codeString))
131          return new Enumeration<GuideDependencyType>(this, GuideDependencyType.INCLUSION);
132        throw new FHIRException("Unknown GuideDependencyType code '"+codeString+"'");
133        }
134    public String toCode(GuideDependencyType code) {
135      if (code == GuideDependencyType.REFERENCE)
136        return "reference";
137      if (code == GuideDependencyType.INCLUSION)
138        return "inclusion";
139      return "?";
140      }
141    public String toSystem(GuideDependencyType code) {
142      return code.getSystem();
143      }
144    }
145
146    public enum GuidePageKind {
147        /**
148         * This is a page of content that is included in the implementation guide. It has no particular function.
149         */
150        PAGE, 
151        /**
152         * This is a page that represents a human readable rendering of an example.
153         */
154        EXAMPLE, 
155        /**
156         * This is a page that represents a list of resources of one or more types.
157         */
158        LIST, 
159        /**
160         * This is a page showing where an included guide is injected.
161         */
162        INCLUDE, 
163        /**
164         * This is a page that lists the resources of a given type, and also creates pages for all the listed types as other pages in the section.
165         */
166        DIRECTORY, 
167        /**
168         * This is a page that creates the listed resources as a dictionary.
169         */
170        DICTIONARY, 
171        /**
172         * This is a generated page that contains the table of contents.
173         */
174        TOC, 
175        /**
176         * This is a page that represents a presented resource. This is typically used for generated conformance resource presentations.
177         */
178        RESOURCE, 
179        /**
180         * added to help the parsers with the generic types
181         */
182        NULL;
183        public static GuidePageKind fromCode(String codeString) throws FHIRException {
184            if (codeString == null || "".equals(codeString))
185                return null;
186        if ("page".equals(codeString))
187          return PAGE;
188        if ("example".equals(codeString))
189          return EXAMPLE;
190        if ("list".equals(codeString))
191          return LIST;
192        if ("include".equals(codeString))
193          return INCLUDE;
194        if ("directory".equals(codeString))
195          return DIRECTORY;
196        if ("dictionary".equals(codeString))
197          return DICTIONARY;
198        if ("toc".equals(codeString))
199          return TOC;
200        if ("resource".equals(codeString))
201          return RESOURCE;
202        if (Configuration.isAcceptInvalidEnums())
203          return null;
204        else
205          throw new FHIRException("Unknown GuidePageKind code '"+codeString+"'");
206        }
207        public String toCode() {
208          switch (this) {
209            case PAGE: return "page";
210            case EXAMPLE: return "example";
211            case LIST: return "list";
212            case INCLUDE: return "include";
213            case DIRECTORY: return "directory";
214            case DICTIONARY: return "dictionary";
215            case TOC: return "toc";
216            case RESOURCE: return "resource";
217            default: return "?";
218          }
219        }
220        public String getSystem() {
221          switch (this) {
222            case PAGE: return "http://hl7.org/fhir/guide-page-kind";
223            case EXAMPLE: return "http://hl7.org/fhir/guide-page-kind";
224            case LIST: return "http://hl7.org/fhir/guide-page-kind";
225            case INCLUDE: return "http://hl7.org/fhir/guide-page-kind";
226            case DIRECTORY: return "http://hl7.org/fhir/guide-page-kind";
227            case DICTIONARY: return "http://hl7.org/fhir/guide-page-kind";
228            case TOC: return "http://hl7.org/fhir/guide-page-kind";
229            case RESOURCE: return "http://hl7.org/fhir/guide-page-kind";
230            default: return "?";
231          }
232        }
233        public String getDefinition() {
234          switch (this) {
235            case PAGE: return "This is a page of content that is included in the implementation guide. It has no particular function.";
236            case EXAMPLE: return "This is a page that represents a human readable rendering of an example.";
237            case LIST: return "This is a page that represents a list of resources of one or more types.";
238            case INCLUDE: return "This is a page showing where an included guide is injected.";
239            case DIRECTORY: return "This is a page that lists the resources of a given type, and also creates pages for all the listed types as other pages in the section.";
240            case DICTIONARY: return "This is a page that creates the listed resources as a dictionary.";
241            case TOC: return "This is a generated page that contains the table of contents.";
242            case RESOURCE: return "This is a page that represents a presented resource. This is typically used for generated conformance resource presentations.";
243            default: return "?";
244          }
245        }
246        public String getDisplay() {
247          switch (this) {
248            case PAGE: return "Page";
249            case EXAMPLE: return "Example";
250            case LIST: return "List";
251            case INCLUDE: return "Include";
252            case DIRECTORY: return "Directory";
253            case DICTIONARY: return "Dictionary";
254            case TOC: return "Table Of Contents";
255            case RESOURCE: return "Resource";
256            default: return "?";
257          }
258        }
259    }
260
261  public static class GuidePageKindEnumFactory implements EnumFactory<GuidePageKind> {
262    public GuidePageKind fromCode(String codeString) throws IllegalArgumentException {
263      if (codeString == null || "".equals(codeString))
264            if (codeString == null || "".equals(codeString))
265                return null;
266        if ("page".equals(codeString))
267          return GuidePageKind.PAGE;
268        if ("example".equals(codeString))
269          return GuidePageKind.EXAMPLE;
270        if ("list".equals(codeString))
271          return GuidePageKind.LIST;
272        if ("include".equals(codeString))
273          return GuidePageKind.INCLUDE;
274        if ("directory".equals(codeString))
275          return GuidePageKind.DIRECTORY;
276        if ("dictionary".equals(codeString))
277          return GuidePageKind.DICTIONARY;
278        if ("toc".equals(codeString))
279          return GuidePageKind.TOC;
280        if ("resource".equals(codeString))
281          return GuidePageKind.RESOURCE;
282        throw new IllegalArgumentException("Unknown GuidePageKind code '"+codeString+"'");
283        }
284        public Enumeration<GuidePageKind> fromType(Base code) throws FHIRException {
285          if (code == null)
286            return null;
287          if (code.isEmpty())
288            return new Enumeration<GuidePageKind>(this);
289          String codeString = ((PrimitiveType) code).asStringValue();
290          if (codeString == null || "".equals(codeString))
291            return null;
292        if ("page".equals(codeString))
293          return new Enumeration<GuidePageKind>(this, GuidePageKind.PAGE);
294        if ("example".equals(codeString))
295          return new Enumeration<GuidePageKind>(this, GuidePageKind.EXAMPLE);
296        if ("list".equals(codeString))
297          return new Enumeration<GuidePageKind>(this, GuidePageKind.LIST);
298        if ("include".equals(codeString))
299          return new Enumeration<GuidePageKind>(this, GuidePageKind.INCLUDE);
300        if ("directory".equals(codeString))
301          return new Enumeration<GuidePageKind>(this, GuidePageKind.DIRECTORY);
302        if ("dictionary".equals(codeString))
303          return new Enumeration<GuidePageKind>(this, GuidePageKind.DICTIONARY);
304        if ("toc".equals(codeString))
305          return new Enumeration<GuidePageKind>(this, GuidePageKind.TOC);
306        if ("resource".equals(codeString))
307          return new Enumeration<GuidePageKind>(this, GuidePageKind.RESOURCE);
308        throw new FHIRException("Unknown GuidePageKind code '"+codeString+"'");
309        }
310    public String toCode(GuidePageKind code) {
311      if (code == GuidePageKind.PAGE)
312        return "page";
313      if (code == GuidePageKind.EXAMPLE)
314        return "example";
315      if (code == GuidePageKind.LIST)
316        return "list";
317      if (code == GuidePageKind.INCLUDE)
318        return "include";
319      if (code == GuidePageKind.DIRECTORY)
320        return "directory";
321      if (code == GuidePageKind.DICTIONARY)
322        return "dictionary";
323      if (code == GuidePageKind.TOC)
324        return "toc";
325      if (code == GuidePageKind.RESOURCE)
326        return "resource";
327      return "?";
328      }
329    public String toSystem(GuidePageKind code) {
330      return code.getSystem();
331      }
332    }
333
334    @Block()
335    public static class ImplementationGuideDependencyComponent extends BackboneElement implements IBaseBackboneElement {
336        /**
337         * How the dependency is represented when the guide is published.
338         */
339        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
340        @Description(shortDefinition="reference | inclusion", formalDefinition="How the dependency is represented when the guide is published." )
341        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/guide-dependency-type")
342        protected Enumeration<GuideDependencyType> type;
343
344        /**
345         * Where the dependency is located.
346         */
347        @Child(name = "uri", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true)
348        @Description(shortDefinition="Where to find dependency", formalDefinition="Where the dependency is located." )
349        protected UriType uri;
350
351        private static final long serialVersionUID = 162447098L;
352
353    /**
354     * Constructor
355     */
356      public ImplementationGuideDependencyComponent() {
357        super();
358      }
359
360    /**
361     * Constructor
362     */
363      public ImplementationGuideDependencyComponent(Enumeration<GuideDependencyType> type, UriType uri) {
364        super();
365        this.type = type;
366        this.uri = uri;
367      }
368
369        /**
370         * @return {@link #type} (How the dependency is represented when the guide is published.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
371         */
372        public Enumeration<GuideDependencyType> getTypeElement() { 
373          if (this.type == null)
374            if (Configuration.errorOnAutoCreate())
375              throw new Error("Attempt to auto-create ImplementationGuideDependencyComponent.type");
376            else if (Configuration.doAutoCreate())
377              this.type = new Enumeration<GuideDependencyType>(new GuideDependencyTypeEnumFactory()); // bb
378          return this.type;
379        }
380
381        public boolean hasTypeElement() { 
382          return this.type != null && !this.type.isEmpty();
383        }
384
385        public boolean hasType() { 
386          return this.type != null && !this.type.isEmpty();
387        }
388
389        /**
390         * @param value {@link #type} (How the dependency is represented when the guide is published.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
391         */
392        public ImplementationGuideDependencyComponent setTypeElement(Enumeration<GuideDependencyType> value) { 
393          this.type = value;
394          return this;
395        }
396
397        /**
398         * @return How the dependency is represented when the guide is published.
399         */
400        public GuideDependencyType getType() { 
401          return this.type == null ? null : this.type.getValue();
402        }
403
404        /**
405         * @param value How the dependency is represented when the guide is published.
406         */
407        public ImplementationGuideDependencyComponent setType(GuideDependencyType value) { 
408            if (this.type == null)
409              this.type = new Enumeration<GuideDependencyType>(new GuideDependencyTypeEnumFactory());
410            this.type.setValue(value);
411          return this;
412        }
413
414        /**
415         * @return {@link #uri} (Where the dependency is located.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
416         */
417        public UriType getUriElement() { 
418          if (this.uri == null)
419            if (Configuration.errorOnAutoCreate())
420              throw new Error("Attempt to auto-create ImplementationGuideDependencyComponent.uri");
421            else if (Configuration.doAutoCreate())
422              this.uri = new UriType(); // bb
423          return this.uri;
424        }
425
426        public boolean hasUriElement() { 
427          return this.uri != null && !this.uri.isEmpty();
428        }
429
430        public boolean hasUri() { 
431          return this.uri != null && !this.uri.isEmpty();
432        }
433
434        /**
435         * @param value {@link #uri} (Where the dependency is located.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
436         */
437        public ImplementationGuideDependencyComponent setUriElement(UriType value) { 
438          this.uri = value;
439          return this;
440        }
441
442        /**
443         * @return Where the dependency is located.
444         */
445        public String getUri() { 
446          return this.uri == null ? null : this.uri.getValue();
447        }
448
449        /**
450         * @param value Where the dependency is located.
451         */
452        public ImplementationGuideDependencyComponent setUri(String value) { 
453            if (this.uri == null)
454              this.uri = new UriType();
455            this.uri.setValue(value);
456          return this;
457        }
458
459        protected void listChildren(List<Property> children) {
460          super.listChildren(children);
461          children.add(new Property("type", "code", "How the dependency is represented when the guide is published.", 0, 1, type));
462          children.add(new Property("uri", "uri", "Where the dependency is located.", 0, 1, uri));
463        }
464
465        @Override
466        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
467          switch (_hash) {
468          case 3575610: /*type*/  return new Property("type", "code", "How the dependency is represented when the guide is published.", 0, 1, type);
469          case 116076: /*uri*/  return new Property("uri", "uri", "Where the dependency is located.", 0, 1, uri);
470          default: return super.getNamedProperty(_hash, _name, _checkValid);
471          }
472
473        }
474
475      @Override
476      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
477        switch (hash) {
478        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<GuideDependencyType>
479        case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // UriType
480        default: return super.getProperty(hash, name, checkValid);
481        }
482
483      }
484
485      @Override
486      public Base setProperty(int hash, String name, Base value) throws FHIRException {
487        switch (hash) {
488        case 3575610: // type
489          value = new GuideDependencyTypeEnumFactory().fromType(castToCode(value));
490          this.type = (Enumeration) value; // Enumeration<GuideDependencyType>
491          return value;
492        case 116076: // uri
493          this.uri = castToUri(value); // UriType
494          return value;
495        default: return super.setProperty(hash, name, value);
496        }
497
498      }
499
500      @Override
501      public Base setProperty(String name, Base value) throws FHIRException {
502        if (name.equals("type")) {
503          value = new GuideDependencyTypeEnumFactory().fromType(castToCode(value));
504          this.type = (Enumeration) value; // Enumeration<GuideDependencyType>
505        } else if (name.equals("uri")) {
506          this.uri = castToUri(value); // UriType
507        } else
508          return super.setProperty(name, value);
509        return value;
510      }
511
512      @Override
513      public Base makeProperty(int hash, String name) throws FHIRException {
514        switch (hash) {
515        case 3575610:  return getTypeElement();
516        case 116076:  return getUriElement();
517        default: return super.makeProperty(hash, name);
518        }
519
520      }
521
522      @Override
523      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
524        switch (hash) {
525        case 3575610: /*type*/ return new String[] {"code"};
526        case 116076: /*uri*/ return new String[] {"uri"};
527        default: return super.getTypesForProperty(hash, name);
528        }
529
530      }
531
532      @Override
533      public Base addChild(String name) throws FHIRException {
534        if (name.equals("type")) {
535          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.type");
536        }
537        else if (name.equals("uri")) {
538          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.uri");
539        }
540        else
541          return super.addChild(name);
542      }
543
544      public ImplementationGuideDependencyComponent copy() {
545        ImplementationGuideDependencyComponent dst = new ImplementationGuideDependencyComponent();
546        copyValues(dst);
547        dst.type = type == null ? null : type.copy();
548        dst.uri = uri == null ? null : uri.copy();
549        return dst;
550      }
551
552      @Override
553      public boolean equalsDeep(Base other_) {
554        if (!super.equalsDeep(other_))
555          return false;
556        if (!(other_ instanceof ImplementationGuideDependencyComponent))
557          return false;
558        ImplementationGuideDependencyComponent o = (ImplementationGuideDependencyComponent) other_;
559        return compareDeep(type, o.type, true) && compareDeep(uri, o.uri, true);
560      }
561
562      @Override
563      public boolean equalsShallow(Base other_) {
564        if (!super.equalsShallow(other_))
565          return false;
566        if (!(other_ instanceof ImplementationGuideDependencyComponent))
567          return false;
568        ImplementationGuideDependencyComponent o = (ImplementationGuideDependencyComponent) other_;
569        return compareValues(type, o.type, true) && compareValues(uri, o.uri, true);
570      }
571
572      public boolean isEmpty() {
573        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, uri);
574      }
575
576  public String fhirType() {
577    return "ImplementationGuide.dependency";
578
579  }
580
581  }
582
583    @Block()
584    public static class ImplementationGuidePackageComponent extends BackboneElement implements IBaseBackboneElement {
585        /**
586         * The name for the group, as used in page.package.
587         */
588        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
589        @Description(shortDefinition="Name used .page.package", formalDefinition="The name for the group, as used in page.package." )
590        protected StringType name;
591
592        /**
593         * Human readable text describing the package.
594         */
595        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
596        @Description(shortDefinition="Human readable text describing the package", formalDefinition="Human readable text describing the package." )
597        protected StringType description;
598
599        /**
600         * A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.
601         */
602        @Child(name = "resource", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
603        @Description(shortDefinition="Resource in the implementation guide", formalDefinition="A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource." )
604        protected List<ImplementationGuidePackageResourceComponent> resource;
605
606        private static final long serialVersionUID = -701846580L;
607
608    /**
609     * Constructor
610     */
611      public ImplementationGuidePackageComponent() {
612        super();
613      }
614
615    /**
616     * Constructor
617     */
618      public ImplementationGuidePackageComponent(StringType name) {
619        super();
620        this.name = name;
621      }
622
623        /**
624         * @return {@link #name} (The name for the group, as used in page.package.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
625         */
626        public StringType getNameElement() { 
627          if (this.name == null)
628            if (Configuration.errorOnAutoCreate())
629              throw new Error("Attempt to auto-create ImplementationGuidePackageComponent.name");
630            else if (Configuration.doAutoCreate())
631              this.name = new StringType(); // bb
632          return this.name;
633        }
634
635        public boolean hasNameElement() { 
636          return this.name != null && !this.name.isEmpty();
637        }
638
639        public boolean hasName() { 
640          return this.name != null && !this.name.isEmpty();
641        }
642
643        /**
644         * @param value {@link #name} (The name for the group, as used in page.package.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
645         */
646        public ImplementationGuidePackageComponent setNameElement(StringType value) { 
647          this.name = value;
648          return this;
649        }
650
651        /**
652         * @return The name for the group, as used in page.package.
653         */
654        public String getName() { 
655          return this.name == null ? null : this.name.getValue();
656        }
657
658        /**
659         * @param value The name for the group, as used in page.package.
660         */
661        public ImplementationGuidePackageComponent setName(String value) { 
662            if (this.name == null)
663              this.name = new StringType();
664            this.name.setValue(value);
665          return this;
666        }
667
668        /**
669         * @return {@link #description} (Human readable text describing the package.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
670         */
671        public StringType getDescriptionElement() { 
672          if (this.description == null)
673            if (Configuration.errorOnAutoCreate())
674              throw new Error("Attempt to auto-create ImplementationGuidePackageComponent.description");
675            else if (Configuration.doAutoCreate())
676              this.description = new StringType(); // bb
677          return this.description;
678        }
679
680        public boolean hasDescriptionElement() { 
681          return this.description != null && !this.description.isEmpty();
682        }
683
684        public boolean hasDescription() { 
685          return this.description != null && !this.description.isEmpty();
686        }
687
688        /**
689         * @param value {@link #description} (Human readable text describing the package.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
690         */
691        public ImplementationGuidePackageComponent setDescriptionElement(StringType value) { 
692          this.description = value;
693          return this;
694        }
695
696        /**
697         * @return Human readable text describing the package.
698         */
699        public String getDescription() { 
700          return this.description == null ? null : this.description.getValue();
701        }
702
703        /**
704         * @param value Human readable text describing the package.
705         */
706        public ImplementationGuidePackageComponent setDescription(String value) { 
707          if (Utilities.noString(value))
708            this.description = null;
709          else {
710            if (this.description == null)
711              this.description = new StringType();
712            this.description.setValue(value);
713          }
714          return this;
715        }
716
717        /**
718         * @return {@link #resource} (A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.)
719         */
720        public List<ImplementationGuidePackageResourceComponent> getResource() { 
721          if (this.resource == null)
722            this.resource = new ArrayList<ImplementationGuidePackageResourceComponent>();
723          return this.resource;
724        }
725
726        /**
727         * @return Returns a reference to <code>this</code> for easy method chaining
728         */
729        public ImplementationGuidePackageComponent setResource(List<ImplementationGuidePackageResourceComponent> theResource) { 
730          this.resource = theResource;
731          return this;
732        }
733
734        public boolean hasResource() { 
735          if (this.resource == null)
736            return false;
737          for (ImplementationGuidePackageResourceComponent item : this.resource)
738            if (!item.isEmpty())
739              return true;
740          return false;
741        }
742
743        public ImplementationGuidePackageResourceComponent addResource() { //3
744          ImplementationGuidePackageResourceComponent t = new ImplementationGuidePackageResourceComponent();
745          if (this.resource == null)
746            this.resource = new ArrayList<ImplementationGuidePackageResourceComponent>();
747          this.resource.add(t);
748          return t;
749        }
750
751        public ImplementationGuidePackageComponent addResource(ImplementationGuidePackageResourceComponent t) { //3
752          if (t == null)
753            return this;
754          if (this.resource == null)
755            this.resource = new ArrayList<ImplementationGuidePackageResourceComponent>();
756          this.resource.add(t);
757          return this;
758        }
759
760        /**
761         * @return The first repetition of repeating field {@link #resource}, creating it if it does not already exist
762         */
763        public ImplementationGuidePackageResourceComponent getResourceFirstRep() { 
764          if (getResource().isEmpty()) {
765            addResource();
766          }
767          return getResource().get(0);
768        }
769
770        protected void listChildren(List<Property> children) {
771          super.listChildren(children);
772          children.add(new Property("name", "string", "The name for the group, as used in page.package.", 0, 1, name));
773          children.add(new Property("description", "string", "Human readable text describing the package.", 0, 1, description));
774          children.add(new Property("resource", "", "A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.", 0, java.lang.Integer.MAX_VALUE, resource));
775        }
776
777        @Override
778        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
779          switch (_hash) {
780          case 3373707: /*name*/  return new Property("name", "string", "The name for the group, as used in page.package.", 0, 1, name);
781          case -1724546052: /*description*/  return new Property("description", "string", "Human readable text describing the package.", 0, 1, description);
782          case -341064690: /*resource*/  return new Property("resource", "", "A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.", 0, java.lang.Integer.MAX_VALUE, resource);
783          default: return super.getNamedProperty(_hash, _name, _checkValid);
784          }
785
786        }
787
788      @Override
789      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
790        switch (hash) {
791        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
792        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
793        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : this.resource.toArray(new Base[this.resource.size()]); // ImplementationGuidePackageResourceComponent
794        default: return super.getProperty(hash, name, checkValid);
795        }
796
797      }
798
799      @Override
800      public Base setProperty(int hash, String name, Base value) throws FHIRException {
801        switch (hash) {
802        case 3373707: // name
803          this.name = castToString(value); // StringType
804          return value;
805        case -1724546052: // description
806          this.description = castToString(value); // StringType
807          return value;
808        case -341064690: // resource
809          this.getResource().add((ImplementationGuidePackageResourceComponent) value); // ImplementationGuidePackageResourceComponent
810          return value;
811        default: return super.setProperty(hash, name, value);
812        }
813
814      }
815
816      @Override
817      public Base setProperty(String name, Base value) throws FHIRException {
818        if (name.equals("name")) {
819          this.name = castToString(value); // StringType
820        } else if (name.equals("description")) {
821          this.description = castToString(value); // StringType
822        } else if (name.equals("resource")) {
823          this.getResource().add((ImplementationGuidePackageResourceComponent) value);
824        } else
825          return super.setProperty(name, value);
826        return value;
827      }
828
829      @Override
830      public Base makeProperty(int hash, String name) throws FHIRException {
831        switch (hash) {
832        case 3373707:  return getNameElement();
833        case -1724546052:  return getDescriptionElement();
834        case -341064690:  return addResource(); 
835        default: return super.makeProperty(hash, name);
836        }
837
838      }
839
840      @Override
841      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
842        switch (hash) {
843        case 3373707: /*name*/ return new String[] {"string"};
844        case -1724546052: /*description*/ return new String[] {"string"};
845        case -341064690: /*resource*/ return new String[] {};
846        default: return super.getTypesForProperty(hash, name);
847        }
848
849      }
850
851      @Override
852      public Base addChild(String name) throws FHIRException {
853        if (name.equals("name")) {
854          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.name");
855        }
856        else if (name.equals("description")) {
857          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.description");
858        }
859        else if (name.equals("resource")) {
860          return addResource();
861        }
862        else
863          return super.addChild(name);
864      }
865
866      public ImplementationGuidePackageComponent copy() {
867        ImplementationGuidePackageComponent dst = new ImplementationGuidePackageComponent();
868        copyValues(dst);
869        dst.name = name == null ? null : name.copy();
870        dst.description = description == null ? null : description.copy();
871        if (resource != null) {
872          dst.resource = new ArrayList<ImplementationGuidePackageResourceComponent>();
873          for (ImplementationGuidePackageResourceComponent i : resource)
874            dst.resource.add(i.copy());
875        };
876        return dst;
877      }
878
879      @Override
880      public boolean equalsDeep(Base other_) {
881        if (!super.equalsDeep(other_))
882          return false;
883        if (!(other_ instanceof ImplementationGuidePackageComponent))
884          return false;
885        ImplementationGuidePackageComponent o = (ImplementationGuidePackageComponent) other_;
886        return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(resource, o.resource, true)
887          ;
888      }
889
890      @Override
891      public boolean equalsShallow(Base other_) {
892        if (!super.equalsShallow(other_))
893          return false;
894        if (!(other_ instanceof ImplementationGuidePackageComponent))
895          return false;
896        ImplementationGuidePackageComponent o = (ImplementationGuidePackageComponent) other_;
897        return compareValues(name, o.name, true) && compareValues(description, o.description, true);
898      }
899
900      public boolean isEmpty() {
901        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, description, resource
902          );
903      }
904
905  public String fhirType() {
906    return "ImplementationGuide.package";
907
908  }
909
910  }
911
912    @Block()
913    public static class ImplementationGuidePackageResourceComponent extends BackboneElement implements IBaseBackboneElement {
914        /**
915         * Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.
916         */
917        @Child(name = "example", type = {BooleanType.class}, order=1, min=1, max=1, modifier=false, summary=true)
918        @Description(shortDefinition="If not an example, has its normal meaning", formalDefinition="Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide." )
919        protected BooleanType example;
920
921        /**
922         * A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).
923         */
924        @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
925        @Description(shortDefinition="Human Name for the resource", formalDefinition="A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name)." )
926        protected StringType name;
927
928        /**
929         * A description of the reason that a resource has been included in the implementation guide.
930         */
931        @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
932        @Description(shortDefinition="Reason why included in guide", formalDefinition="A description of the reason that a resource has been included in the implementation guide." )
933        protected StringType description;
934
935        /**
936         * A short code that may be used to identify the resource throughout the implementation guide.
937         */
938        @Child(name = "acronym", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
939        @Description(shortDefinition="Short code to identify the resource", formalDefinition="A short code that may be used to identify the resource throughout the implementation guide." )
940        protected StringType acronym;
941
942        /**
943         * Where this resource is found.
944         */
945        @Child(name = "source", type = {UriType.class, Reference.class}, order=5, min=1, max=1, modifier=false, summary=true)
946        @Description(shortDefinition="Location of the resource", formalDefinition="Where this resource is found." )
947        protected Type source;
948
949        /**
950         * Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.
951         */
952        @Child(name = "exampleFor", type = {StructureDefinition.class}, order=6, min=0, max=1, modifier=false, summary=false)
953        @Description(shortDefinition="Resource this is an example of (if applicable)", formalDefinition="Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions." )
954        protected Reference exampleFor;
955
956        /**
957         * The actual object that is the target of the reference (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.)
958         */
959        protected StructureDefinition exampleForTarget;
960
961        private static final long serialVersionUID = 2085404852L;
962
963    /**
964     * Constructor
965     */
966      public ImplementationGuidePackageResourceComponent() {
967        super();
968      }
969
970    /**
971     * Constructor
972     */
973      public ImplementationGuidePackageResourceComponent(BooleanType example, Type source) {
974        super();
975        this.example = example;
976        this.source = source;
977      }
978
979        /**
980         * @return {@link #example} (Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.). This is the underlying object with id, value and extensions. The accessor "getExample" gives direct access to the value
981         */
982        public BooleanType getExampleElement() { 
983          if (this.example == null)
984            if (Configuration.errorOnAutoCreate())
985              throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.example");
986            else if (Configuration.doAutoCreate())
987              this.example = new BooleanType(); // bb
988          return this.example;
989        }
990
991        public boolean hasExampleElement() { 
992          return this.example != null && !this.example.isEmpty();
993        }
994
995        public boolean hasExample() { 
996          return this.example != null && !this.example.isEmpty();
997        }
998
999        /**
1000         * @param value {@link #example} (Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.). This is the underlying object with id, value and extensions. The accessor "getExample" gives direct access to the value
1001         */
1002        public ImplementationGuidePackageResourceComponent setExampleElement(BooleanType value) { 
1003          this.example = value;
1004          return this;
1005        }
1006
1007        /**
1008         * @return Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.
1009         */
1010        public boolean getExample() { 
1011          return this.example == null || this.example.isEmpty() ? false : this.example.getValue();
1012        }
1013
1014        /**
1015         * @param value Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.
1016         */
1017        public ImplementationGuidePackageResourceComponent setExample(boolean value) { 
1018            if (this.example == null)
1019              this.example = new BooleanType();
1020            this.example.setValue(value);
1021          return this;
1022        }
1023
1024        /**
1025         * @return {@link #name} (A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1026         */
1027        public StringType getNameElement() { 
1028          if (this.name == null)
1029            if (Configuration.errorOnAutoCreate())
1030              throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.name");
1031            else if (Configuration.doAutoCreate())
1032              this.name = new StringType(); // bb
1033          return this.name;
1034        }
1035
1036        public boolean hasNameElement() { 
1037          return this.name != null && !this.name.isEmpty();
1038        }
1039
1040        public boolean hasName() { 
1041          return this.name != null && !this.name.isEmpty();
1042        }
1043
1044        /**
1045         * @param value {@link #name} (A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1046         */
1047        public ImplementationGuidePackageResourceComponent setNameElement(StringType value) { 
1048          this.name = value;
1049          return this;
1050        }
1051
1052        /**
1053         * @return A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).
1054         */
1055        public String getName() { 
1056          return this.name == null ? null : this.name.getValue();
1057        }
1058
1059        /**
1060         * @param value A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).
1061         */
1062        public ImplementationGuidePackageResourceComponent setName(String value) { 
1063          if (Utilities.noString(value))
1064            this.name = null;
1065          else {
1066            if (this.name == null)
1067              this.name = new StringType();
1068            this.name.setValue(value);
1069          }
1070          return this;
1071        }
1072
1073        /**
1074         * @return {@link #description} (A description of the reason that a resource has been included in the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1075         */
1076        public StringType getDescriptionElement() { 
1077          if (this.description == null)
1078            if (Configuration.errorOnAutoCreate())
1079              throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.description");
1080            else if (Configuration.doAutoCreate())
1081              this.description = new StringType(); // bb
1082          return this.description;
1083        }
1084
1085        public boolean hasDescriptionElement() { 
1086          return this.description != null && !this.description.isEmpty();
1087        }
1088
1089        public boolean hasDescription() { 
1090          return this.description != null && !this.description.isEmpty();
1091        }
1092
1093        /**
1094         * @param value {@link #description} (A description of the reason that a resource has been included in the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1095         */
1096        public ImplementationGuidePackageResourceComponent setDescriptionElement(StringType value) { 
1097          this.description = value;
1098          return this;
1099        }
1100
1101        /**
1102         * @return A description of the reason that a resource has been included in the implementation guide.
1103         */
1104        public String getDescription() { 
1105          return this.description == null ? null : this.description.getValue();
1106        }
1107
1108        /**
1109         * @param value A description of the reason that a resource has been included in the implementation guide.
1110         */
1111        public ImplementationGuidePackageResourceComponent setDescription(String value) { 
1112          if (Utilities.noString(value))
1113            this.description = null;
1114          else {
1115            if (this.description == null)
1116              this.description = new StringType();
1117            this.description.setValue(value);
1118          }
1119          return this;
1120        }
1121
1122        /**
1123         * @return {@link #acronym} (A short code that may be used to identify the resource throughout the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getAcronym" gives direct access to the value
1124         */
1125        public StringType getAcronymElement() { 
1126          if (this.acronym == null)
1127            if (Configuration.errorOnAutoCreate())
1128              throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.acronym");
1129            else if (Configuration.doAutoCreate())
1130              this.acronym = new StringType(); // bb
1131          return this.acronym;
1132        }
1133
1134        public boolean hasAcronymElement() { 
1135          return this.acronym != null && !this.acronym.isEmpty();
1136        }
1137
1138        public boolean hasAcronym() { 
1139          return this.acronym != null && !this.acronym.isEmpty();
1140        }
1141
1142        /**
1143         * @param value {@link #acronym} (A short code that may be used to identify the resource throughout the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getAcronym" gives direct access to the value
1144         */
1145        public ImplementationGuidePackageResourceComponent setAcronymElement(StringType value) { 
1146          this.acronym = value;
1147          return this;
1148        }
1149
1150        /**
1151         * @return A short code that may be used to identify the resource throughout the implementation guide.
1152         */
1153        public String getAcronym() { 
1154          return this.acronym == null ? null : this.acronym.getValue();
1155        }
1156
1157        /**
1158         * @param value A short code that may be used to identify the resource throughout the implementation guide.
1159         */
1160        public ImplementationGuidePackageResourceComponent setAcronym(String value) { 
1161          if (Utilities.noString(value))
1162            this.acronym = null;
1163          else {
1164            if (this.acronym == null)
1165              this.acronym = new StringType();
1166            this.acronym.setValue(value);
1167          }
1168          return this;
1169        }
1170
1171        /**
1172         * @return {@link #source} (Where this resource is found.)
1173         */
1174        public Type getSource() { 
1175          return this.source;
1176        }
1177
1178        /**
1179         * @return {@link #source} (Where this resource is found.)
1180         */
1181        public UriType getSourceUriType() throws FHIRException { 
1182          if (this.source == null)
1183            return null;
1184          if (!(this.source instanceof UriType))
1185            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.source.getClass().getName()+" was encountered");
1186          return (UriType) this.source;
1187        }
1188
1189        public boolean hasSourceUriType() { 
1190          return this != null && this.source instanceof UriType;
1191        }
1192
1193        /**
1194         * @return {@link #source} (Where this resource is found.)
1195         */
1196        public Reference getSourceReference() throws FHIRException { 
1197          if (this.source == null)
1198            return null;
1199          if (!(this.source instanceof Reference))
1200            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.source.getClass().getName()+" was encountered");
1201          return (Reference) this.source;
1202        }
1203
1204        public boolean hasSourceReference() { 
1205          return this != null && this.source instanceof Reference;
1206        }
1207
1208        public boolean hasSource() { 
1209          return this.source != null && !this.source.isEmpty();
1210        }
1211
1212        /**
1213         * @param value {@link #source} (Where this resource is found.)
1214         */
1215        public ImplementationGuidePackageResourceComponent setSource(Type value) throws FHIRFormatError { 
1216          if (value != null && !(value instanceof UriType || value instanceof Reference))
1217            throw new FHIRFormatError("Not the right type for ImplementationGuide.package.resource.source[x]: "+value.fhirType());
1218          this.source = value;
1219          return this;
1220        }
1221
1222        /**
1223         * @return {@link #exampleFor} (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.)
1224         */
1225        public Reference getExampleFor() { 
1226          if (this.exampleFor == null)
1227            if (Configuration.errorOnAutoCreate())
1228              throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.exampleFor");
1229            else if (Configuration.doAutoCreate())
1230              this.exampleFor = new Reference(); // cc
1231          return this.exampleFor;
1232        }
1233
1234        public boolean hasExampleFor() { 
1235          return this.exampleFor != null && !this.exampleFor.isEmpty();
1236        }
1237
1238        /**
1239         * @param value {@link #exampleFor} (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.)
1240         */
1241        public ImplementationGuidePackageResourceComponent setExampleFor(Reference value)  { 
1242          this.exampleFor = value;
1243          return this;
1244        }
1245
1246        /**
1247         * @return {@link #exampleFor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.)
1248         */
1249        public StructureDefinition getExampleForTarget() { 
1250          if (this.exampleForTarget == null)
1251            if (Configuration.errorOnAutoCreate())
1252              throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.exampleFor");
1253            else if (Configuration.doAutoCreate())
1254              this.exampleForTarget = new StructureDefinition(); // aa
1255          return this.exampleForTarget;
1256        }
1257
1258        /**
1259         * @param value {@link #exampleFor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.)
1260         */
1261        public ImplementationGuidePackageResourceComponent setExampleForTarget(StructureDefinition value) { 
1262          this.exampleForTarget = value;
1263          return this;
1264        }
1265
1266        protected void listChildren(List<Property> children) {
1267          super.listChildren(children);
1268          children.add(new Property("example", "boolean", "Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.", 0, 1, example));
1269          children.add(new Property("name", "string", "A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).", 0, 1, name));
1270          children.add(new Property("description", "string", "A description of the reason that a resource has been included in the implementation guide.", 0, 1, description));
1271          children.add(new Property("acronym", "string", "A short code that may be used to identify the resource throughout the implementation guide.", 0, 1, acronym));
1272          children.add(new Property("source[x]", "uri|Reference(Any)", "Where this resource is found.", 0, 1, source));
1273          children.add(new Property("exampleFor", "Reference(StructureDefinition)", "Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.", 0, 1, exampleFor));
1274        }
1275
1276        @Override
1277        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1278          switch (_hash) {
1279          case -1322970774: /*example*/  return new Property("example", "boolean", "Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.", 0, 1, example);
1280          case 3373707: /*name*/  return new Property("name", "string", "A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).", 0, 1, name);
1281          case -1724546052: /*description*/  return new Property("description", "string", "A description of the reason that a resource has been included in the implementation guide.", 0, 1, description);
1282          case -1163472445: /*acronym*/  return new Property("acronym", "string", "A short code that may be used to identify the resource throughout the implementation guide.", 0, 1, acronym);
1283          case -1698413947: /*source[x]*/  return new Property("source[x]", "uri|Reference(Any)", "Where this resource is found.", 0, 1, source);
1284          case -896505829: /*source*/  return new Property("source[x]", "uri|Reference(Any)", "Where this resource is found.", 0, 1, source);
1285          case -1698419887: /*sourceUri*/  return new Property("source[x]", "uri|Reference(Any)", "Where this resource is found.", 0, 1, source);
1286          case -244259472: /*sourceReference*/  return new Property("source[x]", "uri|Reference(Any)", "Where this resource is found.", 0, 1, source);
1287          case -2002349313: /*exampleFor*/  return new Property("exampleFor", "Reference(StructureDefinition)", "Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.", 0, 1, exampleFor);
1288          default: return super.getNamedProperty(_hash, _name, _checkValid);
1289          }
1290
1291        }
1292
1293      @Override
1294      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1295        switch (hash) {
1296        case -1322970774: /*example*/ return this.example == null ? new Base[0] : new Base[] {this.example}; // BooleanType
1297        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1298        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1299        case -1163472445: /*acronym*/ return this.acronym == null ? new Base[0] : new Base[] {this.acronym}; // StringType
1300        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Type
1301        case -2002349313: /*exampleFor*/ return this.exampleFor == null ? new Base[0] : new Base[] {this.exampleFor}; // Reference
1302        default: return super.getProperty(hash, name, checkValid);
1303        }
1304
1305      }
1306
1307      @Override
1308      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1309        switch (hash) {
1310        case -1322970774: // example
1311          this.example = castToBoolean(value); // BooleanType
1312          return value;
1313        case 3373707: // name
1314          this.name = castToString(value); // StringType
1315          return value;
1316        case -1724546052: // description
1317          this.description = castToString(value); // StringType
1318          return value;
1319        case -1163472445: // acronym
1320          this.acronym = castToString(value); // StringType
1321          return value;
1322        case -896505829: // source
1323          this.source = castToType(value); // Type
1324          return value;
1325        case -2002349313: // exampleFor
1326          this.exampleFor = castToReference(value); // Reference
1327          return value;
1328        default: return super.setProperty(hash, name, value);
1329        }
1330
1331      }
1332
1333      @Override
1334      public Base setProperty(String name, Base value) throws FHIRException {
1335        if (name.equals("example")) {
1336          this.example = castToBoolean(value); // BooleanType
1337        } else if (name.equals("name")) {
1338          this.name = castToString(value); // StringType
1339        } else if (name.equals("description")) {
1340          this.description = castToString(value); // StringType
1341        } else if (name.equals("acronym")) {
1342          this.acronym = castToString(value); // StringType
1343        } else if (name.equals("source[x]")) {
1344          this.source = castToType(value); // Type
1345        } else if (name.equals("exampleFor")) {
1346          this.exampleFor = castToReference(value); // Reference
1347        } else
1348          return super.setProperty(name, value);
1349        return value;
1350      }
1351
1352      @Override
1353      public Base makeProperty(int hash, String name) throws FHIRException {
1354        switch (hash) {
1355        case -1322970774:  return getExampleElement();
1356        case 3373707:  return getNameElement();
1357        case -1724546052:  return getDescriptionElement();
1358        case -1163472445:  return getAcronymElement();
1359        case -1698413947:  return getSource(); 
1360        case -896505829:  return getSource(); 
1361        case -2002349313:  return getExampleFor(); 
1362        default: return super.makeProperty(hash, name);
1363        }
1364
1365      }
1366
1367      @Override
1368      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1369        switch (hash) {
1370        case -1322970774: /*example*/ return new String[] {"boolean"};
1371        case 3373707: /*name*/ return new String[] {"string"};
1372        case -1724546052: /*description*/ return new String[] {"string"};
1373        case -1163472445: /*acronym*/ return new String[] {"string"};
1374        case -896505829: /*source*/ return new String[] {"uri", "Reference"};
1375        case -2002349313: /*exampleFor*/ return new String[] {"Reference"};
1376        default: return super.getTypesForProperty(hash, name);
1377        }
1378
1379      }
1380
1381      @Override
1382      public Base addChild(String name) throws FHIRException {
1383        if (name.equals("example")) {
1384          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.example");
1385        }
1386        else if (name.equals("name")) {
1387          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.name");
1388        }
1389        else if (name.equals("description")) {
1390          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.description");
1391        }
1392        else if (name.equals("acronym")) {
1393          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.acronym");
1394        }
1395        else if (name.equals("sourceUri")) {
1396          this.source = new UriType();
1397          return this.source;
1398        }
1399        else if (name.equals("sourceReference")) {
1400          this.source = new Reference();
1401          return this.source;
1402        }
1403        else if (name.equals("exampleFor")) {
1404          this.exampleFor = new Reference();
1405          return this.exampleFor;
1406        }
1407        else
1408          return super.addChild(name);
1409      }
1410
1411      public ImplementationGuidePackageResourceComponent copy() {
1412        ImplementationGuidePackageResourceComponent dst = new ImplementationGuidePackageResourceComponent();
1413        copyValues(dst);
1414        dst.example = example == null ? null : example.copy();
1415        dst.name = name == null ? null : name.copy();
1416        dst.description = description == null ? null : description.copy();
1417        dst.acronym = acronym == null ? null : acronym.copy();
1418        dst.source = source == null ? null : source.copy();
1419        dst.exampleFor = exampleFor == null ? null : exampleFor.copy();
1420        return dst;
1421      }
1422
1423      @Override
1424      public boolean equalsDeep(Base other_) {
1425        if (!super.equalsDeep(other_))
1426          return false;
1427        if (!(other_ instanceof ImplementationGuidePackageResourceComponent))
1428          return false;
1429        ImplementationGuidePackageResourceComponent o = (ImplementationGuidePackageResourceComponent) other_;
1430        return compareDeep(example, o.example, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true)
1431           && compareDeep(acronym, o.acronym, true) && compareDeep(source, o.source, true) && compareDeep(exampleFor, o.exampleFor, true)
1432          ;
1433      }
1434
1435      @Override
1436      public boolean equalsShallow(Base other_) {
1437        if (!super.equalsShallow(other_))
1438          return false;
1439        if (!(other_ instanceof ImplementationGuidePackageResourceComponent))
1440          return false;
1441        ImplementationGuidePackageResourceComponent o = (ImplementationGuidePackageResourceComponent) other_;
1442        return compareValues(example, o.example, true) && compareValues(name, o.name, true) && compareValues(description, o.description, true)
1443           && compareValues(acronym, o.acronym, true);
1444      }
1445
1446      public boolean isEmpty() {
1447        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(example, name, description
1448          , acronym, source, exampleFor);
1449      }
1450
1451  public String fhirType() {
1452    return "ImplementationGuide.package.resource";
1453
1454  }
1455
1456  }
1457
1458    @Block()
1459    public static class ImplementationGuideGlobalComponent extends BackboneElement implements IBaseBackboneElement {
1460        /**
1461         * The type of resource that all instances must conform to.
1462         */
1463        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1464        @Description(shortDefinition="Type this profiles applies to", formalDefinition="The type of resource that all instances must conform to." )
1465        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types")
1466        protected CodeType type;
1467
1468        /**
1469         * A reference to the profile that all instances must conform to.
1470         */
1471        @Child(name = "profile", type = {StructureDefinition.class}, order=2, min=1, max=1, modifier=false, summary=true)
1472        @Description(shortDefinition="Profile that all resources must conform to", formalDefinition="A reference to the profile that all instances must conform to." )
1473        protected Reference profile;
1474
1475        /**
1476         * The actual object that is the target of the reference (A reference to the profile that all instances must conform to.)
1477         */
1478        protected StructureDefinition profileTarget;
1479
1480        private static final long serialVersionUID = 2011731959L;
1481
1482    /**
1483     * Constructor
1484     */
1485      public ImplementationGuideGlobalComponent() {
1486        super();
1487      }
1488
1489    /**
1490     * Constructor
1491     */
1492      public ImplementationGuideGlobalComponent(CodeType type, Reference profile) {
1493        super();
1494        this.type = type;
1495        this.profile = profile;
1496      }
1497
1498        /**
1499         * @return {@link #type} (The type of resource that all instances must conform to.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1500         */
1501        public CodeType getTypeElement() { 
1502          if (this.type == null)
1503            if (Configuration.errorOnAutoCreate())
1504              throw new Error("Attempt to auto-create ImplementationGuideGlobalComponent.type");
1505            else if (Configuration.doAutoCreate())
1506              this.type = new CodeType(); // bb
1507          return this.type;
1508        }
1509
1510        public boolean hasTypeElement() { 
1511          return this.type != null && !this.type.isEmpty();
1512        }
1513
1514        public boolean hasType() { 
1515          return this.type != null && !this.type.isEmpty();
1516        }
1517
1518        /**
1519         * @param value {@link #type} (The type of resource that all instances must conform to.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1520         */
1521        public ImplementationGuideGlobalComponent setTypeElement(CodeType value) { 
1522          this.type = value;
1523          return this;
1524        }
1525
1526        /**
1527         * @return The type of resource that all instances must conform to.
1528         */
1529        public String getType() { 
1530          return this.type == null ? null : this.type.getValue();
1531        }
1532
1533        /**
1534         * @param value The type of resource that all instances must conform to.
1535         */
1536        public ImplementationGuideGlobalComponent setType(String value) { 
1537            if (this.type == null)
1538              this.type = new CodeType();
1539            this.type.setValue(value);
1540          return this;
1541        }
1542
1543        /**
1544         * @return {@link #profile} (A reference to the profile that all instances must conform to.)
1545         */
1546        public Reference getProfile() { 
1547          if (this.profile == null)
1548            if (Configuration.errorOnAutoCreate())
1549              throw new Error("Attempt to auto-create ImplementationGuideGlobalComponent.profile");
1550            else if (Configuration.doAutoCreate())
1551              this.profile = new Reference(); // cc
1552          return this.profile;
1553        }
1554
1555        public boolean hasProfile() { 
1556          return this.profile != null && !this.profile.isEmpty();
1557        }
1558
1559        /**
1560         * @param value {@link #profile} (A reference to the profile that all instances must conform to.)
1561         */
1562        public ImplementationGuideGlobalComponent setProfile(Reference value)  { 
1563          this.profile = value;
1564          return this;
1565        }
1566
1567        /**
1568         * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the profile that all instances must conform to.)
1569         */
1570        public StructureDefinition getProfileTarget() { 
1571          if (this.profileTarget == null)
1572            if (Configuration.errorOnAutoCreate())
1573              throw new Error("Attempt to auto-create ImplementationGuideGlobalComponent.profile");
1574            else if (Configuration.doAutoCreate())
1575              this.profileTarget = new StructureDefinition(); // aa
1576          return this.profileTarget;
1577        }
1578
1579        /**
1580         * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the profile that all instances must conform to.)
1581         */
1582        public ImplementationGuideGlobalComponent setProfileTarget(StructureDefinition value) { 
1583          this.profileTarget = value;
1584          return this;
1585        }
1586
1587        protected void listChildren(List<Property> children) {
1588          super.listChildren(children);
1589          children.add(new Property("type", "code", "The type of resource that all instances must conform to.", 0, 1, type));
1590          children.add(new Property("profile", "Reference(StructureDefinition)", "A reference to the profile that all instances must conform to.", 0, 1, profile));
1591        }
1592
1593        @Override
1594        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1595          switch (_hash) {
1596          case 3575610: /*type*/  return new Property("type", "code", "The type of resource that all instances must conform to.", 0, 1, type);
1597          case -309425751: /*profile*/  return new Property("profile", "Reference(StructureDefinition)", "A reference to the profile that all instances must conform to.", 0, 1, profile);
1598          default: return super.getNamedProperty(_hash, _name, _checkValid);
1599          }
1600
1601        }
1602
1603      @Override
1604      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1605        switch (hash) {
1606        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType
1607        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference
1608        default: return super.getProperty(hash, name, checkValid);
1609        }
1610
1611      }
1612
1613      @Override
1614      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1615        switch (hash) {
1616        case 3575610: // type
1617          this.type = castToCode(value); // CodeType
1618          return value;
1619        case -309425751: // profile
1620          this.profile = castToReference(value); // Reference
1621          return value;
1622        default: return super.setProperty(hash, name, value);
1623        }
1624
1625      }
1626
1627      @Override
1628      public Base setProperty(String name, Base value) throws FHIRException {
1629        if (name.equals("type")) {
1630          this.type = castToCode(value); // CodeType
1631        } else if (name.equals("profile")) {
1632          this.profile = castToReference(value); // Reference
1633        } else
1634          return super.setProperty(name, value);
1635        return value;
1636      }
1637
1638      @Override
1639      public Base makeProperty(int hash, String name) throws FHIRException {
1640        switch (hash) {
1641        case 3575610:  return getTypeElement();
1642        case -309425751:  return getProfile(); 
1643        default: return super.makeProperty(hash, name);
1644        }
1645
1646      }
1647
1648      @Override
1649      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1650        switch (hash) {
1651        case 3575610: /*type*/ return new String[] {"code"};
1652        case -309425751: /*profile*/ return new String[] {"Reference"};
1653        default: return super.getTypesForProperty(hash, name);
1654        }
1655
1656      }
1657
1658      @Override
1659      public Base addChild(String name) throws FHIRException {
1660        if (name.equals("type")) {
1661          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.type");
1662        }
1663        else if (name.equals("profile")) {
1664          this.profile = new Reference();
1665          return this.profile;
1666        }
1667        else
1668          return super.addChild(name);
1669      }
1670
1671      public ImplementationGuideGlobalComponent copy() {
1672        ImplementationGuideGlobalComponent dst = new ImplementationGuideGlobalComponent();
1673        copyValues(dst);
1674        dst.type = type == null ? null : type.copy();
1675        dst.profile = profile == null ? null : profile.copy();
1676        return dst;
1677      }
1678
1679      @Override
1680      public boolean equalsDeep(Base other_) {
1681        if (!super.equalsDeep(other_))
1682          return false;
1683        if (!(other_ instanceof ImplementationGuideGlobalComponent))
1684          return false;
1685        ImplementationGuideGlobalComponent o = (ImplementationGuideGlobalComponent) other_;
1686        return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true);
1687      }
1688
1689      @Override
1690      public boolean equalsShallow(Base other_) {
1691        if (!super.equalsShallow(other_))
1692          return false;
1693        if (!(other_ instanceof ImplementationGuideGlobalComponent))
1694          return false;
1695        ImplementationGuideGlobalComponent o = (ImplementationGuideGlobalComponent) other_;
1696        return compareValues(type, o.type, true);
1697      }
1698
1699      public boolean isEmpty() {
1700        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, profile);
1701      }
1702
1703  public String fhirType() {
1704    return "ImplementationGuide.global";
1705
1706  }
1707
1708  }
1709
1710    @Block()
1711    public static class ImplementationGuidePageComponent extends BackboneElement implements IBaseBackboneElement {
1712        /**
1713         * The source address for the page.
1714         */
1715        @Child(name = "source", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1716        @Description(shortDefinition="Where to find that page", formalDefinition="The source address for the page." )
1717        protected UriType source;
1718
1719        /**
1720         * A short title used to represent this page in navigational structures such as table of contents, bread crumbs, etc.
1721         */
1722        @Child(name = "title", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true)
1723        @Description(shortDefinition="Short title shown for navigational assistance", formalDefinition="A short title used to represent this page in navigational structures such as table of contents, bread crumbs, etc." )
1724        protected StringType title;
1725
1726        /**
1727         * The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.
1728         */
1729        @Child(name = "kind", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true)
1730        @Description(shortDefinition="page | example | list | include | directory | dictionary | toc | resource", formalDefinition="The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest." )
1731        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/guide-page-kind")
1732        protected Enumeration<GuidePageKind> kind;
1733
1734        /**
1735         * For constructed pages, what kind of resources to include in the list.
1736         */
1737        @Child(name = "type", type = {CodeType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1738        @Description(shortDefinition="Kind of resource to include in the list", formalDefinition="For constructed pages, what kind of resources to include in the list." )
1739        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types")
1740        protected List<CodeType> type;
1741
1742        /**
1743         * For constructed pages, a list of packages to include in the page (or else empty for everything).
1744         */
1745        @Child(name = "package", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1746        @Description(shortDefinition="Name of package to include", formalDefinition="For constructed pages, a list of packages to include in the page (or else empty for everything)." )
1747        protected List<StringType> package_;
1748
1749        /**
1750         * The format of the page.
1751         */
1752        @Child(name = "format", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false)
1753        @Description(shortDefinition="Format of the page (e.g. html, markdown, etc.)", formalDefinition="The format of the page." )
1754        protected CodeType format;
1755
1756        /**
1757         * Nested Pages/Sections under this page.
1758         */
1759        @Child(name = "page", type = {ImplementationGuidePageComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1760        @Description(shortDefinition="Nested Pages / Sections", formalDefinition="Nested Pages/Sections under this page." )
1761        protected List<ImplementationGuidePageComponent> page;
1762
1763        private static final long serialVersionUID = -687763908L;
1764
1765    /**
1766     * Constructor
1767     */
1768      public ImplementationGuidePageComponent() {
1769        super();
1770      }
1771
1772    /**
1773     * Constructor
1774     */
1775      public ImplementationGuidePageComponent(UriType source, StringType title, Enumeration<GuidePageKind> kind) {
1776        super();
1777        this.source = source;
1778        this.title = title;
1779        this.kind = kind;
1780      }
1781
1782        /**
1783         * @return {@link #source} (The source address for the page.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value
1784         */
1785        public UriType getSourceElement() { 
1786          if (this.source == null)
1787            if (Configuration.errorOnAutoCreate())
1788              throw new Error("Attempt to auto-create ImplementationGuidePageComponent.source");
1789            else if (Configuration.doAutoCreate())
1790              this.source = new UriType(); // bb
1791          return this.source;
1792        }
1793
1794        public boolean hasSourceElement() { 
1795          return this.source != null && !this.source.isEmpty();
1796        }
1797
1798        public boolean hasSource() { 
1799          return this.source != null && !this.source.isEmpty();
1800        }
1801
1802        /**
1803         * @param value {@link #source} (The source address for the page.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value
1804         */
1805        public ImplementationGuidePageComponent setSourceElement(UriType value) { 
1806          this.source = value;
1807          return this;
1808        }
1809
1810        /**
1811         * @return The source address for the page.
1812         */
1813        public String getSource() { 
1814          return this.source == null ? null : this.source.getValue();
1815        }
1816
1817        /**
1818         * @param value The source address for the page.
1819         */
1820        public ImplementationGuidePageComponent setSource(String value) { 
1821            if (this.source == null)
1822              this.source = new UriType();
1823            this.source.setValue(value);
1824          return this;
1825        }
1826
1827        /**
1828         * @return {@link #title} (A short title used to represent this page in navigational structures such as table of contents, bread crumbs, etc.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1829         */
1830        public StringType getTitleElement() { 
1831          if (this.title == null)
1832            if (Configuration.errorOnAutoCreate())
1833              throw new Error("Attempt to auto-create ImplementationGuidePageComponent.title");
1834            else if (Configuration.doAutoCreate())
1835              this.title = new StringType(); // bb
1836          return this.title;
1837        }
1838
1839        public boolean hasTitleElement() { 
1840          return this.title != null && !this.title.isEmpty();
1841        }
1842
1843        public boolean hasTitle() { 
1844          return this.title != null && !this.title.isEmpty();
1845        }
1846
1847        /**
1848         * @param value {@link #title} (A short title used to represent this page in navigational structures such as table of contents, bread crumbs, etc.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1849         */
1850        public ImplementationGuidePageComponent setTitleElement(StringType value) { 
1851          this.title = value;
1852          return this;
1853        }
1854
1855        /**
1856         * @return A short title used to represent this page in navigational structures such as table of contents, bread crumbs, etc.
1857         */
1858        public String getTitle() { 
1859          return this.title == null ? null : this.title.getValue();
1860        }
1861
1862        /**
1863         * @param value A short title used to represent this page in navigational structures such as table of contents, bread crumbs, etc.
1864         */
1865        public ImplementationGuidePageComponent setTitle(String value) { 
1866            if (this.title == null)
1867              this.title = new StringType();
1868            this.title.setValue(value);
1869          return this;
1870        }
1871
1872        /**
1873         * @return {@link #kind} (The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
1874         */
1875        public Enumeration<GuidePageKind> getKindElement() { 
1876          if (this.kind == null)
1877            if (Configuration.errorOnAutoCreate())
1878              throw new Error("Attempt to auto-create ImplementationGuidePageComponent.kind");
1879            else if (Configuration.doAutoCreate())
1880              this.kind = new Enumeration<GuidePageKind>(new GuidePageKindEnumFactory()); // bb
1881          return this.kind;
1882        }
1883
1884        public boolean hasKindElement() { 
1885          return this.kind != null && !this.kind.isEmpty();
1886        }
1887
1888        public boolean hasKind() { 
1889          return this.kind != null && !this.kind.isEmpty();
1890        }
1891
1892        /**
1893         * @param value {@link #kind} (The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
1894         */
1895        public ImplementationGuidePageComponent setKindElement(Enumeration<GuidePageKind> value) { 
1896          this.kind = value;
1897          return this;
1898        }
1899
1900        /**
1901         * @return The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.
1902         */
1903        public GuidePageKind getKind() { 
1904          return this.kind == null ? null : this.kind.getValue();
1905        }
1906
1907        /**
1908         * @param value The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.
1909         */
1910        public ImplementationGuidePageComponent setKind(GuidePageKind value) { 
1911            if (this.kind == null)
1912              this.kind = new Enumeration<GuidePageKind>(new GuidePageKindEnumFactory());
1913            this.kind.setValue(value);
1914          return this;
1915        }
1916
1917        /**
1918         * @return {@link #type} (For constructed pages, what kind of resources to include in the list.)
1919         */
1920        public List<CodeType> getType() { 
1921          if (this.type == null)
1922            this.type = new ArrayList<CodeType>();
1923          return this.type;
1924        }
1925
1926        /**
1927         * @return Returns a reference to <code>this</code> for easy method chaining
1928         */
1929        public ImplementationGuidePageComponent setType(List<CodeType> theType) { 
1930          this.type = theType;
1931          return this;
1932        }
1933
1934        public boolean hasType() { 
1935          if (this.type == null)
1936            return false;
1937          for (CodeType item : this.type)
1938            if (!item.isEmpty())
1939              return true;
1940          return false;
1941        }
1942
1943        /**
1944         * @return {@link #type} (For constructed pages, what kind of resources to include in the list.)
1945         */
1946        public CodeType addTypeElement() {//2 
1947          CodeType t = new CodeType();
1948          if (this.type == null)
1949            this.type = new ArrayList<CodeType>();
1950          this.type.add(t);
1951          return t;
1952        }
1953
1954        /**
1955         * @param value {@link #type} (For constructed pages, what kind of resources to include in the list.)
1956         */
1957        public ImplementationGuidePageComponent addType(String value) { //1
1958          CodeType t = new CodeType();
1959          t.setValue(value);
1960          if (this.type == null)
1961            this.type = new ArrayList<CodeType>();
1962          this.type.add(t);
1963          return this;
1964        }
1965
1966        /**
1967         * @param value {@link #type} (For constructed pages, what kind of resources to include in the list.)
1968         */
1969        public boolean hasType(String value) { 
1970          if (this.type == null)
1971            return false;
1972          for (CodeType v : this.type)
1973            if (v.getValue().equals(value)) // code
1974              return true;
1975          return false;
1976        }
1977
1978        /**
1979         * @return {@link #package_} (For constructed pages, a list of packages to include in the page (or else empty for everything).)
1980         */
1981        public List<StringType> getPackage() { 
1982          if (this.package_ == null)
1983            this.package_ = new ArrayList<StringType>();
1984          return this.package_;
1985        }
1986
1987        /**
1988         * @return Returns a reference to <code>this</code> for easy method chaining
1989         */
1990        public ImplementationGuidePageComponent setPackage(List<StringType> thePackage) { 
1991          this.package_ = thePackage;
1992          return this;
1993        }
1994
1995        public boolean hasPackage() { 
1996          if (this.package_ == null)
1997            return false;
1998          for (StringType item : this.package_)
1999            if (!item.isEmpty())
2000              return true;
2001          return false;
2002        }
2003
2004        /**
2005         * @return {@link #package_} (For constructed pages, a list of packages to include in the page (or else empty for everything).)
2006         */
2007        public StringType addPackageElement() {//2 
2008          StringType t = new StringType();
2009          if (this.package_ == null)
2010            this.package_ = new ArrayList<StringType>();
2011          this.package_.add(t);
2012          return t;
2013        }
2014
2015        /**
2016         * @param value {@link #package_} (For constructed pages, a list of packages to include in the page (or else empty for everything).)
2017         */
2018        public ImplementationGuidePageComponent addPackage(String value) { //1
2019          StringType t = new StringType();
2020          t.setValue(value);
2021          if (this.package_ == null)
2022            this.package_ = new ArrayList<StringType>();
2023          this.package_.add(t);
2024          return this;
2025        }
2026
2027        /**
2028         * @param value {@link #package_} (For constructed pages, a list of packages to include in the page (or else empty for everything).)
2029         */
2030        public boolean hasPackage(String value) { 
2031          if (this.package_ == null)
2032            return false;
2033          for (StringType v : this.package_)
2034            if (v.getValue().equals(value)) // string
2035              return true;
2036          return false;
2037        }
2038
2039        /**
2040         * @return {@link #format} (The format of the page.). This is the underlying object with id, value and extensions. The accessor "getFormat" gives direct access to the value
2041         */
2042        public CodeType getFormatElement() { 
2043          if (this.format == null)
2044            if (Configuration.errorOnAutoCreate())
2045              throw new Error("Attempt to auto-create ImplementationGuidePageComponent.format");
2046            else if (Configuration.doAutoCreate())
2047              this.format = new CodeType(); // bb
2048          return this.format;
2049        }
2050
2051        public boolean hasFormatElement() { 
2052          return this.format != null && !this.format.isEmpty();
2053        }
2054
2055        public boolean hasFormat() { 
2056          return this.format != null && !this.format.isEmpty();
2057        }
2058
2059        /**
2060         * @param value {@link #format} (The format of the page.). This is the underlying object with id, value and extensions. The accessor "getFormat" gives direct access to the value
2061         */
2062        public ImplementationGuidePageComponent setFormatElement(CodeType value) { 
2063          this.format = value;
2064          return this;
2065        }
2066
2067        /**
2068         * @return The format of the page.
2069         */
2070        public String getFormat() { 
2071          return this.format == null ? null : this.format.getValue();
2072        }
2073
2074        /**
2075         * @param value The format of the page.
2076         */
2077        public ImplementationGuidePageComponent setFormat(String value) { 
2078          if (Utilities.noString(value))
2079            this.format = null;
2080          else {
2081            if (this.format == null)
2082              this.format = new CodeType();
2083            this.format.setValue(value);
2084          }
2085          return this;
2086        }
2087
2088        /**
2089         * @return {@link #page} (Nested Pages/Sections under this page.)
2090         */
2091        public List<ImplementationGuidePageComponent> getPage() { 
2092          if (this.page == null)
2093            this.page = new ArrayList<ImplementationGuidePageComponent>();
2094          return this.page;
2095        }
2096
2097        /**
2098         * @return Returns a reference to <code>this</code> for easy method chaining
2099         */
2100        public ImplementationGuidePageComponent setPage(List<ImplementationGuidePageComponent> thePage) { 
2101          this.page = thePage;
2102          return this;
2103        }
2104
2105        public boolean hasPage() { 
2106          if (this.page == null)
2107            return false;
2108          for (ImplementationGuidePageComponent item : this.page)
2109            if (!item.isEmpty())
2110              return true;
2111          return false;
2112        }
2113
2114        public ImplementationGuidePageComponent addPage() { //3
2115          ImplementationGuidePageComponent t = new ImplementationGuidePageComponent();
2116          if (this.page == null)
2117            this.page = new ArrayList<ImplementationGuidePageComponent>();
2118          this.page.add(t);
2119          return t;
2120        }
2121
2122        public ImplementationGuidePageComponent addPage(ImplementationGuidePageComponent t) { //3
2123          if (t == null)
2124            return this;
2125          if (this.page == null)
2126            this.page = new ArrayList<ImplementationGuidePageComponent>();
2127          this.page.add(t);
2128          return this;
2129        }
2130
2131        /**
2132         * @return The first repetition of repeating field {@link #page}, creating it if it does not already exist
2133         */
2134        public ImplementationGuidePageComponent getPageFirstRep() { 
2135          if (getPage().isEmpty()) {
2136            addPage();
2137          }
2138          return getPage().get(0);
2139        }
2140
2141        protected void listChildren(List<Property> children) {
2142          super.listChildren(children);
2143          children.add(new Property("source", "uri", "The source address for the page.", 0, 1, source));
2144          children.add(new Property("title", "string", "A short title used to represent this page in navigational structures such as table of contents, bread crumbs, etc.", 0, 1, title));
2145          children.add(new Property("kind", "code", "The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.", 0, 1, kind));
2146          children.add(new Property("type", "code", "For constructed pages, what kind of resources to include in the list.", 0, java.lang.Integer.MAX_VALUE, type));
2147          children.add(new Property("package", "string", "For constructed pages, a list of packages to include in the page (or else empty for everything).", 0, java.lang.Integer.MAX_VALUE, package_));
2148          children.add(new Property("format", "code", "The format of the page.", 0, 1, format));
2149          children.add(new Property("page", "@ImplementationGuide.page", "Nested Pages/Sections under this page.", 0, java.lang.Integer.MAX_VALUE, page));
2150        }
2151
2152        @Override
2153        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2154          switch (_hash) {
2155          case -896505829: /*source*/  return new Property("source", "uri", "The source address for the page.", 0, 1, source);
2156          case 110371416: /*title*/  return new Property("title", "string", "A short title used to represent this page in navigational structures such as table of contents, bread crumbs, etc.", 0, 1, title);
2157          case 3292052: /*kind*/  return new Property("kind", "code", "The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.", 0, 1, kind);
2158          case 3575610: /*type*/  return new Property("type", "code", "For constructed pages, what kind of resources to include in the list.", 0, java.lang.Integer.MAX_VALUE, type);
2159          case -807062458: /*package*/  return new Property("package", "string", "For constructed pages, a list of packages to include in the page (or else empty for everything).", 0, java.lang.Integer.MAX_VALUE, package_);
2160          case -1268779017: /*format*/  return new Property("format", "code", "The format of the page.", 0, 1, format);
2161          case 3433103: /*page*/  return new Property("page", "@ImplementationGuide.page", "Nested Pages/Sections under this page.", 0, java.lang.Integer.MAX_VALUE, page);
2162          default: return super.getNamedProperty(_hash, _name, _checkValid);
2163          }
2164
2165        }
2166
2167      @Override
2168      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2169        switch (hash) {
2170        case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // UriType
2171        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
2172        case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration<GuidePageKind>
2173        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeType
2174        case -807062458: /*package*/ return this.package_ == null ? new Base[0] : this.package_.toArray(new Base[this.package_.size()]); // StringType
2175        case -1268779017: /*format*/ return this.format == null ? new Base[0] : new Base[] {this.format}; // CodeType
2176        case 3433103: /*page*/ return this.page == null ? new Base[0] : this.page.toArray(new Base[this.page.size()]); // ImplementationGuidePageComponent
2177        default: return super.getProperty(hash, name, checkValid);
2178        }
2179
2180      }
2181
2182      @Override
2183      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2184        switch (hash) {
2185        case -896505829: // source
2186          this.source = castToUri(value); // UriType
2187          return value;
2188        case 110371416: // title
2189          this.title = castToString(value); // StringType
2190          return value;
2191        case 3292052: // kind
2192          value = new GuidePageKindEnumFactory().fromType(castToCode(value));
2193          this.kind = (Enumeration) value; // Enumeration<GuidePageKind>
2194          return value;
2195        case 3575610: // type
2196          this.getType().add(castToCode(value)); // CodeType
2197          return value;
2198        case -807062458: // package
2199          this.getPackage().add(castToString(value)); // StringType
2200          return value;
2201        case -1268779017: // format
2202          this.format = castToCode(value); // CodeType
2203          return value;
2204        case 3433103: // page
2205          this.getPage().add((ImplementationGuidePageComponent) value); // ImplementationGuidePageComponent
2206          return value;
2207        default: return super.setProperty(hash, name, value);
2208        }
2209
2210      }
2211
2212      @Override
2213      public Base setProperty(String name, Base value) throws FHIRException {
2214        if (name.equals("source")) {
2215          this.source = castToUri(value); // UriType
2216        } else if (name.equals("title")) {
2217          this.title = castToString(value); // StringType
2218        } else if (name.equals("kind")) {
2219          value = new GuidePageKindEnumFactory().fromType(castToCode(value));
2220          this.kind = (Enumeration) value; // Enumeration<GuidePageKind>
2221        } else if (name.equals("type")) {
2222          this.getType().add(castToCode(value));
2223        } else if (name.equals("package")) {
2224          this.getPackage().add(castToString(value));
2225        } else if (name.equals("format")) {
2226          this.format = castToCode(value); // CodeType
2227        } else if (name.equals("page")) {
2228          this.getPage().add((ImplementationGuidePageComponent) value);
2229        } else
2230          return super.setProperty(name, value);
2231        return value;
2232      }
2233
2234      @Override
2235      public Base makeProperty(int hash, String name) throws FHIRException {
2236        switch (hash) {
2237        case -896505829:  return getSourceElement();
2238        case 110371416:  return getTitleElement();
2239        case 3292052:  return getKindElement();
2240        case 3575610:  return addTypeElement();
2241        case -807062458:  return addPackageElement();
2242        case -1268779017:  return getFormatElement();
2243        case 3433103:  return addPage(); 
2244        default: return super.makeProperty(hash, name);
2245        }
2246
2247      }
2248
2249      @Override
2250      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2251        switch (hash) {
2252        case -896505829: /*source*/ return new String[] {"uri"};
2253        case 110371416: /*title*/ return new String[] {"string"};
2254        case 3292052: /*kind*/ return new String[] {"code"};
2255        case 3575610: /*type*/ return new String[] {"code"};
2256        case -807062458: /*package*/ return new String[] {"string"};
2257        case -1268779017: /*format*/ return new String[] {"code"};
2258        case 3433103: /*page*/ return new String[] {"@ImplementationGuide.page"};
2259        default: return super.getTypesForProperty(hash, name);
2260        }
2261
2262      }
2263
2264      @Override
2265      public Base addChild(String name) throws FHIRException {
2266        if (name.equals("source")) {
2267          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.source");
2268        }
2269        else if (name.equals("title")) {
2270          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.title");
2271        }
2272        else if (name.equals("kind")) {
2273          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.kind");
2274        }
2275        else if (name.equals("type")) {
2276          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.type");
2277        }
2278        else if (name.equals("package")) {
2279          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.package");
2280        }
2281        else if (name.equals("format")) {
2282          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.format");
2283        }
2284        else if (name.equals("page")) {
2285          return addPage();
2286        }
2287        else
2288          return super.addChild(name);
2289      }
2290
2291      public ImplementationGuidePageComponent copy() {
2292        ImplementationGuidePageComponent dst = new ImplementationGuidePageComponent();
2293        copyValues(dst);
2294        dst.source = source == null ? null : source.copy();
2295        dst.title = title == null ? null : title.copy();
2296        dst.kind = kind == null ? null : kind.copy();
2297        if (type != null) {
2298          dst.type = new ArrayList<CodeType>();
2299          for (CodeType i : type)
2300            dst.type.add(i.copy());
2301        };
2302        if (package_ != null) {
2303          dst.package_ = new ArrayList<StringType>();
2304          for (StringType i : package_)
2305            dst.package_.add(i.copy());
2306        };
2307        dst.format = format == null ? null : format.copy();
2308        if (page != null) {
2309          dst.page = new ArrayList<ImplementationGuidePageComponent>();
2310          for (ImplementationGuidePageComponent i : page)
2311            dst.page.add(i.copy());
2312        };
2313        return dst;
2314      }
2315
2316      @Override
2317      public boolean equalsDeep(Base other_) {
2318        if (!super.equalsDeep(other_))
2319          return false;
2320        if (!(other_ instanceof ImplementationGuidePageComponent))
2321          return false;
2322        ImplementationGuidePageComponent o = (ImplementationGuidePageComponent) other_;
2323        return compareDeep(source, o.source, true) && compareDeep(title, o.title, true) && compareDeep(kind, o.kind, true)
2324           && compareDeep(type, o.type, true) && compareDeep(package_, o.package_, true) && compareDeep(format, o.format, true)
2325           && compareDeep(page, o.page, true);
2326      }
2327
2328      @Override
2329      public boolean equalsShallow(Base other_) {
2330        if (!super.equalsShallow(other_))
2331          return false;
2332        if (!(other_ instanceof ImplementationGuidePageComponent))
2333          return false;
2334        ImplementationGuidePageComponent o = (ImplementationGuidePageComponent) other_;
2335        return compareValues(source, o.source, true) && compareValues(title, o.title, true) && compareValues(kind, o.kind, true)
2336           && compareValues(type, o.type, true) && compareValues(package_, o.package_, true) && compareValues(format, o.format, true)
2337          ;
2338      }
2339
2340      public boolean isEmpty() {
2341        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(source, title, kind, type
2342          , package_, format, page);
2343      }
2344
2345  public String fhirType() {
2346    return "ImplementationGuide.page";
2347
2348  }
2349
2350  }
2351
2352    /**
2353     * A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide.
2354     */
2355    @Child(name = "copyright", type = {MarkdownType.class}, order=0, min=0, max=1, modifier=false, summary=false)
2356    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide." )
2357    protected MarkdownType copyright;
2358
2359    /**
2360     * The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.
2361     */
2362    @Child(name = "fhirVersion", type = {IdType.class}, order=1, min=0, max=1, modifier=false, summary=true)
2363    @Description(shortDefinition="FHIR Version this Implementation Guide targets", formalDefinition="The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version." )
2364    protected IdType fhirVersion;
2365
2366    /**
2367     * Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.
2368     */
2369    @Child(name = "dependency", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2370    @Description(shortDefinition="Another Implementation guide this depends on", formalDefinition="Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides." )
2371    protected List<ImplementationGuideDependencyComponent> dependency;
2372
2373    /**
2374     * A logical group of resources. Logical groups can be used when building pages.
2375     */
2376    @Child(name = "package", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2377    @Description(shortDefinition="Group of resources as used in .page.package", formalDefinition="A logical group of resources. Logical groups can be used when building pages." )
2378    protected List<ImplementationGuidePackageComponent> package_;
2379
2380    /**
2381     * A set of profiles that all resources covered by this implementation guide must conform to.
2382     */
2383    @Child(name = "global", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2384    @Description(shortDefinition="Profiles that apply globally", formalDefinition="A set of profiles that all resources covered by this implementation guide must conform to." )
2385    protected List<ImplementationGuideGlobalComponent> global;
2386
2387    /**
2388     * A binary file that is included in the  implementation guide when it is published.
2389     */
2390    @Child(name = "binary", type = {UriType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2391    @Description(shortDefinition="Image, css, script, etc.", formalDefinition="A binary file that is included in the  implementation guide when it is published." )
2392    protected List<UriType> binary;
2393
2394    /**
2395     * A page / section in the implementation guide. The root page is the implementation guide home page.
2396     */
2397    @Child(name = "page", type = {}, order=6, min=0, max=1, modifier=false, summary=true)
2398    @Description(shortDefinition="Page/Section in the Guide", formalDefinition="A page / section in the implementation guide. The root page is the implementation guide home page." )
2399    protected ImplementationGuidePageComponent page;
2400
2401    private static final long serialVersionUID = -1252164384L;
2402
2403  /**
2404   * Constructor
2405   */
2406    public ImplementationGuide() {
2407      super();
2408    }
2409
2410  /**
2411   * Constructor
2412   */
2413    public ImplementationGuide(UriType url, StringType name, Enumeration<PublicationStatus> status) {
2414      super();
2415      this.url = url;
2416      this.name = name;
2417      this.status = status;
2418    }
2419
2420    /**
2421     * @return {@link #url} (An absolute URI that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published. The URL SHOULD include the major version of the implementation guide. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2422     */
2423    public UriType getUrlElement() { 
2424      if (this.url == null)
2425        if (Configuration.errorOnAutoCreate())
2426          throw new Error("Attempt to auto-create ImplementationGuide.url");
2427        else if (Configuration.doAutoCreate())
2428          this.url = new UriType(); // bb
2429      return this.url;
2430    }
2431
2432    public boolean hasUrlElement() { 
2433      return this.url != null && !this.url.isEmpty();
2434    }
2435
2436    public boolean hasUrl() { 
2437      return this.url != null && !this.url.isEmpty();
2438    }
2439
2440    /**
2441     * @param value {@link #url} (An absolute URI that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published. The URL SHOULD include the major version of the implementation guide. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2442     */
2443    public ImplementationGuide setUrlElement(UriType value) { 
2444      this.url = value;
2445      return this;
2446    }
2447
2448    /**
2449     * @return An absolute URI that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published. The URL SHOULD include the major version of the implementation guide. For more information see [Technical and Business Versions](resource.html#versions).
2450     */
2451    public String getUrl() { 
2452      return this.url == null ? null : this.url.getValue();
2453    }
2454
2455    /**
2456     * @param value An absolute URI that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published. The URL SHOULD include the major version of the implementation guide. For more information see [Technical and Business Versions](resource.html#versions).
2457     */
2458    public ImplementationGuide setUrl(String value) { 
2459        if (this.url == null)
2460          this.url = new UriType();
2461        this.url.setValue(value);
2462      return this;
2463    }
2464
2465    /**
2466     * @return {@link #version} (The identifier that is used to identify this version of the implementation guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the implementation guide 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
2467     */
2468    public StringType getVersionElement() { 
2469      if (this.version == null)
2470        if (Configuration.errorOnAutoCreate())
2471          throw new Error("Attempt to auto-create ImplementationGuide.version");
2472        else if (Configuration.doAutoCreate())
2473          this.version = new StringType(); // bb
2474      return this.version;
2475    }
2476
2477    public boolean hasVersionElement() { 
2478      return this.version != null && !this.version.isEmpty();
2479    }
2480
2481    public boolean hasVersion() { 
2482      return this.version != null && !this.version.isEmpty();
2483    }
2484
2485    /**
2486     * @param value {@link #version} (The identifier that is used to identify this version of the implementation guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the implementation guide 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
2487     */
2488    public ImplementationGuide setVersionElement(StringType value) { 
2489      this.version = value;
2490      return this;
2491    }
2492
2493    /**
2494     * @return The identifier that is used to identify this version of the implementation guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the implementation guide 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.
2495     */
2496    public String getVersion() { 
2497      return this.version == null ? null : this.version.getValue();
2498    }
2499
2500    /**
2501     * @param value The identifier that is used to identify this version of the implementation guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the implementation guide 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.
2502     */
2503    public ImplementationGuide setVersion(String value) { 
2504      if (Utilities.noString(value))
2505        this.version = null;
2506      else {
2507        if (this.version == null)
2508          this.version = new StringType();
2509        this.version.setValue(value);
2510      }
2511      return this;
2512    }
2513
2514    /**
2515     * @return {@link #name} (A natural language name identifying the implementation guide. 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
2516     */
2517    public StringType getNameElement() { 
2518      if (this.name == null)
2519        if (Configuration.errorOnAutoCreate())
2520          throw new Error("Attempt to auto-create ImplementationGuide.name");
2521        else if (Configuration.doAutoCreate())
2522          this.name = new StringType(); // bb
2523      return this.name;
2524    }
2525
2526    public boolean hasNameElement() { 
2527      return this.name != null && !this.name.isEmpty();
2528    }
2529
2530    public boolean hasName() { 
2531      return this.name != null && !this.name.isEmpty();
2532    }
2533
2534    /**
2535     * @param value {@link #name} (A natural language name identifying the implementation guide. 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
2536     */
2537    public ImplementationGuide setNameElement(StringType value) { 
2538      this.name = value;
2539      return this;
2540    }
2541
2542    /**
2543     * @return A natural language name identifying the implementation guide. This name should be usable as an identifier for the module by machine processing applications such as code generation.
2544     */
2545    public String getName() { 
2546      return this.name == null ? null : this.name.getValue();
2547    }
2548
2549    /**
2550     * @param value A natural language name identifying the implementation guide. This name should be usable as an identifier for the module by machine processing applications such as code generation.
2551     */
2552    public ImplementationGuide setName(String value) { 
2553        if (this.name == null)
2554          this.name = new StringType();
2555        this.name.setValue(value);
2556      return this;
2557    }
2558
2559    /**
2560     * @return {@link #status} (The status of this implementation guide. 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
2561     */
2562    public Enumeration<PublicationStatus> getStatusElement() { 
2563      if (this.status == null)
2564        if (Configuration.errorOnAutoCreate())
2565          throw new Error("Attempt to auto-create ImplementationGuide.status");
2566        else if (Configuration.doAutoCreate())
2567          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
2568      return this.status;
2569    }
2570
2571    public boolean hasStatusElement() { 
2572      return this.status != null && !this.status.isEmpty();
2573    }
2574
2575    public boolean hasStatus() { 
2576      return this.status != null && !this.status.isEmpty();
2577    }
2578
2579    /**
2580     * @param value {@link #status} (The status of this implementation guide. 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
2581     */
2582    public ImplementationGuide setStatusElement(Enumeration<PublicationStatus> value) { 
2583      this.status = value;
2584      return this;
2585    }
2586
2587    /**
2588     * @return The status of this implementation guide. Enables tracking the life-cycle of the content.
2589     */
2590    public PublicationStatus getStatus() { 
2591      return this.status == null ? null : this.status.getValue();
2592    }
2593
2594    /**
2595     * @param value The status of this implementation guide. Enables tracking the life-cycle of the content.
2596     */
2597    public ImplementationGuide setStatus(PublicationStatus value) { 
2598        if (this.status == null)
2599          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
2600        this.status.setValue(value);
2601      return this;
2602    }
2603
2604    /**
2605     * @return {@link #experimental} (A boolean value to indicate that this implementation guide 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
2606     */
2607    public BooleanType getExperimentalElement() { 
2608      if (this.experimental == null)
2609        if (Configuration.errorOnAutoCreate())
2610          throw new Error("Attempt to auto-create ImplementationGuide.experimental");
2611        else if (Configuration.doAutoCreate())
2612          this.experimental = new BooleanType(); // bb
2613      return this.experimental;
2614    }
2615
2616    public boolean hasExperimentalElement() { 
2617      return this.experimental != null && !this.experimental.isEmpty();
2618    }
2619
2620    public boolean hasExperimental() { 
2621      return this.experimental != null && !this.experimental.isEmpty();
2622    }
2623
2624    /**
2625     * @param value {@link #experimental} (A boolean value to indicate that this implementation guide 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
2626     */
2627    public ImplementationGuide setExperimentalElement(BooleanType value) { 
2628      this.experimental = value;
2629      return this;
2630    }
2631
2632    /**
2633     * @return A boolean value to indicate that this implementation guide is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
2634     */
2635    public boolean getExperimental() { 
2636      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
2637    }
2638
2639    /**
2640     * @param value A boolean value to indicate that this implementation guide is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
2641     */
2642    public ImplementationGuide setExperimental(boolean value) { 
2643        if (this.experimental == null)
2644          this.experimental = new BooleanType();
2645        this.experimental.setValue(value);
2646      return this;
2647    }
2648
2649    /**
2650     * @return {@link #date} (The date  (and optionally time) when the implementation guide was published. The date must change if and 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 implementation guide changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2651     */
2652    public DateTimeType getDateElement() { 
2653      if (this.date == null)
2654        if (Configuration.errorOnAutoCreate())
2655          throw new Error("Attempt to auto-create ImplementationGuide.date");
2656        else if (Configuration.doAutoCreate())
2657          this.date = new DateTimeType(); // bb
2658      return this.date;
2659    }
2660
2661    public boolean hasDateElement() { 
2662      return this.date != null && !this.date.isEmpty();
2663    }
2664
2665    public boolean hasDate() { 
2666      return this.date != null && !this.date.isEmpty();
2667    }
2668
2669    /**
2670     * @param value {@link #date} (The date  (and optionally time) when the implementation guide was published. The date must change if and 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 implementation guide changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
2671     */
2672    public ImplementationGuide setDateElement(DateTimeType value) { 
2673      this.date = value;
2674      return this;
2675    }
2676
2677    /**
2678     * @return The date  (and optionally time) when the implementation guide was published. The date must change if and 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 implementation guide changes.
2679     */
2680    public Date getDate() { 
2681      return this.date == null ? null : this.date.getValue();
2682    }
2683
2684    /**
2685     * @param value The date  (and optionally time) when the implementation guide was published. The date must change if and 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 implementation guide changes.
2686     */
2687    public ImplementationGuide setDate(Date value) { 
2688      if (value == null)
2689        this.date = null;
2690      else {
2691        if (this.date == null)
2692          this.date = new DateTimeType();
2693        this.date.setValue(value);
2694      }
2695      return this;
2696    }
2697
2698    /**
2699     * @return {@link #publisher} (The name of the individual or organization that published the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
2700     */
2701    public StringType getPublisherElement() { 
2702      if (this.publisher == null)
2703        if (Configuration.errorOnAutoCreate())
2704          throw new Error("Attempt to auto-create ImplementationGuide.publisher");
2705        else if (Configuration.doAutoCreate())
2706          this.publisher = new StringType(); // bb
2707      return this.publisher;
2708    }
2709
2710    public boolean hasPublisherElement() { 
2711      return this.publisher != null && !this.publisher.isEmpty();
2712    }
2713
2714    public boolean hasPublisher() { 
2715      return this.publisher != null && !this.publisher.isEmpty();
2716    }
2717
2718    /**
2719     * @param value {@link #publisher} (The name of the individual or organization that published the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
2720     */
2721    public ImplementationGuide setPublisherElement(StringType value) { 
2722      this.publisher = value;
2723      return this;
2724    }
2725
2726    /**
2727     * @return The name of the individual or organization that published the implementation guide.
2728     */
2729    public String getPublisher() { 
2730      return this.publisher == null ? null : this.publisher.getValue();
2731    }
2732
2733    /**
2734     * @param value The name of the individual or organization that published the implementation guide.
2735     */
2736    public ImplementationGuide setPublisher(String value) { 
2737      if (Utilities.noString(value))
2738        this.publisher = null;
2739      else {
2740        if (this.publisher == null)
2741          this.publisher = new StringType();
2742        this.publisher.setValue(value);
2743      }
2744      return this;
2745    }
2746
2747    /**
2748     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
2749     */
2750    public List<ContactDetail> getContact() { 
2751      if (this.contact == null)
2752        this.contact = new ArrayList<ContactDetail>();
2753      return this.contact;
2754    }
2755
2756    /**
2757     * @return Returns a reference to <code>this</code> for easy method chaining
2758     */
2759    public ImplementationGuide setContact(List<ContactDetail> theContact) { 
2760      this.contact = theContact;
2761      return this;
2762    }
2763
2764    public boolean hasContact() { 
2765      if (this.contact == null)
2766        return false;
2767      for (ContactDetail item : this.contact)
2768        if (!item.isEmpty())
2769          return true;
2770      return false;
2771    }
2772
2773    public ContactDetail addContact() { //3
2774      ContactDetail t = new ContactDetail();
2775      if (this.contact == null)
2776        this.contact = new ArrayList<ContactDetail>();
2777      this.contact.add(t);
2778      return t;
2779    }
2780
2781    public ImplementationGuide addContact(ContactDetail t) { //3
2782      if (t == null)
2783        return this;
2784      if (this.contact == null)
2785        this.contact = new ArrayList<ContactDetail>();
2786      this.contact.add(t);
2787      return this;
2788    }
2789
2790    /**
2791     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
2792     */
2793    public ContactDetail getContactFirstRep() { 
2794      if (getContact().isEmpty()) {
2795        addContact();
2796      }
2797      return getContact().get(0);
2798    }
2799
2800    /**
2801     * @return {@link #description} (A free text natural language description of the implementation guide from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2802     */
2803    public MarkdownType getDescriptionElement() { 
2804      if (this.description == null)
2805        if (Configuration.errorOnAutoCreate())
2806          throw new Error("Attempt to auto-create ImplementationGuide.description");
2807        else if (Configuration.doAutoCreate())
2808          this.description = new MarkdownType(); // bb
2809      return this.description;
2810    }
2811
2812    public boolean hasDescriptionElement() { 
2813      return this.description != null && !this.description.isEmpty();
2814    }
2815
2816    public boolean hasDescription() { 
2817      return this.description != null && !this.description.isEmpty();
2818    }
2819
2820    /**
2821     * @param value {@link #description} (A free text natural language description of the implementation guide from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2822     */
2823    public ImplementationGuide setDescriptionElement(MarkdownType value) { 
2824      this.description = value;
2825      return this;
2826    }
2827
2828    /**
2829     * @return A free text natural language description of the implementation guide from a consumer's perspective.
2830     */
2831    public String getDescription() { 
2832      return this.description == null ? null : this.description.getValue();
2833    }
2834
2835    /**
2836     * @param value A free text natural language description of the implementation guide from a consumer's perspective.
2837     */
2838    public ImplementationGuide setDescription(String value) { 
2839      if (value == null)
2840        this.description = null;
2841      else {
2842        if (this.description == null)
2843          this.description = new MarkdownType();
2844        this.description.setValue(value);
2845      }
2846      return this;
2847    }
2848
2849    /**
2850     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate implementation guide instances.)
2851     */
2852    public List<UsageContext> getUseContext() { 
2853      if (this.useContext == null)
2854        this.useContext = new ArrayList<UsageContext>();
2855      return this.useContext;
2856    }
2857
2858    /**
2859     * @return Returns a reference to <code>this</code> for easy method chaining
2860     */
2861    public ImplementationGuide setUseContext(List<UsageContext> theUseContext) { 
2862      this.useContext = theUseContext;
2863      return this;
2864    }
2865
2866    public boolean hasUseContext() { 
2867      if (this.useContext == null)
2868        return false;
2869      for (UsageContext item : this.useContext)
2870        if (!item.isEmpty())
2871          return true;
2872      return false;
2873    }
2874
2875    public UsageContext addUseContext() { //3
2876      UsageContext t = new UsageContext();
2877      if (this.useContext == null)
2878        this.useContext = new ArrayList<UsageContext>();
2879      this.useContext.add(t);
2880      return t;
2881    }
2882
2883    public ImplementationGuide addUseContext(UsageContext t) { //3
2884      if (t == null)
2885        return this;
2886      if (this.useContext == null)
2887        this.useContext = new ArrayList<UsageContext>();
2888      this.useContext.add(t);
2889      return this;
2890    }
2891
2892    /**
2893     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
2894     */
2895    public UsageContext getUseContextFirstRep() { 
2896      if (getUseContext().isEmpty()) {
2897        addUseContext();
2898      }
2899      return getUseContext().get(0);
2900    }
2901
2902    /**
2903     * @return {@link #jurisdiction} (A legal or geographic region in which the implementation guide is intended to be used.)
2904     */
2905    public List<CodeableConcept> getJurisdiction() { 
2906      if (this.jurisdiction == null)
2907        this.jurisdiction = new ArrayList<CodeableConcept>();
2908      return this.jurisdiction;
2909    }
2910
2911    /**
2912     * @return Returns a reference to <code>this</code> for easy method chaining
2913     */
2914    public ImplementationGuide setJurisdiction(List<CodeableConcept> theJurisdiction) { 
2915      this.jurisdiction = theJurisdiction;
2916      return this;
2917    }
2918
2919    public boolean hasJurisdiction() { 
2920      if (this.jurisdiction == null)
2921        return false;
2922      for (CodeableConcept item : this.jurisdiction)
2923        if (!item.isEmpty())
2924          return true;
2925      return false;
2926    }
2927
2928    public CodeableConcept addJurisdiction() { //3
2929      CodeableConcept t = new CodeableConcept();
2930      if (this.jurisdiction == null)
2931        this.jurisdiction = new ArrayList<CodeableConcept>();
2932      this.jurisdiction.add(t);
2933      return t;
2934    }
2935
2936    public ImplementationGuide addJurisdiction(CodeableConcept t) { //3
2937      if (t == null)
2938        return this;
2939      if (this.jurisdiction == null)
2940        this.jurisdiction = new ArrayList<CodeableConcept>();
2941      this.jurisdiction.add(t);
2942      return this;
2943    }
2944
2945    /**
2946     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
2947     */
2948    public CodeableConcept getJurisdictionFirstRep() { 
2949      if (getJurisdiction().isEmpty()) {
2950        addJurisdiction();
2951      }
2952      return getJurisdiction().get(0);
2953    }
2954
2955    /**
2956     * @return {@link #copyright} (A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
2957     */
2958    public MarkdownType getCopyrightElement() { 
2959      if (this.copyright == null)
2960        if (Configuration.errorOnAutoCreate())
2961          throw new Error("Attempt to auto-create ImplementationGuide.copyright");
2962        else if (Configuration.doAutoCreate())
2963          this.copyright = new MarkdownType(); // bb
2964      return this.copyright;
2965    }
2966
2967    public boolean hasCopyrightElement() { 
2968      return this.copyright != null && !this.copyright.isEmpty();
2969    }
2970
2971    public boolean hasCopyright() { 
2972      return this.copyright != null && !this.copyright.isEmpty();
2973    }
2974
2975    /**
2976     * @param value {@link #copyright} (A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
2977     */
2978    public ImplementationGuide setCopyrightElement(MarkdownType value) { 
2979      this.copyright = value;
2980      return this;
2981    }
2982
2983    /**
2984     * @return A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide.
2985     */
2986    public String getCopyright() { 
2987      return this.copyright == null ? null : this.copyright.getValue();
2988    }
2989
2990    /**
2991     * @param value A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide.
2992     */
2993    public ImplementationGuide setCopyright(String value) { 
2994      if (value == null)
2995        this.copyright = null;
2996      else {
2997        if (this.copyright == null)
2998          this.copyright = new MarkdownType();
2999        this.copyright.setValue(value);
3000      }
3001      return this;
3002    }
3003
3004    /**
3005     * @return {@link #fhirVersion} (The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value
3006     */
3007    public IdType getFhirVersionElement() { 
3008      if (this.fhirVersion == null)
3009        if (Configuration.errorOnAutoCreate())
3010          throw new Error("Attempt to auto-create ImplementationGuide.fhirVersion");
3011        else if (Configuration.doAutoCreate())
3012          this.fhirVersion = new IdType(); // bb
3013      return this.fhirVersion;
3014    }
3015
3016    public boolean hasFhirVersionElement() { 
3017      return this.fhirVersion != null && !this.fhirVersion.isEmpty();
3018    }
3019
3020    public boolean hasFhirVersion() { 
3021      return this.fhirVersion != null && !this.fhirVersion.isEmpty();
3022    }
3023
3024    /**
3025     * @param value {@link #fhirVersion} (The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value
3026     */
3027    public ImplementationGuide setFhirVersionElement(IdType value) { 
3028      this.fhirVersion = value;
3029      return this;
3030    }
3031
3032    /**
3033     * @return The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.
3034     */
3035    public String getFhirVersion() { 
3036      return this.fhirVersion == null ? null : this.fhirVersion.getValue();
3037    }
3038
3039    /**
3040     * @param value The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.
3041     */
3042    public ImplementationGuide setFhirVersion(String value) { 
3043      if (Utilities.noString(value))
3044        this.fhirVersion = null;
3045      else {
3046        if (this.fhirVersion == null)
3047          this.fhirVersion = new IdType();
3048        this.fhirVersion.setValue(value);
3049      }
3050      return this;
3051    }
3052
3053    /**
3054     * @return {@link #dependency} (Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.)
3055     */
3056    public List<ImplementationGuideDependencyComponent> getDependency() { 
3057      if (this.dependency == null)
3058        this.dependency = new ArrayList<ImplementationGuideDependencyComponent>();
3059      return this.dependency;
3060    }
3061
3062    /**
3063     * @return Returns a reference to <code>this</code> for easy method chaining
3064     */
3065    public ImplementationGuide setDependency(List<ImplementationGuideDependencyComponent> theDependency) { 
3066      this.dependency = theDependency;
3067      return this;
3068    }
3069
3070    public boolean hasDependency() { 
3071      if (this.dependency == null)
3072        return false;
3073      for (ImplementationGuideDependencyComponent item : this.dependency)
3074        if (!item.isEmpty())
3075          return true;
3076      return false;
3077    }
3078
3079    public ImplementationGuideDependencyComponent addDependency() { //3
3080      ImplementationGuideDependencyComponent t = new ImplementationGuideDependencyComponent();
3081      if (this.dependency == null)
3082        this.dependency = new ArrayList<ImplementationGuideDependencyComponent>();
3083      this.dependency.add(t);
3084      return t;
3085    }
3086
3087    public ImplementationGuide addDependency(ImplementationGuideDependencyComponent t) { //3
3088      if (t == null)
3089        return this;
3090      if (this.dependency == null)
3091        this.dependency = new ArrayList<ImplementationGuideDependencyComponent>();
3092      this.dependency.add(t);
3093      return this;
3094    }
3095
3096    /**
3097     * @return The first repetition of repeating field {@link #dependency}, creating it if it does not already exist
3098     */
3099    public ImplementationGuideDependencyComponent getDependencyFirstRep() { 
3100      if (getDependency().isEmpty()) {
3101        addDependency();
3102      }
3103      return getDependency().get(0);
3104    }
3105
3106    /**
3107     * @return {@link #package_} (A logical group of resources. Logical groups can be used when building pages.)
3108     */
3109    public List<ImplementationGuidePackageComponent> getPackage() { 
3110      if (this.package_ == null)
3111        this.package_ = new ArrayList<ImplementationGuidePackageComponent>();
3112      return this.package_;
3113    }
3114
3115    /**
3116     * @return Returns a reference to <code>this</code> for easy method chaining
3117     */
3118    public ImplementationGuide setPackage(List<ImplementationGuidePackageComponent> thePackage) { 
3119      this.package_ = thePackage;
3120      return this;
3121    }
3122
3123    public boolean hasPackage() { 
3124      if (this.package_ == null)
3125        return false;
3126      for (ImplementationGuidePackageComponent item : this.package_)
3127        if (!item.isEmpty())
3128          return true;
3129      return false;
3130    }
3131
3132    public ImplementationGuidePackageComponent addPackage() { //3
3133      ImplementationGuidePackageComponent t = new ImplementationGuidePackageComponent();
3134      if (this.package_ == null)
3135        this.package_ = new ArrayList<ImplementationGuidePackageComponent>();
3136      this.package_.add(t);
3137      return t;
3138    }
3139
3140    public ImplementationGuide addPackage(ImplementationGuidePackageComponent t) { //3
3141      if (t == null)
3142        return this;
3143      if (this.package_ == null)
3144        this.package_ = new ArrayList<ImplementationGuidePackageComponent>();
3145      this.package_.add(t);
3146      return this;
3147    }
3148
3149    /**
3150     * @return The first repetition of repeating field {@link #package_}, creating it if it does not already exist
3151     */
3152    public ImplementationGuidePackageComponent getPackageFirstRep() { 
3153      if (getPackage().isEmpty()) {
3154        addPackage();
3155      }
3156      return getPackage().get(0);
3157    }
3158
3159    /**
3160     * @return {@link #global} (A set of profiles that all resources covered by this implementation guide must conform to.)
3161     */
3162    public List<ImplementationGuideGlobalComponent> getGlobal() { 
3163      if (this.global == null)
3164        this.global = new ArrayList<ImplementationGuideGlobalComponent>();
3165      return this.global;
3166    }
3167
3168    /**
3169     * @return Returns a reference to <code>this</code> for easy method chaining
3170     */
3171    public ImplementationGuide setGlobal(List<ImplementationGuideGlobalComponent> theGlobal) { 
3172      this.global = theGlobal;
3173      return this;
3174    }
3175
3176    public boolean hasGlobal() { 
3177      if (this.global == null)
3178        return false;
3179      for (ImplementationGuideGlobalComponent item : this.global)
3180        if (!item.isEmpty())
3181          return true;
3182      return false;
3183    }
3184
3185    public ImplementationGuideGlobalComponent addGlobal() { //3
3186      ImplementationGuideGlobalComponent t = new ImplementationGuideGlobalComponent();
3187      if (this.global == null)
3188        this.global = new ArrayList<ImplementationGuideGlobalComponent>();
3189      this.global.add(t);
3190      return t;
3191    }
3192
3193    public ImplementationGuide addGlobal(ImplementationGuideGlobalComponent t) { //3
3194      if (t == null)
3195        return this;
3196      if (this.global == null)
3197        this.global = new ArrayList<ImplementationGuideGlobalComponent>();
3198      this.global.add(t);
3199      return this;
3200    }
3201
3202    /**
3203     * @return The first repetition of repeating field {@link #global}, creating it if it does not already exist
3204     */
3205    public ImplementationGuideGlobalComponent getGlobalFirstRep() { 
3206      if (getGlobal().isEmpty()) {
3207        addGlobal();
3208      }
3209      return getGlobal().get(0);
3210    }
3211
3212    /**
3213     * @return {@link #binary} (A binary file that is included in the  implementation guide when it is published.)
3214     */
3215    public List<UriType> getBinary() { 
3216      if (this.binary == null)
3217        this.binary = new ArrayList<UriType>();
3218      return this.binary;
3219    }
3220
3221    /**
3222     * @return Returns a reference to <code>this</code> for easy method chaining
3223     */
3224    public ImplementationGuide setBinary(List<UriType> theBinary) { 
3225      this.binary = theBinary;
3226      return this;
3227    }
3228
3229    public boolean hasBinary() { 
3230      if (this.binary == null)
3231        return false;
3232      for (UriType item : this.binary)
3233        if (!item.isEmpty())
3234          return true;
3235      return false;
3236    }
3237
3238    /**
3239     * @return {@link #binary} (A binary file that is included in the  implementation guide when it is published.)
3240     */
3241    public UriType addBinaryElement() {//2 
3242      UriType t = new UriType();
3243      if (this.binary == null)
3244        this.binary = new ArrayList<UriType>();
3245      this.binary.add(t);
3246      return t;
3247    }
3248
3249    /**
3250     * @param value {@link #binary} (A binary file that is included in the  implementation guide when it is published.)
3251     */
3252    public ImplementationGuide addBinary(String value) { //1
3253      UriType t = new UriType();
3254      t.setValue(value);
3255      if (this.binary == null)
3256        this.binary = new ArrayList<UriType>();
3257      this.binary.add(t);
3258      return this;
3259    }
3260
3261    /**
3262     * @param value {@link #binary} (A binary file that is included in the  implementation guide when it is published.)
3263     */
3264    public boolean hasBinary(String value) { 
3265      if (this.binary == null)
3266        return false;
3267      for (UriType v : this.binary)
3268        if (v.getValue().equals(value)) // uri
3269          return true;
3270      return false;
3271    }
3272
3273    /**
3274     * @return {@link #page} (A page / section in the implementation guide. The root page is the implementation guide home page.)
3275     */
3276    public ImplementationGuidePageComponent getPage() { 
3277      if (this.page == null)
3278        if (Configuration.errorOnAutoCreate())
3279          throw new Error("Attempt to auto-create ImplementationGuide.page");
3280        else if (Configuration.doAutoCreate())
3281          this.page = new ImplementationGuidePageComponent(); // cc
3282      return this.page;
3283    }
3284
3285    public boolean hasPage() { 
3286      return this.page != null && !this.page.isEmpty();
3287    }
3288
3289    /**
3290     * @param value {@link #page} (A page / section in the implementation guide. The root page is the implementation guide home page.)
3291     */
3292    public ImplementationGuide setPage(ImplementationGuidePageComponent value)  { 
3293      this.page = value;
3294      return this;
3295    }
3296
3297      protected void listChildren(List<Property> children) {
3298        super.listChildren(children);
3299        children.add(new Property("url", "uri", "An absolute URI that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published. The URL SHOULD include the major version of the implementation guide. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url));
3300        children.add(new Property("version", "string", "The identifier that is used to identify this version of the implementation guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the implementation guide 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));
3301        children.add(new Property("name", "string", "A natural language name identifying the implementation guide. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
3302        children.add(new Property("status", "code", "The status of this implementation guide. Enables tracking the life-cycle of the content.", 0, 1, status));
3303        children.add(new Property("experimental", "boolean", "A boolean value to indicate that this implementation guide is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental));
3304        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the implementation guide was published. The date must change if and 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 implementation guide changes.", 0, 1, date));
3305        children.add(new Property("publisher", "string", "The name of the individual or organization that published the implementation guide.", 0, 1, publisher));
3306        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));
3307        children.add(new Property("description", "markdown", "A free text natural language description of the implementation guide from a consumer's perspective.", 0, 1, description));
3308        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate implementation guide instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
3309        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the implementation guide is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
3310        children.add(new Property("copyright", "markdown", "A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide.", 0, 1, copyright));
3311        children.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.", 0, 1, fhirVersion));
3312        children.add(new Property("dependency", "", "Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.", 0, java.lang.Integer.MAX_VALUE, dependency));
3313        children.add(new Property("package", "", "A logical group of resources. Logical groups can be used when building pages.", 0, java.lang.Integer.MAX_VALUE, package_));
3314        children.add(new Property("global", "", "A set of profiles that all resources covered by this implementation guide must conform to.", 0, java.lang.Integer.MAX_VALUE, global));
3315        children.add(new Property("binary", "uri", "A binary file that is included in the  implementation guide when it is published.", 0, java.lang.Integer.MAX_VALUE, binary));
3316        children.add(new Property("page", "", "A page / section in the implementation guide. The root page is the implementation guide home page.", 0, 1, page));
3317      }
3318
3319      @Override
3320      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3321        switch (_hash) {
3322        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published. The URL SHOULD include the major version of the implementation guide. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url);
3323        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the implementation guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the implementation guide 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);
3324        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the implementation guide. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
3325        case -892481550: /*status*/  return new Property("status", "code", "The status of this implementation guide. Enables tracking the life-cycle of the content.", 0, 1, status);
3326        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A boolean value to indicate that this implementation guide is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental);
3327        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the implementation guide was published. The date must change if and 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 implementation guide changes.", 0, 1, date);
3328        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the individual or organization that published the implementation guide.", 0, 1, publisher);
3329        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);
3330        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the implementation guide from a consumer's perspective.", 0, 1, description);
3331        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 terms may be used to assist with indexing and searching for appropriate implementation guide instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
3332        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the implementation guide is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
3333        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide.", 0, 1, copyright);
3334        case 461006061: /*fhirVersion*/  return new Property("fhirVersion", "id", "The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 3.0.1 for this version.", 0, 1, fhirVersion);
3335        case -26291381: /*dependency*/  return new Property("dependency", "", "Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.", 0, java.lang.Integer.MAX_VALUE, dependency);
3336        case -807062458: /*package*/  return new Property("package", "", "A logical group of resources. Logical groups can be used when building pages.", 0, java.lang.Integer.MAX_VALUE, package_);
3337        case -1243020381: /*global*/  return new Property("global", "", "A set of profiles that all resources covered by this implementation guide must conform to.", 0, java.lang.Integer.MAX_VALUE, global);
3338        case -1388966911: /*binary*/  return new Property("binary", "uri", "A binary file that is included in the  implementation guide when it is published.", 0, java.lang.Integer.MAX_VALUE, binary);
3339        case 3433103: /*page*/  return new Property("page", "", "A page / section in the implementation guide. The root page is the implementation guide home page.", 0, 1, page);
3340        default: return super.getNamedProperty(_hash, _name, _checkValid);
3341        }
3342
3343      }
3344
3345      @Override
3346      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3347        switch (hash) {
3348        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
3349        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
3350        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3351        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
3352        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
3353        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
3354        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
3355        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
3356        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
3357        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
3358        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
3359        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
3360        case 461006061: /*fhirVersion*/ return this.fhirVersion == null ? new Base[0] : new Base[] {this.fhirVersion}; // IdType
3361        case -26291381: /*dependency*/ return this.dependency == null ? new Base[0] : this.dependency.toArray(new Base[this.dependency.size()]); // ImplementationGuideDependencyComponent
3362        case -807062458: /*package*/ return this.package_ == null ? new Base[0] : this.package_.toArray(new Base[this.package_.size()]); // ImplementationGuidePackageComponent
3363        case -1243020381: /*global*/ return this.global == null ? new Base[0] : this.global.toArray(new Base[this.global.size()]); // ImplementationGuideGlobalComponent
3364        case -1388966911: /*binary*/ return this.binary == null ? new Base[0] : this.binary.toArray(new Base[this.binary.size()]); // UriType
3365        case 3433103: /*page*/ return this.page == null ? new Base[0] : new Base[] {this.page}; // ImplementationGuidePageComponent
3366        default: return super.getProperty(hash, name, checkValid);
3367        }
3368
3369      }
3370
3371      @Override
3372      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3373        switch (hash) {
3374        case 116079: // url
3375          this.url = castToUri(value); // UriType
3376          return value;
3377        case 351608024: // version
3378          this.version = castToString(value); // StringType
3379          return value;
3380        case 3373707: // name
3381          this.name = castToString(value); // StringType
3382          return value;
3383        case -892481550: // status
3384          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
3385          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3386          return value;
3387        case -404562712: // experimental
3388          this.experimental = castToBoolean(value); // BooleanType
3389          return value;
3390        case 3076014: // date
3391          this.date = castToDateTime(value); // DateTimeType
3392          return value;
3393        case 1447404028: // publisher
3394          this.publisher = castToString(value); // StringType
3395          return value;
3396        case 951526432: // contact
3397          this.getContact().add(castToContactDetail(value)); // ContactDetail
3398          return value;
3399        case -1724546052: // description
3400          this.description = castToMarkdown(value); // MarkdownType
3401          return value;
3402        case -669707736: // useContext
3403          this.getUseContext().add(castToUsageContext(value)); // UsageContext
3404          return value;
3405        case -507075711: // jurisdiction
3406          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
3407          return value;
3408        case 1522889671: // copyright
3409          this.copyright = castToMarkdown(value); // MarkdownType
3410          return value;
3411        case 461006061: // fhirVersion
3412          this.fhirVersion = castToId(value); // IdType
3413          return value;
3414        case -26291381: // dependency
3415          this.getDependency().add((ImplementationGuideDependencyComponent) value); // ImplementationGuideDependencyComponent
3416          return value;
3417        case -807062458: // package
3418          this.getPackage().add((ImplementationGuidePackageComponent) value); // ImplementationGuidePackageComponent
3419          return value;
3420        case -1243020381: // global
3421          this.getGlobal().add((ImplementationGuideGlobalComponent) value); // ImplementationGuideGlobalComponent
3422          return value;
3423        case -1388966911: // binary
3424          this.getBinary().add(castToUri(value)); // UriType
3425          return value;
3426        case 3433103: // page
3427          this.page = (ImplementationGuidePageComponent) value; // ImplementationGuidePageComponent
3428          return value;
3429        default: return super.setProperty(hash, name, value);
3430        }
3431
3432      }
3433
3434      @Override
3435      public Base setProperty(String name, Base value) throws FHIRException {
3436        if (name.equals("url")) {
3437          this.url = castToUri(value); // UriType
3438        } else if (name.equals("version")) {
3439          this.version = castToString(value); // StringType
3440        } else if (name.equals("name")) {
3441          this.name = castToString(value); // StringType
3442        } else if (name.equals("status")) {
3443          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
3444          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3445        } else if (name.equals("experimental")) {
3446          this.experimental = castToBoolean(value); // BooleanType
3447        } else if (name.equals("date")) {
3448          this.date = castToDateTime(value); // DateTimeType
3449        } else if (name.equals("publisher")) {
3450          this.publisher = castToString(value); // StringType
3451        } else if (name.equals("contact")) {
3452          this.getContact().add(castToContactDetail(value));
3453        } else if (name.equals("description")) {
3454          this.description = castToMarkdown(value); // MarkdownType
3455        } else if (name.equals("useContext")) {
3456          this.getUseContext().add(castToUsageContext(value));
3457        } else if (name.equals("jurisdiction")) {
3458          this.getJurisdiction().add(castToCodeableConcept(value));
3459        } else if (name.equals("copyright")) {
3460          this.copyright = castToMarkdown(value); // MarkdownType
3461        } else if (name.equals("fhirVersion")) {
3462          this.fhirVersion = castToId(value); // IdType
3463        } else if (name.equals("dependency")) {
3464          this.getDependency().add((ImplementationGuideDependencyComponent) value);
3465        } else if (name.equals("package")) {
3466          this.getPackage().add((ImplementationGuidePackageComponent) value);
3467        } else if (name.equals("global")) {
3468          this.getGlobal().add((ImplementationGuideGlobalComponent) value);
3469        } else if (name.equals("binary")) {
3470          this.getBinary().add(castToUri(value));
3471        } else if (name.equals("page")) {
3472          this.page = (ImplementationGuidePageComponent) value; // ImplementationGuidePageComponent
3473        } else
3474          return super.setProperty(name, value);
3475        return value;
3476      }
3477
3478      @Override
3479      public Base makeProperty(int hash, String name) throws FHIRException {
3480        switch (hash) {
3481        case 116079:  return getUrlElement();
3482        case 351608024:  return getVersionElement();
3483        case 3373707:  return getNameElement();
3484        case -892481550:  return getStatusElement();
3485        case -404562712:  return getExperimentalElement();
3486        case 3076014:  return getDateElement();
3487        case 1447404028:  return getPublisherElement();
3488        case 951526432:  return addContact(); 
3489        case -1724546052:  return getDescriptionElement();
3490        case -669707736:  return addUseContext(); 
3491        case -507075711:  return addJurisdiction(); 
3492        case 1522889671:  return getCopyrightElement();
3493        case 461006061:  return getFhirVersionElement();
3494        case -26291381:  return addDependency(); 
3495        case -807062458:  return addPackage(); 
3496        case -1243020381:  return addGlobal(); 
3497        case -1388966911:  return addBinaryElement();
3498        case 3433103:  return getPage(); 
3499        default: return super.makeProperty(hash, name);
3500        }
3501
3502      }
3503
3504      @Override
3505      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3506        switch (hash) {
3507        case 116079: /*url*/ return new String[] {"uri"};
3508        case 351608024: /*version*/ return new String[] {"string"};
3509        case 3373707: /*name*/ return new String[] {"string"};
3510        case -892481550: /*status*/ return new String[] {"code"};
3511        case -404562712: /*experimental*/ return new String[] {"boolean"};
3512        case 3076014: /*date*/ return new String[] {"dateTime"};
3513        case 1447404028: /*publisher*/ return new String[] {"string"};
3514        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
3515        case -1724546052: /*description*/ return new String[] {"markdown"};
3516        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
3517        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
3518        case 1522889671: /*copyright*/ return new String[] {"markdown"};
3519        case 461006061: /*fhirVersion*/ return new String[] {"id"};
3520        case -26291381: /*dependency*/ return new String[] {};
3521        case -807062458: /*package*/ return new String[] {};
3522        case -1243020381: /*global*/ return new String[] {};
3523        case -1388966911: /*binary*/ return new String[] {"uri"};
3524        case 3433103: /*page*/ return new String[] {};
3525        default: return super.getTypesForProperty(hash, name);
3526        }
3527
3528      }
3529
3530      @Override
3531      public Base addChild(String name) throws FHIRException {
3532        if (name.equals("url")) {
3533          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.url");
3534        }
3535        else if (name.equals("version")) {
3536          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.version");
3537        }
3538        else if (name.equals("name")) {
3539          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.name");
3540        }
3541        else if (name.equals("status")) {
3542          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.status");
3543        }
3544        else if (name.equals("experimental")) {
3545          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.experimental");
3546        }
3547        else if (name.equals("date")) {
3548          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.date");
3549        }
3550        else if (name.equals("publisher")) {
3551          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.publisher");
3552        }
3553        else if (name.equals("contact")) {
3554          return addContact();
3555        }
3556        else if (name.equals("description")) {
3557          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.description");
3558        }
3559        else if (name.equals("useContext")) {
3560          return addUseContext();
3561        }
3562        else if (name.equals("jurisdiction")) {
3563          return addJurisdiction();
3564        }
3565        else if (name.equals("copyright")) {
3566          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.copyright");
3567        }
3568        else if (name.equals("fhirVersion")) {
3569          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.fhirVersion");
3570        }
3571        else if (name.equals("dependency")) {
3572          return addDependency();
3573        }
3574        else if (name.equals("package")) {
3575          return addPackage();
3576        }
3577        else if (name.equals("global")) {
3578          return addGlobal();
3579        }
3580        else if (name.equals("binary")) {
3581          throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.binary");
3582        }
3583        else if (name.equals("page")) {
3584          this.page = new ImplementationGuidePageComponent();
3585          return this.page;
3586        }
3587        else
3588          return super.addChild(name);
3589      }
3590
3591  public String fhirType() {
3592    return "ImplementationGuide";
3593
3594  }
3595
3596      public ImplementationGuide copy() {
3597        ImplementationGuide dst = new ImplementationGuide();
3598        copyValues(dst);
3599        dst.url = url == null ? null : url.copy();
3600        dst.version = version == null ? null : version.copy();
3601        dst.name = name == null ? null : name.copy();
3602        dst.status = status == null ? null : status.copy();
3603        dst.experimental = experimental == null ? null : experimental.copy();
3604        dst.date = date == null ? null : date.copy();
3605        dst.publisher = publisher == null ? null : publisher.copy();
3606        if (contact != null) {
3607          dst.contact = new ArrayList<ContactDetail>();
3608          for (ContactDetail i : contact)
3609            dst.contact.add(i.copy());
3610        };
3611        dst.description = description == null ? null : description.copy();
3612        if (useContext != null) {
3613          dst.useContext = new ArrayList<UsageContext>();
3614          for (UsageContext i : useContext)
3615            dst.useContext.add(i.copy());
3616        };
3617        if (jurisdiction != null) {
3618          dst.jurisdiction = new ArrayList<CodeableConcept>();
3619          for (CodeableConcept i : jurisdiction)
3620            dst.jurisdiction.add(i.copy());
3621        };
3622        dst.copyright = copyright == null ? null : copyright.copy();
3623        dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy();
3624        if (dependency != null) {
3625          dst.dependency = new ArrayList<ImplementationGuideDependencyComponent>();
3626          for (ImplementationGuideDependencyComponent i : dependency)
3627            dst.dependency.add(i.copy());
3628        };
3629        if (package_ != null) {
3630          dst.package_ = new ArrayList<ImplementationGuidePackageComponent>();
3631          for (ImplementationGuidePackageComponent i : package_)
3632            dst.package_.add(i.copy());
3633        };
3634        if (global != null) {
3635          dst.global = new ArrayList<ImplementationGuideGlobalComponent>();
3636          for (ImplementationGuideGlobalComponent i : global)
3637            dst.global.add(i.copy());
3638        };
3639        if (binary != null) {
3640          dst.binary = new ArrayList<UriType>();
3641          for (UriType i : binary)
3642            dst.binary.add(i.copy());
3643        };
3644        dst.page = page == null ? null : page.copy();
3645        return dst;
3646      }
3647
3648      protected ImplementationGuide typedCopy() {
3649        return copy();
3650      }
3651
3652      @Override
3653      public boolean equalsDeep(Base other_) {
3654        if (!super.equalsDeep(other_))
3655          return false;
3656        if (!(other_ instanceof ImplementationGuide))
3657          return false;
3658        ImplementationGuide o = (ImplementationGuide) other_;
3659        return compareDeep(copyright, o.copyright, true) && compareDeep(fhirVersion, o.fhirVersion, true)
3660           && compareDeep(dependency, o.dependency, true) && compareDeep(package_, o.package_, true) && compareDeep(global, o.global, true)
3661           && compareDeep(binary, o.binary, true) && compareDeep(page, o.page, true);
3662      }
3663
3664      @Override
3665      public boolean equalsShallow(Base other_) {
3666        if (!super.equalsShallow(other_))
3667          return false;
3668        if (!(other_ instanceof ImplementationGuide))
3669          return false;
3670        ImplementationGuide o = (ImplementationGuide) other_;
3671        return compareValues(copyright, o.copyright, true) && compareValues(fhirVersion, o.fhirVersion, true)
3672           && compareValues(binary, o.binary, true);
3673      }
3674
3675      public boolean isEmpty() {
3676        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(copyright, fhirVersion, dependency
3677          , package_, global, binary, page);
3678      }
3679
3680  @Override
3681  public ResourceType getResourceType() {
3682    return ResourceType.ImplementationGuide;
3683   }
3684
3685 /**
3686   * Search parameter: <b>date</b>
3687   * <p>
3688   * Description: <b>The implementation guide publication date</b><br>
3689   * Type: <b>date</b><br>
3690   * Path: <b>ImplementationGuide.date</b><br>
3691   * </p>
3692   */
3693  @SearchParamDefinition(name="date", path="ImplementationGuide.date", description="The implementation guide publication date", type="date" )
3694  public static final String SP_DATE = "date";
3695 /**
3696   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3697   * <p>
3698   * Description: <b>The implementation guide publication date</b><br>
3699   * Type: <b>date</b><br>
3700   * Path: <b>ImplementationGuide.date</b><br>
3701   * </p>
3702   */
3703  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
3704
3705 /**
3706   * Search parameter: <b>dependency</b>
3707   * <p>
3708   * Description: <b>Where to find dependency</b><br>
3709   * Type: <b>uri</b><br>
3710   * Path: <b>ImplementationGuide.dependency.uri</b><br>
3711   * </p>
3712   */
3713  @SearchParamDefinition(name="dependency", path="ImplementationGuide.dependency.uri", description="Where to find dependency", type="uri" )
3714  public static final String SP_DEPENDENCY = "dependency";
3715 /**
3716   * <b>Fluent Client</b> search parameter constant for <b>dependency</b>
3717   * <p>
3718   * Description: <b>Where to find dependency</b><br>
3719   * Type: <b>uri</b><br>
3720   * Path: <b>ImplementationGuide.dependency.uri</b><br>
3721   * </p>
3722   */
3723  public static final ca.uhn.fhir.rest.gclient.UriClientParam DEPENDENCY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DEPENDENCY);
3724
3725 /**
3726   * Search parameter: <b>resource</b>
3727   * <p>
3728   * Description: <b>Location of the resource</b><br>
3729   * Type: <b>reference</b><br>
3730   * Path: <b>ImplementationGuide.package.resource.source[x]</b><br>
3731   * </p>
3732   */
3733  @SearchParamDefinition(name="resource", path="ImplementationGuide.package.resource.source", description="Location of the resource", type="reference" )
3734  public static final String SP_RESOURCE = "resource";
3735 /**
3736   * <b>Fluent Client</b> search parameter constant for <b>resource</b>
3737   * <p>
3738   * Description: <b>Location of the resource</b><br>
3739   * Type: <b>reference</b><br>
3740   * Path: <b>ImplementationGuide.package.resource.source[x]</b><br>
3741   * </p>
3742   */
3743  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESOURCE);
3744
3745/**
3746   * Constant for fluent queries to be used to add include statements. Specifies
3747   * the path value of "<b>ImplementationGuide:resource</b>".
3748   */
3749  public static final ca.uhn.fhir.model.api.Include INCLUDE_RESOURCE = new ca.uhn.fhir.model.api.Include("ImplementationGuide:resource").toLocked();
3750
3751 /**
3752   * Search parameter: <b>jurisdiction</b>
3753   * <p>
3754   * Description: <b>Intended jurisdiction for the implementation guide</b><br>
3755   * Type: <b>token</b><br>
3756   * Path: <b>ImplementationGuide.jurisdiction</b><br>
3757   * </p>
3758   */
3759  @SearchParamDefinition(name="jurisdiction", path="ImplementationGuide.jurisdiction", description="Intended jurisdiction for the implementation guide", type="token" )
3760  public static final String SP_JURISDICTION = "jurisdiction";
3761 /**
3762   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
3763   * <p>
3764   * Description: <b>Intended jurisdiction for the implementation guide</b><br>
3765   * Type: <b>token</b><br>
3766   * Path: <b>ImplementationGuide.jurisdiction</b><br>
3767   * </p>
3768   */
3769  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
3770
3771 /**
3772   * Search parameter: <b>name</b>
3773   * <p>
3774   * Description: <b>Computationally friendly name of the implementation guide</b><br>
3775   * Type: <b>string</b><br>
3776   * Path: <b>ImplementationGuide.name</b><br>
3777   * </p>
3778   */
3779  @SearchParamDefinition(name="name", path="ImplementationGuide.name", description="Computationally friendly name of the implementation guide", type="string" )
3780  public static final String SP_NAME = "name";
3781 /**
3782   * <b>Fluent Client</b> search parameter constant for <b>name</b>
3783   * <p>
3784   * Description: <b>Computationally friendly name of the implementation guide</b><br>
3785   * Type: <b>string</b><br>
3786   * Path: <b>ImplementationGuide.name</b><br>
3787   * </p>
3788   */
3789  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
3790
3791 /**
3792   * Search parameter: <b>description</b>
3793   * <p>
3794   * Description: <b>The description of the implementation guide</b><br>
3795   * Type: <b>string</b><br>
3796   * Path: <b>ImplementationGuide.description</b><br>
3797   * </p>
3798   */
3799  @SearchParamDefinition(name="description", path="ImplementationGuide.description", description="The description of the implementation guide", type="string" )
3800  public static final String SP_DESCRIPTION = "description";
3801 /**
3802   * <b>Fluent Client</b> search parameter constant for <b>description</b>
3803   * <p>
3804   * Description: <b>The description of the implementation guide</b><br>
3805   * Type: <b>string</b><br>
3806   * Path: <b>ImplementationGuide.description</b><br>
3807   * </p>
3808   */
3809  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
3810
3811 /**
3812   * Search parameter: <b>publisher</b>
3813   * <p>
3814   * Description: <b>Name of the publisher of the implementation guide</b><br>
3815   * Type: <b>string</b><br>
3816   * Path: <b>ImplementationGuide.publisher</b><br>
3817   * </p>
3818   */
3819  @SearchParamDefinition(name="publisher", path="ImplementationGuide.publisher", description="Name of the publisher of the implementation guide", type="string" )
3820  public static final String SP_PUBLISHER = "publisher";
3821 /**
3822   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
3823   * <p>
3824   * Description: <b>Name of the publisher of the implementation guide</b><br>
3825   * Type: <b>string</b><br>
3826   * Path: <b>ImplementationGuide.publisher</b><br>
3827   * </p>
3828   */
3829  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
3830
3831 /**
3832   * Search parameter: <b>experimental</b>
3833   * <p>
3834   * Description: <b>For testing purposes, not real usage</b><br>
3835   * Type: <b>token</b><br>
3836   * Path: <b>ImplementationGuide.experimental</b><br>
3837   * </p>
3838   */
3839  @SearchParamDefinition(name="experimental", path="ImplementationGuide.experimental", description="For testing purposes, not real usage", type="token" )
3840  public static final String SP_EXPERIMENTAL = "experimental";
3841 /**
3842   * <b>Fluent Client</b> search parameter constant for <b>experimental</b>
3843   * <p>
3844   * Description: <b>For testing purposes, not real usage</b><br>
3845   * Type: <b>token</b><br>
3846   * Path: <b>ImplementationGuide.experimental</b><br>
3847   * </p>
3848   */
3849  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EXPERIMENTAL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EXPERIMENTAL);
3850
3851 /**
3852   * Search parameter: <b>version</b>
3853   * <p>
3854   * Description: <b>The business version of the implementation guide</b><br>
3855   * Type: <b>token</b><br>
3856   * Path: <b>ImplementationGuide.version</b><br>
3857   * </p>
3858   */
3859  @SearchParamDefinition(name="version", path="ImplementationGuide.version", description="The business version of the implementation guide", type="token" )
3860  public static final String SP_VERSION = "version";
3861 /**
3862   * <b>Fluent Client</b> search parameter constant for <b>version</b>
3863   * <p>
3864   * Description: <b>The business version of the implementation guide</b><br>
3865   * Type: <b>token</b><br>
3866   * Path: <b>ImplementationGuide.version</b><br>
3867   * </p>
3868   */
3869  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
3870
3871 /**
3872   * Search parameter: <b>url</b>
3873   * <p>
3874   * Description: <b>The uri that identifies the implementation guide</b><br>
3875   * Type: <b>uri</b><br>
3876   * Path: <b>ImplementationGuide.url</b><br>
3877   * </p>
3878   */
3879  @SearchParamDefinition(name="url", path="ImplementationGuide.url", description="The uri that identifies the implementation guide", type="uri" )
3880  public static final String SP_URL = "url";
3881 /**
3882   * <b>Fluent Client</b> search parameter constant for <b>url</b>
3883   * <p>
3884   * Description: <b>The uri that identifies the implementation guide</b><br>
3885   * Type: <b>uri</b><br>
3886   * Path: <b>ImplementationGuide.url</b><br>
3887   * </p>
3888   */
3889  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
3890
3891 /**
3892   * Search parameter: <b>status</b>
3893   * <p>
3894   * Description: <b>The current status of the implementation guide</b><br>
3895   * Type: <b>token</b><br>
3896   * Path: <b>ImplementationGuide.status</b><br>
3897   * </p>
3898   */
3899  @SearchParamDefinition(name="status", path="ImplementationGuide.status", description="The current status of the implementation guide", type="token" )
3900  public static final String SP_STATUS = "status";
3901 /**
3902   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3903   * <p>
3904   * Description: <b>The current status of the implementation guide</b><br>
3905   * Type: <b>token</b><br>
3906   * Path: <b>ImplementationGuide.status</b><br>
3907   * </p>
3908   */
3909  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3910
3911
3912}
3913