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