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