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