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