001package org.hl7.fhir.dstu3.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 Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
036import java.util.ArrayList;
037import java.util.Date;
038import java.util.List;
039
040import org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus;
041import org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory;
042import org.hl7.fhir.dstu3.model.Enumerations.SearchParamType;
043import org.hl7.fhir.dstu3.model.Enumerations.SearchParamTypeEnumFactory;
044import org.hl7.fhir.exceptions.FHIRException;
045import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
046import org.hl7.fhir.instance.model.api.IBaseConformance;
047import org.hl7.fhir.utilities.Utilities;
048
049import ca.uhn.fhir.model.api.annotation.Block;
050import ca.uhn.fhir.model.api.annotation.Child;
051import ca.uhn.fhir.model.api.annotation.ChildOrder;
052import ca.uhn.fhir.model.api.annotation.Description;
053import ca.uhn.fhir.model.api.annotation.ResourceDef;
054import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
055/**
056 * A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.
057 */
058@ResourceDef(name="CapabilityStatement", profile="http://hl7.org/fhir/Profile/CapabilityStatement")
059@ChildOrder(names={"url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "kind", "instantiates", "software", "implementation", "fhirVersion", "acceptUnknown", "format", "patchFormat", "implementationGuide", "profile", "rest", "messaging", "document"})
060public class CapabilityStatement extends MetadataResource implements IBaseConformance {
061
062    public enum CapabilityStatementKind {
063        /**
064         * The CapabilityStatement instance represents the present capabilities of a specific system instance.  This is the kind returned by OPTIONS for a FHIR server end-point.
065         */
066        INSTANCE, 
067        /**
068         * The CapabilityStatement instance represents the capabilities of a system or piece of software, independent of a particular installation.
069         */
070        CAPABILITY, 
071        /**
072         * The CapabilityStatement instance represents a set of requirements for other systems to meet; e.g. as part of an implementation guide or 'request for proposal'.
073         */
074        REQUIREMENTS, 
075        /**
076         * added to help the parsers with the generic types
077         */
078        NULL;
079        public static CapabilityStatementKind fromCode(String codeString) throws FHIRException {
080            if (codeString == null || "".equals(codeString))
081                return null;
082        if ("instance".equals(codeString))
083          return INSTANCE;
084        if ("capability".equals(codeString))
085          return CAPABILITY;
086        if ("requirements".equals(codeString))
087          return REQUIREMENTS;
088        if (Configuration.isAcceptInvalidEnums())
089          return null;
090        else
091          throw new FHIRException("Unknown CapabilityStatementKind code '"+codeString+"'");
092        }
093        public String toCode() {
094          switch (this) {
095            case INSTANCE: return "instance";
096            case CAPABILITY: return "capability";
097            case REQUIREMENTS: return "requirements";
098            case NULL: return null;
099            default: return "?";
100          }
101        }
102        public String getSystem() {
103          switch (this) {
104            case INSTANCE: return "http://hl7.org/fhir/capability-statement-kind";
105            case CAPABILITY: return "http://hl7.org/fhir/capability-statement-kind";
106            case REQUIREMENTS: return "http://hl7.org/fhir/capability-statement-kind";
107            case NULL: return null;
108            default: return "?";
109          }
110        }
111        public String getDefinition() {
112          switch (this) {
113            case INSTANCE: return "The CapabilityStatement instance represents the present capabilities of a specific system instance.  This is the kind returned by OPTIONS for a FHIR server end-point.";
114            case CAPABILITY: return "The CapabilityStatement instance represents the capabilities of a system or piece of software, independent of a particular installation.";
115            case REQUIREMENTS: return "The CapabilityStatement instance represents a set of requirements for other systems to meet; e.g. as part of an implementation guide or 'request for proposal'.";
116            case NULL: return null;
117            default: return "?";
118          }
119        }
120        public String getDisplay() {
121          switch (this) {
122            case INSTANCE: return "Instance";
123            case CAPABILITY: return "Capability";
124            case REQUIREMENTS: return "Requirements";
125            case NULL: return null;
126            default: return "?";
127          }
128        }
129    }
130
131  public static class CapabilityStatementKindEnumFactory implements EnumFactory<CapabilityStatementKind> {
132    public CapabilityStatementKind fromCode(String codeString) throws IllegalArgumentException {
133      if (codeString == null || "".equals(codeString))
134            if (codeString == null || "".equals(codeString))
135                return null;
136        if ("instance".equals(codeString))
137          return CapabilityStatementKind.INSTANCE;
138        if ("capability".equals(codeString))
139          return CapabilityStatementKind.CAPABILITY;
140        if ("requirements".equals(codeString))
141          return CapabilityStatementKind.REQUIREMENTS;
142        throw new IllegalArgumentException("Unknown CapabilityStatementKind code '"+codeString+"'");
143        }
144        public Enumeration<CapabilityStatementKind> fromType(Base code) throws FHIRException {
145          if (code == null)
146            return null;
147          if (code.isEmpty())
148            return new Enumeration<CapabilityStatementKind>(this);
149          String codeString = ((PrimitiveType) code).asStringValue();
150          if (codeString == null || "".equals(codeString))
151            return null;
152        if ("instance".equals(codeString))
153          return new Enumeration<CapabilityStatementKind>(this, CapabilityStatementKind.INSTANCE);
154        if ("capability".equals(codeString))
155          return new Enumeration<CapabilityStatementKind>(this, CapabilityStatementKind.CAPABILITY);
156        if ("requirements".equals(codeString))
157          return new Enumeration<CapabilityStatementKind>(this, CapabilityStatementKind.REQUIREMENTS);
158        throw new FHIRException("Unknown CapabilityStatementKind code '"+codeString+"'");
159        }
160    public String toCode(CapabilityStatementKind code) {
161      if (code == CapabilityStatementKind.INSTANCE)
162        return "instance";
163      if (code == CapabilityStatementKind.CAPABILITY)
164        return "capability";
165      if (code == CapabilityStatementKind.REQUIREMENTS)
166        return "requirements";
167      return "?";
168      }
169    public String toSystem(CapabilityStatementKind code) {
170      return code.getSystem();
171      }
172    }
173
174    public enum UnknownContentCode {
175        /**
176         * The application does not accept either unknown elements or extensions.
177         */
178        NO, 
179        /**
180         * The application accepts unknown extensions, but not unknown elements.
181         */
182        EXTENSIONS, 
183        /**
184         * The application accepts unknown elements, but not unknown extensions.
185         */
186        ELEMENTS, 
187        /**
188         * The application accepts unknown elements and extensions.
189         */
190        BOTH, 
191        /**
192         * added to help the parsers with the generic types
193         */
194        NULL;
195        public static UnknownContentCode fromCode(String codeString) throws FHIRException {
196            if (codeString == null || "".equals(codeString))
197                return null;
198        if ("no".equals(codeString))
199          return NO;
200        if ("extensions".equals(codeString))
201          return EXTENSIONS;
202        if ("elements".equals(codeString))
203          return ELEMENTS;
204        if ("both".equals(codeString))
205          return BOTH;
206        if (Configuration.isAcceptInvalidEnums())
207          return null;
208        else
209          throw new FHIRException("Unknown UnknownContentCode code '"+codeString+"'");
210        }
211        public String toCode() {
212          switch (this) {
213            case NO: return "no";
214            case EXTENSIONS: return "extensions";
215            case ELEMENTS: return "elements";
216            case BOTH: return "both";
217            case NULL: return null;
218            default: return "?";
219          }
220        }
221        public String getSystem() {
222          switch (this) {
223            case NO: return "http://hl7.org/fhir/unknown-content-code";
224            case EXTENSIONS: return "http://hl7.org/fhir/unknown-content-code";
225            case ELEMENTS: return "http://hl7.org/fhir/unknown-content-code";
226            case BOTH: return "http://hl7.org/fhir/unknown-content-code";
227            case NULL: return null;
228            default: return "?";
229          }
230        }
231        public String getDefinition() {
232          switch (this) {
233            case NO: return "The application does not accept either unknown elements or extensions.";
234            case EXTENSIONS: return "The application accepts unknown extensions, but not unknown elements.";
235            case ELEMENTS: return "The application accepts unknown elements, but not unknown extensions.";
236            case BOTH: return "The application accepts unknown elements and extensions.";
237            case NULL: return null;
238            default: return "?";
239          }
240        }
241        public String getDisplay() {
242          switch (this) {
243            case NO: return "Neither Elements or Extensions";
244            case EXTENSIONS: return "Unknown Extensions";
245            case ELEMENTS: return "Unknown Elements";
246            case BOTH: return "Unknown Elements and Extensions";
247            case NULL: return null;
248            default: return "?";
249          }
250        }
251    }
252
253  public static class UnknownContentCodeEnumFactory implements EnumFactory<UnknownContentCode> {
254    public UnknownContentCode fromCode(String codeString) throws IllegalArgumentException {
255      if (codeString == null || "".equals(codeString))
256            if (codeString == null || "".equals(codeString))
257                return null;
258        if ("no".equals(codeString))
259          return UnknownContentCode.NO;
260        if ("extensions".equals(codeString))
261          return UnknownContentCode.EXTENSIONS;
262        if ("elements".equals(codeString))
263          return UnknownContentCode.ELEMENTS;
264        if ("both".equals(codeString))
265          return UnknownContentCode.BOTH;
266        throw new IllegalArgumentException("Unknown UnknownContentCode code '"+codeString+"'");
267        }
268        public Enumeration<UnknownContentCode> fromType(Base code) throws FHIRException {
269          if (code == null)
270            return null;
271          if (code.isEmpty())
272            return new Enumeration<UnknownContentCode>(this);
273          String codeString = ((PrimitiveType) code).asStringValue();
274          if (codeString == null || "".equals(codeString))
275            return null;
276        if ("no".equals(codeString))
277          return new Enumeration<UnknownContentCode>(this, UnknownContentCode.NO);
278        if ("extensions".equals(codeString))
279          return new Enumeration<UnknownContentCode>(this, UnknownContentCode.EXTENSIONS);
280        if ("elements".equals(codeString))
281          return new Enumeration<UnknownContentCode>(this, UnknownContentCode.ELEMENTS);
282        if ("both".equals(codeString))
283          return new Enumeration<UnknownContentCode>(this, UnknownContentCode.BOTH);
284        throw new FHIRException("Unknown UnknownContentCode code '"+codeString+"'");
285        }
286    public String toCode(UnknownContentCode code) {
287      if (code == UnknownContentCode.NO)
288        return "no";
289      if (code == UnknownContentCode.EXTENSIONS)
290        return "extensions";
291      if (code == UnknownContentCode.ELEMENTS)
292        return "elements";
293      if (code == UnknownContentCode.BOTH)
294        return "both";
295      return "?";
296      }
297    public String toSystem(UnknownContentCode code) {
298      return code.getSystem();
299      }
300    }
301
302    public enum RestfulCapabilityMode {
303        /**
304         * The application acts as a client for this resource.
305         */
306        CLIENT, 
307        /**
308         * The application acts as a server for this resource.
309         */
310        SERVER, 
311        /**
312         * added to help the parsers with the generic types
313         */
314        NULL;
315        public static RestfulCapabilityMode fromCode(String codeString) throws FHIRException {
316            if (codeString == null || "".equals(codeString))
317                return null;
318        if ("client".equals(codeString))
319          return CLIENT;
320        if ("server".equals(codeString))
321          return SERVER;
322        if (Configuration.isAcceptInvalidEnums())
323          return null;
324        else
325          throw new FHIRException("Unknown RestfulCapabilityMode code '"+codeString+"'");
326        }
327        public String toCode() {
328          switch (this) {
329            case CLIENT: return "client";
330            case SERVER: return "server";
331            case NULL: return null;
332            default: return "?";
333          }
334        }
335        public String getSystem() {
336          switch (this) {
337            case CLIENT: return "http://hl7.org/fhir/restful-capability-mode";
338            case SERVER: return "http://hl7.org/fhir/restful-capability-mode";
339            case NULL: return null;
340            default: return "?";
341          }
342        }
343        public String getDefinition() {
344          switch (this) {
345            case CLIENT: return "The application acts as a client for this resource.";
346            case SERVER: return "The application acts as a server for this resource.";
347            case NULL: return null;
348            default: return "?";
349          }
350        }
351        public String getDisplay() {
352          switch (this) {
353            case CLIENT: return "Client";
354            case SERVER: return "Server";
355            case NULL: return null;
356            default: return "?";
357          }
358        }
359    }
360
361  public static class RestfulCapabilityModeEnumFactory implements EnumFactory<RestfulCapabilityMode> {
362    public RestfulCapabilityMode fromCode(String codeString) throws IllegalArgumentException {
363      if (codeString == null || "".equals(codeString))
364            if (codeString == null || "".equals(codeString))
365                return null;
366        if ("client".equals(codeString))
367          return RestfulCapabilityMode.CLIENT;
368        if ("server".equals(codeString))
369          return RestfulCapabilityMode.SERVER;
370        throw new IllegalArgumentException("Unknown RestfulCapabilityMode code '"+codeString+"'");
371        }
372        public Enumeration<RestfulCapabilityMode> fromType(Base code) throws FHIRException {
373          if (code == null)
374            return null;
375          if (code.isEmpty())
376            return new Enumeration<RestfulCapabilityMode>(this);
377          String codeString = ((PrimitiveType) code).asStringValue();
378          if (codeString == null || "".equals(codeString))
379            return null;
380        if ("client".equals(codeString))
381          return new Enumeration<RestfulCapabilityMode>(this, RestfulCapabilityMode.CLIENT);
382        if ("server".equals(codeString))
383          return new Enumeration<RestfulCapabilityMode>(this, RestfulCapabilityMode.SERVER);
384        throw new FHIRException("Unknown RestfulCapabilityMode code '"+codeString+"'");
385        }
386    public String toCode(RestfulCapabilityMode code) {
387      if (code == RestfulCapabilityMode.CLIENT)
388        return "client";
389      if (code == RestfulCapabilityMode.SERVER)
390        return "server";
391      return "?";
392      }
393    public String toSystem(RestfulCapabilityMode code) {
394      return code.getSystem();
395      }
396    }
397
398    public enum TypeRestfulInteraction {
399        /**
400         * null
401         */
402        READ, 
403        /**
404         * null
405         */
406        VREAD, 
407        /**
408         * null
409         */
410        UPDATE, 
411        /**
412         * null
413         */
414        PATCH, 
415        /**
416         * null
417         */
418        DELETE, 
419        /**
420         * null
421         */
422        HISTORYINSTANCE, 
423        /**
424         * null
425         */
426        HISTORYTYPE, 
427        /**
428         * null
429         */
430        CREATE, 
431        /**
432         * null
433         */
434        SEARCHTYPE, 
435        /**
436         * added to help the parsers with the generic types
437         */
438        NULL;
439        public static TypeRestfulInteraction fromCode(String codeString) throws FHIRException {
440            if (codeString == null || "".equals(codeString))
441                return null;
442        if ("read".equals(codeString))
443          return READ;
444        if ("vread".equals(codeString))
445          return VREAD;
446        if ("update".equals(codeString))
447          return UPDATE;
448        if ("patch".equals(codeString))
449          return PATCH;
450        if ("delete".equals(codeString))
451          return DELETE;
452        if ("history-instance".equals(codeString))
453          return HISTORYINSTANCE;
454        if ("history-type".equals(codeString))
455          return HISTORYTYPE;
456        if ("create".equals(codeString))
457          return CREATE;
458        if ("search-type".equals(codeString))
459          return SEARCHTYPE;
460        if (Configuration.isAcceptInvalidEnums())
461          return null;
462        else
463          throw new FHIRException("Unknown TypeRestfulInteraction code '"+codeString+"'");
464        }
465        public String toCode() {
466          switch (this) {
467            case READ: return "read";
468            case VREAD: return "vread";
469            case UPDATE: return "update";
470            case PATCH: return "patch";
471            case DELETE: return "delete";
472            case HISTORYINSTANCE: return "history-instance";
473            case HISTORYTYPE: return "history-type";
474            case CREATE: return "create";
475            case SEARCHTYPE: return "search-type";
476            case NULL: return null;
477            default: return "?";
478          }
479        }
480        public String getSystem() {
481          switch (this) {
482            case READ: return "http://hl7.org/fhir/restful-interaction";
483            case VREAD: return "http://hl7.org/fhir/restful-interaction";
484            case UPDATE: return "http://hl7.org/fhir/restful-interaction";
485            case PATCH: return "http://hl7.org/fhir/restful-interaction";
486            case DELETE: return "http://hl7.org/fhir/restful-interaction";
487            case HISTORYINSTANCE: return "http://hl7.org/fhir/restful-interaction";
488            case HISTORYTYPE: return "http://hl7.org/fhir/restful-interaction";
489            case CREATE: return "http://hl7.org/fhir/restful-interaction";
490            case SEARCHTYPE: return "http://hl7.org/fhir/restful-interaction";
491            case NULL: return null;
492            default: return "?";
493          }
494        }
495        public String getDefinition() {
496          switch (this) {
497            case READ: return "";
498            case VREAD: return "";
499            case UPDATE: return "";
500            case PATCH: return "";
501            case DELETE: return "";
502            case HISTORYINSTANCE: return "";
503            case HISTORYTYPE: return "";
504            case CREATE: return "";
505            case SEARCHTYPE: return "";
506            case NULL: return null;
507            default: return "?";
508          }
509        }
510        public String getDisplay() {
511          switch (this) {
512            case READ: return "read";
513            case VREAD: return "vread";
514            case UPDATE: return "update";
515            case PATCH: return "patch";
516            case DELETE: return "delete";
517            case HISTORYINSTANCE: return "history-instance";
518            case HISTORYTYPE: return "history-type";
519            case CREATE: return "create";
520            case SEARCHTYPE: return "search-type";
521            case NULL: return null;
522            default: return "?";
523          }
524        }
525    }
526
527  public static class TypeRestfulInteractionEnumFactory implements EnumFactory<TypeRestfulInteraction> {
528    public TypeRestfulInteraction fromCode(String codeString) throws IllegalArgumentException {
529      if (codeString == null || "".equals(codeString))
530            if (codeString == null || "".equals(codeString))
531                return null;
532        if ("read".equals(codeString))
533          return TypeRestfulInteraction.READ;
534        if ("vread".equals(codeString))
535          return TypeRestfulInteraction.VREAD;
536        if ("update".equals(codeString))
537          return TypeRestfulInteraction.UPDATE;
538        if ("patch".equals(codeString))
539          return TypeRestfulInteraction.PATCH;
540        if ("delete".equals(codeString))
541          return TypeRestfulInteraction.DELETE;
542        if ("history-instance".equals(codeString))
543          return TypeRestfulInteraction.HISTORYINSTANCE;
544        if ("history-type".equals(codeString))
545          return TypeRestfulInteraction.HISTORYTYPE;
546        if ("create".equals(codeString))
547          return TypeRestfulInteraction.CREATE;
548        if ("search-type".equals(codeString))
549          return TypeRestfulInteraction.SEARCHTYPE;
550        throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'");
551        }
552        public Enumeration<TypeRestfulInteraction> fromType(Base code) throws FHIRException {
553          if (code == null)
554            return null;
555          if (code.isEmpty())
556            return new Enumeration<TypeRestfulInteraction>(this);
557          String codeString = ((PrimitiveType) code).asStringValue();
558          if (codeString == null || "".equals(codeString))
559            return null;
560        if ("read".equals(codeString))
561          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.READ);
562        if ("vread".equals(codeString))
563          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.VREAD);
564        if ("update".equals(codeString))
565          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.UPDATE);
566        if ("patch".equals(codeString))
567          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.PATCH);
568        if ("delete".equals(codeString))
569          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.DELETE);
570        if ("history-instance".equals(codeString))
571          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.HISTORYINSTANCE);
572        if ("history-type".equals(codeString))
573          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.HISTORYTYPE);
574        if ("create".equals(codeString))
575          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.CREATE);
576        if ("search-type".equals(codeString))
577          return new Enumeration<TypeRestfulInteraction>(this, TypeRestfulInteraction.SEARCHTYPE);
578        throw new FHIRException("Unknown TypeRestfulInteraction code '"+codeString+"'");
579        }
580    public String toCode(TypeRestfulInteraction code) {
581      if (code == TypeRestfulInteraction.READ)
582        return "read";
583      if (code == TypeRestfulInteraction.VREAD)
584        return "vread";
585      if (code == TypeRestfulInteraction.UPDATE)
586        return "update";
587      if (code == TypeRestfulInteraction.PATCH)
588        return "patch";
589      if (code == TypeRestfulInteraction.DELETE)
590        return "delete";
591      if (code == TypeRestfulInteraction.HISTORYINSTANCE)
592        return "history-instance";
593      if (code == TypeRestfulInteraction.HISTORYTYPE)
594        return "history-type";
595      if (code == TypeRestfulInteraction.CREATE)
596        return "create";
597      if (code == TypeRestfulInteraction.SEARCHTYPE)
598        return "search-type";
599      return "?";
600      }
601    public String toSystem(TypeRestfulInteraction code) {
602      return code.getSystem();
603      }
604    }
605
606    public enum ResourceVersionPolicy {
607        /**
608         * VersionId meta-property is not supported (server) or used (client).
609         */
610        NOVERSION, 
611        /**
612         * VersionId meta-property is supported (server) or used (client).
613         */
614        VERSIONED, 
615        /**
616         * VersionId must be correct for updates (server) or will be specified (If-match header) for updates (client).
617         */
618        VERSIONEDUPDATE, 
619        /**
620         * added to help the parsers with the generic types
621         */
622        NULL;
623        public static ResourceVersionPolicy fromCode(String codeString) throws FHIRException {
624            if (codeString == null || "".equals(codeString))
625                return null;
626        if ("no-version".equals(codeString))
627          return NOVERSION;
628        if ("versioned".equals(codeString))
629          return VERSIONED;
630        if ("versioned-update".equals(codeString))
631          return VERSIONEDUPDATE;
632        if (Configuration.isAcceptInvalidEnums())
633          return null;
634        else
635          throw new FHIRException("Unknown ResourceVersionPolicy code '"+codeString+"'");
636        }
637        public String toCode() {
638          switch (this) {
639            case NOVERSION: return "no-version";
640            case VERSIONED: return "versioned";
641            case VERSIONEDUPDATE: return "versioned-update";
642            case NULL: return null;
643            default: return "?";
644          }
645        }
646        public String getSystem() {
647          switch (this) {
648            case NOVERSION: return "http://hl7.org/fhir/versioning-policy";
649            case VERSIONED: return "http://hl7.org/fhir/versioning-policy";
650            case VERSIONEDUPDATE: return "http://hl7.org/fhir/versioning-policy";
651            case NULL: return null;
652            default: return "?";
653          }
654        }
655        public String getDefinition() {
656          switch (this) {
657            case NOVERSION: return "VersionId meta-property is not supported (server) or used (client).";
658            case VERSIONED: return "VersionId meta-property is supported (server) or used (client).";
659            case VERSIONEDUPDATE: return "VersionId must be correct for updates (server) or will be specified (If-match header) for updates (client).";
660            case NULL: return null;
661            default: return "?";
662          }
663        }
664        public String getDisplay() {
665          switch (this) {
666            case NOVERSION: return "No VersionId Support";
667            case VERSIONED: return "Versioned";
668            case VERSIONEDUPDATE: return "VersionId tracked fully";
669            case NULL: return null;
670            default: return "?";
671          }
672        }
673    }
674
675  public static class ResourceVersionPolicyEnumFactory implements EnumFactory<ResourceVersionPolicy> {
676    public ResourceVersionPolicy fromCode(String codeString) throws IllegalArgumentException {
677      if (codeString == null || "".equals(codeString))
678            if (codeString == null || "".equals(codeString))
679                return null;
680        if ("no-version".equals(codeString))
681          return ResourceVersionPolicy.NOVERSION;
682        if ("versioned".equals(codeString))
683          return ResourceVersionPolicy.VERSIONED;
684        if ("versioned-update".equals(codeString))
685          return ResourceVersionPolicy.VERSIONEDUPDATE;
686        throw new IllegalArgumentException("Unknown ResourceVersionPolicy code '"+codeString+"'");
687        }
688        public Enumeration<ResourceVersionPolicy> fromType(Base code) throws FHIRException {
689          if (code == null)
690            return null;
691          if (code.isEmpty())
692            return new Enumeration<ResourceVersionPolicy>(this);
693          String codeString = ((PrimitiveType) code).asStringValue();
694          if (codeString == null || "".equals(codeString))
695            return null;
696        if ("no-version".equals(codeString))
697          return new Enumeration<ResourceVersionPolicy>(this, ResourceVersionPolicy.NOVERSION);
698        if ("versioned".equals(codeString))
699          return new Enumeration<ResourceVersionPolicy>(this, ResourceVersionPolicy.VERSIONED);
700        if ("versioned-update".equals(codeString))
701          return new Enumeration<ResourceVersionPolicy>(this, ResourceVersionPolicy.VERSIONEDUPDATE);
702        throw new FHIRException("Unknown ResourceVersionPolicy code '"+codeString+"'");
703        }
704    public String toCode(ResourceVersionPolicy code) {
705      if (code == ResourceVersionPolicy.NOVERSION)
706        return "no-version";
707      if (code == ResourceVersionPolicy.VERSIONED)
708        return "versioned";
709      if (code == ResourceVersionPolicy.VERSIONEDUPDATE)
710        return "versioned-update";
711      return "?";
712      }
713    public String toSystem(ResourceVersionPolicy code) {
714      return code.getSystem();
715      }
716    }
717
718    public enum ConditionalReadStatus {
719        /**
720         * No support for conditional deletes.
721         */
722        NOTSUPPORTED, 
723        /**
724         * Conditional reads are supported, but only with the If-Modified-Since HTTP Header.
725         */
726        MODIFIEDSINCE, 
727        /**
728         * Conditional reads are supported, but only with the If-None-Match HTTP Header.
729         */
730        NOTMATCH, 
731        /**
732         * Conditional reads are supported, with both If-Modified-Since and If-None-Match HTTP Headers.
733         */
734        FULLSUPPORT, 
735        /**
736         * added to help the parsers with the generic types
737         */
738        NULL;
739        public static ConditionalReadStatus fromCode(String codeString) throws FHIRException {
740            if (codeString == null || "".equals(codeString))
741                return null;
742        if ("not-supported".equals(codeString))
743          return NOTSUPPORTED;
744        if ("modified-since".equals(codeString))
745          return MODIFIEDSINCE;
746        if ("not-match".equals(codeString))
747          return NOTMATCH;
748        if ("full-support".equals(codeString))
749          return FULLSUPPORT;
750        if (Configuration.isAcceptInvalidEnums())
751          return null;
752        else
753          throw new FHIRException("Unknown ConditionalReadStatus code '"+codeString+"'");
754        }
755        public String toCode() {
756          switch (this) {
757            case NOTSUPPORTED: return "not-supported";
758            case MODIFIEDSINCE: return "modified-since";
759            case NOTMATCH: return "not-match";
760            case FULLSUPPORT: return "full-support";
761            case NULL: return null;
762            default: return "?";
763          }
764        }
765        public String getSystem() {
766          switch (this) {
767            case NOTSUPPORTED: return "http://hl7.org/fhir/conditional-read-status";
768            case MODIFIEDSINCE: return "http://hl7.org/fhir/conditional-read-status";
769            case NOTMATCH: return "http://hl7.org/fhir/conditional-read-status";
770            case FULLSUPPORT: return "http://hl7.org/fhir/conditional-read-status";
771            case NULL: return null;
772            default: return "?";
773          }
774        }
775        public String getDefinition() {
776          switch (this) {
777            case NOTSUPPORTED: return "No support for conditional deletes.";
778            case MODIFIEDSINCE: return "Conditional reads are supported, but only with the If-Modified-Since HTTP Header.";
779            case NOTMATCH: return "Conditional reads are supported, but only with the If-None-Match HTTP Header.";
780            case FULLSUPPORT: return "Conditional reads are supported, with both If-Modified-Since and If-None-Match HTTP Headers.";
781            case NULL: return null;
782            default: return "?";
783          }
784        }
785        public String getDisplay() {
786          switch (this) {
787            case NOTSUPPORTED: return "Not Supported";
788            case MODIFIEDSINCE: return "If-Modified-Since";
789            case NOTMATCH: return "If-None-Match";
790            case FULLSUPPORT: return "Full Support";
791            case NULL: return null;
792            default: return "?";
793          }
794        }
795    }
796
797  public static class ConditionalReadStatusEnumFactory implements EnumFactory<ConditionalReadStatus> {
798    public ConditionalReadStatus fromCode(String codeString) throws IllegalArgumentException {
799      if (codeString == null || "".equals(codeString))
800            if (codeString == null || "".equals(codeString))
801                return null;
802        if ("not-supported".equals(codeString))
803          return ConditionalReadStatus.NOTSUPPORTED;
804        if ("modified-since".equals(codeString))
805          return ConditionalReadStatus.MODIFIEDSINCE;
806        if ("not-match".equals(codeString))
807          return ConditionalReadStatus.NOTMATCH;
808        if ("full-support".equals(codeString))
809          return ConditionalReadStatus.FULLSUPPORT;
810        throw new IllegalArgumentException("Unknown ConditionalReadStatus code '"+codeString+"'");
811        }
812        public Enumeration<ConditionalReadStatus> fromType(Base code) throws FHIRException {
813          if (code == null)
814            return null;
815          if (code.isEmpty())
816            return new Enumeration<ConditionalReadStatus>(this);
817          String codeString = ((PrimitiveType) code).asStringValue();
818          if (codeString == null || "".equals(codeString))
819            return null;
820        if ("not-supported".equals(codeString))
821          return new Enumeration<ConditionalReadStatus>(this, ConditionalReadStatus.NOTSUPPORTED);
822        if ("modified-since".equals(codeString))
823          return new Enumeration<ConditionalReadStatus>(this, ConditionalReadStatus.MODIFIEDSINCE);
824        if ("not-match".equals(codeString))
825          return new Enumeration<ConditionalReadStatus>(this, ConditionalReadStatus.NOTMATCH);
826        if ("full-support".equals(codeString))
827          return new Enumeration<ConditionalReadStatus>(this, ConditionalReadStatus.FULLSUPPORT);
828        throw new FHIRException("Unknown ConditionalReadStatus code '"+codeString+"'");
829        }
830    public String toCode(ConditionalReadStatus code) {
831      if (code == ConditionalReadStatus.NOTSUPPORTED)
832        return "not-supported";
833      if (code == ConditionalReadStatus.MODIFIEDSINCE)
834        return "modified-since";
835      if (code == ConditionalReadStatus.NOTMATCH)
836        return "not-match";
837      if (code == ConditionalReadStatus.FULLSUPPORT)
838        return "full-support";
839      return "?";
840      }
841    public String toSystem(ConditionalReadStatus code) {
842      return code.getSystem();
843      }
844    }
845
846    public enum ConditionalDeleteStatus {
847        /**
848         * No support for conditional deletes.
849         */
850        NOTSUPPORTED, 
851        /**
852         * Conditional deletes are supported, but only single resources at a time.
853         */
854        SINGLE, 
855        /**
856         * Conditional deletes are supported, and multiple resources can be deleted in a single interaction.
857         */
858        MULTIPLE, 
859        /**
860         * added to help the parsers with the generic types
861         */
862        NULL;
863        public static ConditionalDeleteStatus fromCode(String codeString) throws FHIRException {
864            if (codeString == null || "".equals(codeString))
865                return null;
866        if ("not-supported".equals(codeString))
867          return NOTSUPPORTED;
868        if ("single".equals(codeString))
869          return SINGLE;
870        if ("multiple".equals(codeString))
871          return MULTIPLE;
872        if (Configuration.isAcceptInvalidEnums())
873          return null;
874        else
875          throw new FHIRException("Unknown ConditionalDeleteStatus code '"+codeString+"'");
876        }
877        public String toCode() {
878          switch (this) {
879            case NOTSUPPORTED: return "not-supported";
880            case SINGLE: return "single";
881            case MULTIPLE: return "multiple";
882            case NULL: return null;
883            default: return "?";
884          }
885        }
886        public String getSystem() {
887          switch (this) {
888            case NOTSUPPORTED: return "http://hl7.org/fhir/conditional-delete-status";
889            case SINGLE: return "http://hl7.org/fhir/conditional-delete-status";
890            case MULTIPLE: return "http://hl7.org/fhir/conditional-delete-status";
891            case NULL: return null;
892            default: return "?";
893          }
894        }
895        public String getDefinition() {
896          switch (this) {
897            case NOTSUPPORTED: return "No support for conditional deletes.";
898            case SINGLE: return "Conditional deletes are supported, but only single resources at a time.";
899            case MULTIPLE: return "Conditional deletes are supported, and multiple resources can be deleted in a single interaction.";
900            case NULL: return null;
901            default: return "?";
902          }
903        }
904        public String getDisplay() {
905          switch (this) {
906            case NOTSUPPORTED: return "Not Supported";
907            case SINGLE: return "Single Deletes Supported";
908            case MULTIPLE: return "Multiple Deletes Supported";
909            case NULL: return null;
910            default: return "?";
911          }
912        }
913    }
914
915  public static class ConditionalDeleteStatusEnumFactory implements EnumFactory<ConditionalDeleteStatus> {
916    public ConditionalDeleteStatus fromCode(String codeString) throws IllegalArgumentException {
917      if (codeString == null || "".equals(codeString))
918            if (codeString == null || "".equals(codeString))
919                return null;
920        if ("not-supported".equals(codeString))
921          return ConditionalDeleteStatus.NOTSUPPORTED;
922        if ("single".equals(codeString))
923          return ConditionalDeleteStatus.SINGLE;
924        if ("multiple".equals(codeString))
925          return ConditionalDeleteStatus.MULTIPLE;
926        throw new IllegalArgumentException("Unknown ConditionalDeleteStatus code '"+codeString+"'");
927        }
928        public Enumeration<ConditionalDeleteStatus> fromType(Base code) throws FHIRException {
929          if (code == null)
930            return null;
931          if (code.isEmpty())
932            return new Enumeration<ConditionalDeleteStatus>(this);
933          String codeString = ((PrimitiveType) code).asStringValue();
934          if (codeString == null || "".equals(codeString))
935            return null;
936        if ("not-supported".equals(codeString))
937          return new Enumeration<ConditionalDeleteStatus>(this, ConditionalDeleteStatus.NOTSUPPORTED);
938        if ("single".equals(codeString))
939          return new Enumeration<ConditionalDeleteStatus>(this, ConditionalDeleteStatus.SINGLE);
940        if ("multiple".equals(codeString))
941          return new Enumeration<ConditionalDeleteStatus>(this, ConditionalDeleteStatus.MULTIPLE);
942        throw new FHIRException("Unknown ConditionalDeleteStatus code '"+codeString+"'");
943        }
944    public String toCode(ConditionalDeleteStatus code) {
945      if (code == ConditionalDeleteStatus.NOTSUPPORTED)
946        return "not-supported";
947      if (code == ConditionalDeleteStatus.SINGLE)
948        return "single";
949      if (code == ConditionalDeleteStatus.MULTIPLE)
950        return "multiple";
951      return "?";
952      }
953    public String toSystem(ConditionalDeleteStatus code) {
954      return code.getSystem();
955      }
956    }
957
958    public enum ReferenceHandlingPolicy {
959        /**
960         * The server supports and populates Literal references where they are known (this code does not guarantee that all references are literal; see 'enforced')
961         */
962        LITERAL, 
963        /**
964         * The server allows logical references
965         */
966        LOGICAL, 
967        /**
968         * The server will attempt to resolve logical references to literal references (if resolution fails, the server may still accept resources; see logical)
969         */
970        RESOLVES, 
971        /**
972         * The server enforces that references have integrity - e.g. it ensures that references can always be resolved. This is typically the case for clinical record systems, but often not the case for middleware/proxy systems
973         */
974        ENFORCED, 
975        /**
976         * The server does not support references that point to other servers
977         */
978        LOCAL, 
979        /**
980         * added to help the parsers with the generic types
981         */
982        NULL;
983        public static ReferenceHandlingPolicy fromCode(String codeString) throws FHIRException {
984            if (codeString == null || "".equals(codeString))
985                return null;
986        if ("literal".equals(codeString))
987          return LITERAL;
988        if ("logical".equals(codeString))
989          return LOGICAL;
990        if ("resolves".equals(codeString))
991          return RESOLVES;
992        if ("enforced".equals(codeString))
993          return ENFORCED;
994        if ("local".equals(codeString))
995          return LOCAL;
996        if (Configuration.isAcceptInvalidEnums())
997          return null;
998        else
999          throw new FHIRException("Unknown ReferenceHandlingPolicy code '"+codeString+"'");
1000        }
1001        public String toCode() {
1002          switch (this) {
1003            case LITERAL: return "literal";
1004            case LOGICAL: return "logical";
1005            case RESOLVES: return "resolves";
1006            case ENFORCED: return "enforced";
1007            case LOCAL: return "local";
1008            case NULL: return null;
1009            default: return "?";
1010          }
1011        }
1012        public String getSystem() {
1013          switch (this) {
1014            case LITERAL: return "http://hl7.org/fhir/reference-handling-policy";
1015            case LOGICAL: return "http://hl7.org/fhir/reference-handling-policy";
1016            case RESOLVES: return "http://hl7.org/fhir/reference-handling-policy";
1017            case ENFORCED: return "http://hl7.org/fhir/reference-handling-policy";
1018            case LOCAL: return "http://hl7.org/fhir/reference-handling-policy";
1019            case NULL: return null;
1020            default: return "?";
1021          }
1022        }
1023        public String getDefinition() {
1024          switch (this) {
1025            case LITERAL: return "The server supports and populates Literal references where they are known (this code does not guarantee that all references are literal; see 'enforced')";
1026            case LOGICAL: return "The server allows logical references";
1027            case RESOLVES: return "The server will attempt to resolve logical references to literal references (if resolution fails, the server may still accept resources; see logical)";
1028            case ENFORCED: return "The server enforces that references have integrity - e.g. it ensures that references can always be resolved. This is typically the case for clinical record systems, but often not the case for middleware/proxy systems";
1029            case LOCAL: return "The server does not support references that point to other servers";
1030            case NULL: return null;
1031            default: return "?";
1032          }
1033        }
1034        public String getDisplay() {
1035          switch (this) {
1036            case LITERAL: return "Literal References";
1037            case LOGICAL: return "Logical References";
1038            case RESOLVES: return "Resolves References";
1039            case ENFORCED: return "Reference Integrity Enforced";
1040            case LOCAL: return "Local References Only";
1041            case NULL: return null;
1042            default: return "?";
1043          }
1044        }
1045    }
1046
1047  public static class ReferenceHandlingPolicyEnumFactory implements EnumFactory<ReferenceHandlingPolicy> {
1048    public ReferenceHandlingPolicy fromCode(String codeString) throws IllegalArgumentException {
1049      if (codeString == null || "".equals(codeString))
1050            if (codeString == null || "".equals(codeString))
1051                return null;
1052        if ("literal".equals(codeString))
1053          return ReferenceHandlingPolicy.LITERAL;
1054        if ("logical".equals(codeString))
1055          return ReferenceHandlingPolicy.LOGICAL;
1056        if ("resolves".equals(codeString))
1057          return ReferenceHandlingPolicy.RESOLVES;
1058        if ("enforced".equals(codeString))
1059          return ReferenceHandlingPolicy.ENFORCED;
1060        if ("local".equals(codeString))
1061          return ReferenceHandlingPolicy.LOCAL;
1062        throw new IllegalArgumentException("Unknown ReferenceHandlingPolicy code '"+codeString+"'");
1063        }
1064        public Enumeration<ReferenceHandlingPolicy> fromType(Base code) throws FHIRException {
1065          if (code == null)
1066            return null;
1067          if (code.isEmpty())
1068            return new Enumeration<ReferenceHandlingPolicy>(this);
1069          String codeString = ((PrimitiveType) code).asStringValue();
1070          if (codeString == null || "".equals(codeString))
1071            return null;
1072        if ("literal".equals(codeString))
1073          return new Enumeration<ReferenceHandlingPolicy>(this, ReferenceHandlingPolicy.LITERAL);
1074        if ("logical".equals(codeString))
1075          return new Enumeration<ReferenceHandlingPolicy>(this, ReferenceHandlingPolicy.LOGICAL);
1076        if ("resolves".equals(codeString))
1077          return new Enumeration<ReferenceHandlingPolicy>(this, ReferenceHandlingPolicy.RESOLVES);
1078        if ("enforced".equals(codeString))
1079          return new Enumeration<ReferenceHandlingPolicy>(this, ReferenceHandlingPolicy.ENFORCED);
1080        if ("local".equals(codeString))
1081          return new Enumeration<ReferenceHandlingPolicy>(this, ReferenceHandlingPolicy.LOCAL);
1082        throw new FHIRException("Unknown ReferenceHandlingPolicy code '"+codeString+"'");
1083        }
1084    public String toCode(ReferenceHandlingPolicy code) {
1085      if (code == ReferenceHandlingPolicy.LITERAL)
1086        return "literal";
1087      if (code == ReferenceHandlingPolicy.LOGICAL)
1088        return "logical";
1089      if (code == ReferenceHandlingPolicy.RESOLVES)
1090        return "resolves";
1091      if (code == ReferenceHandlingPolicy.ENFORCED)
1092        return "enforced";
1093      if (code == ReferenceHandlingPolicy.LOCAL)
1094        return "local";
1095      return "?";
1096      }
1097    public String toSystem(ReferenceHandlingPolicy code) {
1098      return code.getSystem();
1099      }
1100    }
1101
1102    public enum SystemRestfulInteraction {
1103        /**
1104         * null
1105         */
1106        TRANSACTION, 
1107        /**
1108         * null
1109         */
1110        BATCH, 
1111        /**
1112         * null
1113         */
1114        SEARCHSYSTEM, 
1115        /**
1116         * null
1117         */
1118        HISTORYSYSTEM, 
1119        /**
1120         * added to help the parsers with the generic types
1121         */
1122        NULL;
1123        public static SystemRestfulInteraction fromCode(String codeString) throws FHIRException {
1124            if (codeString == null || "".equals(codeString))
1125                return null;
1126        if ("transaction".equals(codeString))
1127          return TRANSACTION;
1128        if ("batch".equals(codeString))
1129          return BATCH;
1130        if ("search-system".equals(codeString))
1131          return SEARCHSYSTEM;
1132        if ("history-system".equals(codeString))
1133          return HISTORYSYSTEM;
1134        if (Configuration.isAcceptInvalidEnums())
1135          return null;
1136        else
1137          throw new FHIRException("Unknown SystemRestfulInteraction code '"+codeString+"'");
1138        }
1139        public String toCode() {
1140          switch (this) {
1141            case TRANSACTION: return "transaction";
1142            case BATCH: return "batch";
1143            case SEARCHSYSTEM: return "search-system";
1144            case HISTORYSYSTEM: return "history-system";
1145            case NULL: return null;
1146            default: return "?";
1147          }
1148        }
1149        public String getSystem() {
1150          switch (this) {
1151            case TRANSACTION: return "http://hl7.org/fhir/restful-interaction";
1152            case BATCH: return "http://hl7.org/fhir/restful-interaction";
1153            case SEARCHSYSTEM: return "http://hl7.org/fhir/restful-interaction";
1154            case HISTORYSYSTEM: return "http://hl7.org/fhir/restful-interaction";
1155            case NULL: return null;
1156            default: return "?";
1157          }
1158        }
1159        public String getDefinition() {
1160          switch (this) {
1161            case TRANSACTION: return "";
1162            case BATCH: return "";
1163            case SEARCHSYSTEM: return "";
1164            case HISTORYSYSTEM: return "";
1165            case NULL: return null;
1166            default: return "?";
1167          }
1168        }
1169        public String getDisplay() {
1170          switch (this) {
1171            case TRANSACTION: return "transaction";
1172            case BATCH: return "batch";
1173            case SEARCHSYSTEM: return "search-system";
1174            case HISTORYSYSTEM: return "history-system";
1175            case NULL: return null;
1176            default: return "?";
1177          }
1178        }
1179    }
1180
1181  public static class SystemRestfulInteractionEnumFactory implements EnumFactory<SystemRestfulInteraction> {
1182    public SystemRestfulInteraction fromCode(String codeString) throws IllegalArgumentException {
1183      if (codeString == null || "".equals(codeString))
1184            if (codeString == null || "".equals(codeString))
1185                return null;
1186        if ("transaction".equals(codeString))
1187          return SystemRestfulInteraction.TRANSACTION;
1188        if ("batch".equals(codeString))
1189          return SystemRestfulInteraction.BATCH;
1190        if ("search-system".equals(codeString))
1191          return SystemRestfulInteraction.SEARCHSYSTEM;
1192        if ("history-system".equals(codeString))
1193          return SystemRestfulInteraction.HISTORYSYSTEM;
1194        throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'");
1195        }
1196        public Enumeration<SystemRestfulInteraction> fromType(Base code) throws FHIRException {
1197          if (code == null)
1198            return null;
1199          if (code.isEmpty())
1200            return new Enumeration<SystemRestfulInteraction>(this);
1201          String codeString = ((PrimitiveType) code).asStringValue();
1202          if (codeString == null || "".equals(codeString))
1203            return null;
1204        if ("transaction".equals(codeString))
1205          return new Enumeration<SystemRestfulInteraction>(this, SystemRestfulInteraction.TRANSACTION);
1206        if ("batch".equals(codeString))
1207          return new Enumeration<SystemRestfulInteraction>(this, SystemRestfulInteraction.BATCH);
1208        if ("search-system".equals(codeString))
1209          return new Enumeration<SystemRestfulInteraction>(this, SystemRestfulInteraction.SEARCHSYSTEM);
1210        if ("history-system".equals(codeString))
1211          return new Enumeration<SystemRestfulInteraction>(this, SystemRestfulInteraction.HISTORYSYSTEM);
1212        throw new FHIRException("Unknown SystemRestfulInteraction code '"+codeString+"'");
1213        }
1214    public String toCode(SystemRestfulInteraction code) {
1215      if (code == SystemRestfulInteraction.TRANSACTION)
1216        return "transaction";
1217      if (code == SystemRestfulInteraction.BATCH)
1218        return "batch";
1219      if (code == SystemRestfulInteraction.SEARCHSYSTEM)
1220        return "search-system";
1221      if (code == SystemRestfulInteraction.HISTORYSYSTEM)
1222        return "history-system";
1223      return "?";
1224      }
1225    public String toSystem(SystemRestfulInteraction code) {
1226      return code.getSystem();
1227      }
1228    }
1229
1230    public enum EventCapabilityMode {
1231        /**
1232         * The application sends requests and receives responses.
1233         */
1234        SENDER, 
1235        /**
1236         * The application receives requests and sends responses.
1237         */
1238        RECEIVER, 
1239        /**
1240         * added to help the parsers with the generic types
1241         */
1242        NULL;
1243        public static EventCapabilityMode fromCode(String codeString) throws FHIRException {
1244            if (codeString == null || "".equals(codeString))
1245                return null;
1246        if ("sender".equals(codeString))
1247          return SENDER;
1248        if ("receiver".equals(codeString))
1249          return RECEIVER;
1250        if (Configuration.isAcceptInvalidEnums())
1251          return null;
1252        else
1253          throw new FHIRException("Unknown EventCapabilityMode code '"+codeString+"'");
1254        }
1255        public String toCode() {
1256          switch (this) {
1257            case SENDER: return "sender";
1258            case RECEIVER: return "receiver";
1259            case NULL: return null;
1260            default: return "?";
1261          }
1262        }
1263        public String getSystem() {
1264          switch (this) {
1265            case SENDER: return "http://hl7.org/fhir/event-capability-mode";
1266            case RECEIVER: return "http://hl7.org/fhir/event-capability-mode";
1267            case NULL: return null;
1268            default: return "?";
1269          }
1270        }
1271        public String getDefinition() {
1272          switch (this) {
1273            case SENDER: return "The application sends requests and receives responses.";
1274            case RECEIVER: return "The application receives requests and sends responses.";
1275            case NULL: return null;
1276            default: return "?";
1277          }
1278        }
1279        public String getDisplay() {
1280          switch (this) {
1281            case SENDER: return "Sender";
1282            case RECEIVER: return "Receiver";
1283            case NULL: return null;
1284            default: return "?";
1285          }
1286        }
1287    }
1288
1289  public static class EventCapabilityModeEnumFactory implements EnumFactory<EventCapabilityMode> {
1290    public EventCapabilityMode fromCode(String codeString) throws IllegalArgumentException {
1291      if (codeString == null || "".equals(codeString))
1292            if (codeString == null || "".equals(codeString))
1293                return null;
1294        if ("sender".equals(codeString))
1295          return EventCapabilityMode.SENDER;
1296        if ("receiver".equals(codeString))
1297          return EventCapabilityMode.RECEIVER;
1298        throw new IllegalArgumentException("Unknown EventCapabilityMode code '"+codeString+"'");
1299        }
1300        public Enumeration<EventCapabilityMode> fromType(Base code) throws FHIRException {
1301          if (code == null)
1302            return null;
1303          if (code.isEmpty())
1304            return new Enumeration<EventCapabilityMode>(this);
1305          String codeString = ((PrimitiveType) code).asStringValue();
1306          if (codeString == null || "".equals(codeString))
1307            return null;
1308        if ("sender".equals(codeString))
1309          return new Enumeration<EventCapabilityMode>(this, EventCapabilityMode.SENDER);
1310        if ("receiver".equals(codeString))
1311          return new Enumeration<EventCapabilityMode>(this, EventCapabilityMode.RECEIVER);
1312        throw new FHIRException("Unknown EventCapabilityMode code '"+codeString+"'");
1313        }
1314    public String toCode(EventCapabilityMode code) {
1315      if (code == EventCapabilityMode.SENDER)
1316        return "sender";
1317      if (code == EventCapabilityMode.RECEIVER)
1318        return "receiver";
1319      return "?";
1320      }
1321    public String toSystem(EventCapabilityMode code) {
1322      return code.getSystem();
1323      }
1324    }
1325
1326    public enum MessageSignificanceCategory {
1327        /**
1328         * The message represents/requests a change that should not be processed more than once; e.g., making a booking for an appointment.
1329         */
1330        CONSEQUENCE, 
1331        /**
1332         * The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful.
1333         */
1334        CURRENCY, 
1335        /**
1336         * The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications.
1337         */
1338        NOTIFICATION, 
1339        /**
1340         * added to help the parsers with the generic types
1341         */
1342        NULL;
1343        public static MessageSignificanceCategory fromCode(String codeString) throws FHIRException {
1344            if (codeString == null || "".equals(codeString))
1345                return null;
1346        if ("Consequence".equals(codeString))
1347          return CONSEQUENCE;
1348        if ("Currency".equals(codeString))
1349          return CURRENCY;
1350        if ("Notification".equals(codeString))
1351          return NOTIFICATION;
1352        if (Configuration.isAcceptInvalidEnums())
1353          return null;
1354        else
1355          throw new FHIRException("Unknown MessageSignificanceCategory code '"+codeString+"'");
1356        }
1357        public String toCode() {
1358          switch (this) {
1359            case CONSEQUENCE: return "Consequence";
1360            case CURRENCY: return "Currency";
1361            case NOTIFICATION: return "Notification";
1362            case NULL: return null;
1363            default: return "?";
1364          }
1365        }
1366        public String getSystem() {
1367          switch (this) {
1368            case CONSEQUENCE: return "http://hl7.org/fhir/message-significance-category";
1369            case CURRENCY: return "http://hl7.org/fhir/message-significance-category";
1370            case NOTIFICATION: return "http://hl7.org/fhir/message-significance-category";
1371            case NULL: return null;
1372            default: return "?";
1373          }
1374        }
1375        public String getDefinition() {
1376          switch (this) {
1377            case CONSEQUENCE: return "The message represents/requests a change that should not be processed more than once; e.g., making a booking for an appointment.";
1378            case CURRENCY: return "The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful.";
1379            case NOTIFICATION: return "The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications.";
1380            case NULL: return null;
1381            default: return "?";
1382          }
1383        }
1384        public String getDisplay() {
1385          switch (this) {
1386            case CONSEQUENCE: return "Consequence";
1387            case CURRENCY: return "Currency";
1388            case NOTIFICATION: return "Notification";
1389            case NULL: return null;
1390            default: return "?";
1391          }
1392        }
1393    }
1394
1395  public static class MessageSignificanceCategoryEnumFactory implements EnumFactory<MessageSignificanceCategory> {
1396    public MessageSignificanceCategory fromCode(String codeString) throws IllegalArgumentException {
1397      if (codeString == null || "".equals(codeString))
1398            if (codeString == null || "".equals(codeString))
1399                return null;
1400        if ("Consequence".equals(codeString))
1401          return MessageSignificanceCategory.CONSEQUENCE;
1402        if ("Currency".equals(codeString))
1403          return MessageSignificanceCategory.CURRENCY;
1404        if ("Notification".equals(codeString))
1405          return MessageSignificanceCategory.NOTIFICATION;
1406        throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'");
1407        }
1408        public Enumeration<MessageSignificanceCategory> fromType(Base code) throws FHIRException {
1409          if (code == null)
1410            return null;
1411          if (code.isEmpty())
1412            return new Enumeration<MessageSignificanceCategory>(this);
1413          String codeString = ((PrimitiveType) code).asStringValue();
1414          if (codeString == null || "".equals(codeString))
1415            return null;
1416        if ("Consequence".equals(codeString))
1417          return new Enumeration<MessageSignificanceCategory>(this, MessageSignificanceCategory.CONSEQUENCE);
1418        if ("Currency".equals(codeString))
1419          return new Enumeration<MessageSignificanceCategory>(this, MessageSignificanceCategory.CURRENCY);
1420        if ("Notification".equals(codeString))
1421          return new Enumeration<MessageSignificanceCategory>(this, MessageSignificanceCategory.NOTIFICATION);
1422        throw new FHIRException("Unknown MessageSignificanceCategory code '"+codeString+"'");
1423        }
1424    public String toCode(MessageSignificanceCategory code) {
1425      if (code == MessageSignificanceCategory.CONSEQUENCE)
1426        return "Consequence";
1427      if (code == MessageSignificanceCategory.CURRENCY)
1428        return "Currency";
1429      if (code == MessageSignificanceCategory.NOTIFICATION)
1430        return "Notification";
1431      return "?";
1432      }
1433    public String toSystem(MessageSignificanceCategory code) {
1434      return code.getSystem();
1435      }
1436    }
1437
1438    public enum DocumentMode {
1439        /**
1440         * The application produces documents of the specified type.
1441         */
1442        PRODUCER, 
1443        /**
1444         * The application consumes documents of the specified type.
1445         */
1446        CONSUMER, 
1447        /**
1448         * added to help the parsers with the generic types
1449         */
1450        NULL;
1451        public static DocumentMode fromCode(String codeString) throws FHIRException {
1452            if (codeString == null || "".equals(codeString))
1453                return null;
1454        if ("producer".equals(codeString))
1455          return PRODUCER;
1456        if ("consumer".equals(codeString))
1457          return CONSUMER;
1458        if (Configuration.isAcceptInvalidEnums())
1459          return null;
1460        else
1461          throw new FHIRException("Unknown DocumentMode code '"+codeString+"'");
1462        }
1463        public String toCode() {
1464          switch (this) {
1465            case PRODUCER: return "producer";
1466            case CONSUMER: return "consumer";
1467            case NULL: return null;
1468            default: return "?";
1469          }
1470        }
1471        public String getSystem() {
1472          switch (this) {
1473            case PRODUCER: return "http://hl7.org/fhir/document-mode";
1474            case CONSUMER: return "http://hl7.org/fhir/document-mode";
1475            case NULL: return null;
1476            default: return "?";
1477          }
1478        }
1479        public String getDefinition() {
1480          switch (this) {
1481            case PRODUCER: return "The application produces documents of the specified type.";
1482            case CONSUMER: return "The application consumes documents of the specified type.";
1483            case NULL: return null;
1484            default: return "?";
1485          }
1486        }
1487        public String getDisplay() {
1488          switch (this) {
1489            case PRODUCER: return "Producer";
1490            case CONSUMER: return "Consumer";
1491            case NULL: return null;
1492            default: return "?";
1493          }
1494        }
1495    }
1496
1497  public static class DocumentModeEnumFactory implements EnumFactory<DocumentMode> {
1498    public DocumentMode fromCode(String codeString) throws IllegalArgumentException {
1499      if (codeString == null || "".equals(codeString))
1500            if (codeString == null || "".equals(codeString))
1501                return null;
1502        if ("producer".equals(codeString))
1503          return DocumentMode.PRODUCER;
1504        if ("consumer".equals(codeString))
1505          return DocumentMode.CONSUMER;
1506        throw new IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'");
1507        }
1508        public Enumeration<DocumentMode> fromType(Base code) throws FHIRException {
1509          if (code == null)
1510            return null;
1511          if (code.isEmpty())
1512            return new Enumeration<DocumentMode>(this);
1513          String codeString = ((PrimitiveType) code).asStringValue();
1514          if (codeString == null || "".equals(codeString))
1515            return null;
1516        if ("producer".equals(codeString))
1517          return new Enumeration<DocumentMode>(this, DocumentMode.PRODUCER);
1518        if ("consumer".equals(codeString))
1519          return new Enumeration<DocumentMode>(this, DocumentMode.CONSUMER);
1520        throw new FHIRException("Unknown DocumentMode code '"+codeString+"'");
1521        }
1522    public String toCode(DocumentMode code) {
1523      if (code == DocumentMode.PRODUCER)
1524        return "producer";
1525      if (code == DocumentMode.CONSUMER)
1526        return "consumer";
1527      return "?";
1528      }
1529    public String toSystem(DocumentMode code) {
1530      return code.getSystem();
1531      }
1532    }
1533
1534    @Block()
1535    public static class CapabilityStatementSoftwareComponent extends BackboneElement implements IBaseBackboneElement {
1536        /**
1537         * Name software is known by.
1538         */
1539        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1540        @Description(shortDefinition="A name the software is known by", formalDefinition="Name software is known by." )
1541        protected StringType name;
1542
1543        /**
1544         * The version identifier for the software covered by this statement.
1545         */
1546        @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1547        @Description(shortDefinition="Version covered by this statement", formalDefinition="The version identifier for the software covered by this statement." )
1548        protected StringType version;
1549
1550        /**
1551         * Date this version of the software was released.
1552         */
1553        @Child(name = "releaseDate", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1554        @Description(shortDefinition="Date this version released", formalDefinition="Date this version of the software was released." )
1555        protected DateTimeType releaseDate;
1556
1557        private static final long serialVersionUID = 1819769027L;
1558
1559    /**
1560     * Constructor
1561     */
1562      public CapabilityStatementSoftwareComponent() {
1563        super();
1564      }
1565
1566    /**
1567     * Constructor
1568     */
1569      public CapabilityStatementSoftwareComponent(StringType name) {
1570        super();
1571        this.name = name;
1572      }
1573
1574        /**
1575         * @return {@link #name} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1576         */
1577        public StringType getNameElement() { 
1578          if (this.name == null)
1579            if (Configuration.errorOnAutoCreate())
1580              throw new Error("Attempt to auto-create CapabilityStatementSoftwareComponent.name");
1581            else if (Configuration.doAutoCreate())
1582              this.name = new StringType(); // bb
1583          return this.name;
1584        }
1585
1586        public boolean hasNameElement() { 
1587          return this.name != null && !this.name.isEmpty();
1588        }
1589
1590        public boolean hasName() { 
1591          return this.name != null && !this.name.isEmpty();
1592        }
1593
1594        /**
1595         * @param value {@link #name} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1596         */
1597        public CapabilityStatementSoftwareComponent setNameElement(StringType value) { 
1598          this.name = value;
1599          return this;
1600        }
1601
1602        /**
1603         * @return Name software is known by.
1604         */
1605        public String getName() { 
1606          return this.name == null ? null : this.name.getValue();
1607        }
1608
1609        /**
1610         * @param value Name software is known by.
1611         */
1612        public CapabilityStatementSoftwareComponent setName(String value) { 
1613            if (this.name == null)
1614              this.name = new StringType();
1615            this.name.setValue(value);
1616          return this;
1617        }
1618
1619        /**
1620         * @return {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1621         */
1622        public StringType getVersionElement() { 
1623          if (this.version == null)
1624            if (Configuration.errorOnAutoCreate())
1625              throw new Error("Attempt to auto-create CapabilityStatementSoftwareComponent.version");
1626            else if (Configuration.doAutoCreate())
1627              this.version = new StringType(); // bb
1628          return this.version;
1629        }
1630
1631        public boolean hasVersionElement() { 
1632          return this.version != null && !this.version.isEmpty();
1633        }
1634
1635        public boolean hasVersion() { 
1636          return this.version != null && !this.version.isEmpty();
1637        }
1638
1639        /**
1640         * @param value {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
1641         */
1642        public CapabilityStatementSoftwareComponent setVersionElement(StringType value) { 
1643          this.version = value;
1644          return this;
1645        }
1646
1647        /**
1648         * @return The version identifier for the software covered by this statement.
1649         */
1650        public String getVersion() { 
1651          return this.version == null ? null : this.version.getValue();
1652        }
1653
1654        /**
1655         * @param value The version identifier for the software covered by this statement.
1656         */
1657        public CapabilityStatementSoftwareComponent setVersion(String value) { 
1658          if (Utilities.noString(value))
1659            this.version = null;
1660          else {
1661            if (this.version == null)
1662              this.version = new StringType();
1663            this.version.setValue(value);
1664          }
1665          return this;
1666        }
1667
1668        /**
1669         * @return {@link #releaseDate} (Date this version of the software was released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value
1670         */
1671        public DateTimeType getReleaseDateElement() { 
1672          if (this.releaseDate == null)
1673            if (Configuration.errorOnAutoCreate())
1674              throw new Error("Attempt to auto-create CapabilityStatementSoftwareComponent.releaseDate");
1675            else if (Configuration.doAutoCreate())
1676              this.releaseDate = new DateTimeType(); // bb
1677          return this.releaseDate;
1678        }
1679
1680        public boolean hasReleaseDateElement() { 
1681          return this.releaseDate != null && !this.releaseDate.isEmpty();
1682        }
1683
1684        public boolean hasReleaseDate() { 
1685          return this.releaseDate != null && !this.releaseDate.isEmpty();
1686        }
1687
1688        /**
1689         * @param value {@link #releaseDate} (Date this version of the software was released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value
1690         */
1691        public CapabilityStatementSoftwareComponent setReleaseDateElement(DateTimeType value) { 
1692          this.releaseDate = value;
1693          return this;
1694        }
1695
1696        /**
1697         * @return Date this version of the software was released.
1698         */
1699        public Date getReleaseDate() { 
1700          return this.releaseDate == null ? null : this.releaseDate.getValue();
1701        }
1702
1703        /**
1704         * @param value Date this version of the software was released.
1705         */
1706        public CapabilityStatementSoftwareComponent setReleaseDate(Date value) { 
1707          if (value == null)
1708            this.releaseDate = null;
1709          else {
1710            if (this.releaseDate == null)
1711              this.releaseDate = new DateTimeType();
1712            this.releaseDate.setValue(value);
1713          }
1714          return this;
1715        }
1716
1717        protected void listChildren(List<Property> children) {
1718          super.listChildren(children);
1719          children.add(new Property("name", "string", "Name software is known by.", 0, 1, name));
1720          children.add(new Property("version", "string", "The version identifier for the software covered by this statement.", 0, 1, version));
1721          children.add(new Property("releaseDate", "dateTime", "Date this version of the software was released.", 0, 1, releaseDate));
1722        }
1723
1724        @Override
1725        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1726          switch (_hash) {
1727          case 3373707: /*name*/  return new Property("name", "string", "Name software is known by.", 0, 1, name);
1728          case 351608024: /*version*/  return new Property("version", "string", "The version identifier for the software covered by this statement.", 0, 1, version);
1729          case 212873301: /*releaseDate*/  return new Property("releaseDate", "dateTime", "Date this version of the software was released.", 0, 1, releaseDate);
1730          default: return super.getNamedProperty(_hash, _name, _checkValid);
1731          }
1732
1733        }
1734
1735      @Override
1736      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1737        switch (hash) {
1738        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1739        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
1740        case 212873301: /*releaseDate*/ return this.releaseDate == null ? new Base[0] : new Base[] {this.releaseDate}; // DateTimeType
1741        default: return super.getProperty(hash, name, checkValid);
1742        }
1743
1744      }
1745
1746      @Override
1747      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1748        switch (hash) {
1749        case 3373707: // name
1750          this.name = castToString(value); // StringType
1751          return value;
1752        case 351608024: // version
1753          this.version = castToString(value); // StringType
1754          return value;
1755        case 212873301: // releaseDate
1756          this.releaseDate = castToDateTime(value); // DateTimeType
1757          return value;
1758        default: return super.setProperty(hash, name, value);
1759        }
1760
1761      }
1762
1763      @Override
1764      public Base setProperty(String name, Base value) throws FHIRException {
1765        if (name.equals("name")) {
1766          this.name = castToString(value); // StringType
1767        } else if (name.equals("version")) {
1768          this.version = castToString(value); // StringType
1769        } else if (name.equals("releaseDate")) {
1770          this.releaseDate = castToDateTime(value); // DateTimeType
1771        } else
1772          return super.setProperty(name, value);
1773        return value;
1774      }
1775
1776      @Override
1777      public Base makeProperty(int hash, String name) throws FHIRException {
1778        switch (hash) {
1779        case 3373707:  return getNameElement();
1780        case 351608024:  return getVersionElement();
1781        case 212873301:  return getReleaseDateElement();
1782        default: return super.makeProperty(hash, name);
1783        }
1784
1785      }
1786
1787      @Override
1788      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1789        switch (hash) {
1790        case 3373707: /*name*/ return new String[] {"string"};
1791        case 351608024: /*version*/ return new String[] {"string"};
1792        case 212873301: /*releaseDate*/ return new String[] {"dateTime"};
1793        default: return super.getTypesForProperty(hash, name);
1794        }
1795
1796      }
1797
1798      @Override
1799      public Base addChild(String name) throws FHIRException {
1800        if (name.equals("name")) {
1801          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.name");
1802        }
1803        else if (name.equals("version")) {
1804          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.version");
1805        }
1806        else if (name.equals("releaseDate")) {
1807          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.releaseDate");
1808        }
1809        else
1810          return super.addChild(name);
1811      }
1812
1813      public CapabilityStatementSoftwareComponent copy() {
1814        CapabilityStatementSoftwareComponent dst = new CapabilityStatementSoftwareComponent();
1815        copyValues(dst);
1816        dst.name = name == null ? null : name.copy();
1817        dst.version = version == null ? null : version.copy();
1818        dst.releaseDate = releaseDate == null ? null : releaseDate.copy();
1819        return dst;
1820      }
1821
1822      @Override
1823      public boolean equalsDeep(Base other_) {
1824        if (!super.equalsDeep(other_))
1825          return false;
1826        if (!(other_ instanceof CapabilityStatementSoftwareComponent))
1827          return false;
1828        CapabilityStatementSoftwareComponent o = (CapabilityStatementSoftwareComponent) other_;
1829        return compareDeep(name, o.name, true) && compareDeep(version, o.version, true) && compareDeep(releaseDate, o.releaseDate, true)
1830          ;
1831      }
1832
1833      @Override
1834      public boolean equalsShallow(Base other_) {
1835        if (!super.equalsShallow(other_))
1836          return false;
1837        if (!(other_ instanceof CapabilityStatementSoftwareComponent))
1838          return false;
1839        CapabilityStatementSoftwareComponent o = (CapabilityStatementSoftwareComponent) other_;
1840        return compareValues(name, o.name, true) && compareValues(version, o.version, true) && compareValues(releaseDate, o.releaseDate, true)
1841          ;
1842      }
1843
1844      public boolean isEmpty() {
1845        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, version, releaseDate
1846          );
1847      }
1848
1849  public String fhirType() {
1850    return "CapabilityStatement.software";
1851
1852  }
1853
1854  }
1855
1856    @Block()
1857    public static class CapabilityStatementImplementationComponent extends BackboneElement implements IBaseBackboneElement {
1858        /**
1859         * Information about the specific installation that this capability statement relates to.
1860         */
1861        @Child(name = "description", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1862        @Description(shortDefinition="Describes this specific instance", formalDefinition="Information about the specific installation that this capability statement relates to." )
1863        protected StringType description;
1864
1865        /**
1866         * An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.
1867         */
1868        @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true)
1869        @Description(shortDefinition="Base URL for the installation", formalDefinition="An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces." )
1870        protected UriType url;
1871
1872        private static final long serialVersionUID = -289238508L;
1873
1874    /**
1875     * Constructor
1876     */
1877      public CapabilityStatementImplementationComponent() {
1878        super();
1879      }
1880
1881    /**
1882     * Constructor
1883     */
1884      public CapabilityStatementImplementationComponent(StringType description) {
1885        super();
1886        this.description = description;
1887      }
1888
1889        /**
1890         * @return {@link #description} (Information about the specific installation that this capability statement relates to.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1891         */
1892        public StringType getDescriptionElement() { 
1893          if (this.description == null)
1894            if (Configuration.errorOnAutoCreate())
1895              throw new Error("Attempt to auto-create CapabilityStatementImplementationComponent.description");
1896            else if (Configuration.doAutoCreate())
1897              this.description = new StringType(); // bb
1898          return this.description;
1899        }
1900
1901        public boolean hasDescriptionElement() { 
1902          return this.description != null && !this.description.isEmpty();
1903        }
1904
1905        public boolean hasDescription() { 
1906          return this.description != null && !this.description.isEmpty();
1907        }
1908
1909        /**
1910         * @param value {@link #description} (Information about the specific installation that this capability statement relates to.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1911         */
1912        public CapabilityStatementImplementationComponent setDescriptionElement(StringType value) { 
1913          this.description = value;
1914          return this;
1915        }
1916
1917        /**
1918         * @return Information about the specific installation that this capability statement relates to.
1919         */
1920        public String getDescription() { 
1921          return this.description == null ? null : this.description.getValue();
1922        }
1923
1924        /**
1925         * @param value Information about the specific installation that this capability statement relates to.
1926         */
1927        public CapabilityStatementImplementationComponent setDescription(String value) { 
1928            if (this.description == null)
1929              this.description = new StringType();
1930            this.description.setValue(value);
1931          return this;
1932        }
1933
1934        /**
1935         * @return {@link #url} (An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1936         */
1937        public UriType getUrlElement() { 
1938          if (this.url == null)
1939            if (Configuration.errorOnAutoCreate())
1940              throw new Error("Attempt to auto-create CapabilityStatementImplementationComponent.url");
1941            else if (Configuration.doAutoCreate())
1942              this.url = new UriType(); // bb
1943          return this.url;
1944        }
1945
1946        public boolean hasUrlElement() { 
1947          return this.url != null && !this.url.isEmpty();
1948        }
1949
1950        public boolean hasUrl() { 
1951          return this.url != null && !this.url.isEmpty();
1952        }
1953
1954        /**
1955         * @param value {@link #url} (An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1956         */
1957        public CapabilityStatementImplementationComponent setUrlElement(UriType value) { 
1958          this.url = value;
1959          return this;
1960        }
1961
1962        /**
1963         * @return An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.
1964         */
1965        public String getUrl() { 
1966          return this.url == null ? null : this.url.getValue();
1967        }
1968
1969        /**
1970         * @param value An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.
1971         */
1972        public CapabilityStatementImplementationComponent setUrl(String value) { 
1973          if (Utilities.noString(value))
1974            this.url = null;
1975          else {
1976            if (this.url == null)
1977              this.url = new UriType();
1978            this.url.setValue(value);
1979          }
1980          return this;
1981        }
1982
1983        protected void listChildren(List<Property> children) {
1984          super.listChildren(children);
1985          children.add(new Property("description", "string", "Information about the specific installation that this capability statement relates to.", 0, 1, description));
1986          children.add(new Property("url", "uri", "An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.", 0, 1, url));
1987        }
1988
1989        @Override
1990        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1991          switch (_hash) {
1992          case -1724546052: /*description*/  return new Property("description", "string", "Information about the specific installation that this capability statement relates to.", 0, 1, description);
1993          case 116079: /*url*/  return new Property("url", "uri", "An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.", 0, 1, url);
1994          default: return super.getNamedProperty(_hash, _name, _checkValid);
1995          }
1996
1997        }
1998
1999      @Override
2000      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2001        switch (hash) {
2002        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
2003        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
2004        default: return super.getProperty(hash, name, checkValid);
2005        }
2006
2007      }
2008
2009      @Override
2010      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2011        switch (hash) {
2012        case -1724546052: // description
2013          this.description = castToString(value); // StringType
2014          return value;
2015        case 116079: // url
2016          this.url = castToUri(value); // UriType
2017          return value;
2018        default: return super.setProperty(hash, name, value);
2019        }
2020
2021      }
2022
2023      @Override
2024      public Base setProperty(String name, Base value) throws FHIRException {
2025        if (name.equals("description")) {
2026          this.description = castToString(value); // StringType
2027        } else if (name.equals("url")) {
2028          this.url = castToUri(value); // UriType
2029        } else
2030          return super.setProperty(name, value);
2031        return value;
2032      }
2033
2034      @Override
2035      public Base makeProperty(int hash, String name) throws FHIRException {
2036        switch (hash) {
2037        case -1724546052:  return getDescriptionElement();
2038        case 116079:  return getUrlElement();
2039        default: return super.makeProperty(hash, name);
2040        }
2041
2042      }
2043
2044      @Override
2045      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2046        switch (hash) {
2047        case -1724546052: /*description*/ return new String[] {"string"};
2048        case 116079: /*url*/ return new String[] {"uri"};
2049        default: return super.getTypesForProperty(hash, name);
2050        }
2051
2052      }
2053
2054      @Override
2055      public Base addChild(String name) throws FHIRException {
2056        if (name.equals("description")) {
2057          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.description");
2058        }
2059        else if (name.equals("url")) {
2060          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.url");
2061        }
2062        else
2063          return super.addChild(name);
2064      }
2065
2066      public CapabilityStatementImplementationComponent copy() {
2067        CapabilityStatementImplementationComponent dst = new CapabilityStatementImplementationComponent();
2068        copyValues(dst);
2069        dst.description = description == null ? null : description.copy();
2070        dst.url = url == null ? null : url.copy();
2071        return dst;
2072      }
2073
2074      @Override
2075      public boolean equalsDeep(Base other_) {
2076        if (!super.equalsDeep(other_))
2077          return false;
2078        if (!(other_ instanceof CapabilityStatementImplementationComponent))
2079          return false;
2080        CapabilityStatementImplementationComponent o = (CapabilityStatementImplementationComponent) other_;
2081        return compareDeep(description, o.description, true) && compareDeep(url, o.url, true);
2082      }
2083
2084      @Override
2085      public boolean equalsShallow(Base other_) {
2086        if (!super.equalsShallow(other_))
2087          return false;
2088        if (!(other_ instanceof CapabilityStatementImplementationComponent))
2089          return false;
2090        CapabilityStatementImplementationComponent o = (CapabilityStatementImplementationComponent) other_;
2091        return compareValues(description, o.description, true) && compareValues(url, o.url, true);
2092      }
2093
2094      public boolean isEmpty() {
2095        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(description, url);
2096      }
2097
2098  public String fhirType() {
2099    return "CapabilityStatement.implementation";
2100
2101  }
2102
2103  }
2104
2105    @Block()
2106    public static class CapabilityStatementRestComponent extends BackboneElement implements IBaseBackboneElement {
2107        /**
2108         * Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.
2109         */
2110        @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2111        @Description(shortDefinition="client | server", formalDefinition="Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations." )
2112        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/restful-capability-mode")
2113        protected Enumeration<RestfulCapabilityMode> mode;
2114
2115        /**
2116         * Information about the system's restful capabilities that apply across all applications, such as security.
2117         */
2118        @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2119        @Description(shortDefinition="General description of implementation", formalDefinition="Information about the system's restful capabilities that apply across all applications, such as security." )
2120        protected StringType documentation;
2121
2122        /**
2123         * Information about security implementation from an interface perspective - what a client needs to know.
2124         */
2125        @Child(name = "security", type = {}, order=3, min=0, max=1, modifier=false, summary=true)
2126        @Description(shortDefinition="Information about security of implementation", formalDefinition="Information about security implementation from an interface perspective - what a client needs to know." )
2127        protected CapabilityStatementRestSecurityComponent security;
2128
2129        /**
2130         * A specification of the restful capabilities of the solution for a specific resource type.
2131         */
2132        @Child(name = "resource", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2133        @Description(shortDefinition="Resource served on the REST interface", formalDefinition="A specification of the restful capabilities of the solution for a specific resource type." )
2134        protected List<CapabilityStatementRestResourceComponent> resource;
2135
2136        /**
2137         * A specification of restful operations supported by the system.
2138         */
2139        @Child(name = "interaction", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2140        @Description(shortDefinition="What operations are supported?", formalDefinition="A specification of restful operations supported by the system." )
2141        protected List<SystemInteractionComponent> interaction;
2142
2143        /**
2144         * Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.
2145         */
2146        @Child(name = "searchParam", type = {CapabilityStatementRestResourceSearchParamComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2147        @Description(shortDefinition="Search parameters for searching all resources", formalDefinition="Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation." )
2148        protected List<CapabilityStatementRestResourceSearchParamComponent> searchParam;
2149
2150        /**
2151         * Definition of an operation or a named query together with its parameters and their meaning and type.
2152         */
2153        @Child(name = "operation", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2154        @Description(shortDefinition="Definition of an operation or a custom query", formalDefinition="Definition of an operation or a named query together with its parameters and their meaning and type." )
2155        protected List<CapabilityStatementRestOperationComponent> operation;
2156
2157        /**
2158         * An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .
2159         */
2160        @Child(name = "compartment", type = {UriType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2161        @Description(shortDefinition="Compartments served/used by system", formalDefinition="An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL ." )
2162        protected List<UriType> compartment;
2163
2164        private static final long serialVersionUID = 38012979L;
2165
2166    /**
2167     * Constructor
2168     */
2169      public CapabilityStatementRestComponent() {
2170        super();
2171      }
2172
2173    /**
2174     * Constructor
2175     */
2176      public CapabilityStatementRestComponent(Enumeration<RestfulCapabilityMode> mode) {
2177        super();
2178        this.mode = mode;
2179      }
2180
2181        /**
2182         * @return {@link #mode} (Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
2183         */
2184        public Enumeration<RestfulCapabilityMode> getModeElement() { 
2185          if (this.mode == null)
2186            if (Configuration.errorOnAutoCreate())
2187              throw new Error("Attempt to auto-create CapabilityStatementRestComponent.mode");
2188            else if (Configuration.doAutoCreate())
2189              this.mode = new Enumeration<RestfulCapabilityMode>(new RestfulCapabilityModeEnumFactory()); // bb
2190          return this.mode;
2191        }
2192
2193        public boolean hasModeElement() { 
2194          return this.mode != null && !this.mode.isEmpty();
2195        }
2196
2197        public boolean hasMode() { 
2198          return this.mode != null && !this.mode.isEmpty();
2199        }
2200
2201        /**
2202         * @param value {@link #mode} (Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
2203         */
2204        public CapabilityStatementRestComponent setModeElement(Enumeration<RestfulCapabilityMode> value) { 
2205          this.mode = value;
2206          return this;
2207        }
2208
2209        /**
2210         * @return Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.
2211         */
2212        public RestfulCapabilityMode getMode() { 
2213          return this.mode == null ? null : this.mode.getValue();
2214        }
2215
2216        /**
2217         * @param value Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.
2218         */
2219        public CapabilityStatementRestComponent setMode(RestfulCapabilityMode value) { 
2220            if (this.mode == null)
2221              this.mode = new Enumeration<RestfulCapabilityMode>(new RestfulCapabilityModeEnumFactory());
2222            this.mode.setValue(value);
2223          return this;
2224        }
2225
2226        /**
2227         * @return {@link #documentation} (Information about the system's restful capabilities that apply across all applications, such as security.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
2228         */
2229        public StringType getDocumentationElement() { 
2230          if (this.documentation == null)
2231            if (Configuration.errorOnAutoCreate())
2232              throw new Error("Attempt to auto-create CapabilityStatementRestComponent.documentation");
2233            else if (Configuration.doAutoCreate())
2234              this.documentation = new StringType(); // bb
2235          return this.documentation;
2236        }
2237
2238        public boolean hasDocumentationElement() { 
2239          return this.documentation != null && !this.documentation.isEmpty();
2240        }
2241
2242        public boolean hasDocumentation() { 
2243          return this.documentation != null && !this.documentation.isEmpty();
2244        }
2245
2246        /**
2247         * @param value {@link #documentation} (Information about the system's restful capabilities that apply across all applications, such as security.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
2248         */
2249        public CapabilityStatementRestComponent setDocumentationElement(StringType value) { 
2250          this.documentation = value;
2251          return this;
2252        }
2253
2254        /**
2255         * @return Information about the system's restful capabilities that apply across all applications, such as security.
2256         */
2257        public String getDocumentation() { 
2258          return this.documentation == null ? null : this.documentation.getValue();
2259        }
2260
2261        /**
2262         * @param value Information about the system's restful capabilities that apply across all applications, such as security.
2263         */
2264        public CapabilityStatementRestComponent setDocumentation(String value) { 
2265          if (Utilities.noString(value))
2266            this.documentation = null;
2267          else {
2268            if (this.documentation == null)
2269              this.documentation = new StringType();
2270            this.documentation.setValue(value);
2271          }
2272          return this;
2273        }
2274
2275        /**
2276         * @return {@link #security} (Information about security implementation from an interface perspective - what a client needs to know.)
2277         */
2278        public CapabilityStatementRestSecurityComponent getSecurity() { 
2279          if (this.security == null)
2280            if (Configuration.errorOnAutoCreate())
2281              throw new Error("Attempt to auto-create CapabilityStatementRestComponent.security");
2282            else if (Configuration.doAutoCreate())
2283              this.security = new CapabilityStatementRestSecurityComponent(); // cc
2284          return this.security;
2285        }
2286
2287        public boolean hasSecurity() { 
2288          return this.security != null && !this.security.isEmpty();
2289        }
2290
2291        /**
2292         * @param value {@link #security} (Information about security implementation from an interface perspective - what a client needs to know.)
2293         */
2294        public CapabilityStatementRestComponent setSecurity(CapabilityStatementRestSecurityComponent value)  { 
2295          this.security = value;
2296          return this;
2297        }
2298
2299        /**
2300         * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.)
2301         */
2302        public List<CapabilityStatementRestResourceComponent> getResource() { 
2303          if (this.resource == null)
2304            this.resource = new ArrayList<CapabilityStatementRestResourceComponent>();
2305          return this.resource;
2306        }
2307
2308        /**
2309         * @return Returns a reference to <code>this</code> for easy method chaining
2310         */
2311        public CapabilityStatementRestComponent setResource(List<CapabilityStatementRestResourceComponent> theResource) { 
2312          this.resource = theResource;
2313          return this;
2314        }
2315
2316        public boolean hasResource() { 
2317          if (this.resource == null)
2318            return false;
2319          for (CapabilityStatementRestResourceComponent item : this.resource)
2320            if (!item.isEmpty())
2321              return true;
2322          return false;
2323        }
2324
2325        public CapabilityStatementRestResourceComponent addResource() { //3
2326          CapabilityStatementRestResourceComponent t = new CapabilityStatementRestResourceComponent();
2327          if (this.resource == null)
2328            this.resource = new ArrayList<CapabilityStatementRestResourceComponent>();
2329          this.resource.add(t);
2330          return t;
2331        }
2332
2333        public CapabilityStatementRestComponent addResource(CapabilityStatementRestResourceComponent t) { //3
2334          if (t == null)
2335            return this;
2336          if (this.resource == null)
2337            this.resource = new ArrayList<CapabilityStatementRestResourceComponent>();
2338          this.resource.add(t);
2339          return this;
2340        }
2341
2342        /**
2343         * @return The first repetition of repeating field {@link #resource}, creating it if it does not already exist
2344         */
2345        public CapabilityStatementRestResourceComponent getResourceFirstRep() { 
2346          if (getResource().isEmpty()) {
2347            addResource();
2348          }
2349          return getResource().get(0);
2350        }
2351
2352        /**
2353         * @return {@link #interaction} (A specification of restful operations supported by the system.)
2354         */
2355        public List<SystemInteractionComponent> getInteraction() { 
2356          if (this.interaction == null)
2357            this.interaction = new ArrayList<SystemInteractionComponent>();
2358          return this.interaction;
2359        }
2360
2361        /**
2362         * @return Returns a reference to <code>this</code> for easy method chaining
2363         */
2364        public CapabilityStatementRestComponent setInteraction(List<SystemInteractionComponent> theInteraction) { 
2365          this.interaction = theInteraction;
2366          return this;
2367        }
2368
2369        public boolean hasInteraction() { 
2370          if (this.interaction == null)
2371            return false;
2372          for (SystemInteractionComponent item : this.interaction)
2373            if (!item.isEmpty())
2374              return true;
2375          return false;
2376        }
2377
2378        public SystemInteractionComponent addInteraction() { //3
2379          SystemInteractionComponent t = new SystemInteractionComponent();
2380          if (this.interaction == null)
2381            this.interaction = new ArrayList<SystemInteractionComponent>();
2382          this.interaction.add(t);
2383          return t;
2384        }
2385
2386        public CapabilityStatementRestComponent addInteraction(SystemInteractionComponent t) { //3
2387          if (t == null)
2388            return this;
2389          if (this.interaction == null)
2390            this.interaction = new ArrayList<SystemInteractionComponent>();
2391          this.interaction.add(t);
2392          return this;
2393        }
2394
2395        /**
2396         * @return The first repetition of repeating field {@link #interaction}, creating it if it does not already exist
2397         */
2398        public SystemInteractionComponent getInteractionFirstRep() { 
2399          if (getInteraction().isEmpty()) {
2400            addInteraction();
2401          }
2402          return getInteraction().get(0);
2403        }
2404
2405        /**
2406         * @return {@link #searchParam} (Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.)
2407         */
2408        public List<CapabilityStatementRestResourceSearchParamComponent> getSearchParam() { 
2409          if (this.searchParam == null)
2410            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
2411          return this.searchParam;
2412        }
2413
2414        /**
2415         * @return Returns a reference to <code>this</code> for easy method chaining
2416         */
2417        public CapabilityStatementRestComponent setSearchParam(List<CapabilityStatementRestResourceSearchParamComponent> theSearchParam) { 
2418          this.searchParam = theSearchParam;
2419          return this;
2420        }
2421
2422        public boolean hasSearchParam() { 
2423          if (this.searchParam == null)
2424            return false;
2425          for (CapabilityStatementRestResourceSearchParamComponent item : this.searchParam)
2426            if (!item.isEmpty())
2427              return true;
2428          return false;
2429        }
2430
2431        public CapabilityStatementRestResourceSearchParamComponent addSearchParam() { //3
2432          CapabilityStatementRestResourceSearchParamComponent t = new CapabilityStatementRestResourceSearchParamComponent();
2433          if (this.searchParam == null)
2434            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
2435          this.searchParam.add(t);
2436          return t;
2437        }
2438
2439        public CapabilityStatementRestComponent addSearchParam(CapabilityStatementRestResourceSearchParamComponent t) { //3
2440          if (t == null)
2441            return this;
2442          if (this.searchParam == null)
2443            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
2444          this.searchParam.add(t);
2445          return this;
2446        }
2447
2448        /**
2449         * @return The first repetition of repeating field {@link #searchParam}, creating it if it does not already exist
2450         */
2451        public CapabilityStatementRestResourceSearchParamComponent getSearchParamFirstRep() { 
2452          if (getSearchParam().isEmpty()) {
2453            addSearchParam();
2454          }
2455          return getSearchParam().get(0);
2456        }
2457
2458        /**
2459         * @return {@link #operation} (Definition of an operation or a named query together with its parameters and their meaning and type.)
2460         */
2461        public List<CapabilityStatementRestOperationComponent> getOperation() { 
2462          if (this.operation == null)
2463            this.operation = new ArrayList<CapabilityStatementRestOperationComponent>();
2464          return this.operation;
2465        }
2466
2467        /**
2468         * @return Returns a reference to <code>this</code> for easy method chaining
2469         */
2470        public CapabilityStatementRestComponent setOperation(List<CapabilityStatementRestOperationComponent> theOperation) { 
2471          this.operation = theOperation;
2472          return this;
2473        }
2474
2475        public boolean hasOperation() { 
2476          if (this.operation == null)
2477            return false;
2478          for (CapabilityStatementRestOperationComponent item : this.operation)
2479            if (!item.isEmpty())
2480              return true;
2481          return false;
2482        }
2483
2484        public CapabilityStatementRestOperationComponent addOperation() { //3
2485          CapabilityStatementRestOperationComponent t = new CapabilityStatementRestOperationComponent();
2486          if (this.operation == null)
2487            this.operation = new ArrayList<CapabilityStatementRestOperationComponent>();
2488          this.operation.add(t);
2489          return t;
2490        }
2491
2492        public CapabilityStatementRestComponent addOperation(CapabilityStatementRestOperationComponent t) { //3
2493          if (t == null)
2494            return this;
2495          if (this.operation == null)
2496            this.operation = new ArrayList<CapabilityStatementRestOperationComponent>();
2497          this.operation.add(t);
2498          return this;
2499        }
2500
2501        /**
2502         * @return The first repetition of repeating field {@link #operation}, creating it if it does not already exist
2503         */
2504        public CapabilityStatementRestOperationComponent getOperationFirstRep() { 
2505          if (getOperation().isEmpty()) {
2506            addOperation();
2507          }
2508          return getOperation().get(0);
2509        }
2510
2511        /**
2512         * @return {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .)
2513         */
2514        public List<UriType> getCompartment() { 
2515          if (this.compartment == null)
2516            this.compartment = new ArrayList<UriType>();
2517          return this.compartment;
2518        }
2519
2520        /**
2521         * @return Returns a reference to <code>this</code> for easy method chaining
2522         */
2523        public CapabilityStatementRestComponent setCompartment(List<UriType> theCompartment) { 
2524          this.compartment = theCompartment;
2525          return this;
2526        }
2527
2528        public boolean hasCompartment() { 
2529          if (this.compartment == null)
2530            return false;
2531          for (UriType item : this.compartment)
2532            if (!item.isEmpty())
2533              return true;
2534          return false;
2535        }
2536
2537        /**
2538         * @return {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .)
2539         */
2540        public UriType addCompartmentElement() {//2 
2541          UriType t = new UriType();
2542          if (this.compartment == null)
2543            this.compartment = new ArrayList<UriType>();
2544          this.compartment.add(t);
2545          return t;
2546        }
2547
2548        /**
2549         * @param value {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .)
2550         */
2551        public CapabilityStatementRestComponent addCompartment(String value) { //1
2552          UriType t = new UriType();
2553          t.setValue(value);
2554          if (this.compartment == null)
2555            this.compartment = new ArrayList<UriType>();
2556          this.compartment.add(t);
2557          return this;
2558        }
2559
2560        /**
2561         * @param value {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .)
2562         */
2563        public boolean hasCompartment(String value) { 
2564          if (this.compartment == null)
2565            return false;
2566          for (UriType v : this.compartment)
2567            if (v.getValue().equals(value)) // uri
2568              return true;
2569          return false;
2570        }
2571
2572        protected void listChildren(List<Property> children) {
2573          super.listChildren(children);
2574          children.add(new Property("mode", "code", "Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.", 0, 1, mode));
2575          children.add(new Property("documentation", "string", "Information about the system's restful capabilities that apply across all applications, such as security.", 0, 1, documentation));
2576          children.add(new Property("security", "", "Information about security implementation from an interface perspective - what a client needs to know.", 0, 1, security));
2577          children.add(new Property("resource", "", "A specification of the restful capabilities of the solution for a specific resource type.", 0, java.lang.Integer.MAX_VALUE, resource));
2578          children.add(new Property("interaction", "", "A specification of restful operations supported by the system.", 0, java.lang.Integer.MAX_VALUE, interaction));
2579          children.add(new Property("searchParam", "@CapabilityStatement.rest.resource.searchParam", "Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam));
2580          children.add(new Property("operation", "", "Definition of an operation or a named query together with its parameters and their meaning and type.", 0, java.lang.Integer.MAX_VALUE, operation));
2581          children.add(new Property("compartment", "uri", "An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .", 0, java.lang.Integer.MAX_VALUE, compartment));
2582        }
2583
2584        @Override
2585        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2586          switch (_hash) {
2587          case 3357091: /*mode*/  return new Property("mode", "code", "Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.", 0, 1, mode);
2588          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Information about the system's restful capabilities that apply across all applications, such as security.", 0, 1, documentation);
2589          case 949122880: /*security*/  return new Property("security", "", "Information about security implementation from an interface perspective - what a client needs to know.", 0, 1, security);
2590          case -341064690: /*resource*/  return new Property("resource", "", "A specification of the restful capabilities of the solution for a specific resource type.", 0, java.lang.Integer.MAX_VALUE, resource);
2591          case 1844104722: /*interaction*/  return new Property("interaction", "", "A specification of restful operations supported by the system.", 0, java.lang.Integer.MAX_VALUE, interaction);
2592          case -553645115: /*searchParam*/  return new Property("searchParam", "@CapabilityStatement.rest.resource.searchParam", "Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam);
2593          case 1662702951: /*operation*/  return new Property("operation", "", "Definition of an operation or a named query together with its parameters and their meaning and type.", 0, java.lang.Integer.MAX_VALUE, operation);
2594          case -397756334: /*compartment*/  return new Property("compartment", "uri", "An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .", 0, java.lang.Integer.MAX_VALUE, compartment);
2595          default: return super.getNamedProperty(_hash, _name, _checkValid);
2596          }
2597
2598        }
2599
2600      @Override
2601      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2602        switch (hash) {
2603        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<RestfulCapabilityMode>
2604        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
2605        case 949122880: /*security*/ return this.security == null ? new Base[0] : new Base[] {this.security}; // CapabilityStatementRestSecurityComponent
2606        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : this.resource.toArray(new Base[this.resource.size()]); // CapabilityStatementRestResourceComponent
2607        case 1844104722: /*interaction*/ return this.interaction == null ? new Base[0] : this.interaction.toArray(new Base[this.interaction.size()]); // SystemInteractionComponent
2608        case -553645115: /*searchParam*/ return this.searchParam == null ? new Base[0] : this.searchParam.toArray(new Base[this.searchParam.size()]); // CapabilityStatementRestResourceSearchParamComponent
2609        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : this.operation.toArray(new Base[this.operation.size()]); // CapabilityStatementRestOperationComponent
2610        case -397756334: /*compartment*/ return this.compartment == null ? new Base[0] : this.compartment.toArray(new Base[this.compartment.size()]); // UriType
2611        default: return super.getProperty(hash, name, checkValid);
2612        }
2613
2614      }
2615
2616      @Override
2617      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2618        switch (hash) {
2619        case 3357091: // mode
2620          value = new RestfulCapabilityModeEnumFactory().fromType(castToCode(value));
2621          this.mode = (Enumeration) value; // Enumeration<RestfulCapabilityMode>
2622          return value;
2623        case 1587405498: // documentation
2624          this.documentation = castToString(value); // StringType
2625          return value;
2626        case 949122880: // security
2627          this.security = (CapabilityStatementRestSecurityComponent) value; // CapabilityStatementRestSecurityComponent
2628          return value;
2629        case -341064690: // resource
2630          this.getResource().add((CapabilityStatementRestResourceComponent) value); // CapabilityStatementRestResourceComponent
2631          return value;
2632        case 1844104722: // interaction
2633          this.getInteraction().add((SystemInteractionComponent) value); // SystemInteractionComponent
2634          return value;
2635        case -553645115: // searchParam
2636          this.getSearchParam().add((CapabilityStatementRestResourceSearchParamComponent) value); // CapabilityStatementRestResourceSearchParamComponent
2637          return value;
2638        case 1662702951: // operation
2639          this.getOperation().add((CapabilityStatementRestOperationComponent) value); // CapabilityStatementRestOperationComponent
2640          return value;
2641        case -397756334: // compartment
2642          this.getCompartment().add(castToUri(value)); // UriType
2643          return value;
2644        default: return super.setProperty(hash, name, value);
2645        }
2646
2647      }
2648
2649      @Override
2650      public Base setProperty(String name, Base value) throws FHIRException {
2651        if (name.equals("mode")) {
2652          value = new RestfulCapabilityModeEnumFactory().fromType(castToCode(value));
2653          this.mode = (Enumeration) value; // Enumeration<RestfulCapabilityMode>
2654        } else if (name.equals("documentation")) {
2655          this.documentation = castToString(value); // StringType
2656        } else if (name.equals("security")) {
2657          this.security = (CapabilityStatementRestSecurityComponent) value; // CapabilityStatementRestSecurityComponent
2658        } else if (name.equals("resource")) {
2659          this.getResource().add((CapabilityStatementRestResourceComponent) value);
2660        } else if (name.equals("interaction")) {
2661          this.getInteraction().add((SystemInteractionComponent) value);
2662        } else if (name.equals("searchParam")) {
2663          this.getSearchParam().add((CapabilityStatementRestResourceSearchParamComponent) value);
2664        } else if (name.equals("operation")) {
2665          this.getOperation().add((CapabilityStatementRestOperationComponent) value);
2666        } else if (name.equals("compartment")) {
2667          this.getCompartment().add(castToUri(value));
2668        } else
2669          return super.setProperty(name, value);
2670        return value;
2671      }
2672
2673      @Override
2674      public Base makeProperty(int hash, String name) throws FHIRException {
2675        switch (hash) {
2676        case 3357091:  return getModeElement();
2677        case 1587405498:  return getDocumentationElement();
2678        case 949122880:  return getSecurity(); 
2679        case -341064690:  return addResource(); 
2680        case 1844104722:  return addInteraction(); 
2681        case -553645115:  return addSearchParam(); 
2682        case 1662702951:  return addOperation(); 
2683        case -397756334:  return addCompartmentElement();
2684        default: return super.makeProperty(hash, name);
2685        }
2686
2687      }
2688
2689      @Override
2690      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2691        switch (hash) {
2692        case 3357091: /*mode*/ return new String[] {"code"};
2693        case 1587405498: /*documentation*/ return new String[] {"string"};
2694        case 949122880: /*security*/ return new String[] {};
2695        case -341064690: /*resource*/ return new String[] {};
2696        case 1844104722: /*interaction*/ return new String[] {};
2697        case -553645115: /*searchParam*/ return new String[] {"@CapabilityStatement.rest.resource.searchParam"};
2698        case 1662702951: /*operation*/ return new String[] {};
2699        case -397756334: /*compartment*/ return new String[] {"uri"};
2700        default: return super.getTypesForProperty(hash, name);
2701        }
2702
2703      }
2704
2705      @Override
2706      public Base addChild(String name) throws FHIRException {
2707        if (name.equals("mode")) {
2708          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.mode");
2709        }
2710        else if (name.equals("documentation")) {
2711          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
2712        }
2713        else if (name.equals("security")) {
2714          this.security = new CapabilityStatementRestSecurityComponent();
2715          return this.security;
2716        }
2717        else if (name.equals("resource")) {
2718          return addResource();
2719        }
2720        else if (name.equals("interaction")) {
2721          return addInteraction();
2722        }
2723        else if (name.equals("searchParam")) {
2724          return addSearchParam();
2725        }
2726        else if (name.equals("operation")) {
2727          return addOperation();
2728        }
2729        else if (name.equals("compartment")) {
2730          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.compartment");
2731        }
2732        else
2733          return super.addChild(name);
2734      }
2735
2736      public CapabilityStatementRestComponent copy() {
2737        CapabilityStatementRestComponent dst = new CapabilityStatementRestComponent();
2738        copyValues(dst);
2739        dst.mode = mode == null ? null : mode.copy();
2740        dst.documentation = documentation == null ? null : documentation.copy();
2741        dst.security = security == null ? null : security.copy();
2742        if (resource != null) {
2743          dst.resource = new ArrayList<CapabilityStatementRestResourceComponent>();
2744          for (CapabilityStatementRestResourceComponent i : resource)
2745            dst.resource.add(i.copy());
2746        };
2747        if (interaction != null) {
2748          dst.interaction = new ArrayList<SystemInteractionComponent>();
2749          for (SystemInteractionComponent i : interaction)
2750            dst.interaction.add(i.copy());
2751        };
2752        if (searchParam != null) {
2753          dst.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
2754          for (CapabilityStatementRestResourceSearchParamComponent i : searchParam)
2755            dst.searchParam.add(i.copy());
2756        };
2757        if (operation != null) {
2758          dst.operation = new ArrayList<CapabilityStatementRestOperationComponent>();
2759          for (CapabilityStatementRestOperationComponent i : operation)
2760            dst.operation.add(i.copy());
2761        };
2762        if (compartment != null) {
2763          dst.compartment = new ArrayList<UriType>();
2764          for (UriType i : compartment)
2765            dst.compartment.add(i.copy());
2766        };
2767        return dst;
2768      }
2769
2770      @Override
2771      public boolean equalsDeep(Base other_) {
2772        if (!super.equalsDeep(other_))
2773          return false;
2774        if (!(other_ instanceof CapabilityStatementRestComponent))
2775          return false;
2776        CapabilityStatementRestComponent o = (CapabilityStatementRestComponent) other_;
2777        return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(security, o.security, true)
2778           && compareDeep(resource, o.resource, true) && compareDeep(interaction, o.interaction, true) && compareDeep(searchParam, o.searchParam, true)
2779           && compareDeep(operation, o.operation, true) && compareDeep(compartment, o.compartment, true);
2780      }
2781
2782      @Override
2783      public boolean equalsShallow(Base other_) {
2784        if (!super.equalsShallow(other_))
2785          return false;
2786        if (!(other_ instanceof CapabilityStatementRestComponent))
2787          return false;
2788        CapabilityStatementRestComponent o = (CapabilityStatementRestComponent) other_;
2789        return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true) && compareValues(compartment, o.compartment, true)
2790          ;
2791      }
2792
2793      public boolean isEmpty() {
2794        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mode, documentation, security
2795          , resource, interaction, searchParam, operation, compartment);
2796      }
2797
2798  public String fhirType() {
2799    return "CapabilityStatement.rest";
2800
2801  }
2802
2803  }
2804
2805    @Block()
2806    public static class CapabilityStatementRestSecurityComponent extends BackboneElement implements IBaseBackboneElement {
2807        /**
2808         * Server adds CORS headers when responding to requests - this enables javascript applications to use the server.
2809         */
2810        @Child(name = "cors", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true)
2811        @Description(shortDefinition="Adds CORS Headers (http://enable-cors.org/)", formalDefinition="Server adds CORS headers when responding to requests - this enables javascript applications to use the server." )
2812        protected BooleanType cors;
2813
2814        /**
2815         * Types of security services that are supported/required by the system.
2816         */
2817        @Child(name = "service", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2818        @Description(shortDefinition="OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates", formalDefinition="Types of security services that are supported/required by the system." )
2819        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/restful-security-service")
2820        protected List<CodeableConcept> service;
2821
2822        /**
2823         * General description of how security works.
2824         */
2825        @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2826        @Description(shortDefinition="General description of how security works", formalDefinition="General description of how security works." )
2827        protected StringType description;
2828
2829        /**
2830         * Certificates associated with security profiles.
2831         */
2832        @Child(name = "certificate", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2833        @Description(shortDefinition="Certificates associated with security profiles", formalDefinition="Certificates associated with security profiles." )
2834        protected List<CapabilityStatementRestSecurityCertificateComponent> certificate;
2835
2836        private static final long serialVersionUID = 1081654002L;
2837
2838    /**
2839     * Constructor
2840     */
2841      public CapabilityStatementRestSecurityComponent() {
2842        super();
2843      }
2844
2845        /**
2846         * @return {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value
2847         */
2848        public BooleanType getCorsElement() { 
2849          if (this.cors == null)
2850            if (Configuration.errorOnAutoCreate())
2851              throw new Error("Attempt to auto-create CapabilityStatementRestSecurityComponent.cors");
2852            else if (Configuration.doAutoCreate())
2853              this.cors = new BooleanType(); // bb
2854          return this.cors;
2855        }
2856
2857        public boolean hasCorsElement() { 
2858          return this.cors != null && !this.cors.isEmpty();
2859        }
2860
2861        public boolean hasCors() { 
2862          return this.cors != null && !this.cors.isEmpty();
2863        }
2864
2865        /**
2866         * @param value {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value
2867         */
2868        public CapabilityStatementRestSecurityComponent setCorsElement(BooleanType value) { 
2869          this.cors = value;
2870          return this;
2871        }
2872
2873        /**
2874         * @return Server adds CORS headers when responding to requests - this enables javascript applications to use the server.
2875         */
2876        public boolean getCors() { 
2877          return this.cors == null || this.cors.isEmpty() ? false : this.cors.getValue();
2878        }
2879
2880        /**
2881         * @param value Server adds CORS headers when responding to requests - this enables javascript applications to use the server.
2882         */
2883        public CapabilityStatementRestSecurityComponent setCors(boolean value) { 
2884            if (this.cors == null)
2885              this.cors = new BooleanType();
2886            this.cors.setValue(value);
2887          return this;
2888        }
2889
2890        /**
2891         * @return {@link #service} (Types of security services that are supported/required by the system.)
2892         */
2893        public List<CodeableConcept> getService() { 
2894          if (this.service == null)
2895            this.service = new ArrayList<CodeableConcept>();
2896          return this.service;
2897        }
2898
2899        /**
2900         * @return Returns a reference to <code>this</code> for easy method chaining
2901         */
2902        public CapabilityStatementRestSecurityComponent setService(List<CodeableConcept> theService) { 
2903          this.service = theService;
2904          return this;
2905        }
2906
2907        public boolean hasService() { 
2908          if (this.service == null)
2909            return false;
2910          for (CodeableConcept item : this.service)
2911            if (!item.isEmpty())
2912              return true;
2913          return false;
2914        }
2915
2916        public CodeableConcept addService() { //3
2917          CodeableConcept t = new CodeableConcept();
2918          if (this.service == null)
2919            this.service = new ArrayList<CodeableConcept>();
2920          this.service.add(t);
2921          return t;
2922        }
2923
2924        public CapabilityStatementRestSecurityComponent addService(CodeableConcept t) { //3
2925          if (t == null)
2926            return this;
2927          if (this.service == null)
2928            this.service = new ArrayList<CodeableConcept>();
2929          this.service.add(t);
2930          return this;
2931        }
2932
2933        /**
2934         * @return The first repetition of repeating field {@link #service}, creating it if it does not already exist
2935         */
2936        public CodeableConcept getServiceFirstRep() { 
2937          if (getService().isEmpty()) {
2938            addService();
2939          }
2940          return getService().get(0);
2941        }
2942
2943        /**
2944         * @return {@link #description} (General description of how security works.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2945         */
2946        public StringType getDescriptionElement() { 
2947          if (this.description == null)
2948            if (Configuration.errorOnAutoCreate())
2949              throw new Error("Attempt to auto-create CapabilityStatementRestSecurityComponent.description");
2950            else if (Configuration.doAutoCreate())
2951              this.description = new StringType(); // bb
2952          return this.description;
2953        }
2954
2955        public boolean hasDescriptionElement() { 
2956          return this.description != null && !this.description.isEmpty();
2957        }
2958
2959        public boolean hasDescription() { 
2960          return this.description != null && !this.description.isEmpty();
2961        }
2962
2963        /**
2964         * @param value {@link #description} (General description of how security works.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2965         */
2966        public CapabilityStatementRestSecurityComponent setDescriptionElement(StringType value) { 
2967          this.description = value;
2968          return this;
2969        }
2970
2971        /**
2972         * @return General description of how security works.
2973         */
2974        public String getDescription() { 
2975          return this.description == null ? null : this.description.getValue();
2976        }
2977
2978        /**
2979         * @param value General description of how security works.
2980         */
2981        public CapabilityStatementRestSecurityComponent setDescription(String value) { 
2982          if (Utilities.noString(value))
2983            this.description = null;
2984          else {
2985            if (this.description == null)
2986              this.description = new StringType();
2987            this.description.setValue(value);
2988          }
2989          return this;
2990        }
2991
2992        /**
2993         * @return {@link #certificate} (Certificates associated with security profiles.)
2994         */
2995        public List<CapabilityStatementRestSecurityCertificateComponent> getCertificate() { 
2996          if (this.certificate == null)
2997            this.certificate = new ArrayList<CapabilityStatementRestSecurityCertificateComponent>();
2998          return this.certificate;
2999        }
3000
3001        /**
3002         * @return Returns a reference to <code>this</code> for easy method chaining
3003         */
3004        public CapabilityStatementRestSecurityComponent setCertificate(List<CapabilityStatementRestSecurityCertificateComponent> theCertificate) { 
3005          this.certificate = theCertificate;
3006          return this;
3007        }
3008
3009        public boolean hasCertificate() { 
3010          if (this.certificate == null)
3011            return false;
3012          for (CapabilityStatementRestSecurityCertificateComponent item : this.certificate)
3013            if (!item.isEmpty())
3014              return true;
3015          return false;
3016        }
3017
3018        public CapabilityStatementRestSecurityCertificateComponent addCertificate() { //3
3019          CapabilityStatementRestSecurityCertificateComponent t = new CapabilityStatementRestSecurityCertificateComponent();
3020          if (this.certificate == null)
3021            this.certificate = new ArrayList<CapabilityStatementRestSecurityCertificateComponent>();
3022          this.certificate.add(t);
3023          return t;
3024        }
3025
3026        public CapabilityStatementRestSecurityComponent addCertificate(CapabilityStatementRestSecurityCertificateComponent t) { //3
3027          if (t == null)
3028            return this;
3029          if (this.certificate == null)
3030            this.certificate = new ArrayList<CapabilityStatementRestSecurityCertificateComponent>();
3031          this.certificate.add(t);
3032          return this;
3033        }
3034
3035        /**
3036         * @return The first repetition of repeating field {@link #certificate}, creating it if it does not already exist
3037         */
3038        public CapabilityStatementRestSecurityCertificateComponent getCertificateFirstRep() { 
3039          if (getCertificate().isEmpty()) {
3040            addCertificate();
3041          }
3042          return getCertificate().get(0);
3043        }
3044
3045        protected void listChildren(List<Property> children) {
3046          super.listChildren(children);
3047          children.add(new Property("cors", "boolean", "Server adds CORS headers when responding to requests - this enables javascript applications to use the server.", 0, 1, cors));
3048          children.add(new Property("service", "CodeableConcept", "Types of security services that are supported/required by the system.", 0, java.lang.Integer.MAX_VALUE, service));
3049          children.add(new Property("description", "string", "General description of how security works.", 0, 1, description));
3050          children.add(new Property("certificate", "", "Certificates associated with security profiles.", 0, java.lang.Integer.MAX_VALUE, certificate));
3051        }
3052
3053        @Override
3054        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3055          switch (_hash) {
3056          case 3059629: /*cors*/  return new Property("cors", "boolean", "Server adds CORS headers when responding to requests - this enables javascript applications to use the server.", 0, 1, cors);
3057          case 1984153269: /*service*/  return new Property("service", "CodeableConcept", "Types of security services that are supported/required by the system.", 0, java.lang.Integer.MAX_VALUE, service);
3058          case -1724546052: /*description*/  return new Property("description", "string", "General description of how security works.", 0, 1, description);
3059          case 1952399767: /*certificate*/  return new Property("certificate", "", "Certificates associated with security profiles.", 0, java.lang.Integer.MAX_VALUE, certificate);
3060          default: return super.getNamedProperty(_hash, _name, _checkValid);
3061          }
3062
3063        }
3064
3065      @Override
3066      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3067        switch (hash) {
3068        case 3059629: /*cors*/ return this.cors == null ? new Base[0] : new Base[] {this.cors}; // BooleanType
3069        case 1984153269: /*service*/ return this.service == null ? new Base[0] : this.service.toArray(new Base[this.service.size()]); // CodeableConcept
3070        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
3071        case 1952399767: /*certificate*/ return this.certificate == null ? new Base[0] : this.certificate.toArray(new Base[this.certificate.size()]); // CapabilityStatementRestSecurityCertificateComponent
3072        default: return super.getProperty(hash, name, checkValid);
3073        }
3074
3075      }
3076
3077      @Override
3078      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3079        switch (hash) {
3080        case 3059629: // cors
3081          this.cors = castToBoolean(value); // BooleanType
3082          return value;
3083        case 1984153269: // service
3084          this.getService().add(castToCodeableConcept(value)); // CodeableConcept
3085          return value;
3086        case -1724546052: // description
3087          this.description = castToString(value); // StringType
3088          return value;
3089        case 1952399767: // certificate
3090          this.getCertificate().add((CapabilityStatementRestSecurityCertificateComponent) value); // CapabilityStatementRestSecurityCertificateComponent
3091          return value;
3092        default: return super.setProperty(hash, name, value);
3093        }
3094
3095      }
3096
3097      @Override
3098      public Base setProperty(String name, Base value) throws FHIRException {
3099        if (name.equals("cors")) {
3100          this.cors = castToBoolean(value); // BooleanType
3101        } else if (name.equals("service")) {
3102          this.getService().add(castToCodeableConcept(value));
3103        } else if (name.equals("description")) {
3104          this.description = castToString(value); // StringType
3105        } else if (name.equals("certificate")) {
3106          this.getCertificate().add((CapabilityStatementRestSecurityCertificateComponent) value);
3107        } else
3108          return super.setProperty(name, value);
3109        return value;
3110      }
3111
3112      @Override
3113      public Base makeProperty(int hash, String name) throws FHIRException {
3114        switch (hash) {
3115        case 3059629:  return getCorsElement();
3116        case 1984153269:  return addService(); 
3117        case -1724546052:  return getDescriptionElement();
3118        case 1952399767:  return addCertificate(); 
3119        default: return super.makeProperty(hash, name);
3120        }
3121
3122      }
3123
3124      @Override
3125      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3126        switch (hash) {
3127        case 3059629: /*cors*/ return new String[] {"boolean"};
3128        case 1984153269: /*service*/ return new String[] {"CodeableConcept"};
3129        case -1724546052: /*description*/ return new String[] {"string"};
3130        case 1952399767: /*certificate*/ return new String[] {};
3131        default: return super.getTypesForProperty(hash, name);
3132        }
3133
3134      }
3135
3136      @Override
3137      public Base addChild(String name) throws FHIRException {
3138        if (name.equals("cors")) {
3139          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.cors");
3140        }
3141        else if (name.equals("service")) {
3142          return addService();
3143        }
3144        else if (name.equals("description")) {
3145          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.description");
3146        }
3147        else if (name.equals("certificate")) {
3148          return addCertificate();
3149        }
3150        else
3151          return super.addChild(name);
3152      }
3153
3154      public CapabilityStatementRestSecurityComponent copy() {
3155        CapabilityStatementRestSecurityComponent dst = new CapabilityStatementRestSecurityComponent();
3156        copyValues(dst);
3157        dst.cors = cors == null ? null : cors.copy();
3158        if (service != null) {
3159          dst.service = new ArrayList<CodeableConcept>();
3160          for (CodeableConcept i : service)
3161            dst.service.add(i.copy());
3162        };
3163        dst.description = description == null ? null : description.copy();
3164        if (certificate != null) {
3165          dst.certificate = new ArrayList<CapabilityStatementRestSecurityCertificateComponent>();
3166          for (CapabilityStatementRestSecurityCertificateComponent i : certificate)
3167            dst.certificate.add(i.copy());
3168        };
3169        return dst;
3170      }
3171
3172      @Override
3173      public boolean equalsDeep(Base other_) {
3174        if (!super.equalsDeep(other_))
3175          return false;
3176        if (!(other_ instanceof CapabilityStatementRestSecurityComponent))
3177          return false;
3178        CapabilityStatementRestSecurityComponent o = (CapabilityStatementRestSecurityComponent) other_;
3179        return compareDeep(cors, o.cors, true) && compareDeep(service, o.service, true) && compareDeep(description, o.description, true)
3180           && compareDeep(certificate, o.certificate, true);
3181      }
3182
3183      @Override
3184      public boolean equalsShallow(Base other_) {
3185        if (!super.equalsShallow(other_))
3186          return false;
3187        if (!(other_ instanceof CapabilityStatementRestSecurityComponent))
3188          return false;
3189        CapabilityStatementRestSecurityComponent o = (CapabilityStatementRestSecurityComponent) other_;
3190        return compareValues(cors, o.cors, true) && compareValues(description, o.description, true);
3191      }
3192
3193      public boolean isEmpty() {
3194        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(cors, service, description
3195          , certificate);
3196      }
3197
3198  public String fhirType() {
3199    return "CapabilityStatement.rest.security";
3200
3201  }
3202
3203  }
3204
3205    @Block()
3206    public static class CapabilityStatementRestSecurityCertificateComponent extends BackboneElement implements IBaseBackboneElement {
3207        /**
3208         * Mime type for a certificate.
3209         */
3210        @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false)
3211        @Description(shortDefinition="Mime type for certificates", formalDefinition="Mime type for a certificate." )
3212        protected CodeType type;
3213
3214        /**
3215         * Actual certificate.
3216         */
3217        @Child(name = "blob", type = {Base64BinaryType.class}, order=2, min=0, max=1, modifier=false, summary=false)
3218        @Description(shortDefinition="Actual certificate", formalDefinition="Actual certificate." )
3219        protected Base64BinaryType blob;
3220
3221        private static final long serialVersionUID = 2092655854L;
3222
3223    /**
3224     * Constructor
3225     */
3226      public CapabilityStatementRestSecurityCertificateComponent() {
3227        super();
3228      }
3229
3230        /**
3231         * @return {@link #type} (Mime type for a certificate.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
3232         */
3233        public CodeType getTypeElement() { 
3234          if (this.type == null)
3235            if (Configuration.errorOnAutoCreate())
3236              throw new Error("Attempt to auto-create CapabilityStatementRestSecurityCertificateComponent.type");
3237            else if (Configuration.doAutoCreate())
3238              this.type = new CodeType(); // bb
3239          return this.type;
3240        }
3241
3242        public boolean hasTypeElement() { 
3243          return this.type != null && !this.type.isEmpty();
3244        }
3245
3246        public boolean hasType() { 
3247          return this.type != null && !this.type.isEmpty();
3248        }
3249
3250        /**
3251         * @param value {@link #type} (Mime type for a certificate.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
3252         */
3253        public CapabilityStatementRestSecurityCertificateComponent setTypeElement(CodeType value) { 
3254          this.type = value;
3255          return this;
3256        }
3257
3258        /**
3259         * @return Mime type for a certificate.
3260         */
3261        public String getType() { 
3262          return this.type == null ? null : this.type.getValue();
3263        }
3264
3265        /**
3266         * @param value Mime type for a certificate.
3267         */
3268        public CapabilityStatementRestSecurityCertificateComponent setType(String value) { 
3269          if (Utilities.noString(value))
3270            this.type = null;
3271          else {
3272            if (this.type == null)
3273              this.type = new CodeType();
3274            this.type.setValue(value);
3275          }
3276          return this;
3277        }
3278
3279        /**
3280         * @return {@link #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value
3281         */
3282        public Base64BinaryType getBlobElement() { 
3283          if (this.blob == null)
3284            if (Configuration.errorOnAutoCreate())
3285              throw new Error("Attempt to auto-create CapabilityStatementRestSecurityCertificateComponent.blob");
3286            else if (Configuration.doAutoCreate())
3287              this.blob = new Base64BinaryType(); // bb
3288          return this.blob;
3289        }
3290
3291        public boolean hasBlobElement() { 
3292          return this.blob != null && !this.blob.isEmpty();
3293        }
3294
3295        public boolean hasBlob() { 
3296          return this.blob != null && !this.blob.isEmpty();
3297        }
3298
3299        /**
3300         * @param value {@link #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value
3301         */
3302        public CapabilityStatementRestSecurityCertificateComponent setBlobElement(Base64BinaryType value) { 
3303          this.blob = value;
3304          return this;
3305        }
3306
3307        /**
3308         * @return Actual certificate.
3309         */
3310        public byte[] getBlob() { 
3311          return this.blob == null ? null : this.blob.getValue();
3312        }
3313
3314        /**
3315         * @param value Actual certificate.
3316         */
3317        public CapabilityStatementRestSecurityCertificateComponent setBlob(byte[] value) { 
3318          if (value == null)
3319            this.blob = null;
3320          else {
3321            if (this.blob == null)
3322              this.blob = new Base64BinaryType();
3323            this.blob.setValue(value);
3324          }
3325          return this;
3326        }
3327
3328        protected void listChildren(List<Property> children) {
3329          super.listChildren(children);
3330          children.add(new Property("type", "code", "Mime type for a certificate.", 0, 1, type));
3331          children.add(new Property("blob", "base64Binary", "Actual certificate.", 0, 1, blob));
3332        }
3333
3334        @Override
3335        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3336          switch (_hash) {
3337          case 3575610: /*type*/  return new Property("type", "code", "Mime type for a certificate.", 0, 1, type);
3338          case 3026845: /*blob*/  return new Property("blob", "base64Binary", "Actual certificate.", 0, 1, blob);
3339          default: return super.getNamedProperty(_hash, _name, _checkValid);
3340          }
3341
3342        }
3343
3344      @Override
3345      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3346        switch (hash) {
3347        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType
3348        case 3026845: /*blob*/ return this.blob == null ? new Base[0] : new Base[] {this.blob}; // Base64BinaryType
3349        default: return super.getProperty(hash, name, checkValid);
3350        }
3351
3352      }
3353
3354      @Override
3355      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3356        switch (hash) {
3357        case 3575610: // type
3358          this.type = castToCode(value); // CodeType
3359          return value;
3360        case 3026845: // blob
3361          this.blob = castToBase64Binary(value); // Base64BinaryType
3362          return value;
3363        default: return super.setProperty(hash, name, value);
3364        }
3365
3366      }
3367
3368      @Override
3369      public Base setProperty(String name, Base value) throws FHIRException {
3370        if (name.equals("type")) {
3371          this.type = castToCode(value); // CodeType
3372        } else if (name.equals("blob")) {
3373          this.blob = castToBase64Binary(value); // Base64BinaryType
3374        } else
3375          return super.setProperty(name, value);
3376        return value;
3377      }
3378
3379      @Override
3380      public Base makeProperty(int hash, String name) throws FHIRException {
3381        switch (hash) {
3382        case 3575610:  return getTypeElement();
3383        case 3026845:  return getBlobElement();
3384        default: return super.makeProperty(hash, name);
3385        }
3386
3387      }
3388
3389      @Override
3390      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3391        switch (hash) {
3392        case 3575610: /*type*/ return new String[] {"code"};
3393        case 3026845: /*blob*/ return new String[] {"base64Binary"};
3394        default: return super.getTypesForProperty(hash, name);
3395        }
3396
3397      }
3398
3399      @Override
3400      public Base addChild(String name) throws FHIRException {
3401        if (name.equals("type")) {
3402          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.type");
3403        }
3404        else if (name.equals("blob")) {
3405          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.blob");
3406        }
3407        else
3408          return super.addChild(name);
3409      }
3410
3411      public CapabilityStatementRestSecurityCertificateComponent copy() {
3412        CapabilityStatementRestSecurityCertificateComponent dst = new CapabilityStatementRestSecurityCertificateComponent();
3413        copyValues(dst);
3414        dst.type = type == null ? null : type.copy();
3415        dst.blob = blob == null ? null : blob.copy();
3416        return dst;
3417      }
3418
3419      @Override
3420      public boolean equalsDeep(Base other_) {
3421        if (!super.equalsDeep(other_))
3422          return false;
3423        if (!(other_ instanceof CapabilityStatementRestSecurityCertificateComponent))
3424          return false;
3425        CapabilityStatementRestSecurityCertificateComponent o = (CapabilityStatementRestSecurityCertificateComponent) other_;
3426        return compareDeep(type, o.type, true) && compareDeep(blob, o.blob, true);
3427      }
3428
3429      @Override
3430      public boolean equalsShallow(Base other_) {
3431        if (!super.equalsShallow(other_))
3432          return false;
3433        if (!(other_ instanceof CapabilityStatementRestSecurityCertificateComponent))
3434          return false;
3435        CapabilityStatementRestSecurityCertificateComponent o = (CapabilityStatementRestSecurityCertificateComponent) other_;
3436        return compareValues(type, o.type, true) && compareValues(blob, o.blob, true);
3437      }
3438
3439      public boolean isEmpty() {
3440        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, blob);
3441      }
3442
3443  public String fhirType() {
3444    return "CapabilityStatement.rest.security.certificate";
3445
3446  }
3447
3448  }
3449
3450    @Block()
3451    public static class CapabilityStatementRestResourceComponent extends BackboneElement implements IBaseBackboneElement {
3452        /**
3453         * A type of resource exposed via the restful interface.
3454         */
3455        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
3456        @Description(shortDefinition="A resource type that is supported", formalDefinition="A type of resource exposed via the restful interface." )
3457        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types")
3458        protected CodeType type;
3459
3460        /**
3461         * A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).
3462         */
3463        @Child(name = "profile", type = {StructureDefinition.class}, order=2, min=0, max=1, modifier=false, summary=true)
3464        @Description(shortDefinition="Base System profile for all uses of resource", formalDefinition="A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses)." )
3465        protected Reference profile;
3466
3467        /**
3468         * The actual object that is the target of the reference (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).)
3469         */
3470        protected StructureDefinition profileTarget;
3471
3472        /**
3473         * Additional information about the resource type used by the system.
3474         */
3475        @Child(name = "documentation", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
3476        @Description(shortDefinition="Additional information about the use of the resource type", formalDefinition="Additional information about the resource type used by the system." )
3477        protected MarkdownType documentation;
3478
3479        /**
3480         * Identifies a restful operation supported by the solution.
3481         */
3482        @Child(name = "interaction", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3483        @Description(shortDefinition="What operations are supported?", formalDefinition="Identifies a restful operation supported by the solution." )
3484        protected List<ResourceInteractionComponent> interaction;
3485
3486        /**
3487         * This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.
3488         */
3489        @Child(name = "versioning", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
3490        @Description(shortDefinition="no-version | versioned | versioned-update", formalDefinition="This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API." )
3491        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/versioning-policy")
3492        protected Enumeration<ResourceVersionPolicy> versioning;
3493
3494        /**
3495         * A flag for whether the server is able to return past versions as part of the vRead operation.
3496         */
3497        @Child(name = "readHistory", type = {BooleanType.class}, order=6, min=0, max=1, modifier=false, summary=false)
3498        @Description(shortDefinition="Whether vRead can return past versions", formalDefinition="A flag for whether the server is able to return past versions as part of the vRead operation." )
3499        protected BooleanType readHistory;
3500
3501        /**
3502         * A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.
3503         */
3504        @Child(name = "updateCreate", type = {BooleanType.class}, order=7, min=0, max=1, modifier=false, summary=false)
3505        @Description(shortDefinition="If update can commit to a new identity", formalDefinition="A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server." )
3506        protected BooleanType updateCreate;
3507
3508        /**
3509         * A flag that indicates that the server supports conditional create.
3510         */
3511        @Child(name = "conditionalCreate", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false)
3512        @Description(shortDefinition="If allows/uses conditional create", formalDefinition="A flag that indicates that the server supports conditional create." )
3513        protected BooleanType conditionalCreate;
3514
3515        /**
3516         * A code that indicates how the server supports conditional read.
3517         */
3518        @Child(name = "conditionalRead", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=false)
3519        @Description(shortDefinition="not-supported | modified-since | not-match | full-support", formalDefinition="A code that indicates how the server supports conditional read." )
3520        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/conditional-read-status")
3521        protected Enumeration<ConditionalReadStatus> conditionalRead;
3522
3523        /**
3524         * A flag that indicates that the server supports conditional update.
3525         */
3526        @Child(name = "conditionalUpdate", type = {BooleanType.class}, order=10, min=0, max=1, modifier=false, summary=false)
3527        @Description(shortDefinition="If allows/uses conditional update", formalDefinition="A flag that indicates that the server supports conditional update." )
3528        protected BooleanType conditionalUpdate;
3529
3530        /**
3531         * A code that indicates how the server supports conditional delete.
3532         */
3533        @Child(name = "conditionalDelete", type = {CodeType.class}, order=11, min=0, max=1, modifier=false, summary=false)
3534        @Description(shortDefinition="not-supported | single | multiple - how conditional delete is supported", formalDefinition="A code that indicates how the server supports conditional delete." )
3535        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/conditional-delete-status")
3536        protected Enumeration<ConditionalDeleteStatus> conditionalDelete;
3537
3538        /**
3539         * A set of flags that defines how references are supported.
3540         */
3541        @Child(name = "referencePolicy", type = {CodeType.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3542        @Description(shortDefinition="literal | logical | resolves | enforced | local", formalDefinition="A set of flags that defines how references are supported." )
3543        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/reference-handling-policy")
3544        protected List<Enumeration<ReferenceHandlingPolicy>> referencePolicy;
3545
3546        /**
3547         * A list of _include values supported by the server.
3548         */
3549        @Child(name = "searchInclude", type = {StringType.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3550        @Description(shortDefinition="_include values supported by the server", formalDefinition="A list of _include values supported by the server." )
3551        protected List<StringType> searchInclude;
3552
3553        /**
3554         * A list of _revinclude (reverse include) values supported by the server.
3555         */
3556        @Child(name = "searchRevInclude", type = {StringType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3557        @Description(shortDefinition="_revinclude values supported by the server", formalDefinition="A list of _revinclude (reverse include) values supported by the server." )
3558        protected List<StringType> searchRevInclude;
3559
3560        /**
3561         * Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.
3562         */
3563        @Child(name = "searchParam", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3564        @Description(shortDefinition="Search parameters supported by implementation", formalDefinition="Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation." )
3565        protected List<CapabilityStatementRestResourceSearchParamComponent> searchParam;
3566
3567        private static final long serialVersionUID = 1271233297L;
3568
3569    /**
3570     * Constructor
3571     */
3572      public CapabilityStatementRestResourceComponent() {
3573        super();
3574      }
3575
3576    /**
3577     * Constructor
3578     */
3579      public CapabilityStatementRestResourceComponent(CodeType type) {
3580        super();
3581        this.type = type;
3582      }
3583
3584        /**
3585         * @return {@link #type} (A type of resource exposed via the restful interface.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
3586         */
3587        public CodeType getTypeElement() { 
3588          if (this.type == null)
3589            if (Configuration.errorOnAutoCreate())
3590              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.type");
3591            else if (Configuration.doAutoCreate())
3592              this.type = new CodeType(); // bb
3593          return this.type;
3594        }
3595
3596        public boolean hasTypeElement() { 
3597          return this.type != null && !this.type.isEmpty();
3598        }
3599
3600        public boolean hasType() { 
3601          return this.type != null && !this.type.isEmpty();
3602        }
3603
3604        /**
3605         * @param value {@link #type} (A type of resource exposed via the restful interface.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
3606         */
3607        public CapabilityStatementRestResourceComponent setTypeElement(CodeType value) { 
3608          this.type = value;
3609          return this;
3610        }
3611
3612        /**
3613         * @return A type of resource exposed via the restful interface.
3614         */
3615        public String getType() { 
3616          return this.type == null ? null : this.type.getValue();
3617        }
3618
3619        /**
3620         * @param value A type of resource exposed via the restful interface.
3621         */
3622        public CapabilityStatementRestResourceComponent setType(String value) { 
3623            if (this.type == null)
3624              this.type = new CodeType();
3625            this.type.setValue(value);
3626          return this;
3627        }
3628
3629        /**
3630         * @return {@link #profile} (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).)
3631         */
3632        public Reference getProfile() { 
3633          if (this.profile == null)
3634            if (Configuration.errorOnAutoCreate())
3635              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.profile");
3636            else if (Configuration.doAutoCreate())
3637              this.profile = new Reference(); // cc
3638          return this.profile;
3639        }
3640
3641        public boolean hasProfile() { 
3642          return this.profile != null && !this.profile.isEmpty();
3643        }
3644
3645        /**
3646         * @param value {@link #profile} (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).)
3647         */
3648        public CapabilityStatementRestResourceComponent setProfile(Reference value)  { 
3649          this.profile = value;
3650          return this;
3651        }
3652
3653        /**
3654         * @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 specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).)
3655         */
3656        public StructureDefinition getProfileTarget() { 
3657          if (this.profileTarget == null)
3658            if (Configuration.errorOnAutoCreate())
3659              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.profile");
3660            else if (Configuration.doAutoCreate())
3661              this.profileTarget = new StructureDefinition(); // aa
3662          return this.profileTarget;
3663        }
3664
3665        /**
3666         * @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 specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).)
3667         */
3668        public CapabilityStatementRestResourceComponent setProfileTarget(StructureDefinition value) { 
3669          this.profileTarget = value;
3670          return this;
3671        }
3672
3673        /**
3674         * @return {@link #documentation} (Additional information about the resource type used by the system.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
3675         */
3676        public MarkdownType getDocumentationElement() { 
3677          if (this.documentation == null)
3678            if (Configuration.errorOnAutoCreate())
3679              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.documentation");
3680            else if (Configuration.doAutoCreate())
3681              this.documentation = new MarkdownType(); // bb
3682          return this.documentation;
3683        }
3684
3685        public boolean hasDocumentationElement() { 
3686          return this.documentation != null && !this.documentation.isEmpty();
3687        }
3688
3689        public boolean hasDocumentation() { 
3690          return this.documentation != null && !this.documentation.isEmpty();
3691        }
3692
3693        /**
3694         * @param value {@link #documentation} (Additional information about the resource type used by the system.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
3695         */
3696        public CapabilityStatementRestResourceComponent setDocumentationElement(MarkdownType value) { 
3697          this.documentation = value;
3698          return this;
3699        }
3700
3701        /**
3702         * @return Additional information about the resource type used by the system.
3703         */
3704        public String getDocumentation() { 
3705          return this.documentation == null ? null : this.documentation.getValue();
3706        }
3707
3708        /**
3709         * @param value Additional information about the resource type used by the system.
3710         */
3711        public CapabilityStatementRestResourceComponent setDocumentation(String value) { 
3712          if (value == null)
3713            this.documentation = null;
3714          else {
3715            if (this.documentation == null)
3716              this.documentation = new MarkdownType();
3717            this.documentation.setValue(value);
3718          }
3719          return this;
3720        }
3721
3722        /**
3723         * @return {@link #interaction} (Identifies a restful operation supported by the solution.)
3724         */
3725        public List<ResourceInteractionComponent> getInteraction() { 
3726          if (this.interaction == null)
3727            this.interaction = new ArrayList<ResourceInteractionComponent>();
3728          return this.interaction;
3729        }
3730
3731        /**
3732         * @return Returns a reference to <code>this</code> for easy method chaining
3733         */
3734        public CapabilityStatementRestResourceComponent setInteraction(List<ResourceInteractionComponent> theInteraction) { 
3735          this.interaction = theInteraction;
3736          return this;
3737        }
3738
3739        public boolean hasInteraction() { 
3740          if (this.interaction == null)
3741            return false;
3742          for (ResourceInteractionComponent item : this.interaction)
3743            if (!item.isEmpty())
3744              return true;
3745          return false;
3746        }
3747
3748        public ResourceInteractionComponent addInteraction() { //3
3749          ResourceInteractionComponent t = new ResourceInteractionComponent();
3750          if (this.interaction == null)
3751            this.interaction = new ArrayList<ResourceInteractionComponent>();
3752          this.interaction.add(t);
3753          return t;
3754        }
3755
3756        public CapabilityStatementRestResourceComponent addInteraction(ResourceInteractionComponent t) { //3
3757          if (t == null)
3758            return this;
3759          if (this.interaction == null)
3760            this.interaction = new ArrayList<ResourceInteractionComponent>();
3761          this.interaction.add(t);
3762          return this;
3763        }
3764
3765        /**
3766         * @return The first repetition of repeating field {@link #interaction}, creating it if it does not already exist
3767         */
3768        public ResourceInteractionComponent getInteractionFirstRep() { 
3769          if (getInteraction().isEmpty()) {
3770            addInteraction();
3771          }
3772          return getInteraction().get(0);
3773        }
3774
3775        /**
3776         * @return {@link #versioning} (This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value
3777         */
3778        public Enumeration<ResourceVersionPolicy> getVersioningElement() { 
3779          if (this.versioning == null)
3780            if (Configuration.errorOnAutoCreate())
3781              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.versioning");
3782            else if (Configuration.doAutoCreate())
3783              this.versioning = new Enumeration<ResourceVersionPolicy>(new ResourceVersionPolicyEnumFactory()); // bb
3784          return this.versioning;
3785        }
3786
3787        public boolean hasVersioningElement() { 
3788          return this.versioning != null && !this.versioning.isEmpty();
3789        }
3790
3791        public boolean hasVersioning() { 
3792          return this.versioning != null && !this.versioning.isEmpty();
3793        }
3794
3795        /**
3796         * @param value {@link #versioning} (This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value
3797         */
3798        public CapabilityStatementRestResourceComponent setVersioningElement(Enumeration<ResourceVersionPolicy> value) { 
3799          this.versioning = value;
3800          return this;
3801        }
3802
3803        /**
3804         * @return This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.
3805         */
3806        public ResourceVersionPolicy getVersioning() { 
3807          return this.versioning == null ? null : this.versioning.getValue();
3808        }
3809
3810        /**
3811         * @param value This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.
3812         */
3813        public CapabilityStatementRestResourceComponent setVersioning(ResourceVersionPolicy value) { 
3814          if (value == null)
3815            this.versioning = null;
3816          else {
3817            if (this.versioning == null)
3818              this.versioning = new Enumeration<ResourceVersionPolicy>(new ResourceVersionPolicyEnumFactory());
3819            this.versioning.setValue(value);
3820          }
3821          return this;
3822        }
3823
3824        /**
3825         * @return {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value
3826         */
3827        public BooleanType getReadHistoryElement() { 
3828          if (this.readHistory == null)
3829            if (Configuration.errorOnAutoCreate())
3830              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.readHistory");
3831            else if (Configuration.doAutoCreate())
3832              this.readHistory = new BooleanType(); // bb
3833          return this.readHistory;
3834        }
3835
3836        public boolean hasReadHistoryElement() { 
3837          return this.readHistory != null && !this.readHistory.isEmpty();
3838        }
3839
3840        public boolean hasReadHistory() { 
3841          return this.readHistory != null && !this.readHistory.isEmpty();
3842        }
3843
3844        /**
3845         * @param value {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value
3846         */
3847        public CapabilityStatementRestResourceComponent setReadHistoryElement(BooleanType value) { 
3848          this.readHistory = value;
3849          return this;
3850        }
3851
3852        /**
3853         * @return A flag for whether the server is able to return past versions as part of the vRead operation.
3854         */
3855        public boolean getReadHistory() { 
3856          return this.readHistory == null || this.readHistory.isEmpty() ? false : this.readHistory.getValue();
3857        }
3858
3859        /**
3860         * @param value A flag for whether the server is able to return past versions as part of the vRead operation.
3861         */
3862        public CapabilityStatementRestResourceComponent setReadHistory(boolean value) { 
3863            if (this.readHistory == null)
3864              this.readHistory = new BooleanType();
3865            this.readHistory.setValue(value);
3866          return this;
3867        }
3868
3869        /**
3870         * @return {@link #updateCreate} (A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value
3871         */
3872        public BooleanType getUpdateCreateElement() { 
3873          if (this.updateCreate == null)
3874            if (Configuration.errorOnAutoCreate())
3875              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.updateCreate");
3876            else if (Configuration.doAutoCreate())
3877              this.updateCreate = new BooleanType(); // bb
3878          return this.updateCreate;
3879        }
3880
3881        public boolean hasUpdateCreateElement() { 
3882          return this.updateCreate != null && !this.updateCreate.isEmpty();
3883        }
3884
3885        public boolean hasUpdateCreate() { 
3886          return this.updateCreate != null && !this.updateCreate.isEmpty();
3887        }
3888
3889        /**
3890         * @param value {@link #updateCreate} (A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value
3891         */
3892        public CapabilityStatementRestResourceComponent setUpdateCreateElement(BooleanType value) { 
3893          this.updateCreate = value;
3894          return this;
3895        }
3896
3897        /**
3898         * @return A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.
3899         */
3900        public boolean getUpdateCreate() { 
3901          return this.updateCreate == null || this.updateCreate.isEmpty() ? false : this.updateCreate.getValue();
3902        }
3903
3904        /**
3905         * @param value A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.
3906         */
3907        public CapabilityStatementRestResourceComponent setUpdateCreate(boolean value) { 
3908            if (this.updateCreate == null)
3909              this.updateCreate = new BooleanType();
3910            this.updateCreate.setValue(value);
3911          return this;
3912        }
3913
3914        /**
3915         * @return {@link #conditionalCreate} (A flag that indicates that the server supports conditional create.). This is the underlying object with id, value and extensions. The accessor "getConditionalCreate" gives direct access to the value
3916         */
3917        public BooleanType getConditionalCreateElement() { 
3918          if (this.conditionalCreate == null)
3919            if (Configuration.errorOnAutoCreate())
3920              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.conditionalCreate");
3921            else if (Configuration.doAutoCreate())
3922              this.conditionalCreate = new BooleanType(); // bb
3923          return this.conditionalCreate;
3924        }
3925
3926        public boolean hasConditionalCreateElement() { 
3927          return this.conditionalCreate != null && !this.conditionalCreate.isEmpty();
3928        }
3929
3930        public boolean hasConditionalCreate() { 
3931          return this.conditionalCreate != null && !this.conditionalCreate.isEmpty();
3932        }
3933
3934        /**
3935         * @param value {@link #conditionalCreate} (A flag that indicates that the server supports conditional create.). This is the underlying object with id, value and extensions. The accessor "getConditionalCreate" gives direct access to the value
3936         */
3937        public CapabilityStatementRestResourceComponent setConditionalCreateElement(BooleanType value) { 
3938          this.conditionalCreate = value;
3939          return this;
3940        }
3941
3942        /**
3943         * @return A flag that indicates that the server supports conditional create.
3944         */
3945        public boolean getConditionalCreate() { 
3946          return this.conditionalCreate == null || this.conditionalCreate.isEmpty() ? false : this.conditionalCreate.getValue();
3947        }
3948
3949        /**
3950         * @param value A flag that indicates that the server supports conditional create.
3951         */
3952        public CapabilityStatementRestResourceComponent setConditionalCreate(boolean value) { 
3953            if (this.conditionalCreate == null)
3954              this.conditionalCreate = new BooleanType();
3955            this.conditionalCreate.setValue(value);
3956          return this;
3957        }
3958
3959        /**
3960         * @return {@link #conditionalRead} (A code that indicates how the server supports conditional read.). This is the underlying object with id, value and extensions. The accessor "getConditionalRead" gives direct access to the value
3961         */
3962        public Enumeration<ConditionalReadStatus> getConditionalReadElement() { 
3963          if (this.conditionalRead == null)
3964            if (Configuration.errorOnAutoCreate())
3965              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.conditionalRead");
3966            else if (Configuration.doAutoCreate())
3967              this.conditionalRead = new Enumeration<ConditionalReadStatus>(new ConditionalReadStatusEnumFactory()); // bb
3968          return this.conditionalRead;
3969        }
3970
3971        public boolean hasConditionalReadElement() { 
3972          return this.conditionalRead != null && !this.conditionalRead.isEmpty();
3973        }
3974
3975        public boolean hasConditionalRead() { 
3976          return this.conditionalRead != null && !this.conditionalRead.isEmpty();
3977        }
3978
3979        /**
3980         * @param value {@link #conditionalRead} (A code that indicates how the server supports conditional read.). This is the underlying object with id, value and extensions. The accessor "getConditionalRead" gives direct access to the value
3981         */
3982        public CapabilityStatementRestResourceComponent setConditionalReadElement(Enumeration<ConditionalReadStatus> value) { 
3983          this.conditionalRead = value;
3984          return this;
3985        }
3986
3987        /**
3988         * @return A code that indicates how the server supports conditional read.
3989         */
3990        public ConditionalReadStatus getConditionalRead() { 
3991          return this.conditionalRead == null ? null : this.conditionalRead.getValue();
3992        }
3993
3994        /**
3995         * @param value A code that indicates how the server supports conditional read.
3996         */
3997        public CapabilityStatementRestResourceComponent setConditionalRead(ConditionalReadStatus value) { 
3998          if (value == null)
3999            this.conditionalRead = null;
4000          else {
4001            if (this.conditionalRead == null)
4002              this.conditionalRead = new Enumeration<ConditionalReadStatus>(new ConditionalReadStatusEnumFactory());
4003            this.conditionalRead.setValue(value);
4004          }
4005          return this;
4006        }
4007
4008        /**
4009         * @return {@link #conditionalUpdate} (A flag that indicates that the server supports conditional update.). This is the underlying object with id, value and extensions. The accessor "getConditionalUpdate" gives direct access to the value
4010         */
4011        public BooleanType getConditionalUpdateElement() { 
4012          if (this.conditionalUpdate == null)
4013            if (Configuration.errorOnAutoCreate())
4014              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.conditionalUpdate");
4015            else if (Configuration.doAutoCreate())
4016              this.conditionalUpdate = new BooleanType(); // bb
4017          return this.conditionalUpdate;
4018        }
4019
4020        public boolean hasConditionalUpdateElement() { 
4021          return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty();
4022        }
4023
4024        public boolean hasConditionalUpdate() { 
4025          return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty();
4026        }
4027
4028        /**
4029         * @param value {@link #conditionalUpdate} (A flag that indicates that the server supports conditional update.). This is the underlying object with id, value and extensions. The accessor "getConditionalUpdate" gives direct access to the value
4030         */
4031        public CapabilityStatementRestResourceComponent setConditionalUpdateElement(BooleanType value) { 
4032          this.conditionalUpdate = value;
4033          return this;
4034        }
4035
4036        /**
4037         * @return A flag that indicates that the server supports conditional update.
4038         */
4039        public boolean getConditionalUpdate() { 
4040          return this.conditionalUpdate == null || this.conditionalUpdate.isEmpty() ? false : this.conditionalUpdate.getValue();
4041        }
4042
4043        /**
4044         * @param value A flag that indicates that the server supports conditional update.
4045         */
4046        public CapabilityStatementRestResourceComponent setConditionalUpdate(boolean value) { 
4047            if (this.conditionalUpdate == null)
4048              this.conditionalUpdate = new BooleanType();
4049            this.conditionalUpdate.setValue(value);
4050          return this;
4051        }
4052
4053        /**
4054         * @return {@link #conditionalDelete} (A code that indicates how the server supports conditional delete.). This is the underlying object with id, value and extensions. The accessor "getConditionalDelete" gives direct access to the value
4055         */
4056        public Enumeration<ConditionalDeleteStatus> getConditionalDeleteElement() { 
4057          if (this.conditionalDelete == null)
4058            if (Configuration.errorOnAutoCreate())
4059              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.conditionalDelete");
4060            else if (Configuration.doAutoCreate())
4061              this.conditionalDelete = new Enumeration<ConditionalDeleteStatus>(new ConditionalDeleteStatusEnumFactory()); // bb
4062          return this.conditionalDelete;
4063        }
4064
4065        public boolean hasConditionalDeleteElement() { 
4066          return this.conditionalDelete != null && !this.conditionalDelete.isEmpty();
4067        }
4068
4069        public boolean hasConditionalDelete() { 
4070          return this.conditionalDelete != null && !this.conditionalDelete.isEmpty();
4071        }
4072
4073        /**
4074         * @param value {@link #conditionalDelete} (A code that indicates how the server supports conditional delete.). This is the underlying object with id, value and extensions. The accessor "getConditionalDelete" gives direct access to the value
4075         */
4076        public CapabilityStatementRestResourceComponent setConditionalDeleteElement(Enumeration<ConditionalDeleteStatus> value) { 
4077          this.conditionalDelete = value;
4078          return this;
4079        }
4080
4081        /**
4082         * @return A code that indicates how the server supports conditional delete.
4083         */
4084        public ConditionalDeleteStatus getConditionalDelete() { 
4085          return this.conditionalDelete == null ? null : this.conditionalDelete.getValue();
4086        }
4087
4088        /**
4089         * @param value A code that indicates how the server supports conditional delete.
4090         */
4091        public CapabilityStatementRestResourceComponent setConditionalDelete(ConditionalDeleteStatus value) { 
4092          if (value == null)
4093            this.conditionalDelete = null;
4094          else {
4095            if (this.conditionalDelete == null)
4096              this.conditionalDelete = new Enumeration<ConditionalDeleteStatus>(new ConditionalDeleteStatusEnumFactory());
4097            this.conditionalDelete.setValue(value);
4098          }
4099          return this;
4100        }
4101
4102        /**
4103         * @return {@link #referencePolicy} (A set of flags that defines how references are supported.)
4104         */
4105        public List<Enumeration<ReferenceHandlingPolicy>> getReferencePolicy() { 
4106          if (this.referencePolicy == null)
4107            this.referencePolicy = new ArrayList<Enumeration<ReferenceHandlingPolicy>>();
4108          return this.referencePolicy;
4109        }
4110
4111        /**
4112         * @return Returns a reference to <code>this</code> for easy method chaining
4113         */
4114        public CapabilityStatementRestResourceComponent setReferencePolicy(List<Enumeration<ReferenceHandlingPolicy>> theReferencePolicy) { 
4115          this.referencePolicy = theReferencePolicy;
4116          return this;
4117        }
4118
4119        public boolean hasReferencePolicy() { 
4120          if (this.referencePolicy == null)
4121            return false;
4122          for (Enumeration<ReferenceHandlingPolicy> item : this.referencePolicy)
4123            if (!item.isEmpty())
4124              return true;
4125          return false;
4126        }
4127
4128        /**
4129         * @return {@link #referencePolicy} (A set of flags that defines how references are supported.)
4130         */
4131        public Enumeration<ReferenceHandlingPolicy> addReferencePolicyElement() {//2 
4132          Enumeration<ReferenceHandlingPolicy> t = new Enumeration<ReferenceHandlingPolicy>(new ReferenceHandlingPolicyEnumFactory());
4133          if (this.referencePolicy == null)
4134            this.referencePolicy = new ArrayList<Enumeration<ReferenceHandlingPolicy>>();
4135          this.referencePolicy.add(t);
4136          return t;
4137        }
4138
4139        /**
4140         * @param value {@link #referencePolicy} (A set of flags that defines how references are supported.)
4141         */
4142        public CapabilityStatementRestResourceComponent addReferencePolicy(ReferenceHandlingPolicy value) { //1
4143          Enumeration<ReferenceHandlingPolicy> t = new Enumeration<ReferenceHandlingPolicy>(new ReferenceHandlingPolicyEnumFactory());
4144          t.setValue(value);
4145          if (this.referencePolicy == null)
4146            this.referencePolicy = new ArrayList<Enumeration<ReferenceHandlingPolicy>>();
4147          this.referencePolicy.add(t);
4148          return this;
4149        }
4150
4151        /**
4152         * @param value {@link #referencePolicy} (A set of flags that defines how references are supported.)
4153         */
4154        public boolean hasReferencePolicy(ReferenceHandlingPolicy value) { 
4155          if (this.referencePolicy == null)
4156            return false;
4157          for (Enumeration<ReferenceHandlingPolicy> v : this.referencePolicy)
4158            if (v.getValue().equals(value)) // code
4159              return true;
4160          return false;
4161        }
4162
4163        /**
4164         * @return {@link #searchInclude} (A list of _include values supported by the server.)
4165         */
4166        public List<StringType> getSearchInclude() { 
4167          if (this.searchInclude == null)
4168            this.searchInclude = new ArrayList<StringType>();
4169          return this.searchInclude;
4170        }
4171
4172        /**
4173         * @return Returns a reference to <code>this</code> for easy method chaining
4174         */
4175        public CapabilityStatementRestResourceComponent setSearchInclude(List<StringType> theSearchInclude) { 
4176          this.searchInclude = theSearchInclude;
4177          return this;
4178        }
4179
4180        public boolean hasSearchInclude() { 
4181          if (this.searchInclude == null)
4182            return false;
4183          for (StringType item : this.searchInclude)
4184            if (!item.isEmpty())
4185              return true;
4186          return false;
4187        }
4188
4189        /**
4190         * @return {@link #searchInclude} (A list of _include values supported by the server.)
4191         */
4192        public StringType addSearchIncludeElement() {//2 
4193          StringType t = new StringType();
4194          if (this.searchInclude == null)
4195            this.searchInclude = new ArrayList<StringType>();
4196          this.searchInclude.add(t);
4197          return t;
4198        }
4199
4200        /**
4201         * @param value {@link #searchInclude} (A list of _include values supported by the server.)
4202         */
4203        public CapabilityStatementRestResourceComponent addSearchInclude(String value) { //1
4204          StringType t = new StringType();
4205          t.setValue(value);
4206          if (this.searchInclude == null)
4207            this.searchInclude = new ArrayList<StringType>();
4208          this.searchInclude.add(t);
4209          return this;
4210        }
4211
4212        /**
4213         * @param value {@link #searchInclude} (A list of _include values supported by the server.)
4214         */
4215        public boolean hasSearchInclude(String value) { 
4216          if (this.searchInclude == null)
4217            return false;
4218          for (StringType v : this.searchInclude)
4219            if (v.getValue().equals(value)) // string
4220              return true;
4221          return false;
4222        }
4223
4224        /**
4225         * @return {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.)
4226         */
4227        public List<StringType> getSearchRevInclude() { 
4228          if (this.searchRevInclude == null)
4229            this.searchRevInclude = new ArrayList<StringType>();
4230          return this.searchRevInclude;
4231        }
4232
4233        /**
4234         * @return Returns a reference to <code>this</code> for easy method chaining
4235         */
4236        public CapabilityStatementRestResourceComponent setSearchRevInclude(List<StringType> theSearchRevInclude) { 
4237          this.searchRevInclude = theSearchRevInclude;
4238          return this;
4239        }
4240
4241        public boolean hasSearchRevInclude() { 
4242          if (this.searchRevInclude == null)
4243            return false;
4244          for (StringType item : this.searchRevInclude)
4245            if (!item.isEmpty())
4246              return true;
4247          return false;
4248        }
4249
4250        /**
4251         * @return {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.)
4252         */
4253        public StringType addSearchRevIncludeElement() {//2 
4254          StringType t = new StringType();
4255          if (this.searchRevInclude == null)
4256            this.searchRevInclude = new ArrayList<StringType>();
4257          this.searchRevInclude.add(t);
4258          return t;
4259        }
4260
4261        /**
4262         * @param value {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.)
4263         */
4264        public CapabilityStatementRestResourceComponent addSearchRevInclude(String value) { //1
4265          StringType t = new StringType();
4266          t.setValue(value);
4267          if (this.searchRevInclude == null)
4268            this.searchRevInclude = new ArrayList<StringType>();
4269          this.searchRevInclude.add(t);
4270          return this;
4271        }
4272
4273        /**
4274         * @param value {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.)
4275         */
4276        public boolean hasSearchRevInclude(String value) { 
4277          if (this.searchRevInclude == null)
4278            return false;
4279          for (StringType v : this.searchRevInclude)
4280            if (v.getValue().equals(value)) // string
4281              return true;
4282          return false;
4283        }
4284
4285        /**
4286         * @return {@link #searchParam} (Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.)
4287         */
4288        public List<CapabilityStatementRestResourceSearchParamComponent> getSearchParam() { 
4289          if (this.searchParam == null)
4290            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
4291          return this.searchParam;
4292        }
4293
4294        /**
4295         * @return Returns a reference to <code>this</code> for easy method chaining
4296         */
4297        public CapabilityStatementRestResourceComponent setSearchParam(List<CapabilityStatementRestResourceSearchParamComponent> theSearchParam) { 
4298          this.searchParam = theSearchParam;
4299          return this;
4300        }
4301
4302        public boolean hasSearchParam() { 
4303          if (this.searchParam == null)
4304            return false;
4305          for (CapabilityStatementRestResourceSearchParamComponent item : this.searchParam)
4306            if (!item.isEmpty())
4307              return true;
4308          return false;
4309        }
4310
4311        public CapabilityStatementRestResourceSearchParamComponent addSearchParam() { //3
4312          CapabilityStatementRestResourceSearchParamComponent t = new CapabilityStatementRestResourceSearchParamComponent();
4313          if (this.searchParam == null)
4314            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
4315          this.searchParam.add(t);
4316          return t;
4317        }
4318
4319        public CapabilityStatementRestResourceComponent addSearchParam(CapabilityStatementRestResourceSearchParamComponent t) { //3
4320          if (t == null)
4321            return this;
4322          if (this.searchParam == null)
4323            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
4324          this.searchParam.add(t);
4325          return this;
4326        }
4327
4328        /**
4329         * @return The first repetition of repeating field {@link #searchParam}, creating it if it does not already exist
4330         */
4331        public CapabilityStatementRestResourceSearchParamComponent getSearchParamFirstRep() { 
4332          if (getSearchParam().isEmpty()) {
4333            addSearchParam();
4334          }
4335          return getSearchParam().get(0);
4336        }
4337
4338        protected void listChildren(List<Property> children) {
4339          super.listChildren(children);
4340          children.add(new Property("type", "code", "A type of resource exposed via the restful interface.", 0, 1, type));
4341          children.add(new Property("profile", "Reference(StructureDefinition)", "A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).", 0, 1, profile));
4342          children.add(new Property("documentation", "markdown", "Additional information about the resource type used by the system.", 0, 1, documentation));
4343          children.add(new Property("interaction", "", "Identifies a restful operation supported by the solution.", 0, java.lang.Integer.MAX_VALUE, interaction));
4344          children.add(new Property("versioning", "code", "This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.", 0, 1, versioning));
4345          children.add(new Property("readHistory", "boolean", "A flag for whether the server is able to return past versions as part of the vRead operation.", 0, 1, readHistory));
4346          children.add(new Property("updateCreate", "boolean", "A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.", 0, 1, updateCreate));
4347          children.add(new Property("conditionalCreate", "boolean", "A flag that indicates that the server supports conditional create.", 0, 1, conditionalCreate));
4348          children.add(new Property("conditionalRead", "code", "A code that indicates how the server supports conditional read.", 0, 1, conditionalRead));
4349          children.add(new Property("conditionalUpdate", "boolean", "A flag that indicates that the server supports conditional update.", 0, 1, conditionalUpdate));
4350          children.add(new Property("conditionalDelete", "code", "A code that indicates how the server supports conditional delete.", 0, 1, conditionalDelete));
4351          children.add(new Property("referencePolicy", "code", "A set of flags that defines how references are supported.", 0, java.lang.Integer.MAX_VALUE, referencePolicy));
4352          children.add(new Property("searchInclude", "string", "A list of _include values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchInclude));
4353          children.add(new Property("searchRevInclude", "string", "A list of _revinclude (reverse include) values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchRevInclude));
4354          children.add(new Property("searchParam", "", "Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam));
4355        }
4356
4357        @Override
4358        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4359          switch (_hash) {
4360          case 3575610: /*type*/  return new Property("type", "code", "A type of resource exposed via the restful interface.", 0, 1, type);
4361          case -309425751: /*profile*/  return new Property("profile", "Reference(StructureDefinition)", "A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).", 0, 1, profile);
4362          case 1587405498: /*documentation*/  return new Property("documentation", "markdown", "Additional information about the resource type used by the system.", 0, 1, documentation);
4363          case 1844104722: /*interaction*/  return new Property("interaction", "", "Identifies a restful operation supported by the solution.", 0, java.lang.Integer.MAX_VALUE, interaction);
4364          case -670487542: /*versioning*/  return new Property("versioning", "code", "This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.", 0, 1, versioning);
4365          case 187518494: /*readHistory*/  return new Property("readHistory", "boolean", "A flag for whether the server is able to return past versions as part of the vRead operation.", 0, 1, readHistory);
4366          case -1400550619: /*updateCreate*/  return new Property("updateCreate", "boolean", "A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.", 0, 1, updateCreate);
4367          case 6401826: /*conditionalCreate*/  return new Property("conditionalCreate", "boolean", "A flag that indicates that the server supports conditional create.", 0, 1, conditionalCreate);
4368          case 822786364: /*conditionalRead*/  return new Property("conditionalRead", "code", "A code that indicates how the server supports conditional read.", 0, 1, conditionalRead);
4369          case 519849711: /*conditionalUpdate*/  return new Property("conditionalUpdate", "boolean", "A flag that indicates that the server supports conditional update.", 0, 1, conditionalUpdate);
4370          case 23237585: /*conditionalDelete*/  return new Property("conditionalDelete", "code", "A code that indicates how the server supports conditional delete.", 0, 1, conditionalDelete);
4371          case 796257373: /*referencePolicy*/  return new Property("referencePolicy", "code", "A set of flags that defines how references are supported.", 0, java.lang.Integer.MAX_VALUE, referencePolicy);
4372          case -1035904544: /*searchInclude*/  return new Property("searchInclude", "string", "A list of _include values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchInclude);
4373          case -2123884979: /*searchRevInclude*/  return new Property("searchRevInclude", "string", "A list of _revinclude (reverse include) values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchRevInclude);
4374          case -553645115: /*searchParam*/  return new Property("searchParam", "", "Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam);
4375          default: return super.getNamedProperty(_hash, _name, _checkValid);
4376          }
4377
4378        }
4379
4380      @Override
4381      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4382        switch (hash) {
4383        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType
4384        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference
4385        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // MarkdownType
4386        case 1844104722: /*interaction*/ return this.interaction == null ? new Base[0] : this.interaction.toArray(new Base[this.interaction.size()]); // ResourceInteractionComponent
4387        case -670487542: /*versioning*/ return this.versioning == null ? new Base[0] : new Base[] {this.versioning}; // Enumeration<ResourceVersionPolicy>
4388        case 187518494: /*readHistory*/ return this.readHistory == null ? new Base[0] : new Base[] {this.readHistory}; // BooleanType
4389        case -1400550619: /*updateCreate*/ return this.updateCreate == null ? new Base[0] : new Base[] {this.updateCreate}; // BooleanType
4390        case 6401826: /*conditionalCreate*/ return this.conditionalCreate == null ? new Base[0] : new Base[] {this.conditionalCreate}; // BooleanType
4391        case 822786364: /*conditionalRead*/ return this.conditionalRead == null ? new Base[0] : new Base[] {this.conditionalRead}; // Enumeration<ConditionalReadStatus>
4392        case 519849711: /*conditionalUpdate*/ return this.conditionalUpdate == null ? new Base[0] : new Base[] {this.conditionalUpdate}; // BooleanType
4393        case 23237585: /*conditionalDelete*/ return this.conditionalDelete == null ? new Base[0] : new Base[] {this.conditionalDelete}; // Enumeration<ConditionalDeleteStatus>
4394        case 796257373: /*referencePolicy*/ return this.referencePolicy == null ? new Base[0] : this.referencePolicy.toArray(new Base[this.referencePolicy.size()]); // Enumeration<ReferenceHandlingPolicy>
4395        case -1035904544: /*searchInclude*/ return this.searchInclude == null ? new Base[0] : this.searchInclude.toArray(new Base[this.searchInclude.size()]); // StringType
4396        case -2123884979: /*searchRevInclude*/ return this.searchRevInclude == null ? new Base[0] : this.searchRevInclude.toArray(new Base[this.searchRevInclude.size()]); // StringType
4397        case -553645115: /*searchParam*/ return this.searchParam == null ? new Base[0] : this.searchParam.toArray(new Base[this.searchParam.size()]); // CapabilityStatementRestResourceSearchParamComponent
4398        default: return super.getProperty(hash, name, checkValid);
4399        }
4400
4401      }
4402
4403      @Override
4404      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4405        switch (hash) {
4406        case 3575610: // type
4407          this.type = castToCode(value); // CodeType
4408          return value;
4409        case -309425751: // profile
4410          this.profile = castToReference(value); // Reference
4411          return value;
4412        case 1587405498: // documentation
4413          this.documentation = castToMarkdown(value); // MarkdownType
4414          return value;
4415        case 1844104722: // interaction
4416          this.getInteraction().add((ResourceInteractionComponent) value); // ResourceInteractionComponent
4417          return value;
4418        case -670487542: // versioning
4419          value = new ResourceVersionPolicyEnumFactory().fromType(castToCode(value));
4420          this.versioning = (Enumeration) value; // Enumeration<ResourceVersionPolicy>
4421          return value;
4422        case 187518494: // readHistory
4423          this.readHistory = castToBoolean(value); // BooleanType
4424          return value;
4425        case -1400550619: // updateCreate
4426          this.updateCreate = castToBoolean(value); // BooleanType
4427          return value;
4428        case 6401826: // conditionalCreate
4429          this.conditionalCreate = castToBoolean(value); // BooleanType
4430          return value;
4431        case 822786364: // conditionalRead
4432          value = new ConditionalReadStatusEnumFactory().fromType(castToCode(value));
4433          this.conditionalRead = (Enumeration) value; // Enumeration<ConditionalReadStatus>
4434          return value;
4435        case 519849711: // conditionalUpdate
4436          this.conditionalUpdate = castToBoolean(value); // BooleanType
4437          return value;
4438        case 23237585: // conditionalDelete
4439          value = new ConditionalDeleteStatusEnumFactory().fromType(castToCode(value));
4440          this.conditionalDelete = (Enumeration) value; // Enumeration<ConditionalDeleteStatus>
4441          return value;
4442        case 796257373: // referencePolicy
4443          value = new ReferenceHandlingPolicyEnumFactory().fromType(castToCode(value));
4444          this.getReferencePolicy().add((Enumeration) value); // Enumeration<ReferenceHandlingPolicy>
4445          return value;
4446        case -1035904544: // searchInclude
4447          this.getSearchInclude().add(castToString(value)); // StringType
4448          return value;
4449        case -2123884979: // searchRevInclude
4450          this.getSearchRevInclude().add(castToString(value)); // StringType
4451          return value;
4452        case -553645115: // searchParam
4453          this.getSearchParam().add((CapabilityStatementRestResourceSearchParamComponent) value); // CapabilityStatementRestResourceSearchParamComponent
4454          return value;
4455        default: return super.setProperty(hash, name, value);
4456        }
4457
4458      }
4459
4460      @Override
4461      public Base setProperty(String name, Base value) throws FHIRException {
4462        if (name.equals("type")) {
4463          this.type = castToCode(value); // CodeType
4464        } else if (name.equals("profile")) {
4465          this.profile = castToReference(value); // Reference
4466        } else if (name.equals("documentation")) {
4467          this.documentation = castToMarkdown(value); // MarkdownType
4468        } else if (name.equals("interaction")) {
4469          this.getInteraction().add((ResourceInteractionComponent) value);
4470        } else if (name.equals("versioning")) {
4471          value = new ResourceVersionPolicyEnumFactory().fromType(castToCode(value));
4472          this.versioning = (Enumeration) value; // Enumeration<ResourceVersionPolicy>
4473        } else if (name.equals("readHistory")) {
4474          this.readHistory = castToBoolean(value); // BooleanType
4475        } else if (name.equals("updateCreate")) {
4476          this.updateCreate = castToBoolean(value); // BooleanType
4477        } else if (name.equals("conditionalCreate")) {
4478          this.conditionalCreate = castToBoolean(value); // BooleanType
4479        } else if (name.equals("conditionalRead")) {
4480          value = new ConditionalReadStatusEnumFactory().fromType(castToCode(value));
4481          this.conditionalRead = (Enumeration) value; // Enumeration<ConditionalReadStatus>
4482        } else if (name.equals("conditionalUpdate")) {
4483          this.conditionalUpdate = castToBoolean(value); // BooleanType
4484        } else if (name.equals("conditionalDelete")) {
4485          value = new ConditionalDeleteStatusEnumFactory().fromType(castToCode(value));
4486          this.conditionalDelete = (Enumeration) value; // Enumeration<ConditionalDeleteStatus>
4487        } else if (name.equals("referencePolicy")) {
4488          value = new ReferenceHandlingPolicyEnumFactory().fromType(castToCode(value));
4489          this.getReferencePolicy().add((Enumeration) value);
4490        } else if (name.equals("searchInclude")) {
4491          this.getSearchInclude().add(castToString(value));
4492        } else if (name.equals("searchRevInclude")) {
4493          this.getSearchRevInclude().add(castToString(value));
4494        } else if (name.equals("searchParam")) {
4495          this.getSearchParam().add((CapabilityStatementRestResourceSearchParamComponent) value);
4496        } else
4497          return super.setProperty(name, value);
4498        return value;
4499      }
4500
4501      @Override
4502      public Base makeProperty(int hash, String name) throws FHIRException {
4503        switch (hash) {
4504        case 3575610:  return getTypeElement();
4505        case -309425751:  return getProfile(); 
4506        case 1587405498:  return getDocumentationElement();
4507        case 1844104722:  return addInteraction(); 
4508        case -670487542:  return getVersioningElement();
4509        case 187518494:  return getReadHistoryElement();
4510        case -1400550619:  return getUpdateCreateElement();
4511        case 6401826:  return getConditionalCreateElement();
4512        case 822786364:  return getConditionalReadElement();
4513        case 519849711:  return getConditionalUpdateElement();
4514        case 23237585:  return getConditionalDeleteElement();
4515        case 796257373:  return addReferencePolicyElement();
4516        case -1035904544:  return addSearchIncludeElement();
4517        case -2123884979:  return addSearchRevIncludeElement();
4518        case -553645115:  return addSearchParam(); 
4519        default: return super.makeProperty(hash, name);
4520        }
4521
4522      }
4523
4524      @Override
4525      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4526        switch (hash) {
4527        case 3575610: /*type*/ return new String[] {"code"};
4528        case -309425751: /*profile*/ return new String[] {"Reference"};
4529        case 1587405498: /*documentation*/ return new String[] {"markdown"};
4530        case 1844104722: /*interaction*/ return new String[] {};
4531        case -670487542: /*versioning*/ return new String[] {"code"};
4532        case 187518494: /*readHistory*/ return new String[] {"boolean"};
4533        case -1400550619: /*updateCreate*/ return new String[] {"boolean"};
4534        case 6401826: /*conditionalCreate*/ return new String[] {"boolean"};
4535        case 822786364: /*conditionalRead*/ return new String[] {"code"};
4536        case 519849711: /*conditionalUpdate*/ return new String[] {"boolean"};
4537        case 23237585: /*conditionalDelete*/ return new String[] {"code"};
4538        case 796257373: /*referencePolicy*/ return new String[] {"code"};
4539        case -1035904544: /*searchInclude*/ return new String[] {"string"};
4540        case -2123884979: /*searchRevInclude*/ return new String[] {"string"};
4541        case -553645115: /*searchParam*/ return new String[] {};
4542        default: return super.getTypesForProperty(hash, name);
4543        }
4544
4545      }
4546
4547      @Override
4548      public Base addChild(String name) throws FHIRException {
4549        if (name.equals("type")) {
4550          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.type");
4551        }
4552        else if (name.equals("profile")) {
4553          this.profile = new Reference();
4554          return this.profile;
4555        }
4556        else if (name.equals("documentation")) {
4557          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
4558        }
4559        else if (name.equals("interaction")) {
4560          return addInteraction();
4561        }
4562        else if (name.equals("versioning")) {
4563          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.versioning");
4564        }
4565        else if (name.equals("readHistory")) {
4566          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.readHistory");
4567        }
4568        else if (name.equals("updateCreate")) {
4569          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.updateCreate");
4570        }
4571        else if (name.equals("conditionalCreate")) {
4572          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.conditionalCreate");
4573        }
4574        else if (name.equals("conditionalRead")) {
4575          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.conditionalRead");
4576        }
4577        else if (name.equals("conditionalUpdate")) {
4578          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.conditionalUpdate");
4579        }
4580        else if (name.equals("conditionalDelete")) {
4581          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.conditionalDelete");
4582        }
4583        else if (name.equals("referencePolicy")) {
4584          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.referencePolicy");
4585        }
4586        else if (name.equals("searchInclude")) {
4587          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.searchInclude");
4588        }
4589        else if (name.equals("searchRevInclude")) {
4590          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.searchRevInclude");
4591        }
4592        else if (name.equals("searchParam")) {
4593          return addSearchParam();
4594        }
4595        else
4596          return super.addChild(name);
4597      }
4598
4599      public CapabilityStatementRestResourceComponent copy() {
4600        CapabilityStatementRestResourceComponent dst = new CapabilityStatementRestResourceComponent();
4601        copyValues(dst);
4602        dst.type = type == null ? null : type.copy();
4603        dst.profile = profile == null ? null : profile.copy();
4604        dst.documentation = documentation == null ? null : documentation.copy();
4605        if (interaction != null) {
4606          dst.interaction = new ArrayList<ResourceInteractionComponent>();
4607          for (ResourceInteractionComponent i : interaction)
4608            dst.interaction.add(i.copy());
4609        };
4610        dst.versioning = versioning == null ? null : versioning.copy();
4611        dst.readHistory = readHistory == null ? null : readHistory.copy();
4612        dst.updateCreate = updateCreate == null ? null : updateCreate.copy();
4613        dst.conditionalCreate = conditionalCreate == null ? null : conditionalCreate.copy();
4614        dst.conditionalRead = conditionalRead == null ? null : conditionalRead.copy();
4615        dst.conditionalUpdate = conditionalUpdate == null ? null : conditionalUpdate.copy();
4616        dst.conditionalDelete = conditionalDelete == null ? null : conditionalDelete.copy();
4617        if (referencePolicy != null) {
4618          dst.referencePolicy = new ArrayList<Enumeration<ReferenceHandlingPolicy>>();
4619          for (Enumeration<ReferenceHandlingPolicy> i : referencePolicy)
4620            dst.referencePolicy.add(i.copy());
4621        };
4622        if (searchInclude != null) {
4623          dst.searchInclude = new ArrayList<StringType>();
4624          for (StringType i : searchInclude)
4625            dst.searchInclude.add(i.copy());
4626        };
4627        if (searchRevInclude != null) {
4628          dst.searchRevInclude = new ArrayList<StringType>();
4629          for (StringType i : searchRevInclude)
4630            dst.searchRevInclude.add(i.copy());
4631        };
4632        if (searchParam != null) {
4633          dst.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
4634          for (CapabilityStatementRestResourceSearchParamComponent i : searchParam)
4635            dst.searchParam.add(i.copy());
4636        };
4637        return dst;
4638      }
4639
4640      @Override
4641      public boolean equalsDeep(Base other_) {
4642        if (!super.equalsDeep(other_))
4643          return false;
4644        if (!(other_ instanceof CapabilityStatementRestResourceComponent))
4645          return false;
4646        CapabilityStatementRestResourceComponent o = (CapabilityStatementRestResourceComponent) other_;
4647        return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true) && compareDeep(documentation, o.documentation, true)
4648           && compareDeep(interaction, o.interaction, true) && compareDeep(versioning, o.versioning, true)
4649           && compareDeep(readHistory, o.readHistory, true) && compareDeep(updateCreate, o.updateCreate, true)
4650           && compareDeep(conditionalCreate, o.conditionalCreate, true) && compareDeep(conditionalRead, o.conditionalRead, true)
4651           && compareDeep(conditionalUpdate, o.conditionalUpdate, true) && compareDeep(conditionalDelete, o.conditionalDelete, true)
4652           && compareDeep(referencePolicy, o.referencePolicy, true) && compareDeep(searchInclude, o.searchInclude, true)
4653           && compareDeep(searchRevInclude, o.searchRevInclude, true) && compareDeep(searchParam, o.searchParam, true)
4654          ;
4655      }
4656
4657      @Override
4658      public boolean equalsShallow(Base other_) {
4659        if (!super.equalsShallow(other_))
4660          return false;
4661        if (!(other_ instanceof CapabilityStatementRestResourceComponent))
4662          return false;
4663        CapabilityStatementRestResourceComponent o = (CapabilityStatementRestResourceComponent) other_;
4664        return compareValues(type, o.type, true) && compareValues(documentation, o.documentation, true) && compareValues(versioning, o.versioning, true)
4665           && compareValues(readHistory, o.readHistory, true) && compareValues(updateCreate, o.updateCreate, true)
4666           && compareValues(conditionalCreate, o.conditionalCreate, true) && compareValues(conditionalRead, o.conditionalRead, true)
4667           && compareValues(conditionalUpdate, o.conditionalUpdate, true) && compareValues(conditionalDelete, o.conditionalDelete, true)
4668           && compareValues(referencePolicy, o.referencePolicy, true) && compareValues(searchInclude, o.searchInclude, true)
4669           && compareValues(searchRevInclude, o.searchRevInclude, true);
4670      }
4671
4672      public boolean isEmpty() {
4673        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, profile, documentation
4674          , interaction, versioning, readHistory, updateCreate, conditionalCreate, conditionalRead
4675          , conditionalUpdate, conditionalDelete, referencePolicy, searchInclude, searchRevInclude
4676          , searchParam);
4677      }
4678
4679  public String fhirType() {
4680    return "CapabilityStatement.rest.resource";
4681
4682  }
4683
4684  }
4685
4686    @Block()
4687    public static class ResourceInteractionComponent extends BackboneElement implements IBaseBackboneElement {
4688        /**
4689         * Coded identifier of the operation, supported by the system resource.
4690         */
4691        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4692        @Description(shortDefinition="read | vread | update | patch | delete | history-instance | history-type | create | search-type", formalDefinition="Coded identifier of the operation, supported by the system resource." )
4693        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/type-restful-interaction")
4694        protected Enumeration<TypeRestfulInteraction> code;
4695
4696        /**
4697         * Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.
4698         */
4699        @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
4700        @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'." )
4701        protected StringType documentation;
4702
4703        private static final long serialVersionUID = -437507806L;
4704
4705    /**
4706     * Constructor
4707     */
4708      public ResourceInteractionComponent() {
4709        super();
4710      }
4711
4712    /**
4713     * Constructor
4714     */
4715      public ResourceInteractionComponent(Enumeration<TypeRestfulInteraction> code) {
4716        super();
4717        this.code = code;
4718      }
4719
4720        /**
4721         * @return {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
4722         */
4723        public Enumeration<TypeRestfulInteraction> getCodeElement() { 
4724          if (this.code == null)
4725            if (Configuration.errorOnAutoCreate())
4726              throw new Error("Attempt to auto-create ResourceInteractionComponent.code");
4727            else if (Configuration.doAutoCreate())
4728              this.code = new Enumeration<TypeRestfulInteraction>(new TypeRestfulInteractionEnumFactory()); // bb
4729          return this.code;
4730        }
4731
4732        public boolean hasCodeElement() { 
4733          return this.code != null && !this.code.isEmpty();
4734        }
4735
4736        public boolean hasCode() { 
4737          return this.code != null && !this.code.isEmpty();
4738        }
4739
4740        /**
4741         * @param value {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
4742         */
4743        public ResourceInteractionComponent setCodeElement(Enumeration<TypeRestfulInteraction> value) { 
4744          this.code = value;
4745          return this;
4746        }
4747
4748        /**
4749         * @return Coded identifier of the operation, supported by the system resource.
4750         */
4751        public TypeRestfulInteraction getCode() { 
4752          return this.code == null ? null : this.code.getValue();
4753        }
4754
4755        /**
4756         * @param value Coded identifier of the operation, supported by the system resource.
4757         */
4758        public ResourceInteractionComponent setCode(TypeRestfulInteraction value) { 
4759            if (this.code == null)
4760              this.code = new Enumeration<TypeRestfulInteraction>(new TypeRestfulInteractionEnumFactory());
4761            this.code.setValue(value);
4762          return this;
4763        }
4764
4765        /**
4766         * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
4767         */
4768        public StringType getDocumentationElement() { 
4769          if (this.documentation == null)
4770            if (Configuration.errorOnAutoCreate())
4771              throw new Error("Attempt to auto-create ResourceInteractionComponent.documentation");
4772            else if (Configuration.doAutoCreate())
4773              this.documentation = new StringType(); // bb
4774          return this.documentation;
4775        }
4776
4777        public boolean hasDocumentationElement() { 
4778          return this.documentation != null && !this.documentation.isEmpty();
4779        }
4780
4781        public boolean hasDocumentation() { 
4782          return this.documentation != null && !this.documentation.isEmpty();
4783        }
4784
4785        /**
4786         * @param value {@link #documentation} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
4787         */
4788        public ResourceInteractionComponent setDocumentationElement(StringType value) { 
4789          this.documentation = value;
4790          return this;
4791        }
4792
4793        /**
4794         * @return Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.
4795         */
4796        public String getDocumentation() { 
4797          return this.documentation == null ? null : this.documentation.getValue();
4798        }
4799
4800        /**
4801         * @param value Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.
4802         */
4803        public ResourceInteractionComponent setDocumentation(String value) { 
4804          if (Utilities.noString(value))
4805            this.documentation = null;
4806          else {
4807            if (this.documentation == null)
4808              this.documentation = new StringType();
4809            this.documentation.setValue(value);
4810          }
4811          return this;
4812        }
4813
4814        protected void listChildren(List<Property> children) {
4815          super.listChildren(children);
4816          children.add(new Property("code", "code", "Coded identifier of the operation, supported by the system resource.", 0, 1, code));
4817          children.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.", 0, 1, documentation));
4818        }
4819
4820        @Override
4821        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4822          switch (_hash) {
4823          case 3059181: /*code*/  return new Property("code", "code", "Coded identifier of the operation, supported by the system resource.", 0, 1, code);
4824          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.", 0, 1, documentation);
4825          default: return super.getNamedProperty(_hash, _name, _checkValid);
4826          }
4827
4828        }
4829
4830      @Override
4831      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4832        switch (hash) {
4833        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration<TypeRestfulInteraction>
4834        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
4835        default: return super.getProperty(hash, name, checkValid);
4836        }
4837
4838      }
4839
4840      @Override
4841      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4842        switch (hash) {
4843        case 3059181: // code
4844          value = new TypeRestfulInteractionEnumFactory().fromType(castToCode(value));
4845          this.code = (Enumeration) value; // Enumeration<TypeRestfulInteraction>
4846          return value;
4847        case 1587405498: // documentation
4848          this.documentation = castToString(value); // StringType
4849          return value;
4850        default: return super.setProperty(hash, name, value);
4851        }
4852
4853      }
4854
4855      @Override
4856      public Base setProperty(String name, Base value) throws FHIRException {
4857        if (name.equals("code")) {
4858          value = new TypeRestfulInteractionEnumFactory().fromType(castToCode(value));
4859          this.code = (Enumeration) value; // Enumeration<TypeRestfulInteraction>
4860        } else if (name.equals("documentation")) {
4861          this.documentation = castToString(value); // StringType
4862        } else
4863          return super.setProperty(name, value);
4864        return value;
4865      }
4866
4867      @Override
4868      public Base makeProperty(int hash, String name) throws FHIRException {
4869        switch (hash) {
4870        case 3059181:  return getCodeElement();
4871        case 1587405498:  return getDocumentationElement();
4872        default: return super.makeProperty(hash, name);
4873        }
4874
4875      }
4876
4877      @Override
4878      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4879        switch (hash) {
4880        case 3059181: /*code*/ return new String[] {"code"};
4881        case 1587405498: /*documentation*/ return new String[] {"string"};
4882        default: return super.getTypesForProperty(hash, name);
4883        }
4884
4885      }
4886
4887      @Override
4888      public Base addChild(String name) throws FHIRException {
4889        if (name.equals("code")) {
4890          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.code");
4891        }
4892        else if (name.equals("documentation")) {
4893          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
4894        }
4895        else
4896          return super.addChild(name);
4897      }
4898
4899      public ResourceInteractionComponent copy() {
4900        ResourceInteractionComponent dst = new ResourceInteractionComponent();
4901        copyValues(dst);
4902        dst.code = code == null ? null : code.copy();
4903        dst.documentation = documentation == null ? null : documentation.copy();
4904        return dst;
4905      }
4906
4907      @Override
4908      public boolean equalsDeep(Base other_) {
4909        if (!super.equalsDeep(other_))
4910          return false;
4911        if (!(other_ instanceof ResourceInteractionComponent))
4912          return false;
4913        ResourceInteractionComponent o = (ResourceInteractionComponent) other_;
4914        return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true);
4915      }
4916
4917      @Override
4918      public boolean equalsShallow(Base other_) {
4919        if (!super.equalsShallow(other_))
4920          return false;
4921        if (!(other_ instanceof ResourceInteractionComponent))
4922          return false;
4923        ResourceInteractionComponent o = (ResourceInteractionComponent) other_;
4924        return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true);
4925      }
4926
4927      public boolean isEmpty() {
4928        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, documentation);
4929      }
4930
4931  public String fhirType() {
4932    return "CapabilityStatement.rest.resource.interaction";
4933
4934  }
4935
4936  }
4937
4938    @Block()
4939    public static class CapabilityStatementRestResourceSearchParamComponent extends BackboneElement implements IBaseBackboneElement {
4940        /**
4941         * The name of the search parameter used in the interface.
4942         */
4943        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4944        @Description(shortDefinition="Name of search parameter", formalDefinition="The name of the search parameter used in the interface." )
4945        protected StringType name;
4946
4947        /**
4948         * An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).
4949         */
4950        @Child(name = "definition", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false)
4951        @Description(shortDefinition="Source of definition for parameter", formalDefinition="An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]])." )
4952        protected UriType definition;
4953
4954        /**
4955         * The type of value a search parameter refers to, and how the content is interpreted.
4956         */
4957        @Child(name = "type", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=false)
4958        @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." )
4959        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/search-param-type")
4960        protected Enumeration<SearchParamType> type;
4961
4962        /**
4963         * This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.
4964         */
4965        @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
4966        @Description(shortDefinition="Server-specific usage", formalDefinition="This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms." )
4967        protected StringType documentation;
4968
4969        private static final long serialVersionUID = 72133006L;
4970
4971    /**
4972     * Constructor
4973     */
4974      public CapabilityStatementRestResourceSearchParamComponent() {
4975        super();
4976      }
4977
4978    /**
4979     * Constructor
4980     */
4981      public CapabilityStatementRestResourceSearchParamComponent(StringType name, Enumeration<SearchParamType> type) {
4982        super();
4983        this.name = name;
4984        this.type = type;
4985      }
4986
4987        /**
4988         * @return {@link #name} (The name of the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
4989         */
4990        public StringType getNameElement() { 
4991          if (this.name == null)
4992            if (Configuration.errorOnAutoCreate())
4993              throw new Error("Attempt to auto-create CapabilityStatementRestResourceSearchParamComponent.name");
4994            else if (Configuration.doAutoCreate())
4995              this.name = new StringType(); // bb
4996          return this.name;
4997        }
4998
4999        public boolean hasNameElement() { 
5000          return this.name != null && !this.name.isEmpty();
5001        }
5002
5003        public boolean hasName() { 
5004          return this.name != null && !this.name.isEmpty();
5005        }
5006
5007        /**
5008         * @param value {@link #name} (The name of the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
5009         */
5010        public CapabilityStatementRestResourceSearchParamComponent setNameElement(StringType value) { 
5011          this.name = value;
5012          return this;
5013        }
5014
5015        /**
5016         * @return The name of the search parameter used in the interface.
5017         */
5018        public String getName() { 
5019          return this.name == null ? null : this.name.getValue();
5020        }
5021
5022        /**
5023         * @param value The name of the search parameter used in the interface.
5024         */
5025        public CapabilityStatementRestResourceSearchParamComponent setName(String value) { 
5026            if (this.name == null)
5027              this.name = new StringType();
5028            this.name.setValue(value);
5029          return this;
5030        }
5031
5032        /**
5033         * @return {@link #definition} (An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
5034         */
5035        public UriType getDefinitionElement() { 
5036          if (this.definition == null)
5037            if (Configuration.errorOnAutoCreate())
5038              throw new Error("Attempt to auto-create CapabilityStatementRestResourceSearchParamComponent.definition");
5039            else if (Configuration.doAutoCreate())
5040              this.definition = new UriType(); // bb
5041          return this.definition;
5042        }
5043
5044        public boolean hasDefinitionElement() { 
5045          return this.definition != null && !this.definition.isEmpty();
5046        }
5047
5048        public boolean hasDefinition() { 
5049          return this.definition != null && !this.definition.isEmpty();
5050        }
5051
5052        /**
5053         * @param value {@link #definition} (An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
5054         */
5055        public CapabilityStatementRestResourceSearchParamComponent setDefinitionElement(UriType value) { 
5056          this.definition = value;
5057          return this;
5058        }
5059
5060        /**
5061         * @return An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).
5062         */
5063        public String getDefinition() { 
5064          return this.definition == null ? null : this.definition.getValue();
5065        }
5066
5067        /**
5068         * @param value An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).
5069         */
5070        public CapabilityStatementRestResourceSearchParamComponent setDefinition(String value) { 
5071          if (Utilities.noString(value))
5072            this.definition = null;
5073          else {
5074            if (this.definition == null)
5075              this.definition = new UriType();
5076            this.definition.setValue(value);
5077          }
5078          return this;
5079        }
5080
5081        /**
5082         * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
5083         */
5084        public Enumeration<SearchParamType> getTypeElement() { 
5085          if (this.type == null)
5086            if (Configuration.errorOnAutoCreate())
5087              throw new Error("Attempt to auto-create CapabilityStatementRestResourceSearchParamComponent.type");
5088            else if (Configuration.doAutoCreate())
5089              this.type = new Enumeration<SearchParamType>(new SearchParamTypeEnumFactory()); // bb
5090          return this.type;
5091        }
5092
5093        public boolean hasTypeElement() { 
5094          return this.type != null && !this.type.isEmpty();
5095        }
5096
5097        public boolean hasType() { 
5098          return this.type != null && !this.type.isEmpty();
5099        }
5100
5101        /**
5102         * @param value {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
5103         */
5104        public CapabilityStatementRestResourceSearchParamComponent setTypeElement(Enumeration<SearchParamType> value) { 
5105          this.type = value;
5106          return this;
5107        }
5108
5109        /**
5110         * @return The type of value a search parameter refers to, and how the content is interpreted.
5111         */
5112        public SearchParamType getType() { 
5113          return this.type == null ? null : this.type.getValue();
5114        }
5115
5116        /**
5117         * @param value The type of value a search parameter refers to, and how the content is interpreted.
5118         */
5119        public CapabilityStatementRestResourceSearchParamComponent setType(SearchParamType value) { 
5120            if (this.type == null)
5121              this.type = new Enumeration<SearchParamType>(new SearchParamTypeEnumFactory());
5122            this.type.setValue(value);
5123          return this;
5124        }
5125
5126        /**
5127         * @return {@link #documentation} (This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
5128         */
5129        public StringType getDocumentationElement() { 
5130          if (this.documentation == null)
5131            if (Configuration.errorOnAutoCreate())
5132              throw new Error("Attempt to auto-create CapabilityStatementRestResourceSearchParamComponent.documentation");
5133            else if (Configuration.doAutoCreate())
5134              this.documentation = new StringType(); // bb
5135          return this.documentation;
5136        }
5137
5138        public boolean hasDocumentationElement() { 
5139          return this.documentation != null && !this.documentation.isEmpty();
5140        }
5141
5142        public boolean hasDocumentation() { 
5143          return this.documentation != null && !this.documentation.isEmpty();
5144        }
5145
5146        /**
5147         * @param value {@link #documentation} (This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
5148         */
5149        public CapabilityStatementRestResourceSearchParamComponent setDocumentationElement(StringType value) { 
5150          this.documentation = value;
5151          return this;
5152        }
5153
5154        /**
5155         * @return This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.
5156         */
5157        public String getDocumentation() { 
5158          return this.documentation == null ? null : this.documentation.getValue();
5159        }
5160
5161        /**
5162         * @param value This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.
5163         */
5164        public CapabilityStatementRestResourceSearchParamComponent setDocumentation(String value) { 
5165          if (Utilities.noString(value))
5166            this.documentation = null;
5167          else {
5168            if (this.documentation == null)
5169              this.documentation = new StringType();
5170            this.documentation.setValue(value);
5171          }
5172          return this;
5173        }
5174
5175        protected void listChildren(List<Property> children) {
5176          super.listChildren(children);
5177          children.add(new Property("name", "string", "The name of the search parameter used in the interface.", 0, 1, name));
5178          children.add(new Property("definition", "uri", "An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).", 0, 1, definition));
5179          children.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, 1, type));
5180          children.add(new Property("documentation", "string", "This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.", 0, 1, documentation));
5181        }
5182
5183        @Override
5184        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5185          switch (_hash) {
5186          case 3373707: /*name*/  return new Property("name", "string", "The name of the search parameter used in the interface.", 0, 1, name);
5187          case -1014418093: /*definition*/  return new Property("definition", "uri", "An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).", 0, 1, definition);
5188          case 3575610: /*type*/  return new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, 1, type);
5189          case 1587405498: /*documentation*/  return new Property("documentation", "string", "This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.", 0, 1, documentation);
5190          default: return super.getNamedProperty(_hash, _name, _checkValid);
5191          }
5192
5193        }
5194
5195      @Override
5196      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5197        switch (hash) {
5198        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
5199        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // UriType
5200        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<SearchParamType>
5201        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
5202        default: return super.getProperty(hash, name, checkValid);
5203        }
5204
5205      }
5206
5207      @Override
5208      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5209        switch (hash) {
5210        case 3373707: // name
5211          this.name = castToString(value); // StringType
5212          return value;
5213        case -1014418093: // definition
5214          this.definition = castToUri(value); // UriType
5215          return value;
5216        case 3575610: // type
5217          value = new SearchParamTypeEnumFactory().fromType(castToCode(value));
5218          this.type = (Enumeration) value; // Enumeration<SearchParamType>
5219          return value;
5220        case 1587405498: // documentation
5221          this.documentation = castToString(value); // StringType
5222          return value;
5223        default: return super.setProperty(hash, name, value);
5224        }
5225
5226      }
5227
5228      @Override
5229      public Base setProperty(String name, Base value) throws FHIRException {
5230        if (name.equals("name")) {
5231          this.name = castToString(value); // StringType
5232        } else if (name.equals("definition")) {
5233          this.definition = castToUri(value); // UriType
5234        } else if (name.equals("type")) {
5235          value = new SearchParamTypeEnumFactory().fromType(castToCode(value));
5236          this.type = (Enumeration) value; // Enumeration<SearchParamType>
5237        } else if (name.equals("documentation")) {
5238          this.documentation = castToString(value); // StringType
5239        } else
5240          return super.setProperty(name, value);
5241        return value;
5242      }
5243
5244      @Override
5245      public Base makeProperty(int hash, String name) throws FHIRException {
5246        switch (hash) {
5247        case 3373707:  return getNameElement();
5248        case -1014418093:  return getDefinitionElement();
5249        case 3575610:  return getTypeElement();
5250        case 1587405498:  return getDocumentationElement();
5251        default: return super.makeProperty(hash, name);
5252        }
5253
5254      }
5255
5256      @Override
5257      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5258        switch (hash) {
5259        case 3373707: /*name*/ return new String[] {"string"};
5260        case -1014418093: /*definition*/ return new String[] {"uri"};
5261        case 3575610: /*type*/ return new String[] {"code"};
5262        case 1587405498: /*documentation*/ return new String[] {"string"};
5263        default: return super.getTypesForProperty(hash, name);
5264        }
5265
5266      }
5267
5268      @Override
5269      public Base addChild(String name) throws FHIRException {
5270        if (name.equals("name")) {
5271          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.name");
5272        }
5273        else if (name.equals("definition")) {
5274          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.definition");
5275        }
5276        else if (name.equals("type")) {
5277          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.type");
5278        }
5279        else if (name.equals("documentation")) {
5280          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
5281        }
5282        else
5283          return super.addChild(name);
5284      }
5285
5286      public CapabilityStatementRestResourceSearchParamComponent copy() {
5287        CapabilityStatementRestResourceSearchParamComponent dst = new CapabilityStatementRestResourceSearchParamComponent();
5288        copyValues(dst);
5289        dst.name = name == null ? null : name.copy();
5290        dst.definition = definition == null ? null : definition.copy();
5291        dst.type = type == null ? null : type.copy();
5292        dst.documentation = documentation == null ? null : documentation.copy();
5293        return dst;
5294      }
5295
5296      @Override
5297      public boolean equalsDeep(Base other_) {
5298        if (!super.equalsDeep(other_))
5299          return false;
5300        if (!(other_ instanceof CapabilityStatementRestResourceSearchParamComponent))
5301          return false;
5302        CapabilityStatementRestResourceSearchParamComponent o = (CapabilityStatementRestResourceSearchParamComponent) other_;
5303        return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true) && compareDeep(type, o.type, true)
5304           && compareDeep(documentation, o.documentation, true);
5305      }
5306
5307      @Override
5308      public boolean equalsShallow(Base other_) {
5309        if (!super.equalsShallow(other_))
5310          return false;
5311        if (!(other_ instanceof CapabilityStatementRestResourceSearchParamComponent))
5312          return false;
5313        CapabilityStatementRestResourceSearchParamComponent o = (CapabilityStatementRestResourceSearchParamComponent) other_;
5314        return compareValues(name, o.name, true) && compareValues(definition, o.definition, true) && compareValues(type, o.type, true)
5315           && compareValues(documentation, o.documentation, true);
5316      }
5317
5318      public boolean isEmpty() {
5319        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, definition, type, documentation
5320          );
5321      }
5322
5323  public String fhirType() {
5324    return "CapabilityStatement.rest.resource.searchParam";
5325
5326  }
5327
5328  }
5329
5330    @Block()
5331    public static class SystemInteractionComponent extends BackboneElement implements IBaseBackboneElement {
5332        /**
5333         * A coded identifier of the operation, supported by the system.
5334         */
5335        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
5336        @Description(shortDefinition="transaction | batch | search-system | history-system", formalDefinition="A coded identifier of the operation, supported by the system." )
5337        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/system-restful-interaction")
5338        protected Enumeration<SystemRestfulInteraction> code;
5339
5340        /**
5341         * Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.
5342         */
5343        @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5344        @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented." )
5345        protected StringType documentation;
5346
5347        private static final long serialVersionUID = 510675287L;
5348
5349    /**
5350     * Constructor
5351     */
5352      public SystemInteractionComponent() {
5353        super();
5354      }
5355
5356    /**
5357     * Constructor
5358     */
5359      public SystemInteractionComponent(Enumeration<SystemRestfulInteraction> code) {
5360        super();
5361        this.code = code;
5362      }
5363
5364        /**
5365         * @return {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
5366         */
5367        public Enumeration<SystemRestfulInteraction> getCodeElement() { 
5368          if (this.code == null)
5369            if (Configuration.errorOnAutoCreate())
5370              throw new Error("Attempt to auto-create SystemInteractionComponent.code");
5371            else if (Configuration.doAutoCreate())
5372              this.code = new Enumeration<SystemRestfulInteraction>(new SystemRestfulInteractionEnumFactory()); // bb
5373          return this.code;
5374        }
5375
5376        public boolean hasCodeElement() { 
5377          return this.code != null && !this.code.isEmpty();
5378        }
5379
5380        public boolean hasCode() { 
5381          return this.code != null && !this.code.isEmpty();
5382        }
5383
5384        /**
5385         * @param value {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
5386         */
5387        public SystemInteractionComponent setCodeElement(Enumeration<SystemRestfulInteraction> value) { 
5388          this.code = value;
5389          return this;
5390        }
5391
5392        /**
5393         * @return A coded identifier of the operation, supported by the system.
5394         */
5395        public SystemRestfulInteraction getCode() { 
5396          return this.code == null ? null : this.code.getValue();
5397        }
5398
5399        /**
5400         * @param value A coded identifier of the operation, supported by the system.
5401         */
5402        public SystemInteractionComponent setCode(SystemRestfulInteraction value) { 
5403            if (this.code == null)
5404              this.code = new Enumeration<SystemRestfulInteraction>(new SystemRestfulInteractionEnumFactory());
5405            this.code.setValue(value);
5406          return this;
5407        }
5408
5409        /**
5410         * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
5411         */
5412        public StringType getDocumentationElement() { 
5413          if (this.documentation == null)
5414            if (Configuration.errorOnAutoCreate())
5415              throw new Error("Attempt to auto-create SystemInteractionComponent.documentation");
5416            else if (Configuration.doAutoCreate())
5417              this.documentation = new StringType(); // bb
5418          return this.documentation;
5419        }
5420
5421        public boolean hasDocumentationElement() { 
5422          return this.documentation != null && !this.documentation.isEmpty();
5423        }
5424
5425        public boolean hasDocumentation() { 
5426          return this.documentation != null && !this.documentation.isEmpty();
5427        }
5428
5429        /**
5430         * @param value {@link #documentation} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
5431         */
5432        public SystemInteractionComponent setDocumentationElement(StringType value) { 
5433          this.documentation = value;
5434          return this;
5435        }
5436
5437        /**
5438         * @return Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.
5439         */
5440        public String getDocumentation() { 
5441          return this.documentation == null ? null : this.documentation.getValue();
5442        }
5443
5444        /**
5445         * @param value Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.
5446         */
5447        public SystemInteractionComponent setDocumentation(String value) { 
5448          if (Utilities.noString(value))
5449            this.documentation = null;
5450          else {
5451            if (this.documentation == null)
5452              this.documentation = new StringType();
5453            this.documentation.setValue(value);
5454          }
5455          return this;
5456        }
5457
5458        protected void listChildren(List<Property> children) {
5459          super.listChildren(children);
5460          children.add(new Property("code", "code", "A coded identifier of the operation, supported by the system.", 0, 1, code));
5461          children.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.", 0, 1, documentation));
5462        }
5463
5464        @Override
5465        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5466          switch (_hash) {
5467          case 3059181: /*code*/  return new Property("code", "code", "A coded identifier of the operation, supported by the system.", 0, 1, code);
5468          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.", 0, 1, documentation);
5469          default: return super.getNamedProperty(_hash, _name, _checkValid);
5470          }
5471
5472        }
5473
5474      @Override
5475      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5476        switch (hash) {
5477        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration<SystemRestfulInteraction>
5478        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
5479        default: return super.getProperty(hash, name, checkValid);
5480        }
5481
5482      }
5483
5484      @Override
5485      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5486        switch (hash) {
5487        case 3059181: // code
5488          value = new SystemRestfulInteractionEnumFactory().fromType(castToCode(value));
5489          this.code = (Enumeration) value; // Enumeration<SystemRestfulInteraction>
5490          return value;
5491        case 1587405498: // documentation
5492          this.documentation = castToString(value); // StringType
5493          return value;
5494        default: return super.setProperty(hash, name, value);
5495        }
5496
5497      }
5498
5499      @Override
5500      public Base setProperty(String name, Base value) throws FHIRException {
5501        if (name.equals("code")) {
5502          value = new SystemRestfulInteractionEnumFactory().fromType(castToCode(value));
5503          this.code = (Enumeration) value; // Enumeration<SystemRestfulInteraction>
5504        } else if (name.equals("documentation")) {
5505          this.documentation = castToString(value); // StringType
5506        } else
5507          return super.setProperty(name, value);
5508        return value;
5509      }
5510
5511      @Override
5512      public Base makeProperty(int hash, String name) throws FHIRException {
5513        switch (hash) {
5514        case 3059181:  return getCodeElement();
5515        case 1587405498:  return getDocumentationElement();
5516        default: return super.makeProperty(hash, name);
5517        }
5518
5519      }
5520
5521      @Override
5522      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5523        switch (hash) {
5524        case 3059181: /*code*/ return new String[] {"code"};
5525        case 1587405498: /*documentation*/ return new String[] {"string"};
5526        default: return super.getTypesForProperty(hash, name);
5527        }
5528
5529      }
5530
5531      @Override
5532      public Base addChild(String name) throws FHIRException {
5533        if (name.equals("code")) {
5534          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.code");
5535        }
5536        else if (name.equals("documentation")) {
5537          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
5538        }
5539        else
5540          return super.addChild(name);
5541      }
5542
5543      public SystemInteractionComponent copy() {
5544        SystemInteractionComponent dst = new SystemInteractionComponent();
5545        copyValues(dst);
5546        dst.code = code == null ? null : code.copy();
5547        dst.documentation = documentation == null ? null : documentation.copy();
5548        return dst;
5549      }
5550
5551      @Override
5552      public boolean equalsDeep(Base other_) {
5553        if (!super.equalsDeep(other_))
5554          return false;
5555        if (!(other_ instanceof SystemInteractionComponent))
5556          return false;
5557        SystemInteractionComponent o = (SystemInteractionComponent) other_;
5558        return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true);
5559      }
5560
5561      @Override
5562      public boolean equalsShallow(Base other_) {
5563        if (!super.equalsShallow(other_))
5564          return false;
5565        if (!(other_ instanceof SystemInteractionComponent))
5566          return false;
5567        SystemInteractionComponent o = (SystemInteractionComponent) other_;
5568        return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true);
5569      }
5570
5571      public boolean isEmpty() {
5572        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, documentation);
5573      }
5574
5575  public String fhirType() {
5576    return "CapabilityStatement.rest.interaction";
5577
5578  }
5579
5580  }
5581
5582    @Block()
5583    public static class CapabilityStatementRestOperationComponent extends BackboneElement implements IBaseBackboneElement {
5584        /**
5585         * The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.
5586         */
5587        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
5588        @Description(shortDefinition="Name by which the operation/query is invoked", formalDefinition="The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called." )
5589        protected StringType name;
5590
5591        /**
5592         * Where the formal definition can be found.
5593         */
5594        @Child(name = "definition", type = {OperationDefinition.class}, order=2, min=1, max=1, modifier=false, summary=true)
5595        @Description(shortDefinition="The defined operation/query", formalDefinition="Where the formal definition can be found." )
5596        protected Reference definition;
5597
5598        /**
5599         * The actual object that is the target of the reference (Where the formal definition can be found.)
5600         */
5601        protected OperationDefinition definitionTarget;
5602
5603        private static final long serialVersionUID = 122107272L;
5604
5605    /**
5606     * Constructor
5607     */
5608      public CapabilityStatementRestOperationComponent() {
5609        super();
5610      }
5611
5612    /**
5613     * Constructor
5614     */
5615      public CapabilityStatementRestOperationComponent(StringType name, Reference definition) {
5616        super();
5617        this.name = name;
5618        this.definition = definition;
5619      }
5620
5621        /**
5622         * @return {@link #name} (The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
5623         */
5624        public StringType getNameElement() { 
5625          if (this.name == null)
5626            if (Configuration.errorOnAutoCreate())
5627              throw new Error("Attempt to auto-create CapabilityStatementRestOperationComponent.name");
5628            else if (Configuration.doAutoCreate())
5629              this.name = new StringType(); // bb
5630          return this.name;
5631        }
5632
5633        public boolean hasNameElement() { 
5634          return this.name != null && !this.name.isEmpty();
5635        }
5636
5637        public boolean hasName() { 
5638          return this.name != null && !this.name.isEmpty();
5639        }
5640
5641        /**
5642         * @param value {@link #name} (The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
5643         */
5644        public CapabilityStatementRestOperationComponent setNameElement(StringType value) { 
5645          this.name = value;
5646          return this;
5647        }
5648
5649        /**
5650         * @return The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.
5651         */
5652        public String getName() { 
5653          return this.name == null ? null : this.name.getValue();
5654        }
5655
5656        /**
5657         * @param value The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.
5658         */
5659        public CapabilityStatementRestOperationComponent setName(String value) { 
5660            if (this.name == null)
5661              this.name = new StringType();
5662            this.name.setValue(value);
5663          return this;
5664        }
5665
5666        /**
5667         * @return {@link #definition} (Where the formal definition can be found.)
5668         */
5669        public Reference getDefinition() { 
5670          if (this.definition == null)
5671            if (Configuration.errorOnAutoCreate())
5672              throw new Error("Attempt to auto-create CapabilityStatementRestOperationComponent.definition");
5673            else if (Configuration.doAutoCreate())
5674              this.definition = new Reference(); // cc
5675          return this.definition;
5676        }
5677
5678        public boolean hasDefinition() { 
5679          return this.definition != null && !this.definition.isEmpty();
5680        }
5681
5682        /**
5683         * @param value {@link #definition} (Where the formal definition can be found.)
5684         */
5685        public CapabilityStatementRestOperationComponent setDefinition(Reference value)  { 
5686          this.definition = value;
5687          return this;
5688        }
5689
5690        /**
5691         * @return {@link #definition} 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. (Where the formal definition can be found.)
5692         */
5693        public OperationDefinition getDefinitionTarget() { 
5694          if (this.definitionTarget == null)
5695            if (Configuration.errorOnAutoCreate())
5696              throw new Error("Attempt to auto-create CapabilityStatementRestOperationComponent.definition");
5697            else if (Configuration.doAutoCreate())
5698              this.definitionTarget = new OperationDefinition(); // aa
5699          return this.definitionTarget;
5700        }
5701
5702        /**
5703         * @param value {@link #definition} 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. (Where the formal definition can be found.)
5704         */
5705        public CapabilityStatementRestOperationComponent setDefinitionTarget(OperationDefinition value) { 
5706          this.definitionTarget = value;
5707          return this;
5708        }
5709
5710        protected void listChildren(List<Property> children) {
5711          super.listChildren(children);
5712          children.add(new Property("name", "string", "The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.", 0, 1, name));
5713          children.add(new Property("definition", "Reference(OperationDefinition)", "Where the formal definition can be found.", 0, 1, definition));
5714        }
5715
5716        @Override
5717        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5718          switch (_hash) {
5719          case 3373707: /*name*/  return new Property("name", "string", "The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.", 0, 1, name);
5720          case -1014418093: /*definition*/  return new Property("definition", "Reference(OperationDefinition)", "Where the formal definition can be found.", 0, 1, definition);
5721          default: return super.getNamedProperty(_hash, _name, _checkValid);
5722          }
5723
5724        }
5725
5726      @Override
5727      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5728        switch (hash) {
5729        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
5730        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // Reference
5731        default: return super.getProperty(hash, name, checkValid);
5732        }
5733
5734      }
5735
5736      @Override
5737      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5738        switch (hash) {
5739        case 3373707: // name
5740          this.name = castToString(value); // StringType
5741          return value;
5742        case -1014418093: // definition
5743          this.definition = castToReference(value); // Reference
5744          return value;
5745        default: return super.setProperty(hash, name, value);
5746        }
5747
5748      }
5749
5750      @Override
5751      public Base setProperty(String name, Base value) throws FHIRException {
5752        if (name.equals("name")) {
5753          this.name = castToString(value); // StringType
5754        } else if (name.equals("definition")) {
5755          this.definition = castToReference(value); // Reference
5756        } else
5757          return super.setProperty(name, value);
5758        return value;
5759      }
5760
5761      @Override
5762      public Base makeProperty(int hash, String name) throws FHIRException {
5763        switch (hash) {
5764        case 3373707:  return getNameElement();
5765        case -1014418093:  return getDefinition(); 
5766        default: return super.makeProperty(hash, name);
5767        }
5768
5769      }
5770
5771      @Override
5772      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5773        switch (hash) {
5774        case 3373707: /*name*/ return new String[] {"string"};
5775        case -1014418093: /*definition*/ return new String[] {"Reference"};
5776        default: return super.getTypesForProperty(hash, name);
5777        }
5778
5779      }
5780
5781      @Override
5782      public Base addChild(String name) throws FHIRException {
5783        if (name.equals("name")) {
5784          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.name");
5785        }
5786        else if (name.equals("definition")) {
5787          this.definition = new Reference();
5788          return this.definition;
5789        }
5790        else
5791          return super.addChild(name);
5792      }
5793
5794      public CapabilityStatementRestOperationComponent copy() {
5795        CapabilityStatementRestOperationComponent dst = new CapabilityStatementRestOperationComponent();
5796        copyValues(dst);
5797        dst.name = name == null ? null : name.copy();
5798        dst.definition = definition == null ? null : definition.copy();
5799        return dst;
5800      }
5801
5802      @Override
5803      public boolean equalsDeep(Base other_) {
5804        if (!super.equalsDeep(other_))
5805          return false;
5806        if (!(other_ instanceof CapabilityStatementRestOperationComponent))
5807          return false;
5808        CapabilityStatementRestOperationComponent o = (CapabilityStatementRestOperationComponent) other_;
5809        return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true);
5810      }
5811
5812      @Override
5813      public boolean equalsShallow(Base other_) {
5814        if (!super.equalsShallow(other_))
5815          return false;
5816        if (!(other_ instanceof CapabilityStatementRestOperationComponent))
5817          return false;
5818        CapabilityStatementRestOperationComponent o = (CapabilityStatementRestOperationComponent) other_;
5819        return compareValues(name, o.name, true);
5820      }
5821
5822      public boolean isEmpty() {
5823        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, definition);
5824      }
5825
5826  public String fhirType() {
5827    return "CapabilityStatement.rest.operation";
5828
5829  }
5830
5831  }
5832
5833    @Block()
5834    public static class CapabilityStatementMessagingComponent extends BackboneElement implements IBaseBackboneElement {
5835        /**
5836         * An endpoint (network accessible address) to which messages and/or replies are to be sent.
5837         */
5838        @Child(name = "endpoint", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5839        @Description(shortDefinition="Where messages should be sent", formalDefinition="An endpoint (network accessible address) to which messages and/or replies are to be sent." )
5840        protected List<CapabilityStatementMessagingEndpointComponent> endpoint;
5841
5842        /**
5843         * Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).
5844         */
5845        @Child(name = "reliableCache", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5846        @Description(shortDefinition="Reliable Message Cache Length (min)", formalDefinition="Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender)." )
5847        protected UnsignedIntType reliableCache;
5848
5849        /**
5850         * Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.
5851         */
5852        @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
5853        @Description(shortDefinition="Messaging interface behavior details", formalDefinition="Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner." )
5854        protected StringType documentation;
5855
5856        /**
5857         * References to message definitions for messages this system can send or receive.
5858         */
5859        @Child(name = "supportedMessage", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5860        @Description(shortDefinition="Messages supported by this system", formalDefinition="References to message definitions for messages this system can send or receive." )
5861        protected List<CapabilityStatementMessagingSupportedMessageComponent> supportedMessage;
5862
5863        /**
5864         * A description of the solution's support for an event at this end-point.
5865         */
5866        @Child(name = "event", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5867        @Description(shortDefinition="Declare support for this event", formalDefinition="A description of the solution's support for an event at this end-point." )
5868        protected List<CapabilityStatementMessagingEventComponent> event;
5869
5870        private static final long serialVersionUID = 816243355L;
5871
5872    /**
5873     * Constructor
5874     */
5875      public CapabilityStatementMessagingComponent() {
5876        super();
5877      }
5878
5879        /**
5880         * @return {@link #endpoint} (An endpoint (network accessible address) to which messages and/or replies are to be sent.)
5881         */
5882        public List<CapabilityStatementMessagingEndpointComponent> getEndpoint() { 
5883          if (this.endpoint == null)
5884            this.endpoint = new ArrayList<CapabilityStatementMessagingEndpointComponent>();
5885          return this.endpoint;
5886        }
5887
5888        /**
5889         * @return Returns a reference to <code>this</code> for easy method chaining
5890         */
5891        public CapabilityStatementMessagingComponent setEndpoint(List<CapabilityStatementMessagingEndpointComponent> theEndpoint) { 
5892          this.endpoint = theEndpoint;
5893          return this;
5894        }
5895
5896        public boolean hasEndpoint() { 
5897          if (this.endpoint == null)
5898            return false;
5899          for (CapabilityStatementMessagingEndpointComponent item : this.endpoint)
5900            if (!item.isEmpty())
5901              return true;
5902          return false;
5903        }
5904
5905        public CapabilityStatementMessagingEndpointComponent addEndpoint() { //3
5906          CapabilityStatementMessagingEndpointComponent t = new CapabilityStatementMessagingEndpointComponent();
5907          if (this.endpoint == null)
5908            this.endpoint = new ArrayList<CapabilityStatementMessagingEndpointComponent>();
5909          this.endpoint.add(t);
5910          return t;
5911        }
5912
5913        public CapabilityStatementMessagingComponent addEndpoint(CapabilityStatementMessagingEndpointComponent t) { //3
5914          if (t == null)
5915            return this;
5916          if (this.endpoint == null)
5917            this.endpoint = new ArrayList<CapabilityStatementMessagingEndpointComponent>();
5918          this.endpoint.add(t);
5919          return this;
5920        }
5921
5922        /**
5923         * @return The first repetition of repeating field {@link #endpoint}, creating it if it does not already exist
5924         */
5925        public CapabilityStatementMessagingEndpointComponent getEndpointFirstRep() { 
5926          if (getEndpoint().isEmpty()) {
5927            addEndpoint();
5928          }
5929          return getEndpoint().get(0);
5930        }
5931
5932        /**
5933         * @return {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value
5934         */
5935        public UnsignedIntType getReliableCacheElement() { 
5936          if (this.reliableCache == null)
5937            if (Configuration.errorOnAutoCreate())
5938              throw new Error("Attempt to auto-create CapabilityStatementMessagingComponent.reliableCache");
5939            else if (Configuration.doAutoCreate())
5940              this.reliableCache = new UnsignedIntType(); // bb
5941          return this.reliableCache;
5942        }
5943
5944        public boolean hasReliableCacheElement() { 
5945          return this.reliableCache != null && !this.reliableCache.isEmpty();
5946        }
5947
5948        public boolean hasReliableCache() { 
5949          return this.reliableCache != null && !this.reliableCache.isEmpty();
5950        }
5951
5952        /**
5953         * @param value {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value
5954         */
5955        public CapabilityStatementMessagingComponent setReliableCacheElement(UnsignedIntType value) { 
5956          this.reliableCache = value;
5957          return this;
5958        }
5959
5960        /**
5961         * @return Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).
5962         */
5963        public int getReliableCache() { 
5964          return this.reliableCache == null || this.reliableCache.isEmpty() ? 0 : this.reliableCache.getValue();
5965        }
5966
5967        /**
5968         * @param value Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).
5969         */
5970        public CapabilityStatementMessagingComponent setReliableCache(int value) { 
5971            if (this.reliableCache == null)
5972              this.reliableCache = new UnsignedIntType();
5973            this.reliableCache.setValue(value);
5974          return this;
5975        }
5976
5977        /**
5978         * @return {@link #documentation} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
5979         */
5980        public StringType getDocumentationElement() { 
5981          if (this.documentation == null)
5982            if (Configuration.errorOnAutoCreate())
5983              throw new Error("Attempt to auto-create CapabilityStatementMessagingComponent.documentation");
5984            else if (Configuration.doAutoCreate())
5985              this.documentation = new StringType(); // bb
5986          return this.documentation;
5987        }
5988
5989        public boolean hasDocumentationElement() { 
5990          return this.documentation != null && !this.documentation.isEmpty();
5991        }
5992
5993        public boolean hasDocumentation() { 
5994          return this.documentation != null && !this.documentation.isEmpty();
5995        }
5996
5997        /**
5998         * @param value {@link #documentation} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
5999         */
6000        public CapabilityStatementMessagingComponent setDocumentationElement(StringType value) { 
6001          this.documentation = value;
6002          return this;
6003        }
6004
6005        /**
6006         * @return Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.
6007         */
6008        public String getDocumentation() { 
6009          return this.documentation == null ? null : this.documentation.getValue();
6010        }
6011
6012        /**
6013         * @param value Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.
6014         */
6015        public CapabilityStatementMessagingComponent setDocumentation(String value) { 
6016          if (Utilities.noString(value))
6017            this.documentation = null;
6018          else {
6019            if (this.documentation == null)
6020              this.documentation = new StringType();
6021            this.documentation.setValue(value);
6022          }
6023          return this;
6024        }
6025
6026        /**
6027         * @return {@link #supportedMessage} (References to message definitions for messages this system can send or receive.)
6028         */
6029        public List<CapabilityStatementMessagingSupportedMessageComponent> getSupportedMessage() { 
6030          if (this.supportedMessage == null)
6031            this.supportedMessage = new ArrayList<CapabilityStatementMessagingSupportedMessageComponent>();
6032          return this.supportedMessage;
6033        }
6034
6035        /**
6036         * @return Returns a reference to <code>this</code> for easy method chaining
6037         */
6038        public CapabilityStatementMessagingComponent setSupportedMessage(List<CapabilityStatementMessagingSupportedMessageComponent> theSupportedMessage) { 
6039          this.supportedMessage = theSupportedMessage;
6040          return this;
6041        }
6042
6043        public boolean hasSupportedMessage() { 
6044          if (this.supportedMessage == null)
6045            return false;
6046          for (CapabilityStatementMessagingSupportedMessageComponent item : this.supportedMessage)
6047            if (!item.isEmpty())
6048              return true;
6049          return false;
6050        }
6051
6052        public CapabilityStatementMessagingSupportedMessageComponent addSupportedMessage() { //3
6053          CapabilityStatementMessagingSupportedMessageComponent t = new CapabilityStatementMessagingSupportedMessageComponent();
6054          if (this.supportedMessage == null)
6055            this.supportedMessage = new ArrayList<CapabilityStatementMessagingSupportedMessageComponent>();
6056          this.supportedMessage.add(t);
6057          return t;
6058        }
6059
6060        public CapabilityStatementMessagingComponent addSupportedMessage(CapabilityStatementMessagingSupportedMessageComponent t) { //3
6061          if (t == null)
6062            return this;
6063          if (this.supportedMessage == null)
6064            this.supportedMessage = new ArrayList<CapabilityStatementMessagingSupportedMessageComponent>();
6065          this.supportedMessage.add(t);
6066          return this;
6067        }
6068
6069        /**
6070         * @return The first repetition of repeating field {@link #supportedMessage}, creating it if it does not already exist
6071         */
6072        public CapabilityStatementMessagingSupportedMessageComponent getSupportedMessageFirstRep() { 
6073          if (getSupportedMessage().isEmpty()) {
6074            addSupportedMessage();
6075          }
6076          return getSupportedMessage().get(0);
6077        }
6078
6079        /**
6080         * @return {@link #event} (A description of the solution's support for an event at this end-point.)
6081         */
6082        public List<CapabilityStatementMessagingEventComponent> getEvent() { 
6083          if (this.event == null)
6084            this.event = new ArrayList<CapabilityStatementMessagingEventComponent>();
6085          return this.event;
6086        }
6087
6088        /**
6089         * @return Returns a reference to <code>this</code> for easy method chaining
6090         */
6091        public CapabilityStatementMessagingComponent setEvent(List<CapabilityStatementMessagingEventComponent> theEvent) { 
6092          this.event = theEvent;
6093          return this;
6094        }
6095
6096        public boolean hasEvent() { 
6097          if (this.event == null)
6098            return false;
6099          for (CapabilityStatementMessagingEventComponent item : this.event)
6100            if (!item.isEmpty())
6101              return true;
6102          return false;
6103        }
6104
6105        public CapabilityStatementMessagingEventComponent addEvent() { //3
6106          CapabilityStatementMessagingEventComponent t = new CapabilityStatementMessagingEventComponent();
6107          if (this.event == null)
6108            this.event = new ArrayList<CapabilityStatementMessagingEventComponent>();
6109          this.event.add(t);
6110          return t;
6111        }
6112
6113        public CapabilityStatementMessagingComponent addEvent(CapabilityStatementMessagingEventComponent t) { //3
6114          if (t == null)
6115            return this;
6116          if (this.event == null)
6117            this.event = new ArrayList<CapabilityStatementMessagingEventComponent>();
6118          this.event.add(t);
6119          return this;
6120        }
6121
6122        /**
6123         * @return The first repetition of repeating field {@link #event}, creating it if it does not already exist
6124         */
6125        public CapabilityStatementMessagingEventComponent getEventFirstRep() { 
6126          if (getEvent().isEmpty()) {
6127            addEvent();
6128          }
6129          return getEvent().get(0);
6130        }
6131
6132        protected void listChildren(List<Property> children) {
6133          super.listChildren(children);
6134          children.add(new Property("endpoint", "", "An endpoint (network accessible address) to which messages and/or replies are to be sent.", 0, java.lang.Integer.MAX_VALUE, endpoint));
6135          children.add(new Property("reliableCache", "unsignedInt", "Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).", 0, 1, reliableCache));
6136          children.add(new Property("documentation", "string", "Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.", 0, 1, documentation));
6137          children.add(new Property("supportedMessage", "", "References to message definitions for messages this system can send or receive.", 0, java.lang.Integer.MAX_VALUE, supportedMessage));
6138          children.add(new Property("event", "", "A description of the solution's support for an event at this end-point.", 0, java.lang.Integer.MAX_VALUE, event));
6139        }
6140
6141        @Override
6142        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6143          switch (_hash) {
6144          case 1741102485: /*endpoint*/  return new Property("endpoint", "", "An endpoint (network accessible address) to which messages and/or replies are to be sent.", 0, java.lang.Integer.MAX_VALUE, endpoint);
6145          case 897803608: /*reliableCache*/  return new Property("reliableCache", "unsignedInt", "Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).", 0, 1, reliableCache);
6146          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.", 0, 1, documentation);
6147          case -1805139079: /*supportedMessage*/  return new Property("supportedMessage", "", "References to message definitions for messages this system can send or receive.", 0, java.lang.Integer.MAX_VALUE, supportedMessage);
6148          case 96891546: /*event*/  return new Property("event", "", "A description of the solution's support for an event at this end-point.", 0, java.lang.Integer.MAX_VALUE, event);
6149          default: return super.getNamedProperty(_hash, _name, _checkValid);
6150          }
6151
6152        }
6153
6154      @Override
6155      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6156        switch (hash) {
6157        case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // CapabilityStatementMessagingEndpointComponent
6158        case 897803608: /*reliableCache*/ return this.reliableCache == null ? new Base[0] : new Base[] {this.reliableCache}; // UnsignedIntType
6159        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
6160        case -1805139079: /*supportedMessage*/ return this.supportedMessage == null ? new Base[0] : this.supportedMessage.toArray(new Base[this.supportedMessage.size()]); // CapabilityStatementMessagingSupportedMessageComponent
6161        case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // CapabilityStatementMessagingEventComponent
6162        default: return super.getProperty(hash, name, checkValid);
6163        }
6164
6165      }
6166
6167      @Override
6168      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6169        switch (hash) {
6170        case 1741102485: // endpoint
6171          this.getEndpoint().add((CapabilityStatementMessagingEndpointComponent) value); // CapabilityStatementMessagingEndpointComponent
6172          return value;
6173        case 897803608: // reliableCache
6174          this.reliableCache = castToUnsignedInt(value); // UnsignedIntType
6175          return value;
6176        case 1587405498: // documentation
6177          this.documentation = castToString(value); // StringType
6178          return value;
6179        case -1805139079: // supportedMessage
6180          this.getSupportedMessage().add((CapabilityStatementMessagingSupportedMessageComponent) value); // CapabilityStatementMessagingSupportedMessageComponent
6181          return value;
6182        case 96891546: // event
6183          this.getEvent().add((CapabilityStatementMessagingEventComponent) value); // CapabilityStatementMessagingEventComponent
6184          return value;
6185        default: return super.setProperty(hash, name, value);
6186        }
6187
6188      }
6189
6190      @Override
6191      public Base setProperty(String name, Base value) throws FHIRException {
6192        if (name.equals("endpoint")) {
6193          this.getEndpoint().add((CapabilityStatementMessagingEndpointComponent) value);
6194        } else if (name.equals("reliableCache")) {
6195          this.reliableCache = castToUnsignedInt(value); // UnsignedIntType
6196        } else if (name.equals("documentation")) {
6197          this.documentation = castToString(value); // StringType
6198        } else if (name.equals("supportedMessage")) {
6199          this.getSupportedMessage().add((CapabilityStatementMessagingSupportedMessageComponent) value);
6200        } else if (name.equals("event")) {
6201          this.getEvent().add((CapabilityStatementMessagingEventComponent) value);
6202        } else
6203          return super.setProperty(name, value);
6204        return value;
6205      }
6206
6207      @Override
6208      public Base makeProperty(int hash, String name) throws FHIRException {
6209        switch (hash) {
6210        case 1741102485:  return addEndpoint(); 
6211        case 897803608:  return getReliableCacheElement();
6212        case 1587405498:  return getDocumentationElement();
6213        case -1805139079:  return addSupportedMessage(); 
6214        case 96891546:  return addEvent(); 
6215        default: return super.makeProperty(hash, name);
6216        }
6217
6218      }
6219
6220      @Override
6221      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6222        switch (hash) {
6223        case 1741102485: /*endpoint*/ return new String[] {};
6224        case 897803608: /*reliableCache*/ return new String[] {"unsignedInt"};
6225        case 1587405498: /*documentation*/ return new String[] {"string"};
6226        case -1805139079: /*supportedMessage*/ return new String[] {};
6227        case 96891546: /*event*/ return new String[] {};
6228        default: return super.getTypesForProperty(hash, name);
6229        }
6230
6231      }
6232
6233      @Override
6234      public Base addChild(String name) throws FHIRException {
6235        if (name.equals("endpoint")) {
6236          return addEndpoint();
6237        }
6238        else if (name.equals("reliableCache")) {
6239          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.reliableCache");
6240        }
6241        else if (name.equals("documentation")) {
6242          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
6243        }
6244        else if (name.equals("supportedMessage")) {
6245          return addSupportedMessage();
6246        }
6247        else if (name.equals("event")) {
6248          return addEvent();
6249        }
6250        else
6251          return super.addChild(name);
6252      }
6253
6254      public CapabilityStatementMessagingComponent copy() {
6255        CapabilityStatementMessagingComponent dst = new CapabilityStatementMessagingComponent();
6256        copyValues(dst);
6257        if (endpoint != null) {
6258          dst.endpoint = new ArrayList<CapabilityStatementMessagingEndpointComponent>();
6259          for (CapabilityStatementMessagingEndpointComponent i : endpoint)
6260            dst.endpoint.add(i.copy());
6261        };
6262        dst.reliableCache = reliableCache == null ? null : reliableCache.copy();
6263        dst.documentation = documentation == null ? null : documentation.copy();
6264        if (supportedMessage != null) {
6265          dst.supportedMessage = new ArrayList<CapabilityStatementMessagingSupportedMessageComponent>();
6266          for (CapabilityStatementMessagingSupportedMessageComponent i : supportedMessage)
6267            dst.supportedMessage.add(i.copy());
6268        };
6269        if (event != null) {
6270          dst.event = new ArrayList<CapabilityStatementMessagingEventComponent>();
6271          for (CapabilityStatementMessagingEventComponent i : event)
6272            dst.event.add(i.copy());
6273        };
6274        return dst;
6275      }
6276
6277      @Override
6278      public boolean equalsDeep(Base other_) {
6279        if (!super.equalsDeep(other_))
6280          return false;
6281        if (!(other_ instanceof CapabilityStatementMessagingComponent))
6282          return false;
6283        CapabilityStatementMessagingComponent o = (CapabilityStatementMessagingComponent) other_;
6284        return compareDeep(endpoint, o.endpoint, true) && compareDeep(reliableCache, o.reliableCache, true)
6285           && compareDeep(documentation, o.documentation, true) && compareDeep(supportedMessage, o.supportedMessage, true)
6286           && compareDeep(event, o.event, true);
6287      }
6288
6289      @Override
6290      public boolean equalsShallow(Base other_) {
6291        if (!super.equalsShallow(other_))
6292          return false;
6293        if (!(other_ instanceof CapabilityStatementMessagingComponent))
6294          return false;
6295        CapabilityStatementMessagingComponent o = (CapabilityStatementMessagingComponent) other_;
6296        return compareValues(reliableCache, o.reliableCache, true) && compareValues(documentation, o.documentation, true)
6297          ;
6298      }
6299
6300      public boolean isEmpty() {
6301        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(endpoint, reliableCache, documentation
6302          , supportedMessage, event);
6303      }
6304
6305  public String fhirType() {
6306    return "CapabilityStatement.messaging";
6307
6308  }
6309
6310  }
6311
6312    @Block()
6313    public static class CapabilityStatementMessagingEndpointComponent extends BackboneElement implements IBaseBackboneElement {
6314        /**
6315         * A list of the messaging transport protocol(s) identifiers, supported by this endpoint.
6316         */
6317        @Child(name = "protocol", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false)
6318        @Description(shortDefinition="http | ftp | mllp +", formalDefinition="A list of the messaging transport protocol(s) identifiers, supported by this endpoint." )
6319        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-transport")
6320        protected Coding protocol;
6321
6322        /**
6323         * The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.
6324         */
6325        @Child(name = "address", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false)
6326        @Description(shortDefinition="Network address or identifier of the end-point", formalDefinition="The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier." )
6327        protected UriType address;
6328
6329        private static final long serialVersionUID = 1294656428L;
6330
6331    /**
6332     * Constructor
6333     */
6334      public CapabilityStatementMessagingEndpointComponent() {
6335        super();
6336      }
6337
6338    /**
6339     * Constructor
6340     */
6341      public CapabilityStatementMessagingEndpointComponent(Coding protocol, UriType address) {
6342        super();
6343        this.protocol = protocol;
6344        this.address = address;
6345      }
6346
6347        /**
6348         * @return {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.)
6349         */
6350        public Coding getProtocol() { 
6351          if (this.protocol == null)
6352            if (Configuration.errorOnAutoCreate())
6353              throw new Error("Attempt to auto-create CapabilityStatementMessagingEndpointComponent.protocol");
6354            else if (Configuration.doAutoCreate())
6355              this.protocol = new Coding(); // cc
6356          return this.protocol;
6357        }
6358
6359        public boolean hasProtocol() { 
6360          return this.protocol != null && !this.protocol.isEmpty();
6361        }
6362
6363        /**
6364         * @param value {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.)
6365         */
6366        public CapabilityStatementMessagingEndpointComponent setProtocol(Coding value)  { 
6367          this.protocol = value;
6368          return this;
6369        }
6370
6371        /**
6372         * @return {@link #address} (The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value
6373         */
6374        public UriType getAddressElement() { 
6375          if (this.address == null)
6376            if (Configuration.errorOnAutoCreate())
6377              throw new Error("Attempt to auto-create CapabilityStatementMessagingEndpointComponent.address");
6378            else if (Configuration.doAutoCreate())
6379              this.address = new UriType(); // bb
6380          return this.address;
6381        }
6382
6383        public boolean hasAddressElement() { 
6384          return this.address != null && !this.address.isEmpty();
6385        }
6386
6387        public boolean hasAddress() { 
6388          return this.address != null && !this.address.isEmpty();
6389        }
6390
6391        /**
6392         * @param value {@link #address} (The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value
6393         */
6394        public CapabilityStatementMessagingEndpointComponent setAddressElement(UriType value) { 
6395          this.address = value;
6396          return this;
6397        }
6398
6399        /**
6400         * @return The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.
6401         */
6402        public String getAddress() { 
6403          return this.address == null ? null : this.address.getValue();
6404        }
6405
6406        /**
6407         * @param value The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.
6408         */
6409        public CapabilityStatementMessagingEndpointComponent setAddress(String value) { 
6410            if (this.address == null)
6411              this.address = new UriType();
6412            this.address.setValue(value);
6413          return this;
6414        }
6415
6416        protected void listChildren(List<Property> children) {
6417          super.listChildren(children);
6418          children.add(new Property("protocol", "Coding", "A list of the messaging transport protocol(s) identifiers, supported by this endpoint.", 0, 1, protocol));
6419          children.add(new Property("address", "uri", "The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.", 0, 1, address));
6420        }
6421
6422        @Override
6423        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6424          switch (_hash) {
6425          case -989163880: /*protocol*/  return new Property("protocol", "Coding", "A list of the messaging transport protocol(s) identifiers, supported by this endpoint.", 0, 1, protocol);
6426          case -1147692044: /*address*/  return new Property("address", "uri", "The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.", 0, 1, address);
6427          default: return super.getNamedProperty(_hash, _name, _checkValid);
6428          }
6429
6430        }
6431
6432      @Override
6433      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6434        switch (hash) {
6435        case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : new Base[] {this.protocol}; // Coding
6436        case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // UriType
6437        default: return super.getProperty(hash, name, checkValid);
6438        }
6439
6440      }
6441
6442      @Override
6443      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6444        switch (hash) {
6445        case -989163880: // protocol
6446          this.protocol = castToCoding(value); // Coding
6447          return value;
6448        case -1147692044: // address
6449          this.address = castToUri(value); // UriType
6450          return value;
6451        default: return super.setProperty(hash, name, value);
6452        }
6453
6454      }
6455
6456      @Override
6457      public Base setProperty(String name, Base value) throws FHIRException {
6458        if (name.equals("protocol")) {
6459          this.protocol = castToCoding(value); // Coding
6460        } else if (name.equals("address")) {
6461          this.address = castToUri(value); // UriType
6462        } else
6463          return super.setProperty(name, value);
6464        return value;
6465      }
6466
6467      @Override
6468      public Base makeProperty(int hash, String name) throws FHIRException {
6469        switch (hash) {
6470        case -989163880:  return getProtocol(); 
6471        case -1147692044:  return getAddressElement();
6472        default: return super.makeProperty(hash, name);
6473        }
6474
6475      }
6476
6477      @Override
6478      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6479        switch (hash) {
6480        case -989163880: /*protocol*/ return new String[] {"Coding"};
6481        case -1147692044: /*address*/ return new String[] {"uri"};
6482        default: return super.getTypesForProperty(hash, name);
6483        }
6484
6485      }
6486
6487      @Override
6488      public Base addChild(String name) throws FHIRException {
6489        if (name.equals("protocol")) {
6490          this.protocol = new Coding();
6491          return this.protocol;
6492        }
6493        else if (name.equals("address")) {
6494          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.address");
6495        }
6496        else
6497          return super.addChild(name);
6498      }
6499
6500      public CapabilityStatementMessagingEndpointComponent copy() {
6501        CapabilityStatementMessagingEndpointComponent dst = new CapabilityStatementMessagingEndpointComponent();
6502        copyValues(dst);
6503        dst.protocol = protocol == null ? null : protocol.copy();
6504        dst.address = address == null ? null : address.copy();
6505        return dst;
6506      }
6507
6508      @Override
6509      public boolean equalsDeep(Base other_) {
6510        if (!super.equalsDeep(other_))
6511          return false;
6512        if (!(other_ instanceof CapabilityStatementMessagingEndpointComponent))
6513          return false;
6514        CapabilityStatementMessagingEndpointComponent o = (CapabilityStatementMessagingEndpointComponent) other_;
6515        return compareDeep(protocol, o.protocol, true) && compareDeep(address, o.address, true);
6516      }
6517
6518      @Override
6519      public boolean equalsShallow(Base other_) {
6520        if (!super.equalsShallow(other_))
6521          return false;
6522        if (!(other_ instanceof CapabilityStatementMessagingEndpointComponent))
6523          return false;
6524        CapabilityStatementMessagingEndpointComponent o = (CapabilityStatementMessagingEndpointComponent) other_;
6525        return compareValues(address, o.address, true);
6526      }
6527
6528      public boolean isEmpty() {
6529        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(protocol, address);
6530      }
6531
6532  public String fhirType() {
6533    return "CapabilityStatement.messaging.endpoint";
6534
6535  }
6536
6537  }
6538
6539    @Block()
6540    public static class CapabilityStatementMessagingSupportedMessageComponent extends BackboneElement implements IBaseBackboneElement {
6541        /**
6542         * The mode of this event declaration - whether application is sender or receiver.
6543         */
6544        @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
6545        @Description(shortDefinition="sender | receiver", formalDefinition="The mode of this event declaration - whether application is sender or receiver." )
6546        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/event-capability-mode")
6547        protected Enumeration<EventCapabilityMode> mode;
6548
6549        /**
6550         * Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.
6551         */
6552        @Child(name = "definition", type = {MessageDefinition.class}, order=2, min=1, max=1, modifier=false, summary=true)
6553        @Description(shortDefinition="Message supported by this system", formalDefinition="Points to a message definition that identifies the messaging event, message structure, allowed responses, etc." )
6554        protected Reference definition;
6555
6556        /**
6557         * The actual object that is the target of the reference (Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.)
6558         */
6559        protected MessageDefinition definitionTarget;
6560
6561        private static final long serialVersionUID = -741523869L;
6562
6563    /**
6564     * Constructor
6565     */
6566      public CapabilityStatementMessagingSupportedMessageComponent() {
6567        super();
6568      }
6569
6570    /**
6571     * Constructor
6572     */
6573      public CapabilityStatementMessagingSupportedMessageComponent(Enumeration<EventCapabilityMode> mode, Reference definition) {
6574        super();
6575        this.mode = mode;
6576        this.definition = definition;
6577      }
6578
6579        /**
6580         * @return {@link #mode} (The mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
6581         */
6582        public Enumeration<EventCapabilityMode> getModeElement() { 
6583          if (this.mode == null)
6584            if (Configuration.errorOnAutoCreate())
6585              throw new Error("Attempt to auto-create CapabilityStatementMessagingSupportedMessageComponent.mode");
6586            else if (Configuration.doAutoCreate())
6587              this.mode = new Enumeration<EventCapabilityMode>(new EventCapabilityModeEnumFactory()); // bb
6588          return this.mode;
6589        }
6590
6591        public boolean hasModeElement() { 
6592          return this.mode != null && !this.mode.isEmpty();
6593        }
6594
6595        public boolean hasMode() { 
6596          return this.mode != null && !this.mode.isEmpty();
6597        }
6598
6599        /**
6600         * @param value {@link #mode} (The mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
6601         */
6602        public CapabilityStatementMessagingSupportedMessageComponent setModeElement(Enumeration<EventCapabilityMode> value) { 
6603          this.mode = value;
6604          return this;
6605        }
6606
6607        /**
6608         * @return The mode of this event declaration - whether application is sender or receiver.
6609         */
6610        public EventCapabilityMode getMode() { 
6611          return this.mode == null ? null : this.mode.getValue();
6612        }
6613
6614        /**
6615         * @param value The mode of this event declaration - whether application is sender or receiver.
6616         */
6617        public CapabilityStatementMessagingSupportedMessageComponent setMode(EventCapabilityMode value) { 
6618            if (this.mode == null)
6619              this.mode = new Enumeration<EventCapabilityMode>(new EventCapabilityModeEnumFactory());
6620            this.mode.setValue(value);
6621          return this;
6622        }
6623
6624        /**
6625         * @return {@link #definition} (Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.)
6626         */
6627        public Reference getDefinition() { 
6628          if (this.definition == null)
6629            if (Configuration.errorOnAutoCreate())
6630              throw new Error("Attempt to auto-create CapabilityStatementMessagingSupportedMessageComponent.definition");
6631            else if (Configuration.doAutoCreate())
6632              this.definition = new Reference(); // cc
6633          return this.definition;
6634        }
6635
6636        public boolean hasDefinition() { 
6637          return this.definition != null && !this.definition.isEmpty();
6638        }
6639
6640        /**
6641         * @param value {@link #definition} (Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.)
6642         */
6643        public CapabilityStatementMessagingSupportedMessageComponent setDefinition(Reference value)  { 
6644          this.definition = value;
6645          return this;
6646        }
6647
6648        /**
6649         * @return {@link #definition} 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. (Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.)
6650         */
6651        public MessageDefinition getDefinitionTarget() { 
6652          if (this.definitionTarget == null)
6653            if (Configuration.errorOnAutoCreate())
6654              throw new Error("Attempt to auto-create CapabilityStatementMessagingSupportedMessageComponent.definition");
6655            else if (Configuration.doAutoCreate())
6656              this.definitionTarget = new MessageDefinition(); // aa
6657          return this.definitionTarget;
6658        }
6659
6660        /**
6661         * @param value {@link #definition} 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. (Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.)
6662         */
6663        public CapabilityStatementMessagingSupportedMessageComponent setDefinitionTarget(MessageDefinition value) { 
6664          this.definitionTarget = value;
6665          return this;
6666        }
6667
6668        protected void listChildren(List<Property> children) {
6669          super.listChildren(children);
6670          children.add(new Property("mode", "code", "The mode of this event declaration - whether application is sender or receiver.", 0, 1, mode));
6671          children.add(new Property("definition", "Reference(MessageDefinition)", "Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.", 0, 1, definition));
6672        }
6673
6674        @Override
6675        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6676          switch (_hash) {
6677          case 3357091: /*mode*/  return new Property("mode", "code", "The mode of this event declaration - whether application is sender or receiver.", 0, 1, mode);
6678          case -1014418093: /*definition*/  return new Property("definition", "Reference(MessageDefinition)", "Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.", 0, 1, definition);
6679          default: return super.getNamedProperty(_hash, _name, _checkValid);
6680          }
6681
6682        }
6683
6684      @Override
6685      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6686        switch (hash) {
6687        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<EventCapabilityMode>
6688        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // Reference
6689        default: return super.getProperty(hash, name, checkValid);
6690        }
6691
6692      }
6693
6694      @Override
6695      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6696        switch (hash) {
6697        case 3357091: // mode
6698          value = new EventCapabilityModeEnumFactory().fromType(castToCode(value));
6699          this.mode = (Enumeration) value; // Enumeration<EventCapabilityMode>
6700          return value;
6701        case -1014418093: // definition
6702          this.definition = castToReference(value); // Reference
6703          return value;
6704        default: return super.setProperty(hash, name, value);
6705        }
6706
6707      }
6708
6709      @Override
6710      public Base setProperty(String name, Base value) throws FHIRException {
6711        if (name.equals("mode")) {
6712          value = new EventCapabilityModeEnumFactory().fromType(castToCode(value));
6713          this.mode = (Enumeration) value; // Enumeration<EventCapabilityMode>
6714        } else if (name.equals("definition")) {
6715          this.definition = castToReference(value); // Reference
6716        } else
6717          return super.setProperty(name, value);
6718        return value;
6719      }
6720
6721      @Override
6722      public Base makeProperty(int hash, String name) throws FHIRException {
6723        switch (hash) {
6724        case 3357091:  return getModeElement();
6725        case -1014418093:  return getDefinition(); 
6726        default: return super.makeProperty(hash, name);
6727        }
6728
6729      }
6730
6731      @Override
6732      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6733        switch (hash) {
6734        case 3357091: /*mode*/ return new String[] {"code"};
6735        case -1014418093: /*definition*/ return new String[] {"Reference"};
6736        default: return super.getTypesForProperty(hash, name);
6737        }
6738
6739      }
6740
6741      @Override
6742      public Base addChild(String name) throws FHIRException {
6743        if (name.equals("mode")) {
6744          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.mode");
6745        }
6746        else if (name.equals("definition")) {
6747          this.definition = new Reference();
6748          return this.definition;
6749        }
6750        else
6751          return super.addChild(name);
6752      }
6753
6754      public CapabilityStatementMessagingSupportedMessageComponent copy() {
6755        CapabilityStatementMessagingSupportedMessageComponent dst = new CapabilityStatementMessagingSupportedMessageComponent();
6756        copyValues(dst);
6757        dst.mode = mode == null ? null : mode.copy();
6758        dst.definition = definition == null ? null : definition.copy();
6759        return dst;
6760      }
6761
6762      @Override
6763      public boolean equalsDeep(Base other_) {
6764        if (!super.equalsDeep(other_))
6765          return false;
6766        if (!(other_ instanceof CapabilityStatementMessagingSupportedMessageComponent))
6767          return false;
6768        CapabilityStatementMessagingSupportedMessageComponent o = (CapabilityStatementMessagingSupportedMessageComponent) other_;
6769        return compareDeep(mode, o.mode, true) && compareDeep(definition, o.definition, true);
6770      }
6771
6772      @Override
6773      public boolean equalsShallow(Base other_) {
6774        if (!super.equalsShallow(other_))
6775          return false;
6776        if (!(other_ instanceof CapabilityStatementMessagingSupportedMessageComponent))
6777          return false;
6778        CapabilityStatementMessagingSupportedMessageComponent o = (CapabilityStatementMessagingSupportedMessageComponent) other_;
6779        return compareValues(mode, o.mode, true);
6780      }
6781
6782      public boolean isEmpty() {
6783        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mode, definition);
6784      }
6785
6786  public String fhirType() {
6787    return "CapabilityStatement.messaging.supportedMessage";
6788
6789  }
6790
6791  }
6792
6793    @Block()
6794    public static class CapabilityStatementMessagingEventComponent extends BackboneElement implements IBaseBackboneElement {
6795        /**
6796         * A coded identifier of a supported messaging event.
6797         */
6798        @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true)
6799        @Description(shortDefinition="Event type", formalDefinition="A coded identifier of a supported messaging event." )
6800        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-events")
6801        protected Coding code;
6802
6803        /**
6804         * The impact of the content of the message.
6805         */
6806        @Child(name = "category", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
6807        @Description(shortDefinition="Consequence | Currency | Notification", formalDefinition="The impact of the content of the message." )
6808        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-significance-category")
6809        protected Enumeration<MessageSignificanceCategory> category;
6810
6811        /**
6812         * The mode of this event declaration - whether an application is a sender or receiver.
6813         */
6814        @Child(name = "mode", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=false)
6815        @Description(shortDefinition="sender | receiver", formalDefinition="The mode of this event declaration - whether an application is a sender or receiver." )
6816        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/event-capability-mode")
6817        protected Enumeration<EventCapabilityMode> mode;
6818
6819        /**
6820         * A resource associated with the event.  This is the resource that defines the event.
6821         */
6822        @Child(name = "focus", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=false)
6823        @Description(shortDefinition="Resource that's focus of message", formalDefinition="A resource associated with the event.  This is the resource that defines the event." )
6824        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types")
6825        protected CodeType focus;
6826
6827        /**
6828         * Information about the request for this event.
6829         */
6830        @Child(name = "request", type = {StructureDefinition.class}, order=5, min=1, max=1, modifier=false, summary=true)
6831        @Description(shortDefinition="Profile that describes the request", formalDefinition="Information about the request for this event." )
6832        protected Reference request;
6833
6834        /**
6835         * The actual object that is the target of the reference (Information about the request for this event.)
6836         */
6837        protected StructureDefinition requestTarget;
6838
6839        /**
6840         * Information about the response for this event.
6841         */
6842        @Child(name = "response", type = {StructureDefinition.class}, order=6, min=1, max=1, modifier=false, summary=true)
6843        @Description(shortDefinition="Profile that describes the response", formalDefinition="Information about the response for this event." )
6844        protected Reference response;
6845
6846        /**
6847         * The actual object that is the target of the reference (Information about the response for this event.)
6848         */
6849        protected StructureDefinition responseTarget;
6850
6851        /**
6852         * Guidance on how this event is handled, such as internal system trigger points, business rules, etc.
6853         */
6854        @Child(name = "documentation", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
6855        @Description(shortDefinition="Endpoint-specific event documentation", formalDefinition="Guidance on how this event is handled, such as internal system trigger points, business rules, etc." )
6856        protected StringType documentation;
6857
6858        private static final long serialVersionUID = -491306017L;
6859
6860    /**
6861     * Constructor
6862     */
6863      public CapabilityStatementMessagingEventComponent() {
6864        super();
6865      }
6866
6867    /**
6868     * Constructor
6869     */
6870      public CapabilityStatementMessagingEventComponent(Coding code, Enumeration<EventCapabilityMode> mode, CodeType focus, Reference request, Reference response) {
6871        super();
6872        this.code = code;
6873        this.mode = mode;
6874        this.focus = focus;
6875        this.request = request;
6876        this.response = response;
6877      }
6878
6879        /**
6880         * @return {@link #code} (A coded identifier of a supported messaging event.)
6881         */
6882        public Coding getCode() { 
6883          if (this.code == null)
6884            if (Configuration.errorOnAutoCreate())
6885              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.code");
6886            else if (Configuration.doAutoCreate())
6887              this.code = new Coding(); // cc
6888          return this.code;
6889        }
6890
6891        public boolean hasCode() { 
6892          return this.code != null && !this.code.isEmpty();
6893        }
6894
6895        /**
6896         * @param value {@link #code} (A coded identifier of a supported messaging event.)
6897         */
6898        public CapabilityStatementMessagingEventComponent setCode(Coding value)  { 
6899          this.code = value;
6900          return this;
6901        }
6902
6903        /**
6904         * @return {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value
6905         */
6906        public Enumeration<MessageSignificanceCategory> getCategoryElement() { 
6907          if (this.category == null)
6908            if (Configuration.errorOnAutoCreate())
6909              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.category");
6910            else if (Configuration.doAutoCreate())
6911              this.category = new Enumeration<MessageSignificanceCategory>(new MessageSignificanceCategoryEnumFactory()); // bb
6912          return this.category;
6913        }
6914
6915        public boolean hasCategoryElement() { 
6916          return this.category != null && !this.category.isEmpty();
6917        }
6918
6919        public boolean hasCategory() { 
6920          return this.category != null && !this.category.isEmpty();
6921        }
6922
6923        /**
6924         * @param value {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value
6925         */
6926        public CapabilityStatementMessagingEventComponent setCategoryElement(Enumeration<MessageSignificanceCategory> value) { 
6927          this.category = value;
6928          return this;
6929        }
6930
6931        /**
6932         * @return The impact of the content of the message.
6933         */
6934        public MessageSignificanceCategory getCategory() { 
6935          return this.category == null ? null : this.category.getValue();
6936        }
6937
6938        /**
6939         * @param value The impact of the content of the message.
6940         */
6941        public CapabilityStatementMessagingEventComponent setCategory(MessageSignificanceCategory value) { 
6942          if (value == null)
6943            this.category = null;
6944          else {
6945            if (this.category == null)
6946              this.category = new Enumeration<MessageSignificanceCategory>(new MessageSignificanceCategoryEnumFactory());
6947            this.category.setValue(value);
6948          }
6949          return this;
6950        }
6951
6952        /**
6953         * @return {@link #mode} (The mode of this event declaration - whether an application is a sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
6954         */
6955        public Enumeration<EventCapabilityMode> getModeElement() { 
6956          if (this.mode == null)
6957            if (Configuration.errorOnAutoCreate())
6958              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.mode");
6959            else if (Configuration.doAutoCreate())
6960              this.mode = new Enumeration<EventCapabilityMode>(new EventCapabilityModeEnumFactory()); // bb
6961          return this.mode;
6962        }
6963
6964        public boolean hasModeElement() { 
6965          return this.mode != null && !this.mode.isEmpty();
6966        }
6967
6968        public boolean hasMode() { 
6969          return this.mode != null && !this.mode.isEmpty();
6970        }
6971
6972        /**
6973         * @param value {@link #mode} (The mode of this event declaration - whether an application is a sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
6974         */
6975        public CapabilityStatementMessagingEventComponent setModeElement(Enumeration<EventCapabilityMode> value) { 
6976          this.mode = value;
6977          return this;
6978        }
6979
6980        /**
6981         * @return The mode of this event declaration - whether an application is a sender or receiver.
6982         */
6983        public EventCapabilityMode getMode() { 
6984          return this.mode == null ? null : this.mode.getValue();
6985        }
6986
6987        /**
6988         * @param value The mode of this event declaration - whether an application is a sender or receiver.
6989         */
6990        public CapabilityStatementMessagingEventComponent setMode(EventCapabilityMode value) { 
6991            if (this.mode == null)
6992              this.mode = new Enumeration<EventCapabilityMode>(new EventCapabilityModeEnumFactory());
6993            this.mode.setValue(value);
6994          return this;
6995        }
6996
6997        /**
6998         * @return {@link #focus} (A resource associated with the event.  This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value
6999         */
7000        public CodeType getFocusElement() { 
7001          if (this.focus == null)
7002            if (Configuration.errorOnAutoCreate())
7003              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.focus");
7004            else if (Configuration.doAutoCreate())
7005              this.focus = new CodeType(); // bb
7006          return this.focus;
7007        }
7008
7009        public boolean hasFocusElement() { 
7010          return this.focus != null && !this.focus.isEmpty();
7011        }
7012
7013        public boolean hasFocus() { 
7014          return this.focus != null && !this.focus.isEmpty();
7015        }
7016
7017        /**
7018         * @param value {@link #focus} (A resource associated with the event.  This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value
7019         */
7020        public CapabilityStatementMessagingEventComponent setFocusElement(CodeType value) { 
7021          this.focus = value;
7022          return this;
7023        }
7024
7025        /**
7026         * @return A resource associated with the event.  This is the resource that defines the event.
7027         */
7028        public String getFocus() { 
7029          return this.focus == null ? null : this.focus.getValue();
7030        }
7031
7032        /**
7033         * @param value A resource associated with the event.  This is the resource that defines the event.
7034         */
7035        public CapabilityStatementMessagingEventComponent setFocus(String value) { 
7036            if (this.focus == null)
7037              this.focus = new CodeType();
7038            this.focus.setValue(value);
7039          return this;
7040        }
7041
7042        /**
7043         * @return {@link #request} (Information about the request for this event.)
7044         */
7045        public Reference getRequest() { 
7046          if (this.request == null)
7047            if (Configuration.errorOnAutoCreate())
7048              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.request");
7049            else if (Configuration.doAutoCreate())
7050              this.request = new Reference(); // cc
7051          return this.request;
7052        }
7053
7054        public boolean hasRequest() { 
7055          return this.request != null && !this.request.isEmpty();
7056        }
7057
7058        /**
7059         * @param value {@link #request} (Information about the request for this event.)
7060         */
7061        public CapabilityStatementMessagingEventComponent setRequest(Reference value)  { 
7062          this.request = value;
7063          return this;
7064        }
7065
7066        /**
7067         * @return {@link #request} 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. (Information about the request for this event.)
7068         */
7069        public StructureDefinition getRequestTarget() { 
7070          if (this.requestTarget == null)
7071            if (Configuration.errorOnAutoCreate())
7072              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.request");
7073            else if (Configuration.doAutoCreate())
7074              this.requestTarget = new StructureDefinition(); // aa
7075          return this.requestTarget;
7076        }
7077
7078        /**
7079         * @param value {@link #request} 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. (Information about the request for this event.)
7080         */
7081        public CapabilityStatementMessagingEventComponent setRequestTarget(StructureDefinition value) { 
7082          this.requestTarget = value;
7083          return this;
7084        }
7085
7086        /**
7087         * @return {@link #response} (Information about the response for this event.)
7088         */
7089        public Reference getResponse() { 
7090          if (this.response == null)
7091            if (Configuration.errorOnAutoCreate())
7092              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.response");
7093            else if (Configuration.doAutoCreate())
7094              this.response = new Reference(); // cc
7095          return this.response;
7096        }
7097
7098        public boolean hasResponse() { 
7099          return this.response != null && !this.response.isEmpty();
7100        }
7101
7102        /**
7103         * @param value {@link #response} (Information about the response for this event.)
7104         */
7105        public CapabilityStatementMessagingEventComponent setResponse(Reference value)  { 
7106          this.response = value;
7107          return this;
7108        }
7109
7110        /**
7111         * @return {@link #response} 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. (Information about the response for this event.)
7112         */
7113        public StructureDefinition getResponseTarget() { 
7114          if (this.responseTarget == null)
7115            if (Configuration.errorOnAutoCreate())
7116              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.response");
7117            else if (Configuration.doAutoCreate())
7118              this.responseTarget = new StructureDefinition(); // aa
7119          return this.responseTarget;
7120        }
7121
7122        /**
7123         * @param value {@link #response} 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. (Information about the response for this event.)
7124         */
7125        public CapabilityStatementMessagingEventComponent setResponseTarget(StructureDefinition value) { 
7126          this.responseTarget = value;
7127          return this;
7128        }
7129
7130        /**
7131         * @return {@link #documentation} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
7132         */
7133        public StringType getDocumentationElement() { 
7134          if (this.documentation == null)
7135            if (Configuration.errorOnAutoCreate())
7136              throw new Error("Attempt to auto-create CapabilityStatementMessagingEventComponent.documentation");
7137            else if (Configuration.doAutoCreate())
7138              this.documentation = new StringType(); // bb
7139          return this.documentation;
7140        }
7141
7142        public boolean hasDocumentationElement() { 
7143          return this.documentation != null && !this.documentation.isEmpty();
7144        }
7145
7146        public boolean hasDocumentation() { 
7147          return this.documentation != null && !this.documentation.isEmpty();
7148        }
7149
7150        /**
7151         * @param value {@link #documentation} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
7152         */
7153        public CapabilityStatementMessagingEventComponent setDocumentationElement(StringType value) { 
7154          this.documentation = value;
7155          return this;
7156        }
7157
7158        /**
7159         * @return Guidance on how this event is handled, such as internal system trigger points, business rules, etc.
7160         */
7161        public String getDocumentation() { 
7162          return this.documentation == null ? null : this.documentation.getValue();
7163        }
7164
7165        /**
7166         * @param value Guidance on how this event is handled, such as internal system trigger points, business rules, etc.
7167         */
7168        public CapabilityStatementMessagingEventComponent setDocumentation(String value) { 
7169          if (Utilities.noString(value))
7170            this.documentation = null;
7171          else {
7172            if (this.documentation == null)
7173              this.documentation = new StringType();
7174            this.documentation.setValue(value);
7175          }
7176          return this;
7177        }
7178
7179        protected void listChildren(List<Property> children) {
7180          super.listChildren(children);
7181          children.add(new Property("code", "Coding", "A coded identifier of a supported messaging event.", 0, 1, code));
7182          children.add(new Property("category", "code", "The impact of the content of the message.", 0, 1, category));
7183          children.add(new Property("mode", "code", "The mode of this event declaration - whether an application is a sender or receiver.", 0, 1, mode));
7184          children.add(new Property("focus", "code", "A resource associated with the event.  This is the resource that defines the event.", 0, 1, focus));
7185          children.add(new Property("request", "Reference(StructureDefinition)", "Information about the request for this event.", 0, 1, request));
7186          children.add(new Property("response", "Reference(StructureDefinition)", "Information about the response for this event.", 0, 1, response));
7187          children.add(new Property("documentation", "string", "Guidance on how this event is handled, such as internal system trigger points, business rules, etc.", 0, 1, documentation));
7188        }
7189
7190        @Override
7191        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7192          switch (_hash) {
7193          case 3059181: /*code*/  return new Property("code", "Coding", "A coded identifier of a supported messaging event.", 0, 1, code);
7194          case 50511102: /*category*/  return new Property("category", "code", "The impact of the content of the message.", 0, 1, category);
7195          case 3357091: /*mode*/  return new Property("mode", "code", "The mode of this event declaration - whether an application is a sender or receiver.", 0, 1, mode);
7196          case 97604824: /*focus*/  return new Property("focus", "code", "A resource associated with the event.  This is the resource that defines the event.", 0, 1, focus);
7197          case 1095692943: /*request*/  return new Property("request", "Reference(StructureDefinition)", "Information about the request for this event.", 0, 1, request);
7198          case -340323263: /*response*/  return new Property("response", "Reference(StructureDefinition)", "Information about the response for this event.", 0, 1, response);
7199          case 1587405498: /*documentation*/  return new Property("documentation", "string", "Guidance on how this event is handled, such as internal system trigger points, business rules, etc.", 0, 1, documentation);
7200          default: return super.getNamedProperty(_hash, _name, _checkValid);
7201          }
7202
7203        }
7204
7205      @Override
7206      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7207        switch (hash) {
7208        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding
7209        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration<MessageSignificanceCategory>
7210        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<EventCapabilityMode>
7211        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : new Base[] {this.focus}; // CodeType
7212        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference
7213        case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Reference
7214        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
7215        default: return super.getProperty(hash, name, checkValid);
7216        }
7217
7218      }
7219
7220      @Override
7221      public Base setProperty(int hash, String name, Base value) throws FHIRException {
7222        switch (hash) {
7223        case 3059181: // code
7224          this.code = castToCoding(value); // Coding
7225          return value;
7226        case 50511102: // category
7227          value = new MessageSignificanceCategoryEnumFactory().fromType(castToCode(value));
7228          this.category = (Enumeration) value; // Enumeration<MessageSignificanceCategory>
7229          return value;
7230        case 3357091: // mode
7231          value = new EventCapabilityModeEnumFactory().fromType(castToCode(value));
7232          this.mode = (Enumeration) value; // Enumeration<EventCapabilityMode>
7233          return value;
7234        case 97604824: // focus
7235          this.focus = castToCode(value); // CodeType
7236          return value;
7237        case 1095692943: // request
7238          this.request = castToReference(value); // Reference
7239          return value;
7240        case -340323263: // response
7241          this.response = castToReference(value); // Reference
7242          return value;
7243        case 1587405498: // documentation
7244          this.documentation = castToString(value); // StringType
7245          return value;
7246        default: return super.setProperty(hash, name, value);
7247        }
7248
7249      }
7250
7251      @Override
7252      public Base setProperty(String name, Base value) throws FHIRException {
7253        if (name.equals("code")) {
7254          this.code = castToCoding(value); // Coding
7255        } else if (name.equals("category")) {
7256          value = new MessageSignificanceCategoryEnumFactory().fromType(castToCode(value));
7257          this.category = (Enumeration) value; // Enumeration<MessageSignificanceCategory>
7258        } else if (name.equals("mode")) {
7259          value = new EventCapabilityModeEnumFactory().fromType(castToCode(value));
7260          this.mode = (Enumeration) value; // Enumeration<EventCapabilityMode>
7261        } else if (name.equals("focus")) {
7262          this.focus = castToCode(value); // CodeType
7263        } else if (name.equals("request")) {
7264          this.request = castToReference(value); // Reference
7265        } else if (name.equals("response")) {
7266          this.response = castToReference(value); // Reference
7267        } else if (name.equals("documentation")) {
7268          this.documentation = castToString(value); // StringType
7269        } else
7270          return super.setProperty(name, value);
7271        return value;
7272      }
7273
7274      @Override
7275      public Base makeProperty(int hash, String name) throws FHIRException {
7276        switch (hash) {
7277        case 3059181:  return getCode(); 
7278        case 50511102:  return getCategoryElement();
7279        case 3357091:  return getModeElement();
7280        case 97604824:  return getFocusElement();
7281        case 1095692943:  return getRequest(); 
7282        case -340323263:  return getResponse(); 
7283        case 1587405498:  return getDocumentationElement();
7284        default: return super.makeProperty(hash, name);
7285        }
7286
7287      }
7288
7289      @Override
7290      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
7291        switch (hash) {
7292        case 3059181: /*code*/ return new String[] {"Coding"};
7293        case 50511102: /*category*/ return new String[] {"code"};
7294        case 3357091: /*mode*/ return new String[] {"code"};
7295        case 97604824: /*focus*/ return new String[] {"code"};
7296        case 1095692943: /*request*/ return new String[] {"Reference"};
7297        case -340323263: /*response*/ return new String[] {"Reference"};
7298        case 1587405498: /*documentation*/ return new String[] {"string"};
7299        default: return super.getTypesForProperty(hash, name);
7300        }
7301
7302      }
7303
7304      @Override
7305      public Base addChild(String name) throws FHIRException {
7306        if (name.equals("code")) {
7307          this.code = new Coding();
7308          return this.code;
7309        }
7310        else if (name.equals("category")) {
7311          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.category");
7312        }
7313        else if (name.equals("mode")) {
7314          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.mode");
7315        }
7316        else if (name.equals("focus")) {
7317          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.focus");
7318        }
7319        else if (name.equals("request")) {
7320          this.request = new Reference();
7321          return this.request;
7322        }
7323        else if (name.equals("response")) {
7324          this.response = new Reference();
7325          return this.response;
7326        }
7327        else if (name.equals("documentation")) {
7328          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
7329        }
7330        else
7331          return super.addChild(name);
7332      }
7333
7334      public CapabilityStatementMessagingEventComponent copy() {
7335        CapabilityStatementMessagingEventComponent dst = new CapabilityStatementMessagingEventComponent();
7336        copyValues(dst);
7337        dst.code = code == null ? null : code.copy();
7338        dst.category = category == null ? null : category.copy();
7339        dst.mode = mode == null ? null : mode.copy();
7340        dst.focus = focus == null ? null : focus.copy();
7341        dst.request = request == null ? null : request.copy();
7342        dst.response = response == null ? null : response.copy();
7343        dst.documentation = documentation == null ? null : documentation.copy();
7344        return dst;
7345      }
7346
7347      @Override
7348      public boolean equalsDeep(Base other_) {
7349        if (!super.equalsDeep(other_))
7350          return false;
7351        if (!(other_ instanceof CapabilityStatementMessagingEventComponent))
7352          return false;
7353        CapabilityStatementMessagingEventComponent o = (CapabilityStatementMessagingEventComponent) other_;
7354        return compareDeep(code, o.code, true) && compareDeep(category, o.category, true) && compareDeep(mode, o.mode, true)
7355           && compareDeep(focus, o.focus, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true)
7356           && compareDeep(documentation, o.documentation, true);
7357      }
7358
7359      @Override
7360      public boolean equalsShallow(Base other_) {
7361        if (!super.equalsShallow(other_))
7362          return false;
7363        if (!(other_ instanceof CapabilityStatementMessagingEventComponent))
7364          return false;
7365        CapabilityStatementMessagingEventComponent o = (CapabilityStatementMessagingEventComponent) other_;
7366        return compareValues(category, o.category, true) && compareValues(mode, o.mode, true) && compareValues(focus, o.focus, true)
7367           && compareValues(documentation, o.documentation, true);
7368      }
7369
7370      public boolean isEmpty() {
7371        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, category, mode, focus
7372          , request, response, documentation);
7373      }
7374
7375  public String fhirType() {
7376    return "CapabilityStatement.messaging.event";
7377
7378  }
7379
7380  }
7381
7382    @Block()
7383    public static class CapabilityStatementDocumentComponent extends BackboneElement implements IBaseBackboneElement {
7384        /**
7385         * Mode of this document declaration - whether an application is a producer or consumer.
7386         */
7387        @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
7388        @Description(shortDefinition="producer | consumer", formalDefinition="Mode of this document declaration - whether an application is a producer or consumer." )
7389        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/document-mode")
7390        protected Enumeration<DocumentMode> mode;
7391
7392        /**
7393         * A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.
7394         */
7395        @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
7396        @Description(shortDefinition="Description of document support", formalDefinition="A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc." )
7397        protected StringType documentation;
7398
7399        /**
7400         * A constraint on a resource used in the document.
7401         */
7402        @Child(name = "profile", type = {StructureDefinition.class}, order=3, min=1, max=1, modifier=false, summary=true)
7403        @Description(shortDefinition="Constraint on a resource used in the document", formalDefinition="A constraint on a resource used in the document." )
7404        protected Reference profile;
7405
7406        /**
7407         * The actual object that is the target of the reference (A constraint on a resource used in the document.)
7408         */
7409        protected StructureDefinition profileTarget;
7410
7411        private static final long serialVersionUID = -1059555053L;
7412
7413    /**
7414     * Constructor
7415     */
7416      public CapabilityStatementDocumentComponent() {
7417        super();
7418      }
7419
7420    /**
7421     * Constructor
7422     */
7423      public CapabilityStatementDocumentComponent(Enumeration<DocumentMode> mode, Reference profile) {
7424        super();
7425        this.mode = mode;
7426        this.profile = profile;
7427      }
7428
7429        /**
7430         * @return {@link #mode} (Mode of this document declaration - whether an application is a producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
7431         */
7432        public Enumeration<DocumentMode> getModeElement() { 
7433          if (this.mode == null)
7434            if (Configuration.errorOnAutoCreate())
7435              throw new Error("Attempt to auto-create CapabilityStatementDocumentComponent.mode");
7436            else if (Configuration.doAutoCreate())
7437              this.mode = new Enumeration<DocumentMode>(new DocumentModeEnumFactory()); // bb
7438          return this.mode;
7439        }
7440
7441        public boolean hasModeElement() { 
7442          return this.mode != null && !this.mode.isEmpty();
7443        }
7444
7445        public boolean hasMode() { 
7446          return this.mode != null && !this.mode.isEmpty();
7447        }
7448
7449        /**
7450         * @param value {@link #mode} (Mode of this document declaration - whether an application is a producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
7451         */
7452        public CapabilityStatementDocumentComponent setModeElement(Enumeration<DocumentMode> value) { 
7453          this.mode = value;
7454          return this;
7455        }
7456
7457        /**
7458         * @return Mode of this document declaration - whether an application is a producer or consumer.
7459         */
7460        public DocumentMode getMode() { 
7461          return this.mode == null ? null : this.mode.getValue();
7462        }
7463
7464        /**
7465         * @param value Mode of this document declaration - whether an application is a producer or consumer.
7466         */
7467        public CapabilityStatementDocumentComponent setMode(DocumentMode value) { 
7468            if (this.mode == null)
7469              this.mode = new Enumeration<DocumentMode>(new DocumentModeEnumFactory());
7470            this.mode.setValue(value);
7471          return this;
7472        }
7473
7474        /**
7475         * @return {@link #documentation} (A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
7476         */
7477        public StringType getDocumentationElement() { 
7478          if (this.documentation == null)
7479            if (Configuration.errorOnAutoCreate())
7480              throw new Error("Attempt to auto-create CapabilityStatementDocumentComponent.documentation");
7481            else if (Configuration.doAutoCreate())
7482              this.documentation = new StringType(); // bb
7483          return this.documentation;
7484        }
7485
7486        public boolean hasDocumentationElement() { 
7487          return this.documentation != null && !this.documentation.isEmpty();
7488        }
7489
7490        public boolean hasDocumentation() { 
7491          return this.documentation != null && !this.documentation.isEmpty();
7492        }
7493
7494        /**
7495         * @param value {@link #documentation} (A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value
7496         */
7497        public CapabilityStatementDocumentComponent setDocumentationElement(StringType value) { 
7498          this.documentation = value;
7499          return this;
7500        }
7501
7502        /**
7503         * @return A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.
7504         */
7505        public String getDocumentation() { 
7506          return this.documentation == null ? null : this.documentation.getValue();
7507        }
7508
7509        /**
7510         * @param value A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.
7511         */
7512        public CapabilityStatementDocumentComponent setDocumentation(String value) { 
7513          if (Utilities.noString(value))
7514            this.documentation = null;
7515          else {
7516            if (this.documentation == null)
7517              this.documentation = new StringType();
7518            this.documentation.setValue(value);
7519          }
7520          return this;
7521        }
7522
7523        /**
7524         * @return {@link #profile} (A constraint on a resource used in the document.)
7525         */
7526        public Reference getProfile() { 
7527          if (this.profile == null)
7528            if (Configuration.errorOnAutoCreate())
7529              throw new Error("Attempt to auto-create CapabilityStatementDocumentComponent.profile");
7530            else if (Configuration.doAutoCreate())
7531              this.profile = new Reference(); // cc
7532          return this.profile;
7533        }
7534
7535        public boolean hasProfile() { 
7536          return this.profile != null && !this.profile.isEmpty();
7537        }
7538
7539        /**
7540         * @param value {@link #profile} (A constraint on a resource used in the document.)
7541         */
7542        public CapabilityStatementDocumentComponent setProfile(Reference value)  { 
7543          this.profile = value;
7544          return this;
7545        }
7546
7547        /**
7548         * @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 constraint on a resource used in the document.)
7549         */
7550        public StructureDefinition getProfileTarget() { 
7551          if (this.profileTarget == null)
7552            if (Configuration.errorOnAutoCreate())
7553              throw new Error("Attempt to auto-create CapabilityStatementDocumentComponent.profile");
7554            else if (Configuration.doAutoCreate())
7555              this.profileTarget = new StructureDefinition(); // aa
7556          return this.profileTarget;
7557        }
7558
7559        /**
7560         * @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 constraint on a resource used in the document.)
7561         */
7562        public CapabilityStatementDocumentComponent setProfileTarget(StructureDefinition value) { 
7563          this.profileTarget = value;
7564          return this;
7565        }
7566
7567        protected void listChildren(List<Property> children) {
7568          super.listChildren(children);
7569          children.add(new Property("mode", "code", "Mode of this document declaration - whether an application is a producer or consumer.", 0, 1, mode));
7570          children.add(new Property("documentation", "string", "A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.", 0, 1, documentation));
7571          children.add(new Property("profile", "Reference(StructureDefinition)", "A constraint on a resource used in the document.", 0, 1, profile));
7572        }
7573
7574        @Override
7575        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7576          switch (_hash) {
7577          case 3357091: /*mode*/  return new Property("mode", "code", "Mode of this document declaration - whether an application is a producer or consumer.", 0, 1, mode);
7578          case 1587405498: /*documentation*/  return new Property("documentation", "string", "A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.", 0, 1, documentation);
7579          case -309425751: /*profile*/  return new Property("profile", "Reference(StructureDefinition)", "A constraint on a resource used in the document.", 0, 1, profile);
7580          default: return super.getNamedProperty(_hash, _name, _checkValid);
7581          }
7582
7583        }
7584
7585      @Override
7586      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7587        switch (hash) {
7588        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<DocumentMode>
7589        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType
7590        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference
7591        default: return super.getProperty(hash, name, checkValid);
7592        }
7593
7594      }
7595
7596      @Override
7597      public Base setProperty(int hash, String name, Base value) throws FHIRException {
7598        switch (hash) {
7599        case 3357091: // mode
7600          value = new DocumentModeEnumFactory().fromType(castToCode(value));
7601          this.mode = (Enumeration) value; // Enumeration<DocumentMode>
7602          return value;
7603        case 1587405498: // documentation
7604          this.documentation = castToString(value); // StringType
7605          return value;
7606        case -309425751: // profile
7607          this.profile = castToReference(value); // Reference
7608          return value;
7609        default: return super.setProperty(hash, name, value);
7610        }
7611
7612      }
7613
7614      @Override
7615      public Base setProperty(String name, Base value) throws FHIRException {
7616        if (name.equals("mode")) {
7617          value = new DocumentModeEnumFactory().fromType(castToCode(value));
7618          this.mode = (Enumeration) value; // Enumeration<DocumentMode>
7619        } else if (name.equals("documentation")) {
7620          this.documentation = castToString(value); // StringType
7621        } else if (name.equals("profile")) {
7622          this.profile = castToReference(value); // Reference
7623        } else
7624          return super.setProperty(name, value);
7625        return value;
7626      }
7627
7628      @Override
7629      public Base makeProperty(int hash, String name) throws FHIRException {
7630        switch (hash) {
7631        case 3357091:  return getModeElement();
7632        case 1587405498:  return getDocumentationElement();
7633        case -309425751:  return getProfile(); 
7634        default: return super.makeProperty(hash, name);
7635        }
7636
7637      }
7638
7639      @Override
7640      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
7641        switch (hash) {
7642        case 3357091: /*mode*/ return new String[] {"code"};
7643        case 1587405498: /*documentation*/ return new String[] {"string"};
7644        case -309425751: /*profile*/ return new String[] {"Reference"};
7645        default: return super.getTypesForProperty(hash, name);
7646        }
7647
7648      }
7649
7650      @Override
7651      public Base addChild(String name) throws FHIRException {
7652        if (name.equals("mode")) {
7653          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.mode");
7654        }
7655        else if (name.equals("documentation")) {
7656          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
7657        }
7658        else if (name.equals("profile")) {
7659          this.profile = new Reference();
7660          return this.profile;
7661        }
7662        else
7663          return super.addChild(name);
7664      }
7665
7666      public CapabilityStatementDocumentComponent copy() {
7667        CapabilityStatementDocumentComponent dst = new CapabilityStatementDocumentComponent();
7668        copyValues(dst);
7669        dst.mode = mode == null ? null : mode.copy();
7670        dst.documentation = documentation == null ? null : documentation.copy();
7671        dst.profile = profile == null ? null : profile.copy();
7672        return dst;
7673      }
7674
7675      @Override
7676      public boolean equalsDeep(Base other_) {
7677        if (!super.equalsDeep(other_))
7678          return false;
7679        if (!(other_ instanceof CapabilityStatementDocumentComponent))
7680          return false;
7681        CapabilityStatementDocumentComponent o = (CapabilityStatementDocumentComponent) other_;
7682        return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(profile, o.profile, true)
7683          ;
7684      }
7685
7686      @Override
7687      public boolean equalsShallow(Base other_) {
7688        if (!super.equalsShallow(other_))
7689          return false;
7690        if (!(other_ instanceof CapabilityStatementDocumentComponent))
7691          return false;
7692        CapabilityStatementDocumentComponent o = (CapabilityStatementDocumentComponent) other_;
7693        return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true);
7694      }
7695
7696      public boolean isEmpty() {
7697        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mode, documentation, profile
7698          );
7699      }
7700
7701  public String fhirType() {
7702    return "CapabilityStatement.document";
7703
7704  }
7705
7706  }
7707
7708    /**
7709     * Explaination of why this capability statement is needed and why it has been designed as it has.
7710     */
7711    @Child(name = "purpose", type = {MarkdownType.class}, order=0, min=0, max=1, modifier=false, summary=false)
7712    @Description(shortDefinition="Why this capability statement is defined", formalDefinition="Explaination of why this capability statement is needed and why it has been designed as it has." )
7713    protected MarkdownType purpose;
7714
7715    /**
7716     * A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.
7717     */
7718    @Child(name = "copyright", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=false)
7719    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement." )
7720    protected MarkdownType copyright;
7721
7722    /**
7723     * The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).
7724     */
7725    @Child(name = "kind", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
7726    @Description(shortDefinition="instance | capability | requirements", formalDefinition="The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase)." )
7727    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/capability-statement-kind")
7728    protected Enumeration<CapabilityStatementKind> kind;
7729
7730    /**
7731     * Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.
7732     */
7733    @Child(name = "instantiates", type = {UriType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7734    @Description(shortDefinition="Canonical URL of another capability statement this implements", formalDefinition="Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so." )
7735    protected List<UriType> instantiates;
7736
7737    /**
7738     * Software that is covered by this capability statement.  It is used when the capability statement describes the capabilities of a particular software version, independent of an installation.
7739     */
7740    @Child(name = "software", type = {}, order=4, min=0, max=1, modifier=false, summary=true)
7741    @Description(shortDefinition="Software that is covered by this capability statement", formalDefinition="Software that is covered by this capability statement.  It is used when the capability statement describes the capabilities of a particular software version, independent of an installation." )
7742    protected CapabilityStatementSoftwareComponent software;
7743
7744    /**
7745     * Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program.
7746     */
7747    @Child(name = "implementation", type = {}, order=5, min=0, max=1, modifier=false, summary=true)
7748    @Description(shortDefinition="If this describes a specific instance", formalDefinition="Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program." )
7749    protected CapabilityStatementImplementationComponent implementation;
7750
7751    /**
7752     * The version of the FHIR specification on which this capability statement is based.
7753     */
7754    @Child(name = "fhirVersion", type = {IdType.class}, order=6, min=1, max=1, modifier=false, summary=true)
7755    @Description(shortDefinition="FHIR Version the system uses", formalDefinition="The version of the FHIR specification on which this capability statement is based." )
7756    protected IdType fhirVersion;
7757
7758    /**
7759     * A code that indicates whether the application accepts unknown elements or extensions when reading resources.
7760     */
7761    @Child(name = "acceptUnknown", type = {CodeType.class}, order=7, min=1, max=1, modifier=false, summary=true)
7762    @Description(shortDefinition="no | extensions | elements | both", formalDefinition="A code that indicates whether the application accepts unknown elements or extensions when reading resources." )
7763    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/unknown-content-code")
7764    protected Enumeration<UnknownContentCode> acceptUnknown;
7765
7766    /**
7767     * A list of the formats supported by this implementation using their content types.
7768     */
7769    @Child(name = "format", type = {CodeType.class}, order=8, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7770    @Description(shortDefinition="formats supported (xml | json | ttl | mime type)", formalDefinition="A list of the formats supported by this implementation using their content types." )
7771    protected List<CodeType> format;
7772
7773    /**
7774     * A list of the patch formats supported by this implementation using their content types.
7775     */
7776    @Child(name = "patchFormat", type = {CodeType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7777    @Description(shortDefinition="Patch formats supported", formalDefinition="A list of the patch formats supported by this implementation using their content types." )
7778    protected List<CodeType> patchFormat;
7779
7780    /**
7781     * A list of implementation guides that the server does (or should) support in their entirety.
7782     */
7783    @Child(name = "implementationGuide", type = {UriType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7784    @Description(shortDefinition="Implementation guides supported", formalDefinition="A list of implementation guides that the server does (or should) support in their entirety." )
7785    protected List<UriType> implementationGuide;
7786
7787    /**
7788     * A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).
7789     */
7790    @Child(name = "profile", type = {StructureDefinition.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7791    @Description(shortDefinition="Profiles for use cases supported", formalDefinition="A list of profiles that represent different use cases supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses)." )
7792    protected List<Reference> profile;
7793    /**
7794     * The actual objects that are the target of the reference (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).)
7795     */
7796    protected List<StructureDefinition> profileTarget;
7797
7798
7799    /**
7800     * A definition of the restful capabilities of the solution, if any.
7801     */
7802    @Child(name = "rest", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7803    @Description(shortDefinition="If the endpoint is a RESTful one", formalDefinition="A definition of the restful capabilities of the solution, if any." )
7804    protected List<CapabilityStatementRestComponent> rest;
7805
7806    /**
7807     * A description of the messaging capabilities of the solution.
7808     */
7809    @Child(name = "messaging", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7810    @Description(shortDefinition="If messaging is supported", formalDefinition="A description of the messaging capabilities of the solution." )
7811    protected List<CapabilityStatementMessagingComponent> messaging;
7812
7813    /**
7814     * A document definition.
7815     */
7816    @Child(name = "document", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7817    @Description(shortDefinition="Document definition", formalDefinition="A document definition." )
7818    protected List<CapabilityStatementDocumentComponent> document;
7819
7820    private static final long serialVersionUID = 227177541L;
7821
7822  /**
7823   * Constructor
7824   */
7825    public CapabilityStatement() {
7826      super();
7827    }
7828
7829  /**
7830   * Constructor
7831   */
7832    public CapabilityStatement(Enumeration<PublicationStatus> status, DateTimeType date, Enumeration<CapabilityStatementKind> kind, IdType fhirVersion, Enumeration<UnknownContentCode> acceptUnknown) {
7833      super();
7834      this.status = status;
7835      this.date = date;
7836      this.kind = kind;
7837      this.fhirVersion = fhirVersion;
7838      this.acceptUnknown = acceptUnknown;
7839    }
7840
7841    /**
7842     * @return {@link #url} (An absolute URI that is used to identify this capability statement 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 capability statement is (or will be) published. The URL SHOULD include the major version of the capability statement. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
7843     */
7844    public UriType getUrlElement() { 
7845      if (this.url == null)
7846        if (Configuration.errorOnAutoCreate())
7847          throw new Error("Attempt to auto-create CapabilityStatement.url");
7848        else if (Configuration.doAutoCreate())
7849          this.url = new UriType(); // bb
7850      return this.url;
7851    }
7852
7853    public boolean hasUrlElement() { 
7854      return this.url != null && !this.url.isEmpty();
7855    }
7856
7857    public boolean hasUrl() { 
7858      return this.url != null && !this.url.isEmpty();
7859    }
7860
7861    /**
7862     * @param value {@link #url} (An absolute URI that is used to identify this capability statement 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 capability statement is (or will be) published. The URL SHOULD include the major version of the capability statement. For more information see [Technical and Business Versions](resource.html#versions).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
7863     */
7864    public CapabilityStatement setUrlElement(UriType value) { 
7865      this.url = value;
7866      return this;
7867    }
7868
7869    /**
7870     * @return An absolute URI that is used to identify this capability statement 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 capability statement is (or will be) published. The URL SHOULD include the major version of the capability statement. For more information see [Technical and Business Versions](resource.html#versions).
7871     */
7872    public String getUrl() { 
7873      return this.url == null ? null : this.url.getValue();
7874    }
7875
7876    /**
7877     * @param value An absolute URI that is used to identify this capability statement 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 capability statement is (or will be) published. The URL SHOULD include the major version of the capability statement. For more information see [Technical and Business Versions](resource.html#versions).
7878     */
7879    public CapabilityStatement setUrl(String value) { 
7880      if (Utilities.noString(value))
7881        this.url = null;
7882      else {
7883        if (this.url == null)
7884          this.url = new UriType();
7885        this.url.setValue(value);
7886      }
7887      return this;
7888    }
7889
7890    /**
7891     * @return {@link #version} (The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
7892     */
7893    public StringType getVersionElement() { 
7894      if (this.version == null)
7895        if (Configuration.errorOnAutoCreate())
7896          throw new Error("Attempt to auto-create CapabilityStatement.version");
7897        else if (Configuration.doAutoCreate())
7898          this.version = new StringType(); // bb
7899      return this.version;
7900    }
7901
7902    public boolean hasVersionElement() { 
7903      return this.version != null && !this.version.isEmpty();
7904    }
7905
7906    public boolean hasVersion() { 
7907      return this.version != null && !this.version.isEmpty();
7908    }
7909
7910    /**
7911     * @param value {@link #version} (The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
7912     */
7913    public CapabilityStatement setVersionElement(StringType value) { 
7914      this.version = value;
7915      return this;
7916    }
7917
7918    /**
7919     * @return The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
7920     */
7921    public String getVersion() { 
7922      return this.version == null ? null : this.version.getValue();
7923    }
7924
7925    /**
7926     * @param value The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
7927     */
7928    public CapabilityStatement setVersion(String value) { 
7929      if (Utilities.noString(value))
7930        this.version = null;
7931      else {
7932        if (this.version == null)
7933          this.version = new StringType();
7934        this.version.setValue(value);
7935      }
7936      return this;
7937    }
7938
7939    /**
7940     * @return {@link #name} (A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
7941     */
7942    public StringType getNameElement() { 
7943      if (this.name == null)
7944        if (Configuration.errorOnAutoCreate())
7945          throw new Error("Attempt to auto-create CapabilityStatement.name");
7946        else if (Configuration.doAutoCreate())
7947          this.name = new StringType(); // bb
7948      return this.name;
7949    }
7950
7951    public boolean hasNameElement() { 
7952      return this.name != null && !this.name.isEmpty();
7953    }
7954
7955    public boolean hasName() { 
7956      return this.name != null && !this.name.isEmpty();
7957    }
7958
7959    /**
7960     * @param value {@link #name} (A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
7961     */
7962    public CapabilityStatement setNameElement(StringType value) { 
7963      this.name = value;
7964      return this;
7965    }
7966
7967    /**
7968     * @return A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.
7969     */
7970    public String getName() { 
7971      return this.name == null ? null : this.name.getValue();
7972    }
7973
7974    /**
7975     * @param value A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.
7976     */
7977    public CapabilityStatement setName(String value) { 
7978      if (Utilities.noString(value))
7979        this.name = null;
7980      else {
7981        if (this.name == null)
7982          this.name = new StringType();
7983        this.name.setValue(value);
7984      }
7985      return this;
7986    }
7987
7988    /**
7989     * @return {@link #title} (A short, descriptive, user-friendly title for the capability statement.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
7990     */
7991    public StringType getTitleElement() { 
7992      if (this.title == null)
7993        if (Configuration.errorOnAutoCreate())
7994          throw new Error("Attempt to auto-create CapabilityStatement.title");
7995        else if (Configuration.doAutoCreate())
7996          this.title = new StringType(); // bb
7997      return this.title;
7998    }
7999
8000    public boolean hasTitleElement() { 
8001      return this.title != null && !this.title.isEmpty();
8002    }
8003
8004    public boolean hasTitle() { 
8005      return this.title != null && !this.title.isEmpty();
8006    }
8007
8008    /**
8009     * @param value {@link #title} (A short, descriptive, user-friendly title for the capability statement.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
8010     */
8011    public CapabilityStatement setTitleElement(StringType value) { 
8012      this.title = value;
8013      return this;
8014    }
8015
8016    /**
8017     * @return A short, descriptive, user-friendly title for the capability statement.
8018     */
8019    public String getTitle() { 
8020      return this.title == null ? null : this.title.getValue();
8021    }
8022
8023    /**
8024     * @param value A short, descriptive, user-friendly title for the capability statement.
8025     */
8026    public CapabilityStatement setTitle(String value) { 
8027      if (Utilities.noString(value))
8028        this.title = null;
8029      else {
8030        if (this.title == null)
8031          this.title = new StringType();
8032        this.title.setValue(value);
8033      }
8034      return this;
8035    }
8036
8037    /**
8038     * @return {@link #status} (The status of this capability statement. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
8039     */
8040    public Enumeration<PublicationStatus> getStatusElement() { 
8041      if (this.status == null)
8042        if (Configuration.errorOnAutoCreate())
8043          throw new Error("Attempt to auto-create CapabilityStatement.status");
8044        else if (Configuration.doAutoCreate())
8045          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
8046      return this.status;
8047    }
8048
8049    public boolean hasStatusElement() { 
8050      return this.status != null && !this.status.isEmpty();
8051    }
8052
8053    public boolean hasStatus() { 
8054      return this.status != null && !this.status.isEmpty();
8055    }
8056
8057    /**
8058     * @param value {@link #status} (The status of this capability statement. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
8059     */
8060    public CapabilityStatement setStatusElement(Enumeration<PublicationStatus> value) { 
8061      this.status = value;
8062      return this;
8063    }
8064
8065    /**
8066     * @return The status of this capability statement. Enables tracking the life-cycle of the content.
8067     */
8068    public PublicationStatus getStatus() { 
8069      return this.status == null ? null : this.status.getValue();
8070    }
8071
8072    /**
8073     * @param value The status of this capability statement. Enables tracking the life-cycle of the content.
8074     */
8075    public CapabilityStatement setStatus(PublicationStatus value) { 
8076        if (this.status == null)
8077          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
8078        this.status.setValue(value);
8079      return this;
8080    }
8081
8082    /**
8083     * @return {@link #experimental} (A boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
8084     */
8085    public BooleanType getExperimentalElement() { 
8086      if (this.experimental == null)
8087        if (Configuration.errorOnAutoCreate())
8088          throw new Error("Attempt to auto-create CapabilityStatement.experimental");
8089        else if (Configuration.doAutoCreate())
8090          this.experimental = new BooleanType(); // bb
8091      return this.experimental;
8092    }
8093
8094    public boolean hasExperimentalElement() { 
8095      return this.experimental != null && !this.experimental.isEmpty();
8096    }
8097
8098    public boolean hasExperimental() { 
8099      return this.experimental != null && !this.experimental.isEmpty();
8100    }
8101
8102    /**
8103     * @param value {@link #experimental} (A boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
8104     */
8105    public CapabilityStatement setExperimentalElement(BooleanType value) { 
8106      this.experimental = value;
8107      return this;
8108    }
8109
8110    /**
8111     * @return A boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
8112     */
8113    public boolean getExperimental() { 
8114      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
8115    }
8116
8117    /**
8118     * @param value A boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
8119     */
8120    public CapabilityStatement setExperimental(boolean value) { 
8121        if (this.experimental == null)
8122          this.experimental = new BooleanType();
8123        this.experimental.setValue(value);
8124      return this;
8125    }
8126
8127    /**
8128     * @return {@link #date} (The date  (and optionally time) when the capability statement was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
8129     */
8130    public DateTimeType getDateElement() { 
8131      if (this.date == null)
8132        if (Configuration.errorOnAutoCreate())
8133          throw new Error("Attempt to auto-create CapabilityStatement.date");
8134        else if (Configuration.doAutoCreate())
8135          this.date = new DateTimeType(); // bb
8136      return this.date;
8137    }
8138
8139    public boolean hasDateElement() { 
8140      return this.date != null && !this.date.isEmpty();
8141    }
8142
8143    public boolean hasDate() { 
8144      return this.date != null && !this.date.isEmpty();
8145    }
8146
8147    /**
8148     * @param value {@link #date} (The date  (and optionally time) when the capability statement was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
8149     */
8150    public CapabilityStatement setDateElement(DateTimeType value) { 
8151      this.date = value;
8152      return this;
8153    }
8154
8155    /**
8156     * @return The date  (and optionally time) when the capability statement was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.
8157     */
8158    public Date getDate() { 
8159      return this.date == null ? null : this.date.getValue();
8160    }
8161
8162    /**
8163     * @param value The date  (and optionally time) when the capability statement was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.
8164     */
8165    public CapabilityStatement setDate(Date value) { 
8166        if (this.date == null)
8167          this.date = new DateTimeType();
8168        this.date.setValue(value);
8169      return this;
8170    }
8171
8172    /**
8173     * @return {@link #publisher} (The name of the individual or organization that published the capability statement.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
8174     */
8175    public StringType getPublisherElement() { 
8176      if (this.publisher == null)
8177        if (Configuration.errorOnAutoCreate())
8178          throw new Error("Attempt to auto-create CapabilityStatement.publisher");
8179        else if (Configuration.doAutoCreate())
8180          this.publisher = new StringType(); // bb
8181      return this.publisher;
8182    }
8183
8184    public boolean hasPublisherElement() { 
8185      return this.publisher != null && !this.publisher.isEmpty();
8186    }
8187
8188    public boolean hasPublisher() { 
8189      return this.publisher != null && !this.publisher.isEmpty();
8190    }
8191
8192    /**
8193     * @param value {@link #publisher} (The name of the individual or organization that published the capability statement.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
8194     */
8195    public CapabilityStatement setPublisherElement(StringType value) { 
8196      this.publisher = value;
8197      return this;
8198    }
8199
8200    /**
8201     * @return The name of the individual or organization that published the capability statement.
8202     */
8203    public String getPublisher() { 
8204      return this.publisher == null ? null : this.publisher.getValue();
8205    }
8206
8207    /**
8208     * @param value The name of the individual or organization that published the capability statement.
8209     */
8210    public CapabilityStatement setPublisher(String value) { 
8211      if (Utilities.noString(value))
8212        this.publisher = null;
8213      else {
8214        if (this.publisher == null)
8215          this.publisher = new StringType();
8216        this.publisher.setValue(value);
8217      }
8218      return this;
8219    }
8220
8221    /**
8222     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
8223     */
8224    public List<ContactDetail> getContact() { 
8225      if (this.contact == null)
8226        this.contact = new ArrayList<ContactDetail>();
8227      return this.contact;
8228    }
8229
8230    /**
8231     * @return Returns a reference to <code>this</code> for easy method chaining
8232     */
8233    public CapabilityStatement setContact(List<ContactDetail> theContact) { 
8234      this.contact = theContact;
8235      return this;
8236    }
8237
8238    public boolean hasContact() { 
8239      if (this.contact == null)
8240        return false;
8241      for (ContactDetail item : this.contact)
8242        if (!item.isEmpty())
8243          return true;
8244      return false;
8245    }
8246
8247    public ContactDetail addContact() { //3
8248      ContactDetail t = new ContactDetail();
8249      if (this.contact == null)
8250        this.contact = new ArrayList<ContactDetail>();
8251      this.contact.add(t);
8252      return t;
8253    }
8254
8255    public CapabilityStatement addContact(ContactDetail t) { //3
8256      if (t == null)
8257        return this;
8258      if (this.contact == null)
8259        this.contact = new ArrayList<ContactDetail>();
8260      this.contact.add(t);
8261      return this;
8262    }
8263
8264    /**
8265     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
8266     */
8267    public ContactDetail getContactFirstRep() { 
8268      if (getContact().isEmpty()) {
8269        addContact();
8270      }
8271      return getContact().get(0);
8272    }
8273
8274    /**
8275     * @return {@link #description} (A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
8276     */
8277    public MarkdownType getDescriptionElement() { 
8278      if (this.description == null)
8279        if (Configuration.errorOnAutoCreate())
8280          throw new Error("Attempt to auto-create CapabilityStatement.description");
8281        else if (Configuration.doAutoCreate())
8282          this.description = new MarkdownType(); // bb
8283      return this.description;
8284    }
8285
8286    public boolean hasDescriptionElement() { 
8287      return this.description != null && !this.description.isEmpty();
8288    }
8289
8290    public boolean hasDescription() { 
8291      return this.description != null && !this.description.isEmpty();
8292    }
8293
8294    /**
8295     * @param value {@link #description} (A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
8296     */
8297    public CapabilityStatement setDescriptionElement(MarkdownType value) { 
8298      this.description = value;
8299      return this;
8300    }
8301
8302    /**
8303     * @return A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.
8304     */
8305    public String getDescription() { 
8306      return this.description == null ? null : this.description.getValue();
8307    }
8308
8309    /**
8310     * @param value A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.
8311     */
8312    public CapabilityStatement setDescription(String value) { 
8313      if (value == null)
8314        this.description = null;
8315      else {
8316        if (this.description == null)
8317          this.description = new MarkdownType();
8318        this.description.setValue(value);
8319      }
8320      return this;
8321    }
8322
8323    /**
8324     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate capability statement instances.)
8325     */
8326    public List<UsageContext> getUseContext() { 
8327      if (this.useContext == null)
8328        this.useContext = new ArrayList<UsageContext>();
8329      return this.useContext;
8330    }
8331
8332    /**
8333     * @return Returns a reference to <code>this</code> for easy method chaining
8334     */
8335    public CapabilityStatement setUseContext(List<UsageContext> theUseContext) { 
8336      this.useContext = theUseContext;
8337      return this;
8338    }
8339
8340    public boolean hasUseContext() { 
8341      if (this.useContext == null)
8342        return false;
8343      for (UsageContext item : this.useContext)
8344        if (!item.isEmpty())
8345          return true;
8346      return false;
8347    }
8348
8349    public UsageContext addUseContext() { //3
8350      UsageContext t = new UsageContext();
8351      if (this.useContext == null)
8352        this.useContext = new ArrayList<UsageContext>();
8353      this.useContext.add(t);
8354      return t;
8355    }
8356
8357    public CapabilityStatement addUseContext(UsageContext t) { //3
8358      if (t == null)
8359        return this;
8360      if (this.useContext == null)
8361        this.useContext = new ArrayList<UsageContext>();
8362      this.useContext.add(t);
8363      return this;
8364    }
8365
8366    /**
8367     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
8368     */
8369    public UsageContext getUseContextFirstRep() { 
8370      if (getUseContext().isEmpty()) {
8371        addUseContext();
8372      }
8373      return getUseContext().get(0);
8374    }
8375
8376    /**
8377     * @return {@link #jurisdiction} (A legal or geographic region in which the capability statement is intended to be used.)
8378     */
8379    public List<CodeableConcept> getJurisdiction() { 
8380      if (this.jurisdiction == null)
8381        this.jurisdiction = new ArrayList<CodeableConcept>();
8382      return this.jurisdiction;
8383    }
8384
8385    /**
8386     * @return Returns a reference to <code>this</code> for easy method chaining
8387     */
8388    public CapabilityStatement setJurisdiction(List<CodeableConcept> theJurisdiction) { 
8389      this.jurisdiction = theJurisdiction;
8390      return this;
8391    }
8392
8393    public boolean hasJurisdiction() { 
8394      if (this.jurisdiction == null)
8395        return false;
8396      for (CodeableConcept item : this.jurisdiction)
8397        if (!item.isEmpty())
8398          return true;
8399      return false;
8400    }
8401
8402    public CodeableConcept addJurisdiction() { //3
8403      CodeableConcept t = new CodeableConcept();
8404      if (this.jurisdiction == null)
8405        this.jurisdiction = new ArrayList<CodeableConcept>();
8406      this.jurisdiction.add(t);
8407      return t;
8408    }
8409
8410    public CapabilityStatement addJurisdiction(CodeableConcept t) { //3
8411      if (t == null)
8412        return this;
8413      if (this.jurisdiction == null)
8414        this.jurisdiction = new ArrayList<CodeableConcept>();
8415      this.jurisdiction.add(t);
8416      return this;
8417    }
8418
8419    /**
8420     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
8421     */
8422    public CodeableConcept getJurisdictionFirstRep() { 
8423      if (getJurisdiction().isEmpty()) {
8424        addJurisdiction();
8425      }
8426      return getJurisdiction().get(0);
8427    }
8428
8429    /**
8430     * @return {@link #purpose} (Explaination of why this capability statement is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
8431     */
8432    public MarkdownType getPurposeElement() { 
8433      if (this.purpose == null)
8434        if (Configuration.errorOnAutoCreate())
8435          throw new Error("Attempt to auto-create CapabilityStatement.purpose");
8436        else if (Configuration.doAutoCreate())
8437          this.purpose = new MarkdownType(); // bb
8438      return this.purpose;
8439    }
8440
8441    public boolean hasPurposeElement() { 
8442      return this.purpose != null && !this.purpose.isEmpty();
8443    }
8444
8445    public boolean hasPurpose() { 
8446      return this.purpose != null && !this.purpose.isEmpty();
8447    }
8448
8449    /**
8450     * @param value {@link #purpose} (Explaination of why this capability statement is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
8451     */
8452    public CapabilityStatement setPurposeElement(MarkdownType value) { 
8453      this.purpose = value;
8454      return this;
8455    }
8456
8457    /**
8458     * @return Explaination of why this capability statement is needed and why it has been designed as it has.
8459     */
8460    public String getPurpose() { 
8461      return this.purpose == null ? null : this.purpose.getValue();
8462    }
8463
8464    /**
8465     * @param value Explaination of why this capability statement is needed and why it has been designed as it has.
8466     */
8467    public CapabilityStatement setPurpose(String value) { 
8468      if (value == null)
8469        this.purpose = null;
8470      else {
8471        if (this.purpose == null)
8472          this.purpose = new MarkdownType();
8473        this.purpose.setValue(value);
8474      }
8475      return this;
8476    }
8477
8478    /**
8479     * @return {@link #copyright} (A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
8480     */
8481    public MarkdownType getCopyrightElement() { 
8482      if (this.copyright == null)
8483        if (Configuration.errorOnAutoCreate())
8484          throw new Error("Attempt to auto-create CapabilityStatement.copyright");
8485        else if (Configuration.doAutoCreate())
8486          this.copyright = new MarkdownType(); // bb
8487      return this.copyright;
8488    }
8489
8490    public boolean hasCopyrightElement() { 
8491      return this.copyright != null && !this.copyright.isEmpty();
8492    }
8493
8494    public boolean hasCopyright() { 
8495      return this.copyright != null && !this.copyright.isEmpty();
8496    }
8497
8498    /**
8499     * @param value {@link #copyright} (A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
8500     */
8501    public CapabilityStatement setCopyrightElement(MarkdownType value) { 
8502      this.copyright = value;
8503      return this;
8504    }
8505
8506    /**
8507     * @return A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.
8508     */
8509    public String getCopyright() { 
8510      return this.copyright == null ? null : this.copyright.getValue();
8511    }
8512
8513    /**
8514     * @param value A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.
8515     */
8516    public CapabilityStatement setCopyright(String value) { 
8517      if (value == null)
8518        this.copyright = null;
8519      else {
8520        if (this.copyright == null)
8521          this.copyright = new MarkdownType();
8522        this.copyright.setValue(value);
8523      }
8524      return this;
8525    }
8526
8527    /**
8528     * @return {@link #kind} (The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
8529     */
8530    public Enumeration<CapabilityStatementKind> getKindElement() { 
8531      if (this.kind == null)
8532        if (Configuration.errorOnAutoCreate())
8533          throw new Error("Attempt to auto-create CapabilityStatement.kind");
8534        else if (Configuration.doAutoCreate())
8535          this.kind = new Enumeration<CapabilityStatementKind>(new CapabilityStatementKindEnumFactory()); // bb
8536      return this.kind;
8537    }
8538
8539    public boolean hasKindElement() { 
8540      return this.kind != null && !this.kind.isEmpty();
8541    }
8542
8543    public boolean hasKind() { 
8544      return this.kind != null && !this.kind.isEmpty();
8545    }
8546
8547    /**
8548     * @param value {@link #kind} (The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
8549     */
8550    public CapabilityStatement setKindElement(Enumeration<CapabilityStatementKind> value) { 
8551      this.kind = value;
8552      return this;
8553    }
8554
8555    /**
8556     * @return The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).
8557     */
8558    public CapabilityStatementKind getKind() { 
8559      return this.kind == null ? null : this.kind.getValue();
8560    }
8561
8562    /**
8563     * @param value The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).
8564     */
8565    public CapabilityStatement setKind(CapabilityStatementKind value) { 
8566        if (this.kind == null)
8567          this.kind = new Enumeration<CapabilityStatementKind>(new CapabilityStatementKindEnumFactory());
8568        this.kind.setValue(value);
8569      return this;
8570    }
8571
8572    /**
8573     * @return {@link #instantiates} (Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.)
8574     */
8575    public List<UriType> getInstantiates() { 
8576      if (this.instantiates == null)
8577        this.instantiates = new ArrayList<UriType>();
8578      return this.instantiates;
8579    }
8580
8581    /**
8582     * @return Returns a reference to <code>this</code> for easy method chaining
8583     */
8584    public CapabilityStatement setInstantiates(List<UriType> theInstantiates) { 
8585      this.instantiates = theInstantiates;
8586      return this;
8587    }
8588
8589    public boolean hasInstantiates() { 
8590      if (this.instantiates == null)
8591        return false;
8592      for (UriType item : this.instantiates)
8593        if (!item.isEmpty())
8594          return true;
8595      return false;
8596    }
8597
8598    /**
8599     * @return {@link #instantiates} (Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.)
8600     */
8601    public UriType addInstantiatesElement() {//2 
8602      UriType t = new UriType();
8603      if (this.instantiates == null)
8604        this.instantiates = new ArrayList<UriType>();
8605      this.instantiates.add(t);
8606      return t;
8607    }
8608
8609    /**
8610     * @param value {@link #instantiates} (Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.)
8611     */
8612    public CapabilityStatement addInstantiates(String value) { //1
8613      UriType t = new UriType();
8614      t.setValue(value);
8615      if (this.instantiates == null)
8616        this.instantiates = new ArrayList<UriType>();
8617      this.instantiates.add(t);
8618      return this;
8619    }
8620
8621    /**
8622     * @param value {@link #instantiates} (Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.)
8623     */
8624    public boolean hasInstantiates(String value) { 
8625      if (this.instantiates == null)
8626        return false;
8627      for (UriType v : this.instantiates)
8628        if (v.getValue().equals(value)) // uri
8629          return true;
8630      return false;
8631    }
8632
8633    /**
8634     * @return {@link #software} (Software that is covered by this capability statement.  It is used when the capability statement describes the capabilities of a particular software version, independent of an installation.)
8635     */
8636    public CapabilityStatementSoftwareComponent getSoftware() { 
8637      if (this.software == null)
8638        if (Configuration.errorOnAutoCreate())
8639          throw new Error("Attempt to auto-create CapabilityStatement.software");
8640        else if (Configuration.doAutoCreate())
8641          this.software = new CapabilityStatementSoftwareComponent(); // cc
8642      return this.software;
8643    }
8644
8645    public boolean hasSoftware() { 
8646      return this.software != null && !this.software.isEmpty();
8647    }
8648
8649    /**
8650     * @param value {@link #software} (Software that is covered by this capability statement.  It is used when the capability statement describes the capabilities of a particular software version, independent of an installation.)
8651     */
8652    public CapabilityStatement setSoftware(CapabilityStatementSoftwareComponent value)  { 
8653      this.software = value;
8654      return this;
8655    }
8656
8657    /**
8658     * @return {@link #implementation} (Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program.)
8659     */
8660    public CapabilityStatementImplementationComponent getImplementation() { 
8661      if (this.implementation == null)
8662        if (Configuration.errorOnAutoCreate())
8663          throw new Error("Attempt to auto-create CapabilityStatement.implementation");
8664        else if (Configuration.doAutoCreate())
8665          this.implementation = new CapabilityStatementImplementationComponent(); // cc
8666      return this.implementation;
8667    }
8668
8669    public boolean hasImplementation() { 
8670      return this.implementation != null && !this.implementation.isEmpty();
8671    }
8672
8673    /**
8674     * @param value {@link #implementation} (Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program.)
8675     */
8676    public CapabilityStatement setImplementation(CapabilityStatementImplementationComponent value)  { 
8677      this.implementation = value;
8678      return this;
8679    }
8680
8681    /**
8682     * @return {@link #fhirVersion} (The version of the FHIR specification on which this capability statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value
8683     */
8684    public IdType getFhirVersionElement() { 
8685      if (this.fhirVersion == null)
8686        if (Configuration.errorOnAutoCreate())
8687          throw new Error("Attempt to auto-create CapabilityStatement.fhirVersion");
8688        else if (Configuration.doAutoCreate())
8689          this.fhirVersion = new IdType(); // bb
8690      return this.fhirVersion;
8691    }
8692
8693    public boolean hasFhirVersionElement() { 
8694      return this.fhirVersion != null && !this.fhirVersion.isEmpty();
8695    }
8696
8697    public boolean hasFhirVersion() { 
8698      return this.fhirVersion != null && !this.fhirVersion.isEmpty();
8699    }
8700
8701    /**
8702     * @param value {@link #fhirVersion} (The version of the FHIR specification on which this capability statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value
8703     */
8704    public CapabilityStatement setFhirVersionElement(IdType value) { 
8705      this.fhirVersion = value;
8706      return this;
8707    }
8708
8709    /**
8710     * @return The version of the FHIR specification on which this capability statement is based.
8711     */
8712    public String getFhirVersion() { 
8713      return this.fhirVersion == null ? null : this.fhirVersion.getValue();
8714    }
8715
8716    /**
8717     * @param value The version of the FHIR specification on which this capability statement is based.
8718     */
8719    public CapabilityStatement setFhirVersion(String value) { 
8720        if (this.fhirVersion == null)
8721          this.fhirVersion = new IdType();
8722        this.fhirVersion.setValue(value);
8723      return this;
8724    }
8725
8726    /**
8727     * @return {@link #acceptUnknown} (A code that indicates whether the application accepts unknown elements or extensions when reading resources.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value
8728     */
8729    public Enumeration<UnknownContentCode> getAcceptUnknownElement() { 
8730      if (this.acceptUnknown == null)
8731        if (Configuration.errorOnAutoCreate())
8732          throw new Error("Attempt to auto-create CapabilityStatement.acceptUnknown");
8733        else if (Configuration.doAutoCreate())
8734          this.acceptUnknown = new Enumeration<UnknownContentCode>(new UnknownContentCodeEnumFactory()); // bb
8735      return this.acceptUnknown;
8736    }
8737
8738    public boolean hasAcceptUnknownElement() { 
8739      return this.acceptUnknown != null && !this.acceptUnknown.isEmpty();
8740    }
8741
8742    public boolean hasAcceptUnknown() { 
8743      return this.acceptUnknown != null && !this.acceptUnknown.isEmpty();
8744    }
8745
8746    /**
8747     * @param value {@link #acceptUnknown} (A code that indicates whether the application accepts unknown elements or extensions when reading resources.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value
8748     */
8749    public CapabilityStatement setAcceptUnknownElement(Enumeration<UnknownContentCode> value) { 
8750      this.acceptUnknown = value;
8751      return this;
8752    }
8753
8754    /**
8755     * @return A code that indicates whether the application accepts unknown elements or extensions when reading resources.
8756     */
8757    public UnknownContentCode getAcceptUnknown() { 
8758      return this.acceptUnknown == null ? null : this.acceptUnknown.getValue();
8759    }
8760
8761    /**
8762     * @param value A code that indicates whether the application accepts unknown elements or extensions when reading resources.
8763     */
8764    public CapabilityStatement setAcceptUnknown(UnknownContentCode value) { 
8765        if (this.acceptUnknown == null)
8766          this.acceptUnknown = new Enumeration<UnknownContentCode>(new UnknownContentCodeEnumFactory());
8767        this.acceptUnknown.setValue(value);
8768      return this;
8769    }
8770
8771    /**
8772     * @return {@link #format} (A list of the formats supported by this implementation using their content types.)
8773     */
8774    public List<CodeType> getFormat() { 
8775      if (this.format == null)
8776        this.format = new ArrayList<CodeType>();
8777      return this.format;
8778    }
8779
8780    /**
8781     * @return Returns a reference to <code>this</code> for easy method chaining
8782     */
8783    public CapabilityStatement setFormat(List<CodeType> theFormat) { 
8784      this.format = theFormat;
8785      return this;
8786    }
8787
8788    public boolean hasFormat() { 
8789      if (this.format == null)
8790        return false;
8791      for (CodeType item : this.format)
8792        if (!item.isEmpty())
8793          return true;
8794      return false;
8795    }
8796
8797    /**
8798     * @return {@link #format} (A list of the formats supported by this implementation using their content types.)
8799     */
8800    public CodeType addFormatElement() {//2 
8801      CodeType t = new CodeType();
8802      if (this.format == null)
8803        this.format = new ArrayList<CodeType>();
8804      this.format.add(t);
8805      return t;
8806    }
8807
8808    /**
8809     * @param value {@link #format} (A list of the formats supported by this implementation using their content types.)
8810     */
8811    public CapabilityStatement addFormat(String value) { //1
8812      CodeType t = new CodeType();
8813      t.setValue(value);
8814      if (this.format == null)
8815        this.format = new ArrayList<CodeType>();
8816      this.format.add(t);
8817      return this;
8818    }
8819
8820    /**
8821     * @param value {@link #format} (A list of the formats supported by this implementation using their content types.)
8822     */
8823    public boolean hasFormat(String value) { 
8824      if (this.format == null)
8825        return false;
8826      for (CodeType v : this.format)
8827        if (v.getValue().equals(value)) // code
8828          return true;
8829      return false;
8830    }
8831
8832    /**
8833     * @return {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.)
8834     */
8835    public List<CodeType> getPatchFormat() { 
8836      if (this.patchFormat == null)
8837        this.patchFormat = new ArrayList<CodeType>();
8838      return this.patchFormat;
8839    }
8840
8841    /**
8842     * @return Returns a reference to <code>this</code> for easy method chaining
8843     */
8844    public CapabilityStatement setPatchFormat(List<CodeType> thePatchFormat) { 
8845      this.patchFormat = thePatchFormat;
8846      return this;
8847    }
8848
8849    public boolean hasPatchFormat() { 
8850      if (this.patchFormat == null)
8851        return false;
8852      for (CodeType item : this.patchFormat)
8853        if (!item.isEmpty())
8854          return true;
8855      return false;
8856    }
8857
8858    /**
8859     * @return {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.)
8860     */
8861    public CodeType addPatchFormatElement() {//2 
8862      CodeType t = new CodeType();
8863      if (this.patchFormat == null)
8864        this.patchFormat = new ArrayList<CodeType>();
8865      this.patchFormat.add(t);
8866      return t;
8867    }
8868
8869    /**
8870     * @param value {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.)
8871     */
8872    public CapabilityStatement addPatchFormat(String value) { //1
8873      CodeType t = new CodeType();
8874      t.setValue(value);
8875      if (this.patchFormat == null)
8876        this.patchFormat = new ArrayList<CodeType>();
8877      this.patchFormat.add(t);
8878      return this;
8879    }
8880
8881    /**
8882     * @param value {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.)
8883     */
8884    public boolean hasPatchFormat(String value) { 
8885      if (this.patchFormat == null)
8886        return false;
8887      for (CodeType v : this.patchFormat)
8888        if (v.getValue().equals(value)) // code
8889          return true;
8890      return false;
8891    }
8892
8893    /**
8894     * @return {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.)
8895     */
8896    public List<UriType> getImplementationGuide() { 
8897      if (this.implementationGuide == null)
8898        this.implementationGuide = new ArrayList<UriType>();
8899      return this.implementationGuide;
8900    }
8901
8902    /**
8903     * @return Returns a reference to <code>this</code> for easy method chaining
8904     */
8905    public CapabilityStatement setImplementationGuide(List<UriType> theImplementationGuide) { 
8906      this.implementationGuide = theImplementationGuide;
8907      return this;
8908    }
8909
8910    public boolean hasImplementationGuide() { 
8911      if (this.implementationGuide == null)
8912        return false;
8913      for (UriType item : this.implementationGuide)
8914        if (!item.isEmpty())
8915          return true;
8916      return false;
8917    }
8918
8919    /**
8920     * @return {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.)
8921     */
8922    public UriType addImplementationGuideElement() {//2 
8923      UriType t = new UriType();
8924      if (this.implementationGuide == null)
8925        this.implementationGuide = new ArrayList<UriType>();
8926      this.implementationGuide.add(t);
8927      return t;
8928    }
8929
8930    /**
8931     * @param value {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.)
8932     */
8933    public CapabilityStatement addImplementationGuide(String value) { //1
8934      UriType t = new UriType();
8935      t.setValue(value);
8936      if (this.implementationGuide == null)
8937        this.implementationGuide = new ArrayList<UriType>();
8938      this.implementationGuide.add(t);
8939      return this;
8940    }
8941
8942    /**
8943     * @param value {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.)
8944     */
8945    public boolean hasImplementationGuide(String value) { 
8946      if (this.implementationGuide == null)
8947        return false;
8948      for (UriType v : this.implementationGuide)
8949        if (v.getValue().equals(value)) // uri
8950          return true;
8951      return false;
8952    }
8953
8954    /**
8955     * @return {@link #profile} (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).)
8956     */
8957    public List<Reference> getProfile() { 
8958      if (this.profile == null)
8959        this.profile = new ArrayList<Reference>();
8960      return this.profile;
8961    }
8962
8963    /**
8964     * @return Returns a reference to <code>this</code> for easy method chaining
8965     */
8966    public CapabilityStatement setProfile(List<Reference> theProfile) { 
8967      this.profile = theProfile;
8968      return this;
8969    }
8970
8971    public boolean hasProfile() { 
8972      if (this.profile == null)
8973        return false;
8974      for (Reference item : this.profile)
8975        if (!item.isEmpty())
8976          return true;
8977      return false;
8978    }
8979
8980    public Reference addProfile() { //3
8981      Reference t = new Reference();
8982      if (this.profile == null)
8983        this.profile = new ArrayList<Reference>();
8984      this.profile.add(t);
8985      return t;
8986    }
8987
8988    public CapabilityStatement addProfile(Reference t) { //3
8989      if (t == null)
8990        return this;
8991      if (this.profile == null)
8992        this.profile = new ArrayList<Reference>();
8993      this.profile.add(t);
8994      return this;
8995    }
8996
8997    /**
8998     * @return The first repetition of repeating field {@link #profile}, creating it if it does not already exist
8999     */
9000    public Reference getProfileFirstRep() { 
9001      if (getProfile().isEmpty()) {
9002        addProfile();
9003      }
9004      return getProfile().get(0);
9005    }
9006
9007    /**
9008     * @deprecated Use Reference#setResource(IBaseResource) instead
9009     */
9010    @Deprecated
9011    public List<StructureDefinition> getProfileTarget() { 
9012      if (this.profileTarget == null)
9013        this.profileTarget = new ArrayList<StructureDefinition>();
9014      return this.profileTarget;
9015    }
9016
9017    /**
9018     * @deprecated Use Reference#setResource(IBaseResource) instead
9019     */
9020    @Deprecated
9021    public StructureDefinition addProfileTarget() { 
9022      StructureDefinition r = new StructureDefinition();
9023      if (this.profileTarget == null)
9024        this.profileTarget = new ArrayList<StructureDefinition>();
9025      this.profileTarget.add(r);
9026      return r;
9027    }
9028
9029    /**
9030     * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.)
9031     */
9032    public List<CapabilityStatementRestComponent> getRest() { 
9033      if (this.rest == null)
9034        this.rest = new ArrayList<CapabilityStatementRestComponent>();
9035      return this.rest;
9036    }
9037
9038    /**
9039     * @return Returns a reference to <code>this</code> for easy method chaining
9040     */
9041    public CapabilityStatement setRest(List<CapabilityStatementRestComponent> theRest) { 
9042      this.rest = theRest;
9043      return this;
9044    }
9045
9046    public boolean hasRest() { 
9047      if (this.rest == null)
9048        return false;
9049      for (CapabilityStatementRestComponent item : this.rest)
9050        if (!item.isEmpty())
9051          return true;
9052      return false;
9053    }
9054
9055    public CapabilityStatementRestComponent addRest() { //3
9056      CapabilityStatementRestComponent t = new CapabilityStatementRestComponent();
9057      if (this.rest == null)
9058        this.rest = new ArrayList<CapabilityStatementRestComponent>();
9059      this.rest.add(t);
9060      return t;
9061    }
9062
9063    public CapabilityStatement addRest(CapabilityStatementRestComponent t) { //3
9064      if (t == null)
9065        return this;
9066      if (this.rest == null)
9067        this.rest = new ArrayList<CapabilityStatementRestComponent>();
9068      this.rest.add(t);
9069      return this;
9070    }
9071
9072    /**
9073     * @return The first repetition of repeating field {@link #rest}, creating it if it does not already exist
9074     */
9075    public CapabilityStatementRestComponent getRestFirstRep() { 
9076      if (getRest().isEmpty()) {
9077        addRest();
9078      }
9079      return getRest().get(0);
9080    }
9081
9082    /**
9083     * @return {@link #messaging} (A description of the messaging capabilities of the solution.)
9084     */
9085    public List<CapabilityStatementMessagingComponent> getMessaging() { 
9086      if (this.messaging == null)
9087        this.messaging = new ArrayList<CapabilityStatementMessagingComponent>();
9088      return this.messaging;
9089    }
9090
9091    /**
9092     * @return Returns a reference to <code>this</code> for easy method chaining
9093     */
9094    public CapabilityStatement setMessaging(List<CapabilityStatementMessagingComponent> theMessaging) { 
9095      this.messaging = theMessaging;
9096      return this;
9097    }
9098
9099    public boolean hasMessaging() { 
9100      if (this.messaging == null)
9101        return false;
9102      for (CapabilityStatementMessagingComponent item : this.messaging)
9103        if (!item.isEmpty())
9104          return true;
9105      return false;
9106    }
9107
9108    public CapabilityStatementMessagingComponent addMessaging() { //3
9109      CapabilityStatementMessagingComponent t = new CapabilityStatementMessagingComponent();
9110      if (this.messaging == null)
9111        this.messaging = new ArrayList<CapabilityStatementMessagingComponent>();
9112      this.messaging.add(t);
9113      return t;
9114    }
9115
9116    public CapabilityStatement addMessaging(CapabilityStatementMessagingComponent t) { //3
9117      if (t == null)
9118        return this;
9119      if (this.messaging == null)
9120        this.messaging = new ArrayList<CapabilityStatementMessagingComponent>();
9121      this.messaging.add(t);
9122      return this;
9123    }
9124
9125    /**
9126     * @return The first repetition of repeating field {@link #messaging}, creating it if it does not already exist
9127     */
9128    public CapabilityStatementMessagingComponent getMessagingFirstRep() { 
9129      if (getMessaging().isEmpty()) {
9130        addMessaging();
9131      }
9132      return getMessaging().get(0);
9133    }
9134
9135    /**
9136     * @return {@link #document} (A document definition.)
9137     */
9138    public List<CapabilityStatementDocumentComponent> getDocument() { 
9139      if (this.document == null)
9140        this.document = new ArrayList<CapabilityStatementDocumentComponent>();
9141      return this.document;
9142    }
9143
9144    /**
9145     * @return Returns a reference to <code>this</code> for easy method chaining
9146     */
9147    public CapabilityStatement setDocument(List<CapabilityStatementDocumentComponent> theDocument) { 
9148      this.document = theDocument;
9149      return this;
9150    }
9151
9152    public boolean hasDocument() { 
9153      if (this.document == null)
9154        return false;
9155      for (CapabilityStatementDocumentComponent item : this.document)
9156        if (!item.isEmpty())
9157          return true;
9158      return false;
9159    }
9160
9161    public CapabilityStatementDocumentComponent addDocument() { //3
9162      CapabilityStatementDocumentComponent t = new CapabilityStatementDocumentComponent();
9163      if (this.document == null)
9164        this.document = new ArrayList<CapabilityStatementDocumentComponent>();
9165      this.document.add(t);
9166      return t;
9167    }
9168
9169    public CapabilityStatement addDocument(CapabilityStatementDocumentComponent t) { //3
9170      if (t == null)
9171        return this;
9172      if (this.document == null)
9173        this.document = new ArrayList<CapabilityStatementDocumentComponent>();
9174      this.document.add(t);
9175      return this;
9176    }
9177
9178    /**
9179     * @return The first repetition of repeating field {@link #document}, creating it if it does not already exist
9180     */
9181    public CapabilityStatementDocumentComponent getDocumentFirstRep() { 
9182      if (getDocument().isEmpty()) {
9183        addDocument();
9184      }
9185      return getDocument().get(0);
9186    }
9187
9188      protected void listChildren(List<Property> children) {
9189        super.listChildren(children);
9190        children.add(new Property("url", "uri", "An absolute URI that is used to identify this capability statement 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 capability statement is (or will be) published. The URL SHOULD include the major version of the capability statement. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url));
9191        children.add(new Property("version", "string", "The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version));
9192        children.add(new Property("name", "string", "A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
9193        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the capability statement.", 0, 1, title));
9194        children.add(new Property("status", "code", "The status of this capability statement. Enables tracking the life-cycle of the content.", 0, 1, status));
9195        children.add(new Property("experimental", "boolean", "A boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental));
9196        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the capability statement was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.", 0, 1, date));
9197        children.add(new Property("publisher", "string", "The name of the individual or organization that published the capability statement.", 0, 1, publisher));
9198        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
9199        children.add(new Property("description", "markdown", "A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.", 0, 1, description));
9200        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate capability statement instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
9201        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the capability statement is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
9202        children.add(new Property("purpose", "markdown", "Explaination of why this capability statement is needed and why it has been designed as it has.", 0, 1, purpose));
9203        children.add(new Property("copyright", "markdown", "A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.", 0, 1, copyright));
9204        children.add(new Property("kind", "code", "The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).", 0, 1, kind));
9205        children.add(new Property("instantiates", "uri", "Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.", 0, java.lang.Integer.MAX_VALUE, instantiates));
9206        children.add(new Property("software", "", "Software that is covered by this capability statement.  It is used when the capability statement describes the capabilities of a particular software version, independent of an installation.", 0, 1, software));
9207        children.add(new Property("implementation", "", "Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program.", 0, 1, implementation));
9208        children.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this capability statement is based.", 0, 1, fhirVersion));
9209        children.add(new Property("acceptUnknown", "code", "A code that indicates whether the application accepts unknown elements or extensions when reading resources.", 0, 1, acceptUnknown));
9210        children.add(new Property("format", "code", "A list of the formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, format));
9211        children.add(new Property("patchFormat", "code", "A list of the patch formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, patchFormat));
9212        children.add(new Property("implementationGuide", "uri", "A list of implementation guides that the server does (or should) support in their entirety.", 0, java.lang.Integer.MAX_VALUE, implementationGuide));
9213        children.add(new Property("profile", "Reference(StructureDefinition)", "A list of profiles that represent different use cases supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).", 0, java.lang.Integer.MAX_VALUE, profile));
9214        children.add(new Property("rest", "", "A definition of the restful capabilities of the solution, if any.", 0, java.lang.Integer.MAX_VALUE, rest));
9215        children.add(new Property("messaging", "", "A description of the messaging capabilities of the solution.", 0, java.lang.Integer.MAX_VALUE, messaging));
9216        children.add(new Property("document", "", "A document definition.", 0, java.lang.Integer.MAX_VALUE, document));
9217      }
9218
9219      @Override
9220      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
9221        switch (_hash) {
9222        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this capability statement 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 capability statement is (or will be) published. The URL SHOULD include the major version of the capability statement. For more information see [Technical and Business Versions](resource.html#versions).", 0, 1, url);
9223        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version);
9224        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
9225        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the capability statement.", 0, 1, title);
9226        case -892481550: /*status*/  return new Property("status", "code", "The status of this capability statement. Enables tracking the life-cycle of the content.", 0, 1, status);
9227        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, 1, experimental);
9228        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the capability statement was published. The date must change if and when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.", 0, 1, date);
9229        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the individual or organization that published the capability statement.", 0, 1, publisher);
9230        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
9231        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.", 0, 1, description);
9232        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate capability statement instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
9233        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the capability statement is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
9234        case -220463842: /*purpose*/  return new Property("purpose", "markdown", "Explaination of why this capability statement is needed and why it has been designed as it has.", 0, 1, purpose);
9235        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.", 0, 1, copyright);
9236        case 3292052: /*kind*/  return new Property("kind", "code", "The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).", 0, 1, kind);
9237        case -246883639: /*instantiates*/  return new Property("instantiates", "uri", "Reference to a canonical URL of another CapabilityStatement that this software implements or uses. This capability statement is a published API description that corresponds to a business service. The rest of the capability statement does not need to repeat the details of the referenced resource, but can do so.", 0, java.lang.Integer.MAX_VALUE, instantiates);
9238        case 1319330215: /*software*/  return new Property("software", "", "Software that is covered by this capability statement.  It is used when the capability statement describes the capabilities of a particular software version, independent of an installation.", 0, 1, software);
9239        case 1683336114: /*implementation*/  return new Property("implementation", "", "Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program.", 0, 1, implementation);
9240        case 461006061: /*fhirVersion*/  return new Property("fhirVersion", "id", "The version of the FHIR specification on which this capability statement is based.", 0, 1, fhirVersion);
9241        case -1862642142: /*acceptUnknown*/  return new Property("acceptUnknown", "code", "A code that indicates whether the application accepts unknown elements or extensions when reading resources.", 0, 1, acceptUnknown);
9242        case -1268779017: /*format*/  return new Property("format", "code", "A list of the formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, format);
9243        case 172338783: /*patchFormat*/  return new Property("patchFormat", "code", "A list of the patch formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, patchFormat);
9244        case 156966506: /*implementationGuide*/  return new Property("implementationGuide", "uri", "A list of implementation guides that the server does (or should) support in their entirety.", 0, java.lang.Integer.MAX_VALUE, implementationGuide);
9245        case -309425751: /*profile*/  return new Property("profile", "Reference(StructureDefinition)", "A list of profiles that represent different use cases supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).", 0, java.lang.Integer.MAX_VALUE, profile);
9246        case 3496916: /*rest*/  return new Property("rest", "", "A definition of the restful capabilities of the solution, if any.", 0, java.lang.Integer.MAX_VALUE, rest);
9247        case -1440008444: /*messaging*/  return new Property("messaging", "", "A description of the messaging capabilities of the solution.", 0, java.lang.Integer.MAX_VALUE, messaging);
9248        case 861720859: /*document*/  return new Property("document", "", "A document definition.", 0, java.lang.Integer.MAX_VALUE, document);
9249        default: return super.getNamedProperty(_hash, _name, _checkValid);
9250        }
9251
9252      }
9253
9254      @Override
9255      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
9256        switch (hash) {
9257        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
9258        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
9259        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
9260        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
9261        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
9262        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
9263        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
9264        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
9265        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
9266        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
9267        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
9268        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
9269        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
9270        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
9271        case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration<CapabilityStatementKind>
9272        case -246883639: /*instantiates*/ return this.instantiates == null ? new Base[0] : this.instantiates.toArray(new Base[this.instantiates.size()]); // UriType
9273        case 1319330215: /*software*/ return this.software == null ? new Base[0] : new Base[] {this.software}; // CapabilityStatementSoftwareComponent
9274        case 1683336114: /*implementation*/ return this.implementation == null ? new Base[0] : new Base[] {this.implementation}; // CapabilityStatementImplementationComponent
9275        case 461006061: /*fhirVersion*/ return this.fhirVersion == null ? new Base[0] : new Base[] {this.fhirVersion}; // IdType
9276        case -1862642142: /*acceptUnknown*/ return this.acceptUnknown == null ? new Base[0] : new Base[] {this.acceptUnknown}; // Enumeration<UnknownContentCode>
9277        case -1268779017: /*format*/ return this.format == null ? new Base[0] : this.format.toArray(new Base[this.format.size()]); // CodeType
9278        case 172338783: /*patchFormat*/ return this.patchFormat == null ? new Base[0] : this.patchFormat.toArray(new Base[this.patchFormat.size()]); // CodeType
9279        case 156966506: /*implementationGuide*/ return this.implementationGuide == null ? new Base[0] : this.implementationGuide.toArray(new Base[this.implementationGuide.size()]); // UriType
9280        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // Reference
9281        case 3496916: /*rest*/ return this.rest == null ? new Base[0] : this.rest.toArray(new Base[this.rest.size()]); // CapabilityStatementRestComponent
9282        case -1440008444: /*messaging*/ return this.messaging == null ? new Base[0] : this.messaging.toArray(new Base[this.messaging.size()]); // CapabilityStatementMessagingComponent
9283        case 861720859: /*document*/ return this.document == null ? new Base[0] : this.document.toArray(new Base[this.document.size()]); // CapabilityStatementDocumentComponent
9284        default: return super.getProperty(hash, name, checkValid);
9285        }
9286
9287      }
9288
9289      @Override
9290      public Base setProperty(int hash, String name, Base value) throws FHIRException {
9291        switch (hash) {
9292        case 116079: // url
9293          this.url = castToUri(value); // UriType
9294          return value;
9295        case 351608024: // version
9296          this.version = castToString(value); // StringType
9297          return value;
9298        case 3373707: // name
9299          this.name = castToString(value); // StringType
9300          return value;
9301        case 110371416: // title
9302          this.title = castToString(value); // StringType
9303          return value;
9304        case -892481550: // status
9305          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
9306          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
9307          return value;
9308        case -404562712: // experimental
9309          this.experimental = castToBoolean(value); // BooleanType
9310          return value;
9311        case 3076014: // date
9312          this.date = castToDateTime(value); // DateTimeType
9313          return value;
9314        case 1447404028: // publisher
9315          this.publisher = castToString(value); // StringType
9316          return value;
9317        case 951526432: // contact
9318          this.getContact().add(castToContactDetail(value)); // ContactDetail
9319          return value;
9320        case -1724546052: // description
9321          this.description = castToMarkdown(value); // MarkdownType
9322          return value;
9323        case -669707736: // useContext
9324          this.getUseContext().add(castToUsageContext(value)); // UsageContext
9325          return value;
9326        case -507075711: // jurisdiction
9327          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
9328          return value;
9329        case -220463842: // purpose
9330          this.purpose = castToMarkdown(value); // MarkdownType
9331          return value;
9332        case 1522889671: // copyright
9333          this.copyright = castToMarkdown(value); // MarkdownType
9334          return value;
9335        case 3292052: // kind
9336          value = new CapabilityStatementKindEnumFactory().fromType(castToCode(value));
9337          this.kind = (Enumeration) value; // Enumeration<CapabilityStatementKind>
9338          return value;
9339        case -246883639: // instantiates
9340          this.getInstantiates().add(castToUri(value)); // UriType
9341          return value;
9342        case 1319330215: // software
9343          this.software = (CapabilityStatementSoftwareComponent) value; // CapabilityStatementSoftwareComponent
9344          return value;
9345        case 1683336114: // implementation
9346          this.implementation = (CapabilityStatementImplementationComponent) value; // CapabilityStatementImplementationComponent
9347          return value;
9348        case 461006061: // fhirVersion
9349          this.fhirVersion = castToId(value); // IdType
9350          return value;
9351        case -1862642142: // acceptUnknown
9352          value = new UnknownContentCodeEnumFactory().fromType(castToCode(value));
9353          this.acceptUnknown = (Enumeration) value; // Enumeration<UnknownContentCode>
9354          return value;
9355        case -1268779017: // format
9356          this.getFormat().add(castToCode(value)); // CodeType
9357          return value;
9358        case 172338783: // patchFormat
9359          this.getPatchFormat().add(castToCode(value)); // CodeType
9360          return value;
9361        case 156966506: // implementationGuide
9362          this.getImplementationGuide().add(castToUri(value)); // UriType
9363          return value;
9364        case -309425751: // profile
9365          this.getProfile().add(castToReference(value)); // Reference
9366          return value;
9367        case 3496916: // rest
9368          this.getRest().add((CapabilityStatementRestComponent) value); // CapabilityStatementRestComponent
9369          return value;
9370        case -1440008444: // messaging
9371          this.getMessaging().add((CapabilityStatementMessagingComponent) value); // CapabilityStatementMessagingComponent
9372          return value;
9373        case 861720859: // document
9374          this.getDocument().add((CapabilityStatementDocumentComponent) value); // CapabilityStatementDocumentComponent
9375          return value;
9376        default: return super.setProperty(hash, name, value);
9377        }
9378
9379      }
9380
9381      @Override
9382      public Base setProperty(String name, Base value) throws FHIRException {
9383        if (name.equals("url")) {
9384          this.url = castToUri(value); // UriType
9385        } else if (name.equals("version")) {
9386          this.version = castToString(value); // StringType
9387        } else if (name.equals("name")) {
9388          this.name = castToString(value); // StringType
9389        } else if (name.equals("title")) {
9390          this.title = castToString(value); // StringType
9391        } else if (name.equals("status")) {
9392          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
9393          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
9394        } else if (name.equals("experimental")) {
9395          this.experimental = castToBoolean(value); // BooleanType
9396        } else if (name.equals("date")) {
9397          this.date = castToDateTime(value); // DateTimeType
9398        } else if (name.equals("publisher")) {
9399          this.publisher = castToString(value); // StringType
9400        } else if (name.equals("contact")) {
9401          this.getContact().add(castToContactDetail(value));
9402        } else if (name.equals("description")) {
9403          this.description = castToMarkdown(value); // MarkdownType
9404        } else if (name.equals("useContext")) {
9405          this.getUseContext().add(castToUsageContext(value));
9406        } else if (name.equals("jurisdiction")) {
9407          this.getJurisdiction().add(castToCodeableConcept(value));
9408        } else if (name.equals("purpose")) {
9409          this.purpose = castToMarkdown(value); // MarkdownType
9410        } else if (name.equals("copyright")) {
9411          this.copyright = castToMarkdown(value); // MarkdownType
9412        } else if (name.equals("kind")) {
9413          value = new CapabilityStatementKindEnumFactory().fromType(castToCode(value));
9414          this.kind = (Enumeration) value; // Enumeration<CapabilityStatementKind>
9415        } else if (name.equals("instantiates")) {
9416          this.getInstantiates().add(castToUri(value));
9417        } else if (name.equals("software")) {
9418          this.software = (CapabilityStatementSoftwareComponent) value; // CapabilityStatementSoftwareComponent
9419        } else if (name.equals("implementation")) {
9420          this.implementation = (CapabilityStatementImplementationComponent) value; // CapabilityStatementImplementationComponent
9421        } else if (name.equals("fhirVersion")) {
9422          this.fhirVersion = castToId(value); // IdType
9423        } else if (name.equals("acceptUnknown")) {
9424          value = new UnknownContentCodeEnumFactory().fromType(castToCode(value));
9425          this.acceptUnknown = (Enumeration) value; // Enumeration<UnknownContentCode>
9426        } else if (name.equals("format")) {
9427          this.getFormat().add(castToCode(value));
9428        } else if (name.equals("patchFormat")) {
9429          this.getPatchFormat().add(castToCode(value));
9430        } else if (name.equals("implementationGuide")) {
9431          this.getImplementationGuide().add(castToUri(value));
9432        } else if (name.equals("profile")) {
9433          this.getProfile().add(castToReference(value));
9434        } else if (name.equals("rest")) {
9435          this.getRest().add((CapabilityStatementRestComponent) value);
9436        } else if (name.equals("messaging")) {
9437          this.getMessaging().add((CapabilityStatementMessagingComponent) value);
9438        } else if (name.equals("document")) {
9439          this.getDocument().add((CapabilityStatementDocumentComponent) value);
9440        } else
9441          return super.setProperty(name, value);
9442        return value;
9443      }
9444
9445      @Override
9446      public Base makeProperty(int hash, String name) throws FHIRException {
9447        switch (hash) {
9448        case 116079:  return getUrlElement();
9449        case 351608024:  return getVersionElement();
9450        case 3373707:  return getNameElement();
9451        case 110371416:  return getTitleElement();
9452        case -892481550:  return getStatusElement();
9453        case -404562712:  return getExperimentalElement();
9454        case 3076014:  return getDateElement();
9455        case 1447404028:  return getPublisherElement();
9456        case 951526432:  return addContact(); 
9457        case -1724546052:  return getDescriptionElement();
9458        case -669707736:  return addUseContext(); 
9459        case -507075711:  return addJurisdiction(); 
9460        case -220463842:  return getPurposeElement();
9461        case 1522889671:  return getCopyrightElement();
9462        case 3292052:  return getKindElement();
9463        case -246883639:  return addInstantiatesElement();
9464        case 1319330215:  return getSoftware(); 
9465        case 1683336114:  return getImplementation(); 
9466        case 461006061:  return getFhirVersionElement();
9467        case -1862642142:  return getAcceptUnknownElement();
9468        case -1268779017:  return addFormatElement();
9469        case 172338783:  return addPatchFormatElement();
9470        case 156966506:  return addImplementationGuideElement();
9471        case -309425751:  return addProfile(); 
9472        case 3496916:  return addRest(); 
9473        case -1440008444:  return addMessaging(); 
9474        case 861720859:  return addDocument(); 
9475        default: return super.makeProperty(hash, name);
9476        }
9477
9478      }
9479
9480      @Override
9481      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
9482        switch (hash) {
9483        case 116079: /*url*/ return new String[] {"uri"};
9484        case 351608024: /*version*/ return new String[] {"string"};
9485        case 3373707: /*name*/ return new String[] {"string"};
9486        case 110371416: /*title*/ return new String[] {"string"};
9487        case -892481550: /*status*/ return new String[] {"code"};
9488        case -404562712: /*experimental*/ return new String[] {"boolean"};
9489        case 3076014: /*date*/ return new String[] {"dateTime"};
9490        case 1447404028: /*publisher*/ return new String[] {"string"};
9491        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
9492        case -1724546052: /*description*/ return new String[] {"markdown"};
9493        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
9494        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
9495        case -220463842: /*purpose*/ return new String[] {"markdown"};
9496        case 1522889671: /*copyright*/ return new String[] {"markdown"};
9497        case 3292052: /*kind*/ return new String[] {"code"};
9498        case -246883639: /*instantiates*/ return new String[] {"uri"};
9499        case 1319330215: /*software*/ return new String[] {};
9500        case 1683336114: /*implementation*/ return new String[] {};
9501        case 461006061: /*fhirVersion*/ return new String[] {"id"};
9502        case -1862642142: /*acceptUnknown*/ return new String[] {"code"};
9503        case -1268779017: /*format*/ return new String[] {"code"};
9504        case 172338783: /*patchFormat*/ return new String[] {"code"};
9505        case 156966506: /*implementationGuide*/ return new String[] {"uri"};
9506        case -309425751: /*profile*/ return new String[] {"Reference"};
9507        case 3496916: /*rest*/ return new String[] {};
9508        case -1440008444: /*messaging*/ return new String[] {};
9509        case 861720859: /*document*/ return new String[] {};
9510        default: return super.getTypesForProperty(hash, name);
9511        }
9512
9513      }
9514
9515      @Override
9516      public Base addChild(String name) throws FHIRException {
9517        if (name.equals("url")) {
9518          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.url");
9519        }
9520        else if (name.equals("version")) {
9521          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.version");
9522        }
9523        else if (name.equals("name")) {
9524          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.name");
9525        }
9526        else if (name.equals("title")) {
9527          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.title");
9528        }
9529        else if (name.equals("status")) {
9530          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.status");
9531        }
9532        else if (name.equals("experimental")) {
9533          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.experimental");
9534        }
9535        else if (name.equals("date")) {
9536          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.date");
9537        }
9538        else if (name.equals("publisher")) {
9539          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.publisher");
9540        }
9541        else if (name.equals("contact")) {
9542          return addContact();
9543        }
9544        else if (name.equals("description")) {
9545          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.description");
9546        }
9547        else if (name.equals("useContext")) {
9548          return addUseContext();
9549        }
9550        else if (name.equals("jurisdiction")) {
9551          return addJurisdiction();
9552        }
9553        else if (name.equals("purpose")) {
9554          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.purpose");
9555        }
9556        else if (name.equals("copyright")) {
9557          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.copyright");
9558        }
9559        else if (name.equals("kind")) {
9560          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.kind");
9561        }
9562        else if (name.equals("instantiates")) {
9563          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.instantiates");
9564        }
9565        else if (name.equals("software")) {
9566          this.software = new CapabilityStatementSoftwareComponent();
9567          return this.software;
9568        }
9569        else if (name.equals("implementation")) {
9570          this.implementation = new CapabilityStatementImplementationComponent();
9571          return this.implementation;
9572        }
9573        else if (name.equals("fhirVersion")) {
9574          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.fhirVersion");
9575        }
9576        else if (name.equals("acceptUnknown")) {
9577          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.acceptUnknown");
9578        }
9579        else if (name.equals("format")) {
9580          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.format");
9581        }
9582        else if (name.equals("patchFormat")) {
9583          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.patchFormat");
9584        }
9585        else if (name.equals("implementationGuide")) {
9586          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.implementationGuide");
9587        }
9588        else if (name.equals("profile")) {
9589          return addProfile();
9590        }
9591        else if (name.equals("rest")) {
9592          return addRest();
9593        }
9594        else if (name.equals("messaging")) {
9595          return addMessaging();
9596        }
9597        else if (name.equals("document")) {
9598          return addDocument();
9599        }
9600        else
9601          return super.addChild(name);
9602      }
9603
9604  public String fhirType() {
9605    return "CapabilityStatement";
9606
9607  }
9608
9609      public CapabilityStatement copy() {
9610        CapabilityStatement dst = new CapabilityStatement();
9611        copyValues(dst);
9612        dst.url = url == null ? null : url.copy();
9613        dst.version = version == null ? null : version.copy();
9614        dst.name = name == null ? null : name.copy();
9615        dst.title = title == null ? null : title.copy();
9616        dst.status = status == null ? null : status.copy();
9617        dst.experimental = experimental == null ? null : experimental.copy();
9618        dst.date = date == null ? null : date.copy();
9619        dst.publisher = publisher == null ? null : publisher.copy();
9620        if (contact != null) {
9621          dst.contact = new ArrayList<ContactDetail>();
9622          for (ContactDetail i : contact)
9623            dst.contact.add(i.copy());
9624        };
9625        dst.description = description == null ? null : description.copy();
9626        if (useContext != null) {
9627          dst.useContext = new ArrayList<UsageContext>();
9628          for (UsageContext i : useContext)