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 Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.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/StructureDefinition/CapabilityStatement")
050@ChildOrder(names={"url", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "kind", "instantiates", "imports", "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 (i.e. using Reference.reference) 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 (i.e. using Reference.identifier).
804         */
805        LOGICAL, 
806        /**
807         * The server will attempt to resolve logical references to literal references - i.e. converting Reference.identifier to Reference.reference (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 (i.e. using Reference.reference) 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 (i.e. using Reference.identifier).";
864            case RESOLVES: return "The server will attempt to resolve logical references to literal references - i.e. converting Reference.identifier to Reference.reference (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        /**
1584         * The organization responsible for the management of the instance and oversight of the data on the server at the specified URL.
1585         */
1586        @Child(name = "custodian", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=true)
1587        @Description(shortDefinition="Organization that manages the data", formalDefinition="The organization responsible for the management of the instance and oversight of the data on the server at the specified URL." )
1588        protected Reference custodian;
1589
1590        /**
1591         * The actual object that is the target of the reference (The organization responsible for the management of the instance and oversight of the data on the server at the specified URL.)
1592         */
1593        protected Organization custodianTarget;
1594
1595        private static final long serialVersionUID = -1705695694L;
1596
1597    /**
1598     * Constructor
1599     */
1600      public CapabilityStatementImplementationComponent() {
1601        super();
1602      }
1603
1604    /**
1605     * Constructor
1606     */
1607      public CapabilityStatementImplementationComponent(StringType description) {
1608        super();
1609        this.description = description;
1610      }
1611
1612        /**
1613         * @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
1614         */
1615        public StringType getDescriptionElement() { 
1616          if (this.description == null)
1617            if (Configuration.errorOnAutoCreate())
1618              throw new Error("Attempt to auto-create CapabilityStatementImplementationComponent.description");
1619            else if (Configuration.doAutoCreate())
1620              this.description = new StringType(); // bb
1621          return this.description;
1622        }
1623
1624        public boolean hasDescriptionElement() { 
1625          return this.description != null && !this.description.isEmpty();
1626        }
1627
1628        public boolean hasDescription() { 
1629          return this.description != null && !this.description.isEmpty();
1630        }
1631
1632        /**
1633         * @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
1634         */
1635        public CapabilityStatementImplementationComponent setDescriptionElement(StringType value) { 
1636          this.description = value;
1637          return this;
1638        }
1639
1640        /**
1641         * @return Information about the specific installation that this capability statement relates to.
1642         */
1643        public String getDescription() { 
1644          return this.description == null ? null : this.description.getValue();
1645        }
1646
1647        /**
1648         * @param value Information about the specific installation that this capability statement relates to.
1649         */
1650        public CapabilityStatementImplementationComponent setDescription(String value) { 
1651            if (this.description == null)
1652              this.description = new StringType();
1653            this.description.setValue(value);
1654          return this;
1655        }
1656
1657        /**
1658         * @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
1659         */
1660        public UrlType getUrlElement() { 
1661          if (this.url == null)
1662            if (Configuration.errorOnAutoCreate())
1663              throw new Error("Attempt to auto-create CapabilityStatementImplementationComponent.url");
1664            else if (Configuration.doAutoCreate())
1665              this.url = new UrlType(); // bb
1666          return this.url;
1667        }
1668
1669        public boolean hasUrlElement() { 
1670          return this.url != null && !this.url.isEmpty();
1671        }
1672
1673        public boolean hasUrl() { 
1674          return this.url != null && !this.url.isEmpty();
1675        }
1676
1677        /**
1678         * @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
1679         */
1680        public CapabilityStatementImplementationComponent setUrlElement(UrlType value) { 
1681          this.url = value;
1682          return this;
1683        }
1684
1685        /**
1686         * @return An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.
1687         */
1688        public String getUrl() { 
1689          return this.url == null ? null : this.url.getValue();
1690        }
1691
1692        /**
1693         * @param value An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.
1694         */
1695        public CapabilityStatementImplementationComponent setUrl(String value) { 
1696          if (Utilities.noString(value))
1697            this.url = null;
1698          else {
1699            if (this.url == null)
1700              this.url = new UrlType();
1701            this.url.setValue(value);
1702          }
1703          return this;
1704        }
1705
1706        /**
1707         * @return {@link #custodian} (The organization responsible for the management of the instance and oversight of the data on the server at the specified URL.)
1708         */
1709        public Reference getCustodian() { 
1710          if (this.custodian == null)
1711            if (Configuration.errorOnAutoCreate())
1712              throw new Error("Attempt to auto-create CapabilityStatementImplementationComponent.custodian");
1713            else if (Configuration.doAutoCreate())
1714              this.custodian = new Reference(); // cc
1715          return this.custodian;
1716        }
1717
1718        public boolean hasCustodian() { 
1719          return this.custodian != null && !this.custodian.isEmpty();
1720        }
1721
1722        /**
1723         * @param value {@link #custodian} (The organization responsible for the management of the instance and oversight of the data on the server at the specified URL.)
1724         */
1725        public CapabilityStatementImplementationComponent setCustodian(Reference value) { 
1726          this.custodian = value;
1727          return this;
1728        }
1729
1730        /**
1731         * @return {@link #custodian} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization responsible for the management of the instance and oversight of the data on the server at the specified URL.)
1732         */
1733        public Organization getCustodianTarget() { 
1734          if (this.custodianTarget == null)
1735            if (Configuration.errorOnAutoCreate())
1736              throw new Error("Attempt to auto-create CapabilityStatementImplementationComponent.custodian");
1737            else if (Configuration.doAutoCreate())
1738              this.custodianTarget = new Organization(); // aa
1739          return this.custodianTarget;
1740        }
1741
1742        /**
1743         * @param value {@link #custodian} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization responsible for the management of the instance and oversight of the data on the server at the specified URL.)
1744         */
1745        public CapabilityStatementImplementationComponent setCustodianTarget(Organization value) { 
1746          this.custodianTarget = value;
1747          return this;
1748        }
1749
1750        protected void listChildren(List<Property> children) {
1751          super.listChildren(children);
1752          children.add(new Property("description", "string", "Information about the specific installation that this capability statement relates to.", 0, 1, description));
1753          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));
1754          children.add(new Property("custodian", "Reference(Organization)", "The organization responsible for the management of the instance and oversight of the data on the server at the specified URL.", 0, 1, custodian));
1755        }
1756
1757        @Override
1758        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1759          switch (_hash) {
1760          case -1724546052: /*description*/  return new Property("description", "string", "Information about the specific installation that this capability statement relates to.", 0, 1, description);
1761          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);
1762          case 1611297262: /*custodian*/  return new Property("custodian", "Reference(Organization)", "The organization responsible for the management of the instance and oversight of the data on the server at the specified URL.", 0, 1, custodian);
1763          default: return super.getNamedProperty(_hash, _name, _checkValid);
1764          }
1765
1766        }
1767
1768      @Override
1769      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1770        switch (hash) {
1771        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1772        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UrlType
1773        case 1611297262: /*custodian*/ return this.custodian == null ? new Base[0] : new Base[] {this.custodian}; // Reference
1774        default: return super.getProperty(hash, name, checkValid);
1775        }
1776
1777      }
1778
1779      @Override
1780      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1781        switch (hash) {
1782        case -1724546052: // description
1783          this.description = castToString(value); // StringType
1784          return value;
1785        case 116079: // url
1786          this.url = castToUrl(value); // UrlType
1787          return value;
1788        case 1611297262: // custodian
1789          this.custodian = castToReference(value); // Reference
1790          return value;
1791        default: return super.setProperty(hash, name, value);
1792        }
1793
1794      }
1795
1796      @Override
1797      public Base setProperty(String name, Base value) throws FHIRException {
1798        if (name.equals("description")) {
1799          this.description = castToString(value); // StringType
1800        } else if (name.equals("url")) {
1801          this.url = castToUrl(value); // UrlType
1802        } else if (name.equals("custodian")) {
1803          this.custodian = castToReference(value); // Reference
1804        } else
1805          return super.setProperty(name, value);
1806        return value;
1807      }
1808
1809      @Override
1810      public Base makeProperty(int hash, String name) throws FHIRException {
1811        switch (hash) {
1812        case -1724546052:  return getDescriptionElement();
1813        case 116079:  return getUrlElement();
1814        case 1611297262:  return getCustodian(); 
1815        default: return super.makeProperty(hash, name);
1816        }
1817
1818      }
1819
1820      @Override
1821      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1822        switch (hash) {
1823        case -1724546052: /*description*/ return new String[] {"string"};
1824        case 116079: /*url*/ return new String[] {"url"};
1825        case 1611297262: /*custodian*/ return new String[] {"Reference"};
1826        default: return super.getTypesForProperty(hash, name);
1827        }
1828
1829      }
1830
1831      @Override
1832      public Base addChild(String name) throws FHIRException {
1833        if (name.equals("description")) {
1834          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.description");
1835        }
1836        else if (name.equals("url")) {
1837          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.url");
1838        }
1839        else if (name.equals("custodian")) {
1840          this.custodian = new Reference();
1841          return this.custodian;
1842        }
1843        else
1844          return super.addChild(name);
1845      }
1846
1847      public CapabilityStatementImplementationComponent copy() {
1848        CapabilityStatementImplementationComponent dst = new CapabilityStatementImplementationComponent();
1849        copyValues(dst);
1850        dst.description = description == null ? null : description.copy();
1851        dst.url = url == null ? null : url.copy();
1852        dst.custodian = custodian == null ? null : custodian.copy();
1853        return dst;
1854      }
1855
1856      @Override
1857      public boolean equalsDeep(Base other_) {
1858        if (!super.equalsDeep(other_))
1859          return false;
1860        if (!(other_ instanceof CapabilityStatementImplementationComponent))
1861          return false;
1862        CapabilityStatementImplementationComponent o = (CapabilityStatementImplementationComponent) other_;
1863        return compareDeep(description, o.description, true) && compareDeep(url, o.url, true) && compareDeep(custodian, o.custodian, true)
1864          ;
1865      }
1866
1867      @Override
1868      public boolean equalsShallow(Base other_) {
1869        if (!super.equalsShallow(other_))
1870          return false;
1871        if (!(other_ instanceof CapabilityStatementImplementationComponent))
1872          return false;
1873        CapabilityStatementImplementationComponent o = (CapabilityStatementImplementationComponent) other_;
1874        return compareValues(description, o.description, true) && compareValues(url, o.url, true);
1875      }
1876
1877      public boolean isEmpty() {
1878        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(description, url, custodian
1879          );
1880      }
1881
1882  public String fhirType() {
1883    return "CapabilityStatement.implementation";
1884
1885  }
1886
1887  }
1888
1889    @Block()
1890    public static class CapabilityStatementRestComponent extends BackboneElement implements IBaseBackboneElement {
1891        /**
1892         * Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.
1893         */
1894        @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1895        @Description(shortDefinition="client | server", formalDefinition="Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations." )
1896        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/restful-capability-mode")
1897        protected Enumeration<RestfulCapabilityMode> mode;
1898
1899        /**
1900         * Information about the system's restful capabilities that apply across all applications, such as security.
1901         */
1902        @Child(name = "documentation", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1903        @Description(shortDefinition="General description of implementation", formalDefinition="Information about the system's restful capabilities that apply across all applications, such as security." )
1904        protected MarkdownType documentation;
1905
1906        /**
1907         * Information about security implementation from an interface perspective - what a client needs to know.
1908         */
1909        @Child(name = "security", type = {}, order=3, min=0, max=1, modifier=false, summary=true)
1910        @Description(shortDefinition="Information about security of implementation", formalDefinition="Information about security implementation from an interface perspective - what a client needs to know." )
1911        protected CapabilityStatementRestSecurityComponent security;
1912
1913        /**
1914         * A specification of the restful capabilities of the solution for a specific resource type.
1915         */
1916        @Child(name = "resource", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1917        @Description(shortDefinition="Resource served on the REST interface", formalDefinition="A specification of the restful capabilities of the solution for a specific resource type." )
1918        protected List<CapabilityStatementRestResourceComponent> resource;
1919
1920        /**
1921         * A specification of restful operations supported by the system.
1922         */
1923        @Child(name = "interaction", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1924        @Description(shortDefinition="What operations are supported?", formalDefinition="A specification of restful operations supported by the system." )
1925        protected List<SystemInteractionComponent> interaction;
1926
1927        /**
1928         * 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.
1929         */
1930        @Child(name = "searchParam", type = {CapabilityStatementRestResourceSearchParamComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1931        @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." )
1932        protected List<CapabilityStatementRestResourceSearchParamComponent> searchParam;
1933
1934        /**
1935         * Definition of an operation or a named query together with its parameters and their meaning and type.
1936         */
1937        @Child(name = "operation", type = {CapabilityStatementRestResourceOperationComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1938        @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." )
1939        protected List<CapabilityStatementRestResourceOperationComponent> operation;
1940
1941        /**
1942         * 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 .
1943         */
1944        @Child(name = "compartment", type = {CanonicalType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1945        @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 ." )
1946        protected List<CanonicalType> compartment;
1947
1948        private static final long serialVersionUID = -1442029817L;
1949
1950    /**
1951     * Constructor
1952     */
1953      public CapabilityStatementRestComponent() {
1954        super();
1955      }
1956
1957    /**
1958     * Constructor
1959     */
1960      public CapabilityStatementRestComponent(Enumeration<RestfulCapabilityMode> mode) {
1961        super();
1962        this.mode = mode;
1963      }
1964
1965        /**
1966         * @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
1967         */
1968        public Enumeration<RestfulCapabilityMode> getModeElement() { 
1969          if (this.mode == null)
1970            if (Configuration.errorOnAutoCreate())
1971              throw new Error("Attempt to auto-create CapabilityStatementRestComponent.mode");
1972            else if (Configuration.doAutoCreate())
1973              this.mode = new Enumeration<RestfulCapabilityMode>(new RestfulCapabilityModeEnumFactory()); // bb
1974          return this.mode;
1975        }
1976
1977        public boolean hasModeElement() { 
1978          return this.mode != null && !this.mode.isEmpty();
1979        }
1980
1981        public boolean hasMode() { 
1982          return this.mode != null && !this.mode.isEmpty();
1983        }
1984
1985        /**
1986         * @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
1987         */
1988        public CapabilityStatementRestComponent setModeElement(Enumeration<RestfulCapabilityMode> value) { 
1989          this.mode = value;
1990          return this;
1991        }
1992
1993        /**
1994         * @return Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.
1995         */
1996        public RestfulCapabilityMode getMode() { 
1997          return this.mode == null ? null : this.mode.getValue();
1998        }
1999
2000        /**
2001         * @param value Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.
2002         */
2003        public CapabilityStatementRestComponent setMode(RestfulCapabilityMode value) { 
2004            if (this.mode == null)
2005              this.mode = new Enumeration<RestfulCapabilityMode>(new RestfulCapabilityModeEnumFactory());
2006            this.mode.setValue(value);
2007          return this;
2008        }
2009
2010        /**
2011         * @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
2012         */
2013        public MarkdownType getDocumentationElement() { 
2014          if (this.documentation == null)
2015            if (Configuration.errorOnAutoCreate())
2016              throw new Error("Attempt to auto-create CapabilityStatementRestComponent.documentation");
2017            else if (Configuration.doAutoCreate())
2018              this.documentation = new MarkdownType(); // bb
2019          return this.documentation;
2020        }
2021
2022        public boolean hasDocumentationElement() { 
2023          return this.documentation != null && !this.documentation.isEmpty();
2024        }
2025
2026        public boolean hasDocumentation() { 
2027          return this.documentation != null && !this.documentation.isEmpty();
2028        }
2029
2030        /**
2031         * @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
2032         */
2033        public CapabilityStatementRestComponent setDocumentationElement(MarkdownType value) { 
2034          this.documentation = value;
2035          return this;
2036        }
2037
2038        /**
2039         * @return Information about the system's restful capabilities that apply across all applications, such as security.
2040         */
2041        public String getDocumentation() { 
2042          return this.documentation == null ? null : this.documentation.getValue();
2043        }
2044
2045        /**
2046         * @param value Information about the system's restful capabilities that apply across all applications, such as security.
2047         */
2048        public CapabilityStatementRestComponent setDocumentation(String value) { 
2049          if (value == null)
2050            this.documentation = null;
2051          else {
2052            if (this.documentation == null)
2053              this.documentation = new MarkdownType();
2054            this.documentation.setValue(value);
2055          }
2056          return this;
2057        }
2058
2059        /**
2060         * @return {@link #security} (Information about security implementation from an interface perspective - what a client needs to know.)
2061         */
2062        public CapabilityStatementRestSecurityComponent getSecurity() { 
2063          if (this.security == null)
2064            if (Configuration.errorOnAutoCreate())
2065              throw new Error("Attempt to auto-create CapabilityStatementRestComponent.security");
2066            else if (Configuration.doAutoCreate())
2067              this.security = new CapabilityStatementRestSecurityComponent(); // cc
2068          return this.security;
2069        }
2070
2071        public boolean hasSecurity() { 
2072          return this.security != null && !this.security.isEmpty();
2073        }
2074
2075        /**
2076         * @param value {@link #security} (Information about security implementation from an interface perspective - what a client needs to know.)
2077         */
2078        public CapabilityStatementRestComponent setSecurity(CapabilityStatementRestSecurityComponent value) { 
2079          this.security = value;
2080          return this;
2081        }
2082
2083        /**
2084         * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.)
2085         */
2086        public List<CapabilityStatementRestResourceComponent> getResource() { 
2087          if (this.resource == null)
2088            this.resource = new ArrayList<CapabilityStatementRestResourceComponent>();
2089          return this.resource;
2090        }
2091
2092        /**
2093         * @return Returns a reference to <code>this</code> for easy method chaining
2094         */
2095        public CapabilityStatementRestComponent setResource(List<CapabilityStatementRestResourceComponent> theResource) { 
2096          this.resource = theResource;
2097          return this;
2098        }
2099
2100        public boolean hasResource() { 
2101          if (this.resource == null)
2102            return false;
2103          for (CapabilityStatementRestResourceComponent item : this.resource)
2104            if (!item.isEmpty())
2105              return true;
2106          return false;
2107        }
2108
2109        public CapabilityStatementRestResourceComponent addResource() { //3
2110          CapabilityStatementRestResourceComponent t = new CapabilityStatementRestResourceComponent();
2111          if (this.resource == null)
2112            this.resource = new ArrayList<CapabilityStatementRestResourceComponent>();
2113          this.resource.add(t);
2114          return t;
2115        }
2116
2117        public CapabilityStatementRestComponent addResource(CapabilityStatementRestResourceComponent t) { //3
2118          if (t == null)
2119            return this;
2120          if (this.resource == null)
2121            this.resource = new ArrayList<CapabilityStatementRestResourceComponent>();
2122          this.resource.add(t);
2123          return this;
2124        }
2125
2126        /**
2127         * @return The first repetition of repeating field {@link #resource}, creating it if it does not already exist
2128         */
2129        public CapabilityStatementRestResourceComponent getResourceFirstRep() { 
2130          if (getResource().isEmpty()) {
2131            addResource();
2132          }
2133          return getResource().get(0);
2134        }
2135
2136        /**
2137         * @return {@link #interaction} (A specification of restful operations supported by the system.)
2138         */
2139        public List<SystemInteractionComponent> getInteraction() { 
2140          if (this.interaction == null)
2141            this.interaction = new ArrayList<SystemInteractionComponent>();
2142          return this.interaction;
2143        }
2144
2145        /**
2146         * @return Returns a reference to <code>this</code> for easy method chaining
2147         */
2148        public CapabilityStatementRestComponent setInteraction(List<SystemInteractionComponent> theInteraction) { 
2149          this.interaction = theInteraction;
2150          return this;
2151        }
2152
2153        public boolean hasInteraction() { 
2154          if (this.interaction == null)
2155            return false;
2156          for (SystemInteractionComponent item : this.interaction)
2157            if (!item.isEmpty())
2158              return true;
2159          return false;
2160        }
2161
2162        public SystemInteractionComponent addInteraction() { //3
2163          SystemInteractionComponent t = new SystemInteractionComponent();
2164          if (this.interaction == null)
2165            this.interaction = new ArrayList<SystemInteractionComponent>();
2166          this.interaction.add(t);
2167          return t;
2168        }
2169
2170        public CapabilityStatementRestComponent addInteraction(SystemInteractionComponent t) { //3
2171          if (t == null)
2172            return this;
2173          if (this.interaction == null)
2174            this.interaction = new ArrayList<SystemInteractionComponent>();
2175          this.interaction.add(t);
2176          return this;
2177        }
2178
2179        /**
2180         * @return The first repetition of repeating field {@link #interaction}, creating it if it does not already exist
2181         */
2182        public SystemInteractionComponent getInteractionFirstRep() { 
2183          if (getInteraction().isEmpty()) {
2184            addInteraction();
2185          }
2186          return getInteraction().get(0);
2187        }
2188
2189        /**
2190         * @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.)
2191         */
2192        public List<CapabilityStatementRestResourceSearchParamComponent> getSearchParam() { 
2193          if (this.searchParam == null)
2194            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
2195          return this.searchParam;
2196        }
2197
2198        /**
2199         * @return Returns a reference to <code>this</code> for easy method chaining
2200         */
2201        public CapabilityStatementRestComponent setSearchParam(List<CapabilityStatementRestResourceSearchParamComponent> theSearchParam) { 
2202          this.searchParam = theSearchParam;
2203          return this;
2204        }
2205
2206        public boolean hasSearchParam() { 
2207          if (this.searchParam == null)
2208            return false;
2209          for (CapabilityStatementRestResourceSearchParamComponent item : this.searchParam)
2210            if (!item.isEmpty())
2211              return true;
2212          return false;
2213        }
2214
2215        public CapabilityStatementRestResourceSearchParamComponent addSearchParam() { //3
2216          CapabilityStatementRestResourceSearchParamComponent t = new CapabilityStatementRestResourceSearchParamComponent();
2217          if (this.searchParam == null)
2218            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
2219          this.searchParam.add(t);
2220          return t;
2221        }
2222
2223        public CapabilityStatementRestComponent addSearchParam(CapabilityStatementRestResourceSearchParamComponent t) { //3
2224          if (t == null)
2225            return this;
2226          if (this.searchParam == null)
2227            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
2228          this.searchParam.add(t);
2229          return this;
2230        }
2231
2232        /**
2233         * @return The first repetition of repeating field {@link #searchParam}, creating it if it does not already exist
2234         */
2235        public CapabilityStatementRestResourceSearchParamComponent getSearchParamFirstRep() { 
2236          if (getSearchParam().isEmpty()) {
2237            addSearchParam();
2238          }
2239          return getSearchParam().get(0);
2240        }
2241
2242        /**
2243         * @return {@link #operation} (Definition of an operation or a named query together with its parameters and their meaning and type.)
2244         */
2245        public List<CapabilityStatementRestResourceOperationComponent> getOperation() { 
2246          if (this.operation == null)
2247            this.operation = new ArrayList<CapabilityStatementRestResourceOperationComponent>();
2248          return this.operation;
2249        }
2250
2251        /**
2252         * @return Returns a reference to <code>this</code> for easy method chaining
2253         */
2254        public CapabilityStatementRestComponent setOperation(List<CapabilityStatementRestResourceOperationComponent> theOperation) { 
2255          this.operation = theOperation;
2256          return this;
2257        }
2258
2259        public boolean hasOperation() { 
2260          if (this.operation == null)
2261            return false;
2262          for (CapabilityStatementRestResourceOperationComponent item : this.operation)
2263            if (!item.isEmpty())
2264              return true;
2265          return false;
2266        }
2267
2268        public CapabilityStatementRestResourceOperationComponent addOperation() { //3
2269          CapabilityStatementRestResourceOperationComponent t = new CapabilityStatementRestResourceOperationComponent();
2270          if (this.operation == null)
2271            this.operation = new ArrayList<CapabilityStatementRestResourceOperationComponent>();
2272          this.operation.add(t);
2273          return t;
2274        }
2275
2276        public CapabilityStatementRestComponent addOperation(CapabilityStatementRestResourceOperationComponent t) { //3
2277          if (t == null)
2278            return this;
2279          if (this.operation == null)
2280            this.operation = new ArrayList<CapabilityStatementRestResourceOperationComponent>();
2281          this.operation.add(t);
2282          return this;
2283        }
2284
2285        /**
2286         * @return The first repetition of repeating field {@link #operation}, creating it if it does not already exist
2287         */
2288        public CapabilityStatementRestResourceOperationComponent getOperationFirstRep() { 
2289          if (getOperation().isEmpty()) {
2290            addOperation();
2291          }
2292          return getOperation().get(0);
2293        }
2294
2295        /**
2296         * @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 .)
2297         */
2298        public List<CanonicalType> getCompartment() { 
2299          if (this.compartment == null)
2300            this.compartment = new ArrayList<CanonicalType>();
2301          return this.compartment;
2302        }
2303
2304        /**
2305         * @return Returns a reference to <code>this</code> for easy method chaining
2306         */
2307        public CapabilityStatementRestComponent setCompartment(List<CanonicalType> theCompartment) { 
2308          this.compartment = theCompartment;
2309          return this;
2310        }
2311
2312        public boolean hasCompartment() { 
2313          if (this.compartment == null)
2314            return false;
2315          for (CanonicalType item : this.compartment)
2316            if (!item.isEmpty())
2317              return true;
2318          return false;
2319        }
2320
2321        /**
2322         * @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 .)
2323         */
2324        public CanonicalType addCompartmentElement() {//2 
2325          CanonicalType t = new CanonicalType();
2326          if (this.compartment == null)
2327            this.compartment = new ArrayList<CanonicalType>();
2328          this.compartment.add(t);
2329          return t;
2330        }
2331
2332        /**
2333         * @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 .)
2334         */
2335        public CapabilityStatementRestComponent addCompartment(String value) { //1
2336          CanonicalType t = new CanonicalType();
2337          t.setValue(value);
2338          if (this.compartment == null)
2339            this.compartment = new ArrayList<CanonicalType>();
2340          this.compartment.add(t);
2341          return this;
2342        }
2343
2344        /**
2345         * @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 .)
2346         */
2347        public boolean hasCompartment(String value) { 
2348          if (this.compartment == null)
2349            return false;
2350          for (CanonicalType v : this.compartment)
2351            if (v.getValue().equals(value)) // canonical(CompartmentDefinition)
2352              return true;
2353          return false;
2354        }
2355
2356        protected void listChildren(List<Property> children) {
2357          super.listChildren(children);
2358          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));
2359          children.add(new Property("documentation", "markdown", "Information about the system's restful capabilities that apply across all applications, such as security.", 0, 1, documentation));
2360          children.add(new Property("security", "", "Information about security implementation from an interface perspective - what a client needs to know.", 0, 1, security));
2361          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));
2362          children.add(new Property("interaction", "", "A specification of restful operations supported by the system.", 0, java.lang.Integer.MAX_VALUE, interaction));
2363          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));
2364          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));
2365          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));
2366        }
2367
2368        @Override
2369        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2370          switch (_hash) {
2371          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);
2372          case 1587405498: /*documentation*/  return new Property("documentation", "markdown", "Information about the system's restful capabilities that apply across all applications, such as security.", 0, 1, documentation);
2373          case 949122880: /*security*/  return new Property("security", "", "Information about security implementation from an interface perspective - what a client needs to know.", 0, 1, security);
2374          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);
2375          case 1844104722: /*interaction*/  return new Property("interaction", "", "A specification of restful operations supported by the system.", 0, java.lang.Integer.MAX_VALUE, interaction);
2376          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);
2377          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);
2378          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);
2379          default: return super.getNamedProperty(_hash, _name, _checkValid);
2380          }
2381
2382        }
2383
2384      @Override
2385      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2386        switch (hash) {
2387        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<RestfulCapabilityMode>
2388        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // MarkdownType
2389        case 949122880: /*security*/ return this.security == null ? new Base[0] : new Base[] {this.security}; // CapabilityStatementRestSecurityComponent
2390        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : this.resource.toArray(new Base[this.resource.size()]); // CapabilityStatementRestResourceComponent
2391        case 1844104722: /*interaction*/ return this.interaction == null ? new Base[0] : this.interaction.toArray(new Base[this.interaction.size()]); // SystemInteractionComponent
2392        case -553645115: /*searchParam*/ return this.searchParam == null ? new Base[0] : this.searchParam.toArray(new Base[this.searchParam.size()]); // CapabilityStatementRestResourceSearchParamComponent
2393        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : this.operation.toArray(new Base[this.operation.size()]); // CapabilityStatementRestResourceOperationComponent
2394        case -397756334: /*compartment*/ return this.compartment == null ? new Base[0] : this.compartment.toArray(new Base[this.compartment.size()]); // CanonicalType
2395        default: return super.getProperty(hash, name, checkValid);
2396        }
2397
2398      }
2399
2400      @Override
2401      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2402        switch (hash) {
2403        case 3357091: // mode
2404          value = new RestfulCapabilityModeEnumFactory().fromType(castToCode(value));
2405          this.mode = (Enumeration) value; // Enumeration<RestfulCapabilityMode>
2406          return value;
2407        case 1587405498: // documentation
2408          this.documentation = castToMarkdown(value); // MarkdownType
2409          return value;
2410        case 949122880: // security
2411          this.security = (CapabilityStatementRestSecurityComponent) value; // CapabilityStatementRestSecurityComponent
2412          return value;
2413        case -341064690: // resource
2414          this.getResource().add((CapabilityStatementRestResourceComponent) value); // CapabilityStatementRestResourceComponent
2415          return value;
2416        case 1844104722: // interaction
2417          this.getInteraction().add((SystemInteractionComponent) value); // SystemInteractionComponent
2418          return value;
2419        case -553645115: // searchParam
2420          this.getSearchParam().add((CapabilityStatementRestResourceSearchParamComponent) value); // CapabilityStatementRestResourceSearchParamComponent
2421          return value;
2422        case 1662702951: // operation
2423          this.getOperation().add((CapabilityStatementRestResourceOperationComponent) value); // CapabilityStatementRestResourceOperationComponent
2424          return value;
2425        case -397756334: // compartment
2426          this.getCompartment().add(castToCanonical(value)); // CanonicalType
2427          return value;
2428        default: return super.setProperty(hash, name, value);
2429        }
2430
2431      }
2432
2433      @Override
2434      public Base setProperty(String name, Base value) throws FHIRException {
2435        if (name.equals("mode")) {
2436          value = new RestfulCapabilityModeEnumFactory().fromType(castToCode(value));
2437          this.mode = (Enumeration) value; // Enumeration<RestfulCapabilityMode>
2438        } else if (name.equals("documentation")) {
2439          this.documentation = castToMarkdown(value); // MarkdownType
2440        } else if (name.equals("security")) {
2441          this.security = (CapabilityStatementRestSecurityComponent) value; // CapabilityStatementRestSecurityComponent
2442        } else if (name.equals("resource")) {
2443          this.getResource().add((CapabilityStatementRestResourceComponent) value);
2444        } else if (name.equals("interaction")) {
2445          this.getInteraction().add((SystemInteractionComponent) value);
2446        } else if (name.equals("searchParam")) {
2447          this.getSearchParam().add((CapabilityStatementRestResourceSearchParamComponent) value);
2448        } else if (name.equals("operation")) {
2449          this.getOperation().add((CapabilityStatementRestResourceOperationComponent) value);
2450        } else if (name.equals("compartment")) {
2451          this.getCompartment().add(castToCanonical(value));
2452        } else
2453          return super.setProperty(name, value);
2454        return value;
2455      }
2456
2457      @Override
2458      public Base makeProperty(int hash, String name) throws FHIRException {
2459        switch (hash) {
2460        case 3357091:  return getModeElement();
2461        case 1587405498:  return getDocumentationElement();
2462        case 949122880:  return getSecurity(); 
2463        case -341064690:  return addResource(); 
2464        case 1844104722:  return addInteraction(); 
2465        case -553645115:  return addSearchParam(); 
2466        case 1662702951:  return addOperation(); 
2467        case -397756334:  return addCompartmentElement();
2468        default: return super.makeProperty(hash, name);
2469        }
2470
2471      }
2472
2473      @Override
2474      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2475        switch (hash) {
2476        case 3357091: /*mode*/ return new String[] {"code"};
2477        case 1587405498: /*documentation*/ return new String[] {"markdown"};
2478        case 949122880: /*security*/ return new String[] {};
2479        case -341064690: /*resource*/ return new String[] {};
2480        case 1844104722: /*interaction*/ return new String[] {};
2481        case -553645115: /*searchParam*/ return new String[] {"@CapabilityStatement.rest.resource.searchParam"};
2482        case 1662702951: /*operation*/ return new String[] {"@CapabilityStatement.rest.resource.operation"};
2483        case -397756334: /*compartment*/ return new String[] {"canonical"};
2484        default: return super.getTypesForProperty(hash, name);
2485        }
2486
2487      }
2488
2489      @Override
2490      public Base addChild(String name) throws FHIRException {
2491        if (name.equals("mode")) {
2492          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.mode");
2493        }
2494        else if (name.equals("documentation")) {
2495          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
2496        }
2497        else if (name.equals("security")) {
2498          this.security = new CapabilityStatementRestSecurityComponent();
2499          return this.security;
2500        }
2501        else if (name.equals("resource")) {
2502          return addResource();
2503        }
2504        else if (name.equals("interaction")) {
2505          return addInteraction();
2506        }
2507        else if (name.equals("searchParam")) {
2508          return addSearchParam();
2509        }
2510        else if (name.equals("operation")) {
2511          return addOperation();
2512        }
2513        else if (name.equals("compartment")) {
2514          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.compartment");
2515        }
2516        else
2517          return super.addChild(name);
2518      }
2519
2520      public CapabilityStatementRestComponent copy() {
2521        CapabilityStatementRestComponent dst = new CapabilityStatementRestComponent();
2522        copyValues(dst);
2523        dst.mode = mode == null ? null : mode.copy();
2524        dst.documentation = documentation == null ? null : documentation.copy();
2525        dst.security = security == null ? null : security.copy();
2526        if (resource != null) {
2527          dst.resource = new ArrayList<CapabilityStatementRestResourceComponent>();
2528          for (CapabilityStatementRestResourceComponent i : resource)
2529            dst.resource.add(i.copy());
2530        };
2531        if (interaction != null) {
2532          dst.interaction = new ArrayList<SystemInteractionComponent>();
2533          for (SystemInteractionComponent i : interaction)
2534            dst.interaction.add(i.copy());
2535        };
2536        if (searchParam != null) {
2537          dst.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
2538          for (CapabilityStatementRestResourceSearchParamComponent i : searchParam)
2539            dst.searchParam.add(i.copy());
2540        };
2541        if (operation != null) {
2542          dst.operation = new ArrayList<CapabilityStatementRestResourceOperationComponent>();
2543          for (CapabilityStatementRestResourceOperationComponent i : operation)
2544            dst.operation.add(i.copy());
2545        };
2546        if (compartment != null) {
2547          dst.compartment = new ArrayList<CanonicalType>();
2548          for (CanonicalType i : compartment)
2549            dst.compartment.add(i.copy());
2550        };
2551        return dst;
2552      }
2553
2554      @Override
2555      public boolean equalsDeep(Base other_) {
2556        if (!super.equalsDeep(other_))
2557          return false;
2558        if (!(other_ instanceof CapabilityStatementRestComponent))
2559          return false;
2560        CapabilityStatementRestComponent o = (CapabilityStatementRestComponent) other_;
2561        return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(security, o.security, true)
2562           && compareDeep(resource, o.resource, true) && compareDeep(interaction, o.interaction, true) && compareDeep(searchParam, o.searchParam, true)
2563           && compareDeep(operation, o.operation, true) && compareDeep(compartment, o.compartment, true);
2564      }
2565
2566      @Override
2567      public boolean equalsShallow(Base other_) {
2568        if (!super.equalsShallow(other_))
2569          return false;
2570        if (!(other_ instanceof CapabilityStatementRestComponent))
2571          return false;
2572        CapabilityStatementRestComponent o = (CapabilityStatementRestComponent) other_;
2573        return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true);
2574      }
2575
2576      public boolean isEmpty() {
2577        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mode, documentation, security
2578          , resource, interaction, searchParam, operation, compartment);
2579      }
2580
2581  public String fhirType() {
2582    return "CapabilityStatement.rest";
2583
2584  }
2585
2586  }
2587
2588    @Block()
2589    public static class CapabilityStatementRestSecurityComponent extends BackboneElement implements IBaseBackboneElement {
2590        /**
2591         * Server adds CORS headers when responding to requests - this enables Javascript applications to use the server.
2592         */
2593        @Child(name = "cors", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true)
2594        @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." )
2595        protected BooleanType cors;
2596
2597        /**
2598         * Types of security services that are supported/required by the system.
2599         */
2600        @Child(name = "service", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2601        @Description(shortDefinition="OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates", formalDefinition="Types of security services that are supported/required by the system." )
2602        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/restful-security-service")
2603        protected List<CodeableConcept> service;
2604
2605        /**
2606         * General description of how security works.
2607         */
2608        @Child(name = "description", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2609        @Description(shortDefinition="General description of how security works", formalDefinition="General description of how security works." )
2610        protected MarkdownType description;
2611
2612        private static final long serialVersionUID = -1348900500L;
2613
2614    /**
2615     * Constructor
2616     */
2617      public CapabilityStatementRestSecurityComponent() {
2618        super();
2619      }
2620
2621        /**
2622         * @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
2623         */
2624        public BooleanType getCorsElement() { 
2625          if (this.cors == null)
2626            if (Configuration.errorOnAutoCreate())
2627              throw new Error("Attempt to auto-create CapabilityStatementRestSecurityComponent.cors");
2628            else if (Configuration.doAutoCreate())
2629              this.cors = new BooleanType(); // bb
2630          return this.cors;
2631        }
2632
2633        public boolean hasCorsElement() { 
2634          return this.cors != null && !this.cors.isEmpty();
2635        }
2636
2637        public boolean hasCors() { 
2638          return this.cors != null && !this.cors.isEmpty();
2639        }
2640
2641        /**
2642         * @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
2643         */
2644        public CapabilityStatementRestSecurityComponent setCorsElement(BooleanType value) { 
2645          this.cors = value;
2646          return this;
2647        }
2648
2649        /**
2650         * @return Server adds CORS headers when responding to requests - this enables Javascript applications to use the server.
2651         */
2652        public boolean getCors() { 
2653          return this.cors == null || this.cors.isEmpty() ? false : this.cors.getValue();
2654        }
2655
2656        /**
2657         * @param value Server adds CORS headers when responding to requests - this enables Javascript applications to use the server.
2658         */
2659        public CapabilityStatementRestSecurityComponent setCors(boolean value) { 
2660            if (this.cors == null)
2661              this.cors = new BooleanType();
2662            this.cors.setValue(value);
2663          return this;
2664        }
2665
2666        /**
2667         * @return {@link #service} (Types of security services that are supported/required by the system.)
2668         */
2669        public List<CodeableConcept> getService() { 
2670          if (this.service == null)
2671            this.service = new ArrayList<CodeableConcept>();
2672          return this.service;
2673        }
2674
2675        /**
2676         * @return Returns a reference to <code>this</code> for easy method chaining
2677         */
2678        public CapabilityStatementRestSecurityComponent setService(List<CodeableConcept> theService) { 
2679          this.service = theService;
2680          return this;
2681        }
2682
2683        public boolean hasService() { 
2684          if (this.service == null)
2685            return false;
2686          for (CodeableConcept item : this.service)
2687            if (!item.isEmpty())
2688              return true;
2689          return false;
2690        }
2691
2692        public CodeableConcept addService() { //3
2693          CodeableConcept t = new CodeableConcept();
2694          if (this.service == null)
2695            this.service = new ArrayList<CodeableConcept>();
2696          this.service.add(t);
2697          return t;
2698        }
2699
2700        public CapabilityStatementRestSecurityComponent addService(CodeableConcept t) { //3
2701          if (t == null)
2702            return this;
2703          if (this.service == null)
2704            this.service = new ArrayList<CodeableConcept>();
2705          this.service.add(t);
2706          return this;
2707        }
2708
2709        /**
2710         * @return The first repetition of repeating field {@link #service}, creating it if it does not already exist
2711         */
2712        public CodeableConcept getServiceFirstRep() { 
2713          if (getService().isEmpty()) {
2714            addService();
2715          }
2716          return getService().get(0);
2717        }
2718
2719        /**
2720         * @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
2721         */
2722        public MarkdownType getDescriptionElement() { 
2723          if (this.description == null)
2724            if (Configuration.errorOnAutoCreate())
2725              throw new Error("Attempt to auto-create CapabilityStatementRestSecurityComponent.description");
2726            else if (Configuration.doAutoCreate())
2727              this.description = new MarkdownType(); // bb
2728          return this.description;
2729        }
2730
2731        public boolean hasDescriptionElement() { 
2732          return this.description != null && !this.description.isEmpty();
2733        }
2734
2735        public boolean hasDescription() { 
2736          return this.description != null && !this.description.isEmpty();
2737        }
2738
2739        /**
2740         * @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
2741         */
2742        public CapabilityStatementRestSecurityComponent setDescriptionElement(MarkdownType value) { 
2743          this.description = value;
2744          return this;
2745        }
2746
2747        /**
2748         * @return General description of how security works.
2749         */
2750        public String getDescription() { 
2751          return this.description == null ? null : this.description.getValue();
2752        }
2753
2754        /**
2755         * @param value General description of how security works.
2756         */
2757        public CapabilityStatementRestSecurityComponent setDescription(String value) { 
2758          if (value == null)
2759            this.description = null;
2760          else {
2761            if (this.description == null)
2762              this.description = new MarkdownType();
2763            this.description.setValue(value);
2764          }
2765          return this;
2766        }
2767
2768        protected void listChildren(List<Property> children) {
2769          super.listChildren(children);
2770          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));
2771          children.add(new Property("service", "CodeableConcept", "Types of security services that are supported/required by the system.", 0, java.lang.Integer.MAX_VALUE, service));
2772          children.add(new Property("description", "markdown", "General description of how security works.", 0, 1, description));
2773        }
2774
2775        @Override
2776        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2777          switch (_hash) {
2778          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);
2779          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);
2780          case -1724546052: /*description*/  return new Property("description", "markdown", "General description of how security works.", 0, 1, description);
2781          default: return super.getNamedProperty(_hash, _name, _checkValid);
2782          }
2783
2784        }
2785
2786      @Override
2787      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2788        switch (hash) {
2789        case 3059629: /*cors*/ return this.cors == null ? new Base[0] : new Base[] {this.cors}; // BooleanType
2790        case 1984153269: /*service*/ return this.service == null ? new Base[0] : this.service.toArray(new Base[this.service.size()]); // CodeableConcept
2791        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
2792        default: return super.getProperty(hash, name, checkValid);
2793        }
2794
2795      }
2796
2797      @Override
2798      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2799        switch (hash) {
2800        case 3059629: // cors
2801          this.cors = castToBoolean(value); // BooleanType
2802          return value;
2803        case 1984153269: // service
2804          this.getService().add(castToCodeableConcept(value)); // CodeableConcept
2805          return value;
2806        case -1724546052: // description
2807          this.description = castToMarkdown(value); // MarkdownType
2808          return value;
2809        default: return super.setProperty(hash, name, value);
2810        }
2811
2812      }
2813
2814      @Override
2815      public Base setProperty(String name, Base value) throws FHIRException {
2816        if (name.equals("cors")) {
2817          this.cors = castToBoolean(value); // BooleanType
2818        } else if (name.equals("service")) {
2819          this.getService().add(castToCodeableConcept(value));
2820        } else if (name.equals("description")) {
2821          this.description = castToMarkdown(value); // MarkdownType
2822        } else
2823          return super.setProperty(name, value);
2824        return value;
2825      }
2826
2827      @Override
2828      public Base makeProperty(int hash, String name) throws FHIRException {
2829        switch (hash) {
2830        case 3059629:  return getCorsElement();
2831        case 1984153269:  return addService(); 
2832        case -1724546052:  return getDescriptionElement();
2833        default: return super.makeProperty(hash, name);
2834        }
2835
2836      }
2837
2838      @Override
2839      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2840        switch (hash) {
2841        case 3059629: /*cors*/ return new String[] {"boolean"};
2842        case 1984153269: /*service*/ return new String[] {"CodeableConcept"};
2843        case -1724546052: /*description*/ return new String[] {"markdown"};
2844        default: return super.getTypesForProperty(hash, name);
2845        }
2846
2847      }
2848
2849      @Override
2850      public Base addChild(String name) throws FHIRException {
2851        if (name.equals("cors")) {
2852          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.cors");
2853        }
2854        else if (name.equals("service")) {
2855          return addService();
2856        }
2857        else if (name.equals("description")) {
2858          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.description");
2859        }
2860        else
2861          return super.addChild(name);
2862      }
2863
2864      public CapabilityStatementRestSecurityComponent copy() {
2865        CapabilityStatementRestSecurityComponent dst = new CapabilityStatementRestSecurityComponent();
2866        copyValues(dst);
2867        dst.cors = cors == null ? null : cors.copy();
2868        if (service != null) {
2869          dst.service = new ArrayList<CodeableConcept>();
2870          for (CodeableConcept i : service)
2871            dst.service.add(i.copy());
2872        };
2873        dst.description = description == null ? null : description.copy();
2874        return dst;
2875      }
2876
2877      @Override
2878      public boolean equalsDeep(Base other_) {
2879        if (!super.equalsDeep(other_))
2880          return false;
2881        if (!(other_ instanceof CapabilityStatementRestSecurityComponent))
2882          return false;
2883        CapabilityStatementRestSecurityComponent o = (CapabilityStatementRestSecurityComponent) other_;
2884        return compareDeep(cors, o.cors, true) && compareDeep(service, o.service, true) && compareDeep(description, o.description, true)
2885          ;
2886      }
2887
2888      @Override
2889      public boolean equalsShallow(Base other_) {
2890        if (!super.equalsShallow(other_))
2891          return false;
2892        if (!(other_ instanceof CapabilityStatementRestSecurityComponent))
2893          return false;
2894        CapabilityStatementRestSecurityComponent o = (CapabilityStatementRestSecurityComponent) other_;
2895        return compareValues(cors, o.cors, true) && compareValues(description, o.description, true);
2896      }
2897
2898      public boolean isEmpty() {
2899        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(cors, service, description
2900          );
2901      }
2902
2903  public String fhirType() {
2904    return "CapabilityStatement.rest.security";
2905
2906  }
2907
2908  }
2909
2910    @Block()
2911    public static class CapabilityStatementRestResourceComponent extends BackboneElement implements IBaseBackboneElement {
2912        /**
2913         * A type of resource exposed via the restful interface.
2914         */
2915        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2916        @Description(shortDefinition="A resource type that is supported", formalDefinition="A type of resource exposed via the restful interface." )
2917        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/resource-types")
2918        protected CodeType type;
2919
2920        /**
2921         * 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).
2922         */
2923        @Child(name = "profile", type = {CanonicalType.class}, order=2, min=0, max=1, modifier=false, summary=true)
2924        @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)." )
2925        protected CanonicalType profile;
2926
2927        /**
2928         * 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).
2929         */
2930        @Child(name = "supportedProfile", type = {CanonicalType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2931        @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)." )
2932        protected List<CanonicalType> supportedProfile;
2933
2934        /**
2935         * Additional information about the resource type used by the system.
2936         */
2937        @Child(name = "documentation", type = {MarkdownType.class}, order=4, min=0, max=1, modifier=false, summary=false)
2938        @Description(shortDefinition="Additional information about the use of the resource type", formalDefinition="Additional information about the resource type used by the system." )
2939        protected MarkdownType documentation;
2940
2941        /**
2942         * Identifies a restful operation supported by the solution.
2943         */
2944        @Child(name = "interaction", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2945        @Description(shortDefinition="What operations are supported?", formalDefinition="Identifies a restful operation supported by the solution." )
2946        protected List<ResourceInteractionComponent> interaction;
2947
2948        /**
2949         * 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.
2950         */
2951        @Child(name = "versioning", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false)
2952        @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." )
2953        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/versioning-policy")
2954        protected Enumeration<ResourceVersionPolicy> versioning;
2955
2956        /**
2957         * A flag for whether the server is able to return past versions as part of the vRead operation.
2958         */
2959        @Child(name = "readHistory", type = {BooleanType.class}, order=7, min=0, max=1, modifier=false, summary=false)
2960        @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." )
2961        protected BooleanType readHistory;
2962
2963        /**
2964         * 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.
2965         */
2966        @Child(name = "updateCreate", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false)
2967        @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." )
2968        protected BooleanType updateCreate;
2969
2970        /**
2971         * A flag that indicates that the server supports conditional create.
2972         */
2973        @Child(name = "conditionalCreate", type = {BooleanType.class}, order=9, min=0, max=1, modifier=false, summary=false)
2974        @Description(shortDefinition="If allows/uses conditional create", formalDefinition="A flag that indicates that the server supports conditional create." )
2975        protected BooleanType conditionalCreate;
2976
2977        /**
2978         * A code that indicates how the server supports conditional read.
2979         */
2980        @Child(name = "conditionalRead", type = {CodeType.class}, order=10, min=0, max=1, modifier=false, summary=false)
2981        @Description(shortDefinition="not-supported | modified-since | not-match | full-support", formalDefinition="A code that indicates how the server supports conditional read." )
2982        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/conditional-read-status")
2983        protected Enumeration<ConditionalReadStatus> conditionalRead;
2984
2985        /**
2986         * A flag that indicates that the server supports conditional update.
2987         */
2988        @Child(name = "conditionalUpdate", type = {BooleanType.class}, order=11, min=0, max=1, modifier=false, summary=false)
2989        @Description(shortDefinition="If allows/uses conditional update", formalDefinition="A flag that indicates that the server supports conditional update." )
2990        protected BooleanType conditionalUpdate;
2991
2992        /**
2993         * A code that indicates how the server supports conditional delete.
2994         */
2995        @Child(name = "conditionalDelete", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=false)
2996        @Description(shortDefinition="not-supported | single | multiple - how conditional delete is supported", formalDefinition="A code that indicates how the server supports conditional delete." )
2997        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/conditional-delete-status")
2998        protected Enumeration<ConditionalDeleteStatus> conditionalDelete;
2999
3000        /**
3001         * A set of flags that defines how references are supported.
3002         */
3003        @Child(name = "referencePolicy", type = {CodeType.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3004        @Description(shortDefinition="literal | logical | resolves | enforced | local", formalDefinition="A set of flags that defines how references are supported." )
3005        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/reference-handling-policy")
3006        protected List<Enumeration<ReferenceHandlingPolicy>> referencePolicy;
3007
3008        /**
3009         * A list of _include values supported by the server.
3010         */
3011        @Child(name = "searchInclude", type = {StringType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3012        @Description(shortDefinition="_include values supported by the server", formalDefinition="A list of _include values supported by the server." )
3013        protected List<StringType> searchInclude;
3014
3015        /**
3016         * A list of _revinclude (reverse include) values supported by the server.
3017         */
3018        @Child(name = "searchRevInclude", type = {StringType.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3019        @Description(shortDefinition="_revinclude values supported by the server", formalDefinition="A list of _revinclude (reverse include) values supported by the server." )
3020        protected List<StringType> searchRevInclude;
3021
3022        /**
3023         * 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.
3024         */
3025        @Child(name = "searchParam", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3026        @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." )
3027        protected List<CapabilityStatementRestResourceSearchParamComponent> searchParam;
3028
3029        /**
3030         * 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.
3031         */
3032        @Child(name = "operation", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3033        @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." )
3034        protected List<CapabilityStatementRestResourceOperationComponent> operation;
3035
3036        private static final long serialVersionUID = -1843372337L;
3037
3038    /**
3039     * Constructor
3040     */
3041      public CapabilityStatementRestResourceComponent() {
3042        super();
3043      }
3044
3045    /**
3046     * Constructor
3047     */
3048      public CapabilityStatementRestResourceComponent(CodeType type) {
3049        super();
3050        this.type = type;
3051      }
3052
3053        /**
3054         * @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
3055         */
3056        public CodeType getTypeElement() { 
3057          if (this.type == null)
3058            if (Configuration.errorOnAutoCreate())
3059              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.type");
3060            else if (Configuration.doAutoCreate())
3061              this.type = new CodeType(); // bb
3062          return this.type;
3063        }
3064
3065        public boolean hasTypeElement() { 
3066          return this.type != null && !this.type.isEmpty();
3067        }
3068
3069        public boolean hasType() { 
3070          return this.type != null && !this.type.isEmpty();
3071        }
3072
3073        /**
3074         * @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
3075         */
3076        public CapabilityStatementRestResourceComponent setTypeElement(CodeType value) { 
3077          this.type = value;
3078          return this;
3079        }
3080
3081        /**
3082         * @return A type of resource exposed via the restful interface.
3083         */
3084        public String getType() { 
3085          return this.type == null ? null : this.type.getValue();
3086        }
3087
3088        /**
3089         * @param value A type of resource exposed via the restful interface.
3090         */
3091        public CapabilityStatementRestResourceComponent setType(String value) { 
3092            if (this.type == null)
3093              this.type = new CodeType();
3094            this.type.setValue(value);
3095          return this;
3096        }
3097
3098        /**
3099         * @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
3100         */
3101        public CanonicalType getProfileElement() { 
3102          if (this.profile == null)
3103            if (Configuration.errorOnAutoCreate())
3104              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.profile");
3105            else if (Configuration.doAutoCreate())
3106              this.profile = new CanonicalType(); // bb
3107          return this.profile;
3108        }
3109
3110        public boolean hasProfileElement() { 
3111          return this.profile != null && !this.profile.isEmpty();
3112        }
3113
3114        public boolean hasProfile() { 
3115          return this.profile != null && !this.profile.isEmpty();
3116        }
3117
3118        /**
3119         * @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
3120         */
3121        public CapabilityStatementRestResourceComponent setProfileElement(CanonicalType value) { 
3122          this.profile = value;
3123          return this;
3124        }
3125
3126        /**
3127         * @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).
3128         */
3129        public String getProfile() { 
3130          return this.profile == null ? null : this.profile.getValue();
3131        }
3132
3133        /**
3134         * @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).
3135         */
3136        public CapabilityStatementRestResourceComponent setProfile(String value) { 
3137          if (Utilities.noString(value))
3138            this.profile = null;
3139          else {
3140            if (this.profile == null)
3141              this.profile = new CanonicalType();
3142            this.profile.setValue(value);
3143          }
3144          return this;
3145        }
3146
3147        /**
3148         * @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).)
3149         */
3150        public List<CanonicalType> getSupportedProfile() { 
3151          if (this.supportedProfile == null)
3152            this.supportedProfile = new ArrayList<CanonicalType>();
3153          return this.supportedProfile;
3154        }
3155
3156        /**
3157         * @return Returns a reference to <code>this</code> for easy method chaining
3158         */
3159        public CapabilityStatementRestResourceComponent setSupportedProfile(List<CanonicalType> theSupportedProfile) { 
3160          this.supportedProfile = theSupportedProfile;
3161          return this;
3162        }
3163
3164        public boolean hasSupportedProfile() { 
3165          if (this.supportedProfile == null)
3166            return false;
3167          for (CanonicalType item : this.supportedProfile)
3168            if (!item.isEmpty())
3169              return true;
3170          return false;
3171        }
3172
3173        /**
3174         * @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).)
3175         */
3176        public CanonicalType addSupportedProfileElement() {//2 
3177          CanonicalType t = new CanonicalType();
3178          if (this.supportedProfile == null)
3179            this.supportedProfile = new ArrayList<CanonicalType>();
3180          this.supportedProfile.add(t);
3181          return t;
3182        }
3183
3184        /**
3185         * @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).)
3186         */
3187        public CapabilityStatementRestResourceComponent addSupportedProfile(String value) { //1
3188          CanonicalType t = new CanonicalType();
3189          t.setValue(value);
3190          if (this.supportedProfile == null)
3191            this.supportedProfile = new ArrayList<CanonicalType>();
3192          this.supportedProfile.add(t);
3193          return this;
3194        }
3195
3196        /**
3197         * @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).)
3198         */
3199        public boolean hasSupportedProfile(String value) { 
3200          if (this.supportedProfile == null)
3201            return false;
3202          for (CanonicalType v : this.supportedProfile)
3203            if (v.getValue().equals(value)) // canonical(StructureDefinition)
3204              return true;
3205          return false;
3206        }
3207
3208        /**
3209         * @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
3210         */
3211        public MarkdownType getDocumentationElement() { 
3212          if (this.documentation == null)
3213            if (Configuration.errorOnAutoCreate())
3214              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.documentation");
3215            else if (Configuration.doAutoCreate())
3216              this.documentation = new MarkdownType(); // bb
3217          return this.documentation;
3218        }
3219
3220        public boolean hasDocumentationElement() { 
3221          return this.documentation != null && !this.documentation.isEmpty();
3222        }
3223
3224        public boolean hasDocumentation() { 
3225          return this.documentation != null && !this.documentation.isEmpty();
3226        }
3227
3228        /**
3229         * @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
3230         */
3231        public CapabilityStatementRestResourceComponent setDocumentationElement(MarkdownType value) { 
3232          this.documentation = value;
3233          return this;
3234        }
3235
3236        /**
3237         * @return Additional information about the resource type used by the system.
3238         */
3239        public String getDocumentation() { 
3240          return this.documentation == null ? null : this.documentation.getValue();
3241        }
3242
3243        /**
3244         * @param value Additional information about the resource type used by the system.
3245         */
3246        public CapabilityStatementRestResourceComponent setDocumentation(String value) { 
3247          if (value == null)
3248            this.documentation = null;
3249          else {
3250            if (this.documentation == null)
3251              this.documentation = new MarkdownType();
3252            this.documentation.setValue(value);
3253          }
3254          return this;
3255        }
3256
3257        /**
3258         * @return {@link #interaction} (Identifies a restful operation supported by the solution.)
3259         */
3260        public List<ResourceInteractionComponent> getInteraction() { 
3261          if (this.interaction == null)
3262            this.interaction = new ArrayList<ResourceInteractionComponent>();
3263          return this.interaction;
3264        }
3265
3266        /**
3267         * @return Returns a reference to <code>this</code> for easy method chaining
3268         */
3269        public CapabilityStatementRestResourceComponent setInteraction(List<ResourceInteractionComponent> theInteraction) { 
3270          this.interaction = theInteraction;
3271          return this;
3272        }
3273
3274        public boolean hasInteraction() { 
3275          if (this.interaction == null)
3276            return false;
3277          for (ResourceInteractionComponent item : this.interaction)
3278            if (!item.isEmpty())
3279              return true;
3280          return false;
3281        }
3282
3283        public ResourceInteractionComponent addInteraction() { //3
3284          ResourceInteractionComponent t = new ResourceInteractionComponent();
3285          if (this.interaction == null)
3286            this.interaction = new ArrayList<ResourceInteractionComponent>();
3287          this.interaction.add(t);
3288          return t;
3289        }
3290
3291        public CapabilityStatementRestResourceComponent addInteraction(ResourceInteractionComponent t) { //3
3292          if (t == null)
3293            return this;
3294          if (this.interaction == null)
3295            this.interaction = new ArrayList<ResourceInteractionComponent>();
3296          this.interaction.add(t);
3297          return this;
3298        }
3299
3300        /**
3301         * @return The first repetition of repeating field {@link #interaction}, creating it if it does not already exist
3302         */
3303        public ResourceInteractionComponent getInteractionFirstRep() { 
3304          if (getInteraction().isEmpty()) {
3305            addInteraction();
3306          }
3307          return getInteraction().get(0);
3308        }
3309
3310        /**
3311         * @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
3312         */
3313        public Enumeration<ResourceVersionPolicy> getVersioningElement() { 
3314          if (this.versioning == null)
3315            if (Configuration.errorOnAutoCreate())
3316              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.versioning");
3317            else if (Configuration.doAutoCreate())
3318              this.versioning = new Enumeration<ResourceVersionPolicy>(new ResourceVersionPolicyEnumFactory()); // bb
3319          return this.versioning;
3320        }
3321
3322        public boolean hasVersioningElement() { 
3323          return this.versioning != null && !this.versioning.isEmpty();
3324        }
3325
3326        public boolean hasVersioning() { 
3327          return this.versioning != null && !this.versioning.isEmpty();
3328        }
3329
3330        /**
3331         * @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
3332         */
3333        public CapabilityStatementRestResourceComponent setVersioningElement(Enumeration<ResourceVersionPolicy> value) { 
3334          this.versioning = value;
3335          return this;
3336        }
3337
3338        /**
3339         * @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.
3340         */
3341        public ResourceVersionPolicy getVersioning() { 
3342          return this.versioning == null ? null : this.versioning.getValue();
3343        }
3344
3345        /**
3346         * @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.
3347         */
3348        public CapabilityStatementRestResourceComponent setVersioning(ResourceVersionPolicy value) { 
3349          if (value == null)
3350            this.versioning = null;
3351          else {
3352            if (this.versioning == null)
3353              this.versioning = new Enumeration<ResourceVersionPolicy>(new ResourceVersionPolicyEnumFactory());
3354            this.versioning.setValue(value);
3355          }
3356          return this;
3357        }
3358
3359        /**
3360         * @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
3361         */
3362        public BooleanType getReadHistoryElement() { 
3363          if (this.readHistory == null)
3364            if (Configuration.errorOnAutoCreate())
3365              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.readHistory");
3366            else if (Configuration.doAutoCreate())
3367              this.readHistory = new BooleanType(); // bb
3368          return this.readHistory;
3369        }
3370
3371        public boolean hasReadHistoryElement() { 
3372          return this.readHistory != null && !this.readHistory.isEmpty();
3373        }
3374
3375        public boolean hasReadHistory() { 
3376          return this.readHistory != null && !this.readHistory.isEmpty();
3377        }
3378
3379        /**
3380         * @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
3381         */
3382        public CapabilityStatementRestResourceComponent setReadHistoryElement(BooleanType value) { 
3383          this.readHistory = value;
3384          return this;
3385        }
3386
3387        /**
3388         * @return A flag for whether the server is able to return past versions as part of the vRead operation.
3389         */
3390        public boolean getReadHistory() { 
3391          return this.readHistory == null || this.readHistory.isEmpty() ? false : this.readHistory.getValue();
3392        }
3393
3394        /**
3395         * @param value A flag for whether the server is able to return past versions as part of the vRead operation.
3396         */
3397        public CapabilityStatementRestResourceComponent setReadHistory(boolean value) { 
3398            if (this.readHistory == null)
3399              this.readHistory = new BooleanType();
3400            this.readHistory.setValue(value);
3401          return this;
3402        }
3403
3404        /**
3405         * @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
3406         */
3407        public BooleanType getUpdateCreateElement() { 
3408          if (this.updateCreate == null)
3409            if (Configuration.errorOnAutoCreate())
3410              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.updateCreate");
3411            else if (Configuration.doAutoCreate())
3412              this.updateCreate = new BooleanType(); // bb
3413          return this.updateCreate;
3414        }
3415
3416        public boolean hasUpdateCreateElement() { 
3417          return this.updateCreate != null && !this.updateCreate.isEmpty();
3418        }
3419
3420        public boolean hasUpdateCreate() { 
3421          return this.updateCreate != null && !this.updateCreate.isEmpty();
3422        }
3423
3424        /**
3425         * @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
3426         */
3427        public CapabilityStatementRestResourceComponent setUpdateCreateElement(BooleanType value) { 
3428          this.updateCreate = value;
3429          return this;
3430        }
3431
3432        /**
3433         * @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.
3434         */
3435        public boolean getUpdateCreate() { 
3436          return this.updateCreate == null || this.updateCreate.isEmpty() ? false : this.updateCreate.getValue();
3437        }
3438
3439        /**
3440         * @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.
3441         */
3442        public CapabilityStatementRestResourceComponent setUpdateCreate(boolean value) { 
3443            if (this.updateCreate == null)
3444              this.updateCreate = new BooleanType();
3445            this.updateCreate.setValue(value);
3446          return this;
3447        }
3448
3449        /**
3450         * @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
3451         */
3452        public BooleanType getConditionalCreateElement() { 
3453          if (this.conditionalCreate == null)
3454            if (Configuration.errorOnAutoCreate())
3455              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.conditionalCreate");
3456            else if (Configuration.doAutoCreate())
3457              this.conditionalCreate = new BooleanType(); // bb
3458          return this.conditionalCreate;
3459        }
3460
3461        public boolean hasConditionalCreateElement() { 
3462          return this.conditionalCreate != null && !this.conditionalCreate.isEmpty();
3463        }
3464
3465        public boolean hasConditionalCreate() { 
3466          return this.conditionalCreate != null && !this.conditionalCreate.isEmpty();
3467        }
3468
3469        /**
3470         * @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
3471         */
3472        public CapabilityStatementRestResourceComponent setConditionalCreateElement(BooleanType value) { 
3473          this.conditionalCreate = value;
3474          return this;
3475        }
3476
3477        /**
3478         * @return A flag that indicates that the server supports conditional create.
3479         */
3480        public boolean getConditionalCreate() { 
3481          return this.conditionalCreate == null || this.conditionalCreate.isEmpty() ? false : this.conditionalCreate.getValue();
3482        }
3483
3484        /**
3485         * @param value A flag that indicates that the server supports conditional create.
3486         */
3487        public CapabilityStatementRestResourceComponent setConditionalCreate(boolean value) { 
3488            if (this.conditionalCreate == null)
3489              this.conditionalCreate = new BooleanType();
3490            this.conditionalCreate.setValue(value);
3491          return this;
3492        }
3493
3494        /**
3495         * @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
3496         */
3497        public Enumeration<ConditionalReadStatus> getConditionalReadElement() { 
3498          if (this.conditionalRead == null)
3499            if (Configuration.errorOnAutoCreate())
3500              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.conditionalRead");
3501            else if (Configuration.doAutoCreate())
3502              this.conditionalRead = new Enumeration<ConditionalReadStatus>(new ConditionalReadStatusEnumFactory()); // bb
3503          return this.conditionalRead;
3504        }
3505
3506        public boolean hasConditionalReadElement() { 
3507          return this.conditionalRead != null && !this.conditionalRead.isEmpty();
3508        }
3509
3510        public boolean hasConditionalRead() { 
3511          return this.conditionalRead != null && !this.conditionalRead.isEmpty();
3512        }
3513
3514        /**
3515         * @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
3516         */
3517        public CapabilityStatementRestResourceComponent setConditionalReadElement(Enumeration<ConditionalReadStatus> value) { 
3518          this.conditionalRead = value;
3519          return this;
3520        }
3521
3522        /**
3523         * @return A code that indicates how the server supports conditional read.
3524         */
3525        public ConditionalReadStatus getConditionalRead() { 
3526          return this.conditionalRead == null ? null : this.conditionalRead.getValue();
3527        }
3528
3529        /**
3530         * @param value A code that indicates how the server supports conditional read.
3531         */
3532        public CapabilityStatementRestResourceComponent setConditionalRead(ConditionalReadStatus value) { 
3533          if (value == null)
3534            this.conditionalRead = null;
3535          else {
3536            if (this.conditionalRead == null)
3537              this.conditionalRead = new Enumeration<ConditionalReadStatus>(new ConditionalReadStatusEnumFactory());
3538            this.conditionalRead.setValue(value);
3539          }
3540          return this;
3541        }
3542
3543        /**
3544         * @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
3545         */
3546        public BooleanType getConditionalUpdateElement() { 
3547          if (this.conditionalUpdate == null)
3548            if (Configuration.errorOnAutoCreate())
3549              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.conditionalUpdate");
3550            else if (Configuration.doAutoCreate())
3551              this.conditionalUpdate = new BooleanType(); // bb
3552          return this.conditionalUpdate;
3553        }
3554
3555        public boolean hasConditionalUpdateElement() { 
3556          return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty();
3557        }
3558
3559        public boolean hasConditionalUpdate() { 
3560          return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty();
3561        }
3562
3563        /**
3564         * @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
3565         */
3566        public CapabilityStatementRestResourceComponent setConditionalUpdateElement(BooleanType value) { 
3567          this.conditionalUpdate = value;
3568          return this;
3569        }
3570
3571        /**
3572         * @return A flag that indicates that the server supports conditional update.
3573         */
3574        public boolean getConditionalUpdate() { 
3575          return this.conditionalUpdate == null || this.conditionalUpdate.isEmpty() ? false : this.conditionalUpdate.getValue();
3576        }
3577
3578        /**
3579         * @param value A flag that indicates that the server supports conditional update.
3580         */
3581        public CapabilityStatementRestResourceComponent setConditionalUpdate(boolean value) { 
3582            if (this.conditionalUpdate == null)
3583              this.conditionalUpdate = new BooleanType();
3584            this.conditionalUpdate.setValue(value);
3585          return this;
3586        }
3587
3588        /**
3589         * @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
3590         */
3591        public Enumeration<ConditionalDeleteStatus> getConditionalDeleteElement() { 
3592          if (this.conditionalDelete == null)
3593            if (Configuration.errorOnAutoCreate())
3594              throw new Error("Attempt to auto-create CapabilityStatementRestResourceComponent.conditionalDelete");
3595            else if (Configuration.doAutoCreate())
3596              this.conditionalDelete = new Enumeration<ConditionalDeleteStatus>(new ConditionalDeleteStatusEnumFactory()); // bb
3597          return this.conditionalDelete;
3598        }
3599
3600        public boolean hasConditionalDeleteElement() { 
3601          return this.conditionalDelete != null && !this.conditionalDelete.isEmpty();
3602        }
3603
3604        public boolean hasConditionalDelete() { 
3605          return this.conditionalDelete != null && !this.conditionalDelete.isEmpty();
3606        }
3607
3608        /**
3609         * @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
3610         */
3611        public CapabilityStatementRestResourceComponent setConditionalDeleteElement(Enumeration<ConditionalDeleteStatus> value) { 
3612          this.conditionalDelete = value;
3613          return this;
3614        }
3615
3616        /**
3617         * @return A code that indicates how the server supports conditional delete.
3618         */
3619        public ConditionalDeleteStatus getConditionalDelete() { 
3620          return this.conditionalDelete == null ? null : this.conditionalDelete.getValue();
3621        }
3622
3623        /**
3624         * @param value A code that indicates how the server supports conditional delete.
3625         */
3626        public CapabilityStatementRestResourceComponent setConditionalDelete(ConditionalDeleteStatus value) { 
3627          if (value == null)
3628            this.conditionalDelete = null;
3629          else {
3630            if (this.conditionalDelete == null)
3631              this.conditionalDelete = new Enumeration<ConditionalDeleteStatus>(new ConditionalDeleteStatusEnumFactory());
3632            this.conditionalDelete.setValue(value);
3633          }
3634          return this;
3635        }
3636
3637        /**
3638         * @return {@link #referencePolicy} (A set of flags that defines how references are supported.)
3639         */
3640        public List<Enumeration<ReferenceHandlingPolicy>> getReferencePolicy() { 
3641          if (this.referencePolicy == null)
3642            this.referencePolicy = new ArrayList<Enumeration<ReferenceHandlingPolicy>>();
3643          return this.referencePolicy;
3644        }
3645
3646        /**
3647         * @return Returns a reference to <code>this</code> for easy method chaining
3648         */
3649        public CapabilityStatementRestResourceComponent setReferencePolicy(List<Enumeration<ReferenceHandlingPolicy>> theReferencePolicy) { 
3650          this.referencePolicy = theReferencePolicy;
3651          return this;
3652        }
3653
3654        public boolean hasReferencePolicy() { 
3655          if (this.referencePolicy == null)
3656            return false;
3657          for (Enumeration<ReferenceHandlingPolicy> item : this.referencePolicy)
3658            if (!item.isEmpty())
3659              return true;
3660          return false;
3661        }
3662
3663        /**
3664         * @return {@link #referencePolicy} (A set of flags that defines how references are supported.)
3665         */
3666        public Enumeration<ReferenceHandlingPolicy> addReferencePolicyElement() {//2 
3667          Enumeration<ReferenceHandlingPolicy> t = new Enumeration<ReferenceHandlingPolicy>(new ReferenceHandlingPolicyEnumFactory());
3668          if (this.referencePolicy == null)
3669            this.referencePolicy = new ArrayList<Enumeration<ReferenceHandlingPolicy>>();
3670          this.referencePolicy.add(t);
3671          return t;
3672        }
3673
3674        /**
3675         * @param value {@link #referencePolicy} (A set of flags that defines how references are supported.)
3676         */
3677        public CapabilityStatementRestResourceComponent addReferencePolicy(ReferenceHandlingPolicy value) { //1
3678          Enumeration<ReferenceHandlingPolicy> t = new Enumeration<ReferenceHandlingPolicy>(new ReferenceHandlingPolicyEnumFactory());
3679          t.setValue(value);
3680          if (this.referencePolicy == null)
3681            this.referencePolicy = new ArrayList<Enumeration<ReferenceHandlingPolicy>>();
3682          this.referencePolicy.add(t);
3683          return this;
3684        }
3685
3686        /**
3687         * @param value {@link #referencePolicy} (A set of flags that defines how references are supported.)
3688         */
3689        public boolean hasReferencePolicy(ReferenceHandlingPolicy value) { 
3690          if (this.referencePolicy == null)
3691            return false;
3692          for (Enumeration<ReferenceHandlingPolicy> v : this.referencePolicy)
3693            if (v.getValue().equals(value)) // code
3694              return true;
3695          return false;
3696        }
3697
3698        /**
3699         * @return {@link #searchInclude} (A list of _include values supported by the server.)
3700         */
3701        public List<StringType> getSearchInclude() { 
3702          if (this.searchInclude == null)
3703            this.searchInclude = new ArrayList<StringType>();
3704          return this.searchInclude;
3705        }
3706
3707        /**
3708         * @return Returns a reference to <code>this</code> for easy method chaining
3709         */
3710        public CapabilityStatementRestResourceComponent setSearchInclude(List<StringType> theSearchInclude) { 
3711          this.searchInclude = theSearchInclude;
3712          return this;
3713        }
3714
3715        public boolean hasSearchInclude() { 
3716          if (this.searchInclude == null)
3717            return false;
3718          for (StringType item : this.searchInclude)
3719            if (!item.isEmpty())
3720              return true;
3721          return false;
3722        }
3723
3724        /**
3725         * @return {@link #searchInclude} (A list of _include values supported by the server.)
3726         */
3727        public StringType addSearchIncludeElement() {//2 
3728          StringType t = new StringType();
3729          if (this.searchInclude == null)
3730            this.searchInclude = new ArrayList<StringType>();
3731          this.searchInclude.add(t);
3732          return t;
3733        }
3734
3735        /**
3736         * @param value {@link #searchInclude} (A list of _include values supported by the server.)
3737         */
3738        public CapabilityStatementRestResourceComponent addSearchInclude(String value) { //1
3739          StringType t = new StringType();
3740          t.setValue(value);
3741          if (this.searchInclude == null)
3742            this.searchInclude = new ArrayList<StringType>();
3743          this.searchInclude.add(t);
3744          return this;
3745        }
3746
3747        /**
3748         * @param value {@link #searchInclude} (A list of _include values supported by the server.)
3749         */
3750        public boolean hasSearchInclude(String value) { 
3751          if (this.searchInclude == null)
3752            return false;
3753          for (StringType v : this.searchInclude)
3754            if (v.getValue().equals(value)) // string
3755              return true;
3756          return false;
3757        }
3758
3759        /**
3760         * @return {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.)
3761         */
3762        public List<StringType> getSearchRevInclude() { 
3763          if (this.searchRevInclude == null)
3764            this.searchRevInclude = new ArrayList<StringType>();
3765          return this.searchRevInclude;
3766        }
3767
3768        /**
3769         * @return Returns a reference to <code>this</code> for easy method chaining
3770         */
3771        public CapabilityStatementRestResourceComponent setSearchRevInclude(List<StringType> theSearchRevInclude) { 
3772          this.searchRevInclude = theSearchRevInclude;
3773          return this;
3774        }
3775
3776        public boolean hasSearchRevInclude() { 
3777          if (this.searchRevInclude == null)
3778            return false;
3779          for (StringType item : this.searchRevInclude)
3780            if (!item.isEmpty())
3781              return true;
3782          return false;
3783        }
3784
3785        /**
3786         * @return {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.)
3787         */
3788        public StringType addSearchRevIncludeElement() {//2 
3789          StringType t = new StringType();
3790          if (this.searchRevInclude == null)
3791            this.searchRevInclude = new ArrayList<StringType>();
3792          this.searchRevInclude.add(t);
3793          return t;
3794        }
3795
3796        /**
3797         * @param value {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.)
3798         */
3799        public CapabilityStatementRestResourceComponent addSearchRevInclude(String value) { //1
3800          StringType t = new StringType();
3801          t.setValue(value);
3802          if (this.searchRevInclude == null)
3803            this.searchRevInclude = new ArrayList<StringType>();
3804          this.searchRevInclude.add(t);
3805          return this;
3806        }
3807
3808        /**
3809         * @param value {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.)
3810         */
3811        public boolean hasSearchRevInclude(String value) { 
3812          if (this.searchRevInclude == null)
3813            return false;
3814          for (StringType v : this.searchRevInclude)
3815            if (v.getValue().equals(value)) // string
3816              return true;
3817          return false;
3818        }
3819
3820        /**
3821         * @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.)
3822         */
3823        public List<CapabilityStatementRestResourceSearchParamComponent> getSearchParam() { 
3824          if (this.searchParam == null)
3825            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
3826          return this.searchParam;
3827        }
3828
3829        /**
3830         * @return Returns a reference to <code>this</code> for easy method chaining
3831         */
3832        public CapabilityStatementRestResourceComponent setSearchParam(List<CapabilityStatementRestResourceSearchParamComponent> theSearchParam) { 
3833          this.searchParam = theSearchParam;
3834          return this;
3835        }
3836
3837        public boolean hasSearchParam() { 
3838          if (this.searchParam == null)
3839            return false;
3840          for (CapabilityStatementRestResourceSearchParamComponent item : this.searchParam)
3841            if (!item.isEmpty())
3842              return true;
3843          return false;
3844        }
3845
3846        public CapabilityStatementRestResourceSearchParamComponent addSearchParam() { //3
3847          CapabilityStatementRestResourceSearchParamComponent t = new CapabilityStatementRestResourceSearchParamComponent();
3848          if (this.searchParam == null)
3849            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
3850          this.searchParam.add(t);
3851          return t;
3852        }
3853
3854        public CapabilityStatementRestResourceComponent addSearchParam(CapabilityStatementRestResourceSearchParamComponent t) { //3
3855          if (t == null)
3856            return this;
3857          if (this.searchParam == null)
3858            this.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
3859          this.searchParam.add(t);
3860          return this;
3861        }
3862
3863        /**
3864         * @return The first repetition of repeating field {@link #searchParam}, creating it if it does not already exist
3865         */
3866        public CapabilityStatementRestResourceSearchParamComponent getSearchParamFirstRep() { 
3867          if (getSearchParam().isEmpty()) {
3868            addSearchParam();
3869          }
3870          return getSearchParam().get(0);
3871        }
3872
3873        /**
3874         * @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.)
3875         */
3876        public List<CapabilityStatementRestResourceOperationComponent> getOperation() { 
3877          if (this.operation == null)
3878            this.operation = new ArrayList<CapabilityStatementRestResourceOperationComponent>();
3879          return this.operation;
3880        }
3881
3882        /**
3883         * @return Returns a reference to <code>this</code> for easy method chaining
3884         */
3885        public CapabilityStatementRestResourceComponent setOperation(List<CapabilityStatementRestResourceOperationComponent> theOperation) { 
3886          this.operation = theOperation;
3887          return this;
3888        }
3889
3890        public boolean hasOperation() { 
3891          if (this.operation == null)
3892            return false;
3893          for (CapabilityStatementRestResourceOperationComponent item : this.operation)
3894            if (!item.isEmpty())
3895              return true;
3896          return false;
3897        }
3898
3899        public CapabilityStatementRestResourceOperationComponent addOperation() { //3
3900          CapabilityStatementRestResourceOperationComponent t = new CapabilityStatementRestResourceOperationComponent();
3901          if (this.operation == null)
3902            this.operation = new ArrayList<CapabilityStatementRestResourceOperationComponent>();
3903          this.operation.add(t);
3904          return t;
3905        }
3906
3907        public CapabilityStatementRestResourceComponent addOperation(CapabilityStatementRestResourceOperationComponent t) { //3
3908          if (t == null)
3909            return this;
3910          if (this.operation == null)
3911            this.operation = new ArrayList<CapabilityStatementRestResourceOperationComponent>();
3912          this.operation.add(t);
3913          return this;
3914        }
3915
3916        /**
3917         * @return The first repetition of repeating field {@link #operation}, creating it if it does not already exist
3918         */
3919        public CapabilityStatementRestResourceOperationComponent getOperationFirstRep() { 
3920          if (getOperation().isEmpty()) {
3921            addOperation();
3922          }
3923          return getOperation().get(0);
3924        }
3925
3926        protected void listChildren(List<Property> children) {
3927          super.listChildren(children);
3928          children.add(new Property("type", "code", "A type of resource exposed via the restful interface.", 0, 1, type));
3929          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));
3930          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));
3931          children.add(new Property("documentation", "markdown", "Additional information about the resource type used by the system.", 0, 1, documentation));
3932          children.add(new Property("interaction", "", "Identifies a restful operation supported by the solution.", 0, java.lang.Integer.MAX_VALUE, interaction));
3933          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));
3934          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));
3935          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));
3936          children.add(new Property("conditionalCreate", "boolean", "A flag that indicates that the server supports conditional create.", 0, 1, conditionalCreate));
3937          children.add(new Property("conditionalRead", "code", "A code that indicates how the server supports conditional read.", 0, 1, conditionalRead));
3938          children.add(new Property("conditionalUpdate", "boolean", "A flag that indicates that the server supports conditional update.", 0, 1, conditionalUpdate));
3939          children.add(new Property("conditionalDelete", "code", "A code that indicates how the server supports conditional delete.", 0, 1, conditionalDelete));
3940          children.add(new Property("referencePolicy", "code", "A set of flags that defines how references are supported.", 0, java.lang.Integer.MAX_VALUE, referencePolicy));
3941          children.add(new Property("searchInclude", "string", "A list of _include values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchInclude));
3942          children.add(new Property("searchRevInclude", "string", "A list of _revinclude (reverse include) values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchRevInclude));
3943          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));
3944          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));
3945        }
3946
3947        @Override
3948        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3949          switch (_hash) {
3950          case 3575610: /*type*/  return new Property("type", "code", "A type of resource exposed via the restful interface.", 0, 1, type);
3951          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);
3952          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);
3953          case 1587405498: /*documentation*/  return new Property("documentation", "markdown", "Additional information about the resource type used by the system.", 0, 1, documentation);
3954          case 1844104722: /*interaction*/  return new Property("interaction", "", "Identifies a restful operation supported by the solution.", 0, java.lang.Integer.MAX_VALUE, interaction);
3955          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);
3956          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);
3957          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);
3958          case 6401826: /*conditionalCreate*/  return new Property("conditionalCreate", "boolean", "A flag that indicates that the server supports conditional create.", 0, 1, conditionalCreate);
3959          case 822786364: /*conditionalRead*/  return new Property("conditionalRead", "code", "A code that indicates how the server supports conditional read.", 0, 1, conditionalRead);
3960          case 519849711: /*conditionalUpdate*/  return new Property("conditionalUpdate", "boolean", "A flag that indicates that the server supports conditional update.", 0, 1, conditionalUpdate);
3961          case 23237585: /*conditionalDelete*/  return new Property("conditionalDelete", "code", "A code that indicates how the server supports conditional delete.", 0, 1, conditionalDelete);
3962          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);
3963          case -1035904544: /*searchInclude*/  return new Property("searchInclude", "string", "A list of _include values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchInclude);
3964          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);
3965          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);
3966          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);
3967          default: return super.getNamedProperty(_hash, _name, _checkValid);
3968          }
3969
3970        }
3971
3972      @Override
3973      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3974        switch (hash) {
3975        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType
3976        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // CanonicalType
3977        case 1225477403: /*supportedProfile*/ return this.supportedProfile == null ? new Base[0] : this.supportedProfile.toArray(new Base[this.supportedProfile.size()]); // CanonicalType
3978        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // MarkdownType
3979        case 1844104722: /*interaction*/ return this.interaction == null ? new Base[0] : this.interaction.toArray(new Base[this.interaction.size()]); // ResourceInteractionComponent
3980        case -670487542: /*versioning*/ return this.versioning == null ? new Base[0] : new Base[] {this.versioning}; // Enumeration<ResourceVersionPolicy>
3981        case 187518494: /*readHistory*/ return this.readHistory == null ? new Base[0] : new Base[] {this.readHistory}; // BooleanType
3982        case -1400550619: /*updateCreate*/ return this.updateCreate == null ? new Base[0] : new Base[] {this.updateCreate}; // BooleanType
3983        case 6401826: /*conditionalCreate*/ return this.conditionalCreate == null ? new Base[0] : new Base[] {this.conditionalCreate}; // BooleanType
3984        case 822786364: /*conditionalRead*/ return this.conditionalRead == null ? new Base[0] : new Base[] {this.conditionalRead}; // Enumeration<ConditionalReadStatus>
3985        case 519849711: /*conditionalUpdate*/ return this.conditionalUpdate == null ? new Base[0] : new Base[] {this.conditionalUpdate}; // BooleanType
3986        case 23237585: /*conditionalDelete*/ return this.conditionalDelete == null ? new Base[0] : new Base[] {this.conditionalDelete}; // Enumeration<ConditionalDeleteStatus>
3987        case 796257373: /*referencePolicy*/ return this.referencePolicy == null ? new Base[0] : this.referencePolicy.toArray(new Base[this.referencePolicy.size()]); // Enumeration<ReferenceHandlingPolicy>
3988        case -1035904544: /*searchInclude*/ return this.searchInclude == null ? new Base[0] : this.searchInclude.toArray(new Base[this.searchInclude.size()]); // StringType
3989        case -2123884979: /*searchRevInclude*/ return this.searchRevInclude == null ? new Base[0] : this.searchRevInclude.toArray(new Base[this.searchRevInclude.size()]); // StringType
3990        case -553645115: /*searchParam*/ return this.searchParam == null ? new Base[0] : this.searchParam.toArray(new Base[this.searchParam.size()]); // CapabilityStatementRestResourceSearchParamComponent
3991        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : this.operation.toArray(new Base[this.operation.size()]); // CapabilityStatementRestResourceOperationComponent
3992        default: return super.getProperty(hash, name, checkValid);
3993        }
3994
3995      }
3996
3997      @Override
3998      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3999        switch (hash) {
4000        case 3575610: // type
4001          this.type = castToCode(value); // CodeType
4002          return value;
4003        case -309425751: // profile
4004          this.profile = castToCanonical(value); // CanonicalType
4005          return value;
4006        case 1225477403: // supportedProfile
4007          this.getSupportedProfile().add(castToCanonical(value)); // CanonicalType
4008          return value;
4009        case 1587405498: // documentation
4010          this.documentation = castToMarkdown(value); // MarkdownType
4011          return value;
4012        case 1844104722: // interaction
4013          this.getInteraction().add((ResourceInteractionComponent) value); // ResourceInteractionComponent
4014          return value;
4015        case -670487542: // versioning
4016          value = new ResourceVersionPolicyEnumFactory().fromType(castToCode(value));
4017          this.versioning = (Enumeration) value; // Enumeration<ResourceVersionPolicy>
4018          return value;
4019        case 187518494: // readHistory
4020          this.readHistory = castToBoolean(value); // BooleanType
4021          return value;
4022        case -1400550619: // updateCreate
4023          this.updateCreate = castToBoolean(value); // BooleanType
4024          return value;
4025        case 6401826: // conditionalCreate
4026          this.conditionalCreate = castToBoolean(value); // BooleanType
4027          return value;
4028        case 822786364: // conditionalRead
4029          value = new ConditionalReadStatusEnumFactory().fromType(castToCode(value));
4030          this.conditionalRead = (Enumeration) value; // Enumeration<ConditionalReadStatus>
4031          return value;
4032        case 519849711: // conditionalUpdate
4033          this.conditionalUpdate = castToBoolean(value); // BooleanType
4034          return value;
4035        case 23237585: // conditionalDelete
4036          value = new ConditionalDeleteStatusEnumFactory().fromType(castToCode(value));
4037          this.conditionalDelete = (Enumeration) value; // Enumeration<ConditionalDeleteStatus>
4038          return value;
4039        case 796257373: // referencePolicy
4040          value = new ReferenceHandlingPolicyEnumFactory().fromType(castToCode(value));
4041          this.getReferencePolicy().add((Enumeration) value); // Enumeration<ReferenceHandlingPolicy>
4042          return value;
4043        case -1035904544: // searchInclude
4044          this.getSearchInclude().add(castToString(value)); // StringType
4045          return value;
4046        case -2123884979: // searchRevInclude
4047          this.getSearchRevInclude().add(castToString(value)); // StringType
4048          return value;
4049        case -553645115: // searchParam
4050          this.getSearchParam().add((CapabilityStatementRestResourceSearchParamComponent) value); // CapabilityStatementRestResourceSearchParamComponent
4051          return value;
4052        case 1662702951: // operation
4053          this.getOperation().add((CapabilityStatementRestResourceOperationComponent) value); // CapabilityStatementRestResourceOperationComponent
4054          return value;
4055        default: return super.setProperty(hash, name, value);
4056        }
4057
4058      }
4059
4060      @Override
4061      public Base setProperty(String name, Base value) throws FHIRException {
4062        if (name.equals("type")) {
4063          this.type = castToCode(value); // CodeType
4064        } else if (name.equals("profile")) {
4065          this.profile = castToCanonical(value); // CanonicalType
4066        } else if (name.equals("supportedProfile")) {
4067          this.getSupportedProfile().add(castToCanonical(value));
4068        } else if (name.equals("documentation")) {
4069          this.documentation = castToMarkdown(value); // MarkdownType
4070        } else if (name.equals("interaction")) {
4071          this.getInteraction().add((ResourceInteractionComponent) value);
4072        } else if (name.equals("versioning")) {
4073          value = new ResourceVersionPolicyEnumFactory().fromType(castToCode(value));
4074          this.versioning = (Enumeration) value; // Enumeration<ResourceVersionPolicy>
4075        } else if (name.equals("readHistory")) {
4076          this.readHistory = castToBoolean(value); // BooleanType
4077        } else if (name.equals("updateCreate")) {
4078          this.updateCreate = castToBoolean(value); // BooleanType
4079        } else if (name.equals("conditionalCreate")) {
4080          this.conditionalCreate = castToBoolean(value); // BooleanType
4081        } else if (name.equals("conditionalRead")) {
4082          value = new ConditionalReadStatusEnumFactory().fromType(castToCode(value));
4083          this.conditionalRead = (Enumeration) value; // Enumeration<ConditionalReadStatus>
4084        } else if (name.equals("conditionalUpdate")) {
4085          this.conditionalUpdate = castToBoolean(value); // BooleanType
4086        } else if (name.equals("conditionalDelete")) {
4087          value = new ConditionalDeleteStatusEnumFactory().fromType(castToCode(value));
4088          this.conditionalDelete = (Enumeration) value; // Enumeration<ConditionalDeleteStatus>
4089        } else if (name.equals("referencePolicy")) {
4090          value = new ReferenceHandlingPolicyEnumFactory().fromType(castToCode(value));
4091          this.getReferencePolicy().add((Enumeration) value);
4092        } else if (name.equals("searchInclude")) {
4093          this.getSearchInclude().add(castToString(value));
4094        } else if (name.equals("searchRevInclude")) {
4095          this.getSearchRevInclude().add(castToString(value));
4096        } else if (name.equals("searchParam")) {
4097          this.getSearchParam().add((CapabilityStatementRestResourceSearchParamComponent) value);
4098        } else if (name.equals("operation")) {
4099          this.getOperation().add((CapabilityStatementRestResourceOperationComponent) value);
4100        } else
4101          return super.setProperty(name, value);
4102        return value;
4103      }
4104
4105      @Override
4106      public Base makeProperty(int hash, String name) throws FHIRException {
4107        switch (hash) {
4108        case 3575610:  return getTypeElement();
4109        case -309425751:  return getProfileElement();
4110        case 1225477403:  return addSupportedProfileElement();
4111        case 1587405498:  return getDocumentationElement();
4112        case 1844104722:  return addInteraction(); 
4113        case -670487542:  return getVersioningElement();
4114        case 187518494:  return getReadHistoryElement();
4115        case -1400550619:  return getUpdateCreateElement();
4116        case 6401826:  return getConditionalCreateElement();
4117        case 822786364:  return getConditionalReadElement();
4118        case 519849711:  return getConditionalUpdateElement();
4119        case 23237585:  return getConditionalDeleteElement();
4120        case 796257373:  return addReferencePolicyElement();
4121        case -1035904544:  return addSearchIncludeElement();
4122        case -2123884979:  return addSearchRevIncludeElement();
4123        case -553645115:  return addSearchParam(); 
4124        case 1662702951:  return addOperation(); 
4125        default: return super.makeProperty(hash, name);
4126        }
4127
4128      }
4129
4130      @Override
4131      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4132        switch (hash) {
4133        case 3575610: /*type*/ return new String[] {"code"};
4134        case -309425751: /*profile*/ return new String[] {"canonical"};
4135        case 1225477403: /*supportedProfile*/ return new String[] {"canonical"};
4136        case 1587405498: /*documentation*/ return new String[] {"markdown"};
4137        case 1844104722: /*interaction*/ return new String[] {};
4138        case -670487542: /*versioning*/ return new String[] {"code"};
4139        case 187518494: /*readHistory*/ return new String[] {"boolean"};
4140        case -1400550619: /*updateCreate*/ return new String[] {"boolean"};
4141        case 6401826: /*conditionalCreate*/ return new String[] {"boolean"};
4142        case 822786364: /*conditionalRead*/ return new String[] {"code"};
4143        case 519849711: /*conditionalUpdate*/ return new String[] {"boolean"};
4144        case 23237585: /*conditionalDelete*/ return new String[] {"code"};
4145        case 796257373: /*referencePolicy*/ return new String[] {"code"};
4146        case -1035904544: /*searchInclude*/ return new String[] {"string"};
4147        case -2123884979: /*searchRevInclude*/ return new String[] {"string"};
4148        case -553645115: /*searchParam*/ return new String[] {};
4149        case 1662702951: /*operation*/ return new String[] {};
4150        default: return super.getTypesForProperty(hash, name);
4151        }
4152
4153      }
4154
4155      @Override
4156      public Base addChild(String name) throws FHIRException {
4157        if (name.equals("type")) {
4158          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.type");
4159        }
4160        else if (name.equals("profile")) {
4161          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.profile");
4162        }
4163        else if (name.equals("supportedProfile")) {
4164          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.supportedProfile");
4165        }
4166        else if (name.equals("documentation")) {
4167          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
4168        }
4169        else if (name.equals("interaction")) {
4170          return addInteraction();
4171        }
4172        else if (name.equals("versioning")) {
4173          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.versioning");
4174        }
4175        else if (name.equals("readHistory")) {
4176          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.readHistory");
4177        }
4178        else if (name.equals("updateCreate")) {
4179          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.updateCreate");
4180        }
4181        else if (name.equals("conditionalCreate")) {
4182          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.conditionalCreate");
4183        }
4184        else if (name.equals("conditionalRead")) {
4185          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.conditionalRead");
4186        }
4187        else if (name.equals("conditionalUpdate")) {
4188          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.conditionalUpdate");
4189        }
4190        else if (name.equals("conditionalDelete")) {
4191          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.conditionalDelete");
4192        }
4193        else if (name.equals("referencePolicy")) {
4194          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.referencePolicy");
4195        }
4196        else if (name.equals("searchInclude")) {
4197          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.searchInclude");
4198        }
4199        else if (name.equals("searchRevInclude")) {
4200          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.searchRevInclude");
4201        }
4202        else if (name.equals("searchParam")) {
4203          return addSearchParam();
4204        }
4205        else if (name.equals("operation")) {
4206          return addOperation();
4207        }
4208        else
4209          return super.addChild(name);
4210      }
4211
4212      public CapabilityStatementRestResourceComponent copy() {
4213        CapabilityStatementRestResourceComponent dst = new CapabilityStatementRestResourceComponent();
4214        copyValues(dst);
4215        dst.type = type == null ? null : type.copy();
4216        dst.profile = profile == null ? null : profile.copy();
4217        if (supportedProfile != null) {
4218          dst.supportedProfile = new ArrayList<CanonicalType>();
4219          for (CanonicalType i : supportedProfile)
4220            dst.supportedProfile.add(i.copy());
4221        };
4222        dst.documentation = documentation == null ? null : documentation.copy();
4223        if (interaction != null) {
4224          dst.interaction = new ArrayList<ResourceInteractionComponent>();
4225          for (ResourceInteractionComponent i : interaction)
4226            dst.interaction.add(i.copy());
4227        };
4228        dst.versioning = versioning == null ? null : versioning.copy();
4229        dst.readHistory = readHistory == null ? null : readHistory.copy();
4230        dst.updateCreate = updateCreate == null ? null : updateCreate.copy();
4231        dst.conditionalCreate = conditionalCreate == null ? null : conditionalCreate.copy();
4232        dst.conditionalRead = conditionalRead == null ? null : conditionalRead.copy();
4233        dst.conditionalUpdate = conditionalUpdate == null ? null : conditionalUpdate.copy();
4234        dst.conditionalDelete = conditionalDelete == null ? null : conditionalDelete.copy();
4235        if (referencePolicy != null) {
4236          dst.referencePolicy = new ArrayList<Enumeration<ReferenceHandlingPolicy>>();
4237          for (Enumeration<ReferenceHandlingPolicy> i : referencePolicy)
4238            dst.referencePolicy.add(i.copy());
4239        };
4240        if (searchInclude != null) {
4241          dst.searchInclude = new ArrayList<StringType>();
4242          for (StringType i : searchInclude)
4243            dst.searchInclude.add(i.copy());
4244        };
4245        if (searchRevInclude != null) {
4246          dst.searchRevInclude = new ArrayList<StringType>();
4247          for (StringType i : searchRevInclude)
4248            dst.searchRevInclude.add(i.copy());
4249        };
4250        if (searchParam != null) {
4251          dst.searchParam = new ArrayList<CapabilityStatementRestResourceSearchParamComponent>();
4252          for (CapabilityStatementRestResourceSearchParamComponent i : searchParam)
4253            dst.searchParam.add(i.copy());
4254        };
4255        if (operation != null) {
4256          dst.operation = new ArrayList<CapabilityStatementRestResourceOperationComponent>();
4257          for (CapabilityStatementRestResourceOperationComponent i : operation)
4258            dst.operation.add(i.copy());
4259        };
4260        return dst;
4261      }
4262
4263      @Override
4264      public boolean equalsDeep(Base other_) {
4265        if (!super.equalsDeep(other_))
4266          return false;
4267        if (!(other_ instanceof CapabilityStatementRestResourceComponent))
4268          return false;
4269        CapabilityStatementRestResourceComponent o = (CapabilityStatementRestResourceComponent) other_;
4270        return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true) && compareDeep(supportedProfile, o.supportedProfile, true)
4271           && compareDeep(documentation, o.documentation, true) && compareDeep(interaction, o.interaction, true)
4272           && compareDeep(versioning, o.versioning, true) && compareDeep(readHistory, o.readHistory, true)
4273           && compareDeep(updateCreate, o.updateCreate, true) && compareDeep(conditionalCreate, o.conditionalCreate, true)
4274           && compareDeep(conditionalRead, o.conditionalRead, true) && compareDeep(conditionalUpdate, o.conditionalUpdate, true)
4275           && compareDeep(conditionalDelete, o.conditionalDelete, true) && compareDeep(referencePolicy, o.referencePolicy, true)
4276           && compareDeep(searchInclude, o.searchInclude, true) && compareDeep(searchRevInclude, o.searchRevInclude, true)
4277           && compareDeep(searchParam, o.searchParam, true) && compareDeep(operation, o.operation, true);
4278      }
4279
4280      @Override
4281      public boolean equalsShallow(Base other_) {
4282        if (!super.equalsShallow(other_))
4283          return false;
4284        if (!(other_ instanceof CapabilityStatementRestResourceComponent))
4285          return false;
4286        CapabilityStatementRestResourceComponent o = (CapabilityStatementRestResourceComponent) other_;
4287        return compareValues(type, o.type, true) && compareValues(documentation, o.documentation, true) && compareValues(versioning, o.versioning, true)
4288           && compareValues(readHistory, o.readHistory, true) && compareValues(updateCreate, o.updateCreate, true)
4289           && compareValues(conditionalCreate, o.conditionalCreate, true) && compareValues(conditionalRead, o.conditionalRead, true)
4290           && compareValues(conditionalUpdate, o.conditionalUpdate, true) && compareValues(conditionalDelete, o.conditionalDelete, true)
4291           && compareValues(referencePolicy, o.referencePolicy, true) && compareValues(searchInclude, o.searchInclude, true)
4292           && compareValues(searchRevInclude, o.searchRevInclude, true);
4293      }
4294
4295      public boolean isEmpty() {
4296        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, profile, supportedProfile
4297          , documentation, interaction, versioning, readHistory, updateCreate, conditionalCreate
4298          , conditionalRead, conditionalUpdate, conditionalDelete, referencePolicy, searchInclude
4299          , searchRevInclude, searchParam, operation);
4300      }
4301
4302  public String fhirType() {
4303    return "CapabilityStatement.rest.resource";
4304
4305  }
4306
4307  }
4308
4309    @Block()
4310    public static class ResourceInteractionComponent extends BackboneElement implements IBaseBackboneElement {
4311        /**
4312         * Coded identifier of the operation, supported by the system resource.
4313         */
4314        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4315        @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." )
4316        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/type-restful-interaction")
4317        protected Enumeration<TypeRestfulInteraction> code;
4318
4319        /**
4320         * 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'.
4321         */
4322        @Child(name = "documentation", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false)
4323        @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'." )
4324        protected MarkdownType documentation;
4325
4326        private static final long serialVersionUID = 2128937796L;
4327
4328    /**
4329     * Constructor
4330     */
4331      public ResourceInteractionComponent() {
4332        super();
4333      }
4334
4335    /**
4336     * Constructor
4337     */
4338      public ResourceInteractionComponent(Enumeration<TypeRestfulInteraction> code) {
4339        super();
4340        this.code = code;
4341      }
4342
4343        /**
4344         * @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
4345         */
4346        public Enumeration<TypeRestfulInteraction> getCodeElement() { 
4347          if (this.code == null)
4348            if (Configuration.errorOnAutoCreate())
4349              throw new Error("Attempt to auto-create ResourceInteractionComponent.code");
4350            else if (Configuration.doAutoCreate())
4351              this.code = new Enumeration<TypeRestfulInteraction>(new TypeRestfulInteractionEnumFactory()); // bb
4352          return this.code;
4353        }
4354
4355        public boolean hasCodeElement() { 
4356          return this.code != null && !this.code.isEmpty();
4357        }
4358
4359        public boolean hasCode() { 
4360          return this.code != null && !this.code.isEmpty();
4361        }
4362
4363        /**
4364         * @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
4365         */
4366        public ResourceInteractionComponent setCodeElement(Enumeration<TypeRestfulInteraction> value) { 
4367          this.code = value;
4368          return this;
4369        }
4370
4371        /**
4372         * @return Coded identifier of the operation, supported by the system resource.
4373         */
4374        public TypeRestfulInteraction getCode() { 
4375          return this.code == null ? null : this.code.getValue();
4376        }
4377
4378        /**
4379         * @param value Coded identifier of the operation, supported by the system resource.
4380         */
4381        public ResourceInteractionComponent setCode(TypeRestfulInteraction value) { 
4382            if (this.code == null)
4383              this.code = new Enumeration<TypeRestfulInteraction>(new TypeRestfulInteractionEnumFactory());
4384            this.code.setValue(value);
4385          return this;
4386        }
4387
4388        /**
4389         * @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
4390         */
4391        public MarkdownType getDocumentationElement() { 
4392          if (this.documentation == null)
4393            if (Configuration.errorOnAutoCreate())
4394              throw new Error("Attempt to auto-create ResourceInteractionComponent.documentation");
4395            else if (Configuration.doAutoCreate())
4396              this.documentation = new MarkdownType(); // bb
4397          return this.documentation;
4398        }
4399
4400        public boolean hasDocumentationElement() { 
4401          return this.documentation != null && !this.documentation.isEmpty();
4402        }
4403
4404        public boolean hasDocumentation() { 
4405          return this.documentation != null && !this.documentation.isEmpty();
4406        }
4407
4408        /**
4409         * @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
4410         */
4411        public ResourceInteractionComponent setDocumentationElement(MarkdownType value) { 
4412          this.documentation = value;
4413          return this;
4414        }
4415
4416        /**
4417         * @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'.
4418         */
4419        public String getDocumentation() { 
4420          return this.documentation == null ? null : this.documentation.getValue();
4421        }
4422
4423        /**
4424         * @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'.
4425         */
4426        public ResourceInteractionComponent setDocumentation(String value) { 
4427          if (value == null)
4428            this.documentation = null;
4429          else {
4430            if (this.documentation == null)
4431              this.documentation = new MarkdownType();
4432            this.documentation.setValue(value);
4433          }
4434          return this;
4435        }
4436
4437        protected void listChildren(List<Property> children) {
4438          super.listChildren(children);
4439          children.add(new Property("code", "code", "Coded identifier of the operation, supported by the system resource.", 0, 1, code));
4440          children.add(new Property("documentation", "markdown", "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));
4441        }
4442
4443        @Override
4444        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4445          switch (_hash) {
4446          case 3059181: /*code*/  return new Property("code", "code", "Coded identifier of the operation, supported by the system resource.", 0, 1, code);
4447          case 1587405498: /*documentation*/  return new Property("documentation", "markdown", "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);
4448          default: return super.getNamedProperty(_hash, _name, _checkValid);
4449          }
4450
4451        }
4452
4453      @Override
4454      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4455        switch (hash) {
4456        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration<TypeRestfulInteraction>
4457        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // MarkdownType
4458        default: return super.getProperty(hash, name, checkValid);
4459        }
4460
4461      }
4462
4463      @Override
4464      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4465        switch (hash) {
4466        case 3059181: // code
4467          value = new TypeRestfulInteractionEnumFactory().fromType(castToCode(value));
4468          this.code = (Enumeration) value; // Enumeration<TypeRestfulInteraction>
4469          return value;
4470        case 1587405498: // documentation
4471          this.documentation = castToMarkdown(value); // MarkdownType
4472          return value;
4473        default: return super.setProperty(hash, name, value);
4474        }
4475
4476      }
4477
4478      @Override
4479      public Base setProperty(String name, Base value) throws FHIRException {
4480        if (name.equals("code")) {
4481          value = new TypeRestfulInteractionEnumFactory().fromType(castToCode(value));
4482          this.code = (Enumeration) value; // Enumeration<TypeRestfulInteraction>
4483        } else if (name.equals("documentation")) {
4484          this.documentation = castToMarkdown(value); // MarkdownType
4485        } else
4486          return super.setProperty(name, value);
4487        return value;
4488      }
4489
4490      @Override
4491      public Base makeProperty(int hash, String name) throws FHIRException {
4492        switch (hash) {
4493        case 3059181:  return getCodeElement();
4494        case 1587405498:  return getDocumentationElement();
4495        default: return super.makeProperty(hash, name);
4496        }
4497
4498      }
4499
4500      @Override
4501      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4502        switch (hash) {
4503        case 3059181: /*code*/ return new String[] {"code"};
4504        case 1587405498: /*documentation*/ return new String[] {"markdown"};
4505        default: return super.getTypesForProperty(hash, name);
4506        }
4507
4508      }
4509
4510      @Override
4511      public Base addChild(String name) throws FHIRException {
4512        if (name.equals("code")) {
4513          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.code");
4514        }
4515        else if (name.equals("documentation")) {
4516          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
4517        }
4518        else
4519          return super.addChild(name);
4520      }
4521
4522      public ResourceInteractionComponent copy() {
4523        ResourceInteractionComponent dst = new ResourceInteractionComponent();
4524        copyValues(dst);
4525        dst.code = code == null ? null : code.copy();
4526        dst.documentation = documentation == null ? null : documentation.copy();
4527        return dst;
4528      }
4529
4530      @Override
4531      public boolean equalsDeep(Base other_) {
4532        if (!super.equalsDeep(other_))
4533          return false;
4534        if (!(other_ instanceof ResourceInteractionComponent))
4535          return false;
4536        ResourceInteractionComponent o = (ResourceInteractionComponent) other_;
4537        return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true);
4538      }
4539
4540      @Override
4541      public boolean equalsShallow(Base other_) {
4542        if (!super.equalsShallow(other_))
4543          return false;
4544        if (!(other_ instanceof ResourceInteractionComponent))
4545          return false;
4546        ResourceInteractionComponent o = (ResourceInteractionComponent) other_;
4547        return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true);
4548      }
4549
4550      public boolean isEmpty() {
4551        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, documentation);
4552      }
4553
4554  public String fhirType() {
4555    return "CapabilityStatement.rest.resource.interaction";
4556
4557  }
4558
4559  }
4560
4561    @Block()
4562    public static class CapabilityStatementRestResourceSearchParamComponent extends BackboneElement implements IBaseBackboneElement {
4563        /**
4564         * The name of the search parameter used in the interface.
4565         */
4566        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4567        @Description(shortDefinition="Name of search parameter", formalDefinition="The name of the search parameter used in the interface." )
4568        protected StringType name;
4569
4570        /**
4571         * 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 element SHALL be populated if the search parameter refers to a SearchParameter defined by the FHIR core specification or externally defined IGs.
4572         */
4573        @Child(name = "definition", type = {CanonicalType.class}, order=2, min=0, max=1, modifier=false, summary=false)
4574        @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]]]). This element SHALL be populated if the search parameter refers to a SearchParameter defined by the FHIR core specification or externally defined IGs." )
4575        protected CanonicalType definition;
4576
4577        /**
4578         * The type of value a search parameter refers to, and how the content is interpreted.
4579         */
4580        @Child(name = "type", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=false)
4581        @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri | special", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." )
4582        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/search-param-type")
4583        protected Enumeration<SearchParamType> type;
4584
4585        /**
4586         * This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.
4587         */
4588        @Child(name = "documentation", type = {MarkdownType.class}, order=4, min=0, max=1, modifier=false, summary=false)
4589        @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." )
4590        protected MarkdownType documentation;
4591
4592        private static final long serialVersionUID = -171123928L;
4593
4594    /**
4595     * Constructor
4596     */
4597      public CapabilityStatementRestResourceSearchParamComponent() {
4598        super();
4599      }
4600
4601    /**
4602     * Constructor
4603     */
4604      public CapabilityStatementRestResourceSearchParamComponent(StringType name, Enumeration<SearchParamType> type) {
4605        super();
4606        this.name = name;
4607        this.type = type;
4608      }
4609
4610        /**
4611         * @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
4612         */
4613        public StringType getNameElement() { 
4614          if (this.name == null)
4615            if (Configuration.errorOnAutoCreate())
4616              throw new Error("Attempt to auto-create CapabilityStatementRestResourceSearchParamComponent.name");
4617            else if (Configuration.doAutoCreate())
4618              this.name = new StringType(); // bb
4619          return this.name;
4620        }
4621
4622        public boolean hasNameElement() { 
4623          return this.name != null && !this.name.isEmpty();
4624        }
4625
4626        public boolean hasName() { 
4627          return this.name != null && !this.name.isEmpty();
4628        }
4629
4630        /**
4631         * @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
4632         */
4633        public CapabilityStatementRestResourceSearchParamComponent setNameElement(StringType value) { 
4634          this.name = value;
4635          return this;
4636        }
4637
4638        /**
4639         * @return The name of the search parameter used in the interface.
4640         */
4641        public String getName() { 
4642          return this.name == null ? null : this.name.getValue();
4643        }
4644
4645        /**
4646         * @param value The name of the search parameter used in the interface.
4647         */
4648        public CapabilityStatementRestResourceSearchParamComponent setName(String value) { 
4649            if (this.name == null)
4650              this.name = new StringType();
4651            this.name.setValue(value);
4652          return this;
4653        }
4654
4655        /**
4656         * @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 element SHALL be populated if the search parameter refers to a SearchParameter defined by the FHIR core specification or externally defined IGs.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
4657         */
4658        public CanonicalType getDefinitionElement() { 
4659          if (this.definition == null)
4660            if (Configuration.errorOnAutoCreate())
4661              throw new Error("Attempt to auto-create CapabilityStatementRestResourceSearchParamComponent.definition");
4662            else if (Configuration.doAutoCreate())
4663              this.definition = new CanonicalType(); // bb
4664          return this.definition;
4665        }
4666
4667        public boolean hasDefinitionElement() { 
4668          return this.definition != null && !this.definition.isEmpty();
4669        }
4670
4671        public boolean hasDefinition() { 
4672          return this.definition != null && !this.definition.isEmpty();
4673        }
4674
4675        /**
4676         * @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 element SHALL be populated if the search parameter refers to a SearchParameter defined by the FHIR core specification or externally defined IGs.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value
4677         */
4678        public CapabilityStatementRestResourceSearchParamComponent setDefinitionElement(CanonicalType value) { 
4679          this.definition = value;
4680          return this;
4681        }
4682
4683        /**
4684         * @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]]]). This element SHALL be populated if the search parameter refers to a SearchParameter defined by the FHIR core specification or externally defined IGs.
4685         */
4686        public String getDefinition() { 
4687          return this.definition == null ? null : this.definition.getValue();
4688        }
4689
4690        /**
4691         * @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]]]). This element SHALL be populated if the search parameter refers to a SearchParameter defined by the FHIR core specification or externally defined IGs.
4692         */
4693        public CapabilityStatementRestResourceSearchParamComponent setDefinition(String value) { 
4694          if (Utilities.noString(value))
4695            this.definition = null;
4696          else {
4697            if (this.definition == null)
4698              this.definition = new CanonicalType();
4699            this.definition.setValue(value);
4700          }
4701          return this;
4702        }
4703
4704        /**
4705         * @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
4706         */
4707        public Enumeration<SearchParamType> getTypeElement() { 
4708          if (this.type == null)
4709            if (Configuration.errorOnAutoCreate())
4710              throw new Error("Attempt to auto-create CapabilityStatementRestResourceSearchParamComponent.type");
4711            else if (Configuration.doAutoCreate())
4712              this.type = new Enumeration<SearchParamType>(new SearchParamTypeEnumFactory()); // bb
4713          return this.type;
4714        }
4715
4716        public boolean hasTypeElement() { 
4717          return this.type != null && !this.type.isEmpty();
4718        }
4719
4720        public boolean hasType() { 
4721          return this.type != null && !this.type.isEmpty();
4722        }
4723
4724        /**
4725         * @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
4726         */
4727        public CapabilityStatementRestResourceSearchParamComponent setTypeElement(Enumeration<SearchParamType> value) { 
4728          this.type = value;
4729          return this;
4730        }
4731
4732        /**
4733         * @return The type of value a search parameter refers to, and how the content is interpreted.
4734         */
4735        public SearchParamType getType() { 
4736          return this.type == null ? null : this.type.getValue();
4737        }
4738
4739        /**
4740         * @param value The type of value a search parameter refers to, and how the content is interpreted.
4741         */
4742        public CapabilityStatementRestResourceSearchParamComponent setType(SearchParamType value) { 
4743            if (this.type == null)
4744              this.type = new Enumeration<SearchParamType>(new SearchParamTypeEnumFactory());
4745            this.type.setValue(value);
4746          return this;
4747        }
4748
4749        /**
4750         * @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
4751         */
4752        public MarkdownType getDocumentationElement() { 
4753          if (this.documentation == null)
4754            if (Configuration.errorOnAutoCreate())
4755              throw new Error("Attempt to auto-create CapabilityStatementRestResourceSearchParamComponent.documentation");
4756            else if (Configuration.doAutoCreate())
4757              this.documentation = new MarkdownType(); // bb
4758          return this.documentation;
4759        }
4760
4761        public boolean hasDocumentationElement() { 
4762          return this.documentation != null && !this.documentation.isEmpty();
4763        }
4764
4765        public boolean hasDocumentation() { 
4766          return this.documentation != null && !this.documentation.isEmpty();
4767        }
4768
4769        /**
4770         * @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
4771         */
4772        public CapabilityStatementRestResourceSearchParamComponent setDocumentationElement(MarkdownType value) { 
4773          this.documentation = value;
4774          return this;
4775        }
4776
4777        /**
4778         * @return This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.
4779         */
4780        public String getDocumentation() { 
4781          return this.documentation == null ? null : this.documentation.getValue();
4782        }
4783
4784        /**
4785         * @param value This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.
4786         */
4787        public CapabilityStatementRestResourceSearchParamComponent setDocumentation(String value) { 
4788          if (value == null)
4789            this.documentation = null;
4790          else {
4791            if (this.documentation == null)
4792              this.documentation = new MarkdownType();
4793            this.documentation.setValue(value);
4794          }
4795          return this;
4796        }
4797
4798        protected void listChildren(List<Property> children) {
4799          super.listChildren(children);
4800          children.add(new Property("name", "string", "The name of the search parameter used in the interface.", 0, 1, name));
4801          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]]]). This element SHALL be populated if the search parameter refers to a SearchParameter defined by the FHIR core specification or externally defined IGs.", 0, 1, definition));
4802          children.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, 1, type));
4803          children.add(new Property("documentation", "markdown", "This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.", 0, 1, documentation));
4804        }
4805
4806        @Override
4807        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4808          switch (_hash) {
4809          case 3373707: /*name*/  return new Property("name", "string", "The name of the search parameter used in the interface.", 0, 1, name);
4810          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]]]). This element SHALL be populated if the search parameter refers to a SearchParameter defined by the FHIR core specification or externally defined IGs.", 0, 1, definition);
4811          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);
4812          case 1587405498: /*documentation*/  return new Property("documentation", "markdown", "This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.", 0, 1, documentation);
4813          default: return super.getNamedProperty(_hash, _name, _checkValid);
4814          }
4815
4816        }
4817
4818      @Override
4819      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4820        switch (hash) {
4821        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
4822        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // CanonicalType
4823        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<SearchParamType>
4824        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // MarkdownType
4825        default: return super.getProperty(hash, name, checkValid);
4826        }
4827
4828      }
4829
4830      @Override
4831      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4832        switch (hash) {
4833        case 3373707: // name
4834          this.name = castToString(value); // StringType
4835          return value;
4836        case -1014418093: // definition
4837          this.definition = castToCanonical(value); // CanonicalType
4838          return value;
4839        case 3575610: // type
4840          value = new SearchParamTypeEnumFactory().fromType(castToCode(value));
4841          this.type = (Enumeration) value; // Enumeration<SearchParamType>
4842          return value;
4843        case 1587405498: // documentation
4844          this.documentation = castToMarkdown(value); // MarkdownType
4845          return value;
4846        default: return super.setProperty(hash, name, value);
4847        }
4848
4849      }
4850
4851      @Override
4852      public Base setProperty(String name, Base value) throws FHIRException {
4853        if (name.equals("name")) {
4854          this.name = castToString(value); // StringType
4855        } else if (name.equals("definition")) {
4856          this.definition = castToCanonical(value); // CanonicalType
4857        } else if (name.equals("type")) {
4858          value = new SearchParamTypeEnumFactory().fromType(castToCode(value));
4859          this.type = (Enumeration) value; // Enumeration<SearchParamType>
4860        } else if (name.equals("documentation")) {
4861          this.documentation = castToMarkdown(value); // MarkdownType
4862        } else
4863          return super.setProperty(name, value);
4864        return value;
4865      }
4866
4867      @Override
4868      public Base makeProperty(int hash, String name) throws FHIRException {
4869        switch (hash) {
4870        case 3373707:  return getNameElement();
4871        case -1014418093:  return getDefinitionElement();
4872        case 3575610:  return getTypeElement();
4873        case 1587405498:  return getDocumentationElement();
4874        default: return super.makeProperty(hash, name);
4875        }
4876
4877      }
4878
4879      @Override
4880      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4881        switch (hash) {
4882        case 3373707: /*name*/ return new String[] {"string"};
4883        case -1014418093: /*definition*/ return new String[] {"canonical"};
4884        case 3575610: /*type*/ return new String[] {"code"};
4885        case 1587405498: /*documentation*/ return new String[] {"markdown"};
4886        default: return super.getTypesForProperty(hash, name);
4887        }
4888
4889      }
4890
4891      @Override
4892      public Base addChild(String name) throws FHIRException {
4893        if (name.equals("name")) {
4894          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.name");
4895        }
4896        else if (name.equals("definition")) {
4897          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.definition");
4898        }
4899        else if (name.equals("type")) {
4900          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.type");
4901        }
4902        else if (name.equals("documentation")) {
4903          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
4904        }
4905        else
4906          return super.addChild(name);
4907      }
4908
4909      public CapabilityStatementRestResourceSearchParamComponent copy() {
4910        CapabilityStatementRestResourceSearchParamComponent dst = new CapabilityStatementRestResourceSearchParamComponent();
4911        copyValues(dst);
4912        dst.name = name == null ? null : name.copy();
4913        dst.definition = definition == null ? null : definition.copy();
4914        dst.type = type == null ? null : type.copy();
4915        dst.documentation = documentation == null ? null : documentation.copy();
4916        return dst;
4917      }
4918
4919      @Override
4920      public boolean equalsDeep(Base other_) {
4921        if (!super.equalsDeep(other_))
4922          return false;
4923        if (!(other_ instanceof CapabilityStatementRestResourceSearchParamComponent))
4924          return false;
4925        CapabilityStatementRestResourceSearchParamComponent o = (CapabilityStatementRestResourceSearchParamComponent) other_;
4926        return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true) && compareDeep(type, o.type, true)
4927           && compareDeep(documentation, o.documentation, true);
4928      }
4929
4930      @Override
4931      public boolean equalsShallow(Base other_) {
4932        if (!super.equalsShallow(other_))
4933          return false;
4934        if (!(other_ instanceof CapabilityStatementRestResourceSearchParamComponent))
4935          return false;
4936        CapabilityStatementRestResourceSearchParamComponent o = (CapabilityStatementRestResourceSearchParamComponent) other_;
4937        return compareValues(name, o.name, true) && compareValues(type, o.type, true) && compareValues(documentation, o.documentation, true)
4938          ;
4939      }
4940
4941      public boolean isEmpty() {
4942        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, definition, type, documentation
4943          );
4944      }
4945
4946  public String fhirType() {
4947    return "CapabilityStatement.rest.resource.searchParam";
4948
4949  }
4950
4951  }
4952
4953    @Block()
4954    public static class CapabilityStatementRestResourceOperationComponent extends BackboneElement implements IBaseBackboneElement {
4955        /**
4956         * 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.
4957         */
4958        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true)
4959        @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." )
4960        protected StringType name;
4961
4962        /**
4963         * Where the formal definition can be found.
4964         */
4965        @Child(name = "definition", type = {CanonicalType.class}, order=2, min=1, max=1, modifier=false, summary=true)
4966        @Description(shortDefinition="The defined operation/query", formalDefinition="Where the formal definition can be found." )
4967        protected CanonicalType definition;
4968
4969        /**
4970         * Documentation that describes anything special about the operation behavior, possibly detailing different behavior for system, type and instance-level invocation of the operation.
4971         */
4972        @Child(name = "documentation", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
4973        @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." )
4974        protected MarkdownType documentation;
4975
4976        private static final long serialVersionUID = -388608084L;
4977
4978    /**
4979     * Constructor
4980     */
4981      public CapabilityStatementRestResourceOperationComponent() {
4982        super();
4983      }
4984
4985    /**
4986     * Constructor
4987     */
4988      public CapabilityStatementRestResourceOperationComponent(StringType name, CanonicalType definition) {
4989        super();
4990        this.name = name;
4991        this.definition = definition;
4992      }
4993
4994        /**
4995         * @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
4996         */
4997        public StringType getNameElement() { 
4998          if (this.name == null)
4999            if (Configuration.errorOnAutoCreate())
5000              throw new Error("Attempt to auto-create CapabilityStatementRestResourceOperationComponent.name");
5001            else if (Configuration.doAutoCreate())
5002              this.name = new StringType(); // bb
5003          return this.name;
5004        }
5005
5006        public boolean hasNameElement() { 
5007          return this.name != null && !this.name.isEmpty();
5008        }
5009
5010        public boolean hasName() { 
5011          return this.name != null && !this.name.isEmpty();
5012        }
5013
5014        /**
5015         * @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
5016         */
5017        public CapabilityStatementRestResourceOperationComponent setNameElement(StringType value) { 
5018          this.name = value;
5019          return this;
5020        }
5021
5022        /**
5023         * @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.
5024         */
5025        public String getName() { 
5026          return this.name == null ? null : this.name.getValue();
5027        }
5028
5029        /**
5030         * @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.
5031         */
5032        public CapabilityStatementRestResourceOperationComponent setName(String value) { 
5033            if (this.name == null)
5034              this.name = new StringType();
5035            this.name.setValue(value);
5036          return this;
5037        }
5038
5039        /**
5040         * @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
5041         */
5042        public CanonicalType getDefinitionElement() { 
5043          if (this.definition == null)
5044            if (Configuration.errorOnAutoCreate())
5045              throw new Error("Attempt to auto-create CapabilityStatementRestResourceOperationComponent.definition");
5046            else if (Configuration.doAutoCreate())
5047              this.definition = new CanonicalType(); // bb
5048          return this.definition;
5049        }
5050
5051        public boolean hasDefinitionElement() { 
5052          return this.definition != null && !this.definition.isEmpty();
5053        }
5054
5055        public boolean hasDefinition() { 
5056          return this.definition != null && !this.definition.isEmpty();
5057        }
5058
5059        /**
5060         * @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
5061         */
5062        public CapabilityStatementRestResourceOperationComponent setDefinitionElement(CanonicalType value) { 
5063          this.definition = value;
5064          return this;
5065        }
5066
5067        /**
5068         * @return Where the formal definition can be found.
5069         */
5070        public String getDefinition() { 
5071          return this.definition == null ? null : this.definition.getValue();
5072        }
5073
5074        /**
5075         * @param value Where the formal definition can be found.
5076         */
5077        public CapabilityStatementRestResourceOperationComponent setDefinition(String value) { 
5078            if (this.definition == null)
5079              this.definition = new CanonicalType();
5080            this.definition.setValue(value);
5081          return this;
5082        }
5083
5084        /**
5085         * @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
5086         */
5087        public MarkdownType getDocumentationElement() { 
5088          if (this.documentation == null)
5089            if (Configuration.errorOnAutoCreate())
5090              throw new Error("Attempt to auto-create CapabilityStatementRestResourceOperationComponent.documentation");
5091            else if (Configuration.doAutoCreate())
5092              this.documentation = new MarkdownType(); // bb
5093          return this.documentation;
5094        }
5095
5096        public boolean hasDocumentationElement() { 
5097          return this.documentation != null && !this.documentation.isEmpty();
5098        }
5099
5100        public boolean hasDocumentation() { 
5101          return this.documentation != null && !this.documentation.isEmpty();
5102        }
5103
5104        /**
5105         * @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
5106         */
5107        public CapabilityStatementRestResourceOperationComponent setDocumentationElement(MarkdownType value) { 
5108          this.documentation = value;
5109          return this;
5110        }
5111
5112        /**
5113         * @return Documentation that describes anything special about the operation behavior, possibly detailing different behavior for system, type and instance-level invocation of the operation.
5114         */
5115        public String getDocumentation() { 
5116          return this.documentation == null ? null : this.documentation.getValue();
5117        }
5118
5119        /**
5120         * @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.
5121         */
5122        public CapabilityStatementRestResourceOperationComponent setDocumentation(String value) { 
5123          if (value == null)
5124            this.documentation = null;
5125          else {
5126            if (this.documentation == null)
5127              this.documentation = new MarkdownType();
5128            this.documentation.setValue(value);
5129          }
5130          return this;
5131        }
5132
5133        protected void listChildren(List<Property> children) {
5134          super.listChildren(children);
5135          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));
5136          children.add(new Property("definition", "canonical(OperationDefinition)", "Where the formal definition can be found.", 0, 1, definition));
5137          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));
5138        }
5139
5140        @Override
5141        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5142          switch (_hash) {
5143          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);
5144          case -1014418093: /*definition*/  return new Property("definition", "canonical(OperationDefinition)", "Where the formal definition can be found.", 0, 1, definition);
5145          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);
5146          default: return super.getNamedProperty(_hash, _name, _checkValid);
5147          }
5148
5149        }
5150
5151      @Override
5152      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5153        switch (hash) {
5154        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
5155        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // CanonicalType
5156        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // MarkdownType
5157        default: return super.getProperty(hash, name, checkValid);
5158        }
5159
5160      }
5161
5162      @Override
5163      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5164        switch (hash) {
5165        case 3373707: // name
5166          this.name = castToString(value); // StringType
5167          return value;
5168        case -1014418093: // definition
5169          this.definition = castToCanonical(value); // CanonicalType
5170          return value;
5171        case 1587405498: // documentation
5172          this.documentation = castToMarkdown(value); // MarkdownType
5173          return value;
5174        default: return super.setProperty(hash, name, value);
5175        }
5176
5177      }
5178
5179      @Override
5180      public Base setProperty(String name, Base value) throws FHIRException {
5181        if (name.equals("name")) {
5182          this.name = castToString(value); // StringType
5183        } else if (name.equals("definition")) {
5184          this.definition = castToCanonical(value); // CanonicalType
5185        } else if (name.equals("documentation")) {
5186          this.documentation = castToMarkdown(value); // MarkdownType
5187        } else
5188          return super.setProperty(name, value);
5189        return value;
5190      }
5191
5192      @Override
5193      public Base makeProperty(int hash, String name) throws FHIRException {
5194        switch (hash) {
5195        case 3373707:  return getNameElement();
5196        case -1014418093:  return getDefinitionElement();
5197        case 1587405498:  return getDocumentationElement();
5198        default: return super.makeProperty(hash, name);
5199        }
5200
5201      }
5202
5203      @Override
5204      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5205        switch (hash) {
5206        case 3373707: /*name*/ return new String[] {"string"};
5207        case -1014418093: /*definition*/ return new String[] {"canonical"};
5208        case 1587405498: /*documentation*/ return new String[] {"markdown"};
5209        default: return super.getTypesForProperty(hash, name);
5210        }
5211
5212      }
5213
5214      @Override
5215      public Base addChild(String name) throws FHIRException {
5216        if (name.equals("name")) {
5217          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.name");
5218        }
5219        else if (name.equals("definition")) {
5220          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.definition");
5221        }
5222        else if (name.equals("documentation")) {
5223          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
5224        }
5225        else
5226          return super.addChild(name);
5227      }
5228
5229      public CapabilityStatementRestResourceOperationComponent copy() {
5230        CapabilityStatementRestResourceOperationComponent dst = new CapabilityStatementRestResourceOperationComponent();
5231        copyValues(dst);
5232        dst.name = name == null ? null : name.copy();
5233        dst.definition = definition == null ? null : definition.copy();
5234        dst.documentation = documentation == null ? null : documentation.copy();
5235        return dst;
5236      }
5237
5238      @Override
5239      public boolean equalsDeep(Base other_) {
5240        if (!super.equalsDeep(other_))
5241          return false;
5242        if (!(other_ instanceof CapabilityStatementRestResourceOperationComponent))
5243          return false;
5244        CapabilityStatementRestResourceOperationComponent o = (CapabilityStatementRestResourceOperationComponent) other_;
5245        return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true) && compareDeep(documentation, o.documentation, true)
5246          ;
5247      }
5248
5249      @Override
5250      public boolean equalsShallow(Base other_) {
5251        if (!super.equalsShallow(other_))
5252          return false;
5253        if (!(other_ instanceof CapabilityStatementRestResourceOperationComponent))
5254          return false;
5255        CapabilityStatementRestResourceOperationComponent o = (CapabilityStatementRestResourceOperationComponent) other_;
5256        return compareValues(name, o.name, true) && compareValues(documentation, o.documentation, true);
5257      }
5258
5259      public boolean isEmpty() {
5260        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, definition, documentation
5261          );
5262      }
5263
5264  public String fhirType() {
5265    return "CapabilityStatement.rest.resource.operation";
5266
5267  }
5268
5269  }
5270
5271    @Block()
5272    public static class SystemInteractionComponent extends BackboneElement implements IBaseBackboneElement {
5273        /**
5274         * A coded identifier of the operation, supported by the system.
5275         */
5276        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
5277        @Description(shortDefinition="transaction | batch | search-system | history-system", formalDefinition="A coded identifier of the operation, supported by the system." )
5278        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/system-restful-interaction")
5279        protected Enumeration<SystemRestfulInteraction> code;
5280
5281        /**
5282         * 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.
5283         */
5284        @Child(name = "documentation", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5285        @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." )
5286        protected MarkdownType documentation;
5287
5288        private static final long serialVersionUID = -1495143879L;
5289
5290    /**
5291     * Constructor
5292     */
5293      public SystemInteractionComponent() {
5294        super();
5295      }
5296
5297    /**
5298     * Constructor
5299     */
5300      public SystemInteractionComponent(Enumeration<SystemRestfulInteraction> code) {
5301        super();
5302        this.code = code;
5303      }
5304
5305        /**
5306         * @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
5307         */
5308        public Enumeration<SystemRestfulInteraction> getCodeElement() { 
5309          if (this.code == null)
5310            if (Configuration.errorOnAutoCreate())
5311              throw new Error("Attempt to auto-create SystemInteractionComponent.code");
5312            else if (Configuration.doAutoCreate())
5313              this.code = new Enumeration<SystemRestfulInteraction>(new SystemRestfulInteractionEnumFactory()); // bb
5314          return this.code;
5315        }
5316
5317        public boolean hasCodeElement() { 
5318          return this.code != null && !this.code.isEmpty();
5319        }
5320
5321        public boolean hasCode() { 
5322          return this.code != null && !this.code.isEmpty();
5323        }
5324
5325        /**
5326         * @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
5327         */
5328        public SystemInteractionComponent setCodeElement(Enumeration<SystemRestfulInteraction> value) { 
5329          this.code = value;
5330          return this;
5331        }
5332
5333        /**
5334         * @return A coded identifier of the operation, supported by the system.
5335         */
5336        public SystemRestfulInteraction getCode() { 
5337          return this.code == null ? null : this.code.getValue();
5338        }
5339
5340        /**
5341         * @param value A coded identifier of the operation, supported by the system.
5342         */
5343        public SystemInteractionComponent setCode(SystemRestfulInteraction value) { 
5344            if (this.code == null)
5345              this.code = new Enumeration<SystemRestfulInteraction>(new SystemRestfulInteractionEnumFactory());
5346            this.code.setValue(value);
5347          return this;
5348        }
5349
5350        /**
5351         * @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
5352         */
5353        public MarkdownType getDocumentationElement() { 
5354          if (this.documentation == null)
5355            if (Configuration.errorOnAutoCreate())
5356              throw new Error("Attempt to auto-create SystemInteractionComponent.documentation");
5357            else if (Configuration.doAutoCreate())
5358              this.documentation = new MarkdownType(); // bb
5359          return this.documentation;
5360        }
5361
5362        public boolean hasDocumentationElement() { 
5363          return this.documentation != null && !this.documentation.isEmpty();
5364        }
5365
5366        public boolean hasDocumentation() { 
5367          return this.documentation != null && !this.documentation.isEmpty();
5368        }
5369
5370        /**
5371         * @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
5372         */
5373        public SystemInteractionComponent setDocumentationElement(MarkdownType value) { 
5374          this.documentation = value;
5375          return this;
5376        }
5377
5378        /**
5379         * @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.
5380         */
5381        public String getDocumentation() { 
5382          return this.documentation == null ? null : this.documentation.getValue();
5383        }
5384
5385        /**
5386         * @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.
5387         */
5388        public SystemInteractionComponent setDocumentation(String value) { 
5389          if (value == null)
5390            this.documentation = null;
5391          else {
5392            if (this.documentation == null)
5393              this.documentation = new MarkdownType();
5394            this.documentation.setValue(value);
5395          }
5396          return this;
5397        }
5398
5399        protected void listChildren(List<Property> children) {
5400          super.listChildren(children);
5401          children.add(new Property("code", "code", "A coded identifier of the operation, supported by the system.", 0, 1, code));
5402          children.add(new Property("documentation", "markdown", "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));
5403        }
5404
5405        @Override
5406        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5407          switch (_hash) {
5408          case 3059181: /*code*/  return new Property("code", "code", "A coded identifier of the operation, supported by the system.", 0, 1, code);
5409          case 1587405498: /*documentation*/  return new Property("documentation", "markdown", "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);
5410          default: return super.getNamedProperty(_hash, _name, _checkValid);
5411          }
5412
5413        }
5414
5415      @Override
5416      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5417        switch (hash) {
5418        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration<SystemRestfulInteraction>
5419        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // MarkdownType
5420        default: return super.getProperty(hash, name, checkValid);
5421        }
5422
5423      }
5424
5425      @Override
5426      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5427        switch (hash) {
5428        case 3059181: // code
5429          value = new SystemRestfulInteractionEnumFactory().fromType(castToCode(value));
5430          this.code = (Enumeration) value; // Enumeration<SystemRestfulInteraction>
5431          return value;
5432        case 1587405498: // documentation
5433          this.documentation = castToMarkdown(value); // MarkdownType
5434          return value;
5435        default: return super.setProperty(hash, name, value);
5436        }
5437
5438      }
5439
5440      @Override
5441      public Base setProperty(String name, Base value) throws FHIRException {
5442        if (name.equals("code")) {
5443          value = new SystemRestfulInteractionEnumFactory().fromType(castToCode(value));
5444          this.code = (Enumeration) value; // Enumeration<SystemRestfulInteraction>
5445        } else if (name.equals("documentation")) {
5446          this.documentation = castToMarkdown(value); // MarkdownType
5447        } else
5448          return super.setProperty(name, value);
5449        return value;
5450      }
5451
5452      @Override
5453      public Base makeProperty(int hash, String name) throws FHIRException {
5454        switch (hash) {
5455        case 3059181:  return getCodeElement();
5456        case 1587405498:  return getDocumentationElement();
5457        default: return super.makeProperty(hash, name);
5458        }
5459
5460      }
5461
5462      @Override
5463      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5464        switch (hash) {
5465        case 3059181: /*code*/ return new String[] {"code"};
5466        case 1587405498: /*documentation*/ return new String[] {"markdown"};
5467        default: return super.getTypesForProperty(hash, name);
5468        }
5469
5470      }
5471
5472      @Override
5473      public Base addChild(String name) throws FHIRException {
5474        if (name.equals("code")) {
5475          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.code");
5476        }
5477        else if (name.equals("documentation")) {
5478          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
5479        }
5480        else
5481          return super.addChild(name);
5482      }
5483
5484      public SystemInteractionComponent copy() {
5485        SystemInteractionComponent dst = new SystemInteractionComponent();
5486        copyValues(dst);
5487        dst.code = code == null ? null : code.copy();
5488        dst.documentation = documentation == null ? null : documentation.copy();
5489        return dst;
5490      }
5491
5492      @Override
5493      public boolean equalsDeep(Base other_) {
5494        if (!super.equalsDeep(other_))
5495          return false;
5496        if (!(other_ instanceof SystemInteractionComponent))
5497          return false;
5498        SystemInteractionComponent o = (SystemInteractionComponent) other_;
5499        return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true);
5500      }
5501
5502      @Override
5503      public boolean equalsShallow(Base other_) {
5504        if (!super.equalsShallow(other_))
5505          return false;
5506        if (!(other_ instanceof SystemInteractionComponent))
5507          return false;
5508        SystemInteractionComponent o = (SystemInteractionComponent) other_;
5509        return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true);
5510      }
5511
5512      public boolean isEmpty() {
5513        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, documentation);
5514      }
5515
5516  public String fhirType() {
5517    return "CapabilityStatement.rest.interaction";
5518
5519  }
5520
5521  }
5522
5523    @Block()
5524    public static class CapabilityStatementMessagingComponent extends BackboneElement implements IBaseBackboneElement {
5525        /**
5526         * An endpoint (network accessible address) to which messages and/or replies are to be sent.
5527         */
5528        @Child(name = "endpoint", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5529        @Description(shortDefinition="Where messages should be sent", formalDefinition="An endpoint (network accessible address) to which messages and/or replies are to be sent." )
5530        protected List<CapabilityStatementMessagingEndpointComponent> endpoint;
5531
5532        /**
5533         * 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).
5534         */
5535        @Child(name = "reliableCache", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5536        @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)." )
5537        protected UnsignedIntType reliableCache;
5538
5539        /**
5540         * 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.
5541         */
5542        @Child(name = "documentation", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
5543        @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." )
5544        protected MarkdownType documentation;
5545
5546        /**
5547         * References to message definitions for messages this system can send or receive.
5548         */
5549        @Child(name = "supportedMessage", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5550        @Description(shortDefinition="Messages supported by this system", formalDefinition="References to message definitions for messages this system can send or receive." )
5551        protected List<CapabilityStatementMessagingSupportedMessageComponent> supportedMessage;
5552
5553        private static final long serialVersionUID = 300411231L;
5554
5555    /**
5556     * Constructor
5557     */
5558      public CapabilityStatementMessagingComponent() {
5559        super();
5560      }
5561
5562        /**
5563         * @return {@link #endpoint} (An endpoint (network accessible address) to which messages and/or replies are to be sent.)
5564         */
5565        public List<CapabilityStatementMessagingEndpointComponent> getEndpoint() { 
5566          if (this.endpoint == null)
5567            this.endpoint = new ArrayList<CapabilityStatementMessagingEndpointComponent>();
5568          return this.endpoint;
5569        }
5570
5571        /**
5572         * @return Returns a reference to <code>this</code> for easy method chaining
5573         */
5574        public CapabilityStatementMessagingComponent setEndpoint(List<CapabilityStatementMessagingEndpointComponent> theEndpoint) { 
5575          this.endpoint = theEndpoint;
5576          return this;
5577        }
5578
5579        public boolean hasEndpoint() { 
5580          if (this.endpoint == null)
5581            return false;
5582          for (CapabilityStatementMessagingEndpointComponent item : this.endpoint)
5583            if (!item.isEmpty())
5584              return true;
5585          return false;
5586        }
5587
5588        public CapabilityStatementMessagingEndpointComponent addEndpoint() { //3
5589          CapabilityStatementMessagingEndpointComponent t = new CapabilityStatementMessagingEndpointComponent();
5590          if (this.endpoint == null)
5591            this.endpoint = new ArrayList<CapabilityStatementMessagingEndpointComponent>();
5592          this.endpoint.add(t);
5593          return t;
5594        }
5595
5596        public CapabilityStatementMessagingComponent addEndpoint(CapabilityStatementMessagingEndpointComponent t) { //3
5597          if (t == null)
5598            return this;
5599          if (this.endpoint == null)
5600            this.endpoint = new ArrayList<CapabilityStatementMessagingEndpointComponent>();
5601          this.endpoint.add(t);
5602          return this;
5603        }
5604
5605        /**
5606         * @return The first repetition of repeating field {@link #endpoint}, creating it if it does not already exist
5607         */
5608        public CapabilityStatementMessagingEndpointComponent getEndpointFirstRep() { 
5609          if (getEndpoint().isEmpty()) {
5610            addEndpoint();
5611          }
5612          return getEndpoint().get(0);
5613        }
5614
5615        /**
5616         * @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
5617         */
5618        public UnsignedIntType getReliableCacheElement() { 
5619          if (this.reliableCache == null)
5620            if (Configuration.errorOnAutoCreate())
5621              throw new Error("Attempt to auto-create CapabilityStatementMessagingComponent.reliableCache");
5622            else if (Configuration.doAutoCreate())
5623              this.reliableCache = new UnsignedIntType(); // bb
5624          return this.reliableCache;
5625        }
5626
5627        public boolean hasReliableCacheElement() { 
5628          return this.reliableCache != null && !this.reliableCache.isEmpty();
5629        }
5630
5631        public boolean hasReliableCache() { 
5632          return this.reliableCache != null && !this.reliableCache.isEmpty();
5633        }
5634
5635        /**
5636         * @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
5637         */
5638        public CapabilityStatementMessagingComponent setReliableCacheElement(UnsignedIntType value) { 
5639          this.reliableCache = value;
5640          return this;
5641        }
5642
5643        /**
5644         * @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).
5645         */
5646        public int getReliableCache() { 
5647          return this.reliableCache == null || this.reliableCache.isEmpty() ? 0 : this.reliableCache.getValue();
5648        }
5649
5650        /**
5651         * @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).
5652         */
5653        public CapabilityStatementMessagingComponent setReliableCache(int value) { 
5654            if (this.reliableCache == null)
5655              this.reliableCache = new UnsignedIntType();
5656            this.reliableCache.setValue(value);
5657          return this;
5658        }
5659
5660        /**
5661         * @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
5662         */
5663        public MarkdownType getDocumentationElement() { 
5664          if (this.documentation == null)
5665            if (Configuration.errorOnAutoCreate())
5666              throw new Error("Attempt to auto-create CapabilityStatementMessagingComponent.documentation");
5667            else if (Configuration.doAutoCreate())
5668              this.documentation = new MarkdownType(); // bb
5669          return this.documentation;
5670        }
5671
5672        public boolean hasDocumentationElement() { 
5673          return this.documentation != null && !this.documentation.isEmpty();
5674        }
5675
5676        public boolean hasDocumentation() { 
5677          return this.documentation != null && !this.documentation.isEmpty();
5678        }
5679
5680        /**
5681         * @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
5682         */
5683        public CapabilityStatementMessagingComponent setDocumentationElement(MarkdownType value) { 
5684          this.documentation = value;
5685          return this;
5686        }
5687
5688        /**
5689         * @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.
5690         */
5691        public String getDocumentation() { 
5692          return this.documentation == null ? null : this.documentation.getValue();
5693        }
5694
5695        /**
5696         * @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.
5697         */
5698        public CapabilityStatementMessagingComponent setDocumentation(String value) { 
5699          if (value == null)
5700            this.documentation = null;
5701          else {
5702            if (this.documentation == null)
5703              this.documentation = new MarkdownType();
5704            this.documentation.setValue(value);
5705          }
5706          return this;
5707        }
5708
5709        /**
5710         * @return {@link #supportedMessage} (References to message definitions for messages this system can send or receive.)
5711         */
5712        public List<CapabilityStatementMessagingSupportedMessageComponent> getSupportedMessage() { 
5713          if (this.supportedMessage == null)
5714            this.supportedMessage = new ArrayList<CapabilityStatementMessagingSupportedMessageComponent>();
5715          return this.supportedMessage;
5716        }
5717
5718        /**
5719         * @return Returns a reference to <code>this</code> for easy method chaining
5720         */
5721        public CapabilityStatementMessagingComponent setSupportedMessage(List<CapabilityStatementMessagingSupportedMessageComponent> theSupportedMessage) { 
5722          this.supportedMessage = theSupportedMessage;
5723          return this;
5724        }
5725
5726        public boolean hasSupportedMessage() { 
5727          if (this.supportedMessage == null)
5728            return false;
5729          for (CapabilityStatementMessagingSupportedMessageComponent item : this.supportedMessage)
5730            if (!item.isEmpty())
5731              return true;
5732          return false;
5733        }
5734
5735        public CapabilityStatementMessagingSupportedMessageComponent addSupportedMessage() { //3
5736          CapabilityStatementMessagingSupportedMessageComponent t = new CapabilityStatementMessagingSupportedMessageComponent();
5737          if (this.supportedMessage == null)
5738            this.supportedMessage = new ArrayList<CapabilityStatementMessagingSupportedMessageComponent>();
5739          this.supportedMessage.add(t);
5740          return t;
5741        }
5742
5743        public CapabilityStatementMessagingComponent addSupportedMessage(CapabilityStatementMessagingSupportedMessageComponent t) { //3
5744          if (t == null)
5745            return this;
5746          if (this.supportedMessage == null)
5747            this.supportedMessage = new ArrayList<CapabilityStatementMessagingSupportedMessageComponent>();
5748          this.supportedMessage.add(t);
5749          return this;
5750        }
5751
5752        /**
5753         * @return The first repetition of repeating field {@link #supportedMessage}, creating it if it does not already exist
5754         */
5755        public CapabilityStatementMessagingSupportedMessageComponent getSupportedMessageFirstRep() { 
5756          if (getSupportedMessage().isEmpty()) {
5757            addSupportedMessage();
5758          }
5759          return getSupportedMessage().get(0);
5760        }
5761
5762        protected void listChildren(List<Property> children) {
5763          super.listChildren(children);
5764          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));
5765          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));
5766          children.add(new Property("documentation", "markdown", "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));
5767          children.add(new Property("supportedMessage", "", "References to message definitions for messages this system can send or receive.", 0, java.lang.Integer.MAX_VALUE, supportedMessage));
5768        }
5769
5770        @Override
5771        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5772          switch (_hash) {
5773          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);
5774          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);
5775          case 1587405498: /*documentation*/  return new Property("documentation", "markdown", "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);
5776          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);
5777          default: return super.getNamedProperty(_hash, _name, _checkValid);
5778          }
5779
5780        }
5781
5782      @Override
5783      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5784        switch (hash) {
5785        case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // CapabilityStatementMessagingEndpointComponent
5786        case 897803608: /*reliableCache*/ return this.reliableCache == null ? new Base[0] : new Base[] {this.reliableCache}; // UnsignedIntType
5787        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // MarkdownType
5788        case -1805139079: /*supportedMessage*/ return this.supportedMessage == null ? new Base[0] : this.supportedMessage.toArray(new Base[this.supportedMessage.size()]); // CapabilityStatementMessagingSupportedMessageComponent
5789        default: return super.getProperty(hash, name, checkValid);
5790        }
5791
5792      }
5793
5794      @Override
5795      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5796        switch (hash) {
5797        case 1741102485: // endpoint
5798          this.getEndpoint().add((CapabilityStatementMessagingEndpointComponent) value); // CapabilityStatementMessagingEndpointComponent
5799          return value;
5800        case 897803608: // reliableCache
5801          this.reliableCache = castToUnsignedInt(value); // UnsignedIntType
5802          return value;
5803        case 1587405498: // documentation
5804          this.documentation = castToMarkdown(value); // MarkdownType
5805          return value;
5806        case -1805139079: // supportedMessage
5807          this.getSupportedMessage().add((CapabilityStatementMessagingSupportedMessageComponent) value); // CapabilityStatementMessagingSupportedMessageComponent
5808          return value;
5809        default: return super.setProperty(hash, name, value);
5810        }
5811
5812      }
5813
5814      @Override
5815      public Base setProperty(String name, Base value) throws FHIRException {
5816        if (name.equals("endpoint")) {
5817          this.getEndpoint().add((CapabilityStatementMessagingEndpointComponent) value);
5818        } else if (name.equals("reliableCache")) {
5819          this.reliableCache = castToUnsignedInt(value); // UnsignedIntType
5820        } else if (name.equals("documentation")) {
5821          this.documentation = castToMarkdown(value); // MarkdownType
5822        } else if (name.equals("supportedMessage")) {
5823          this.getSupportedMessage().add((CapabilityStatementMessagingSupportedMessageComponent) value);
5824        } else
5825          return super.setProperty(name, value);
5826        return value;
5827      }
5828
5829      @Override
5830      public Base makeProperty(int hash, String name) throws FHIRException {
5831        switch (hash) {
5832        case 1741102485:  return addEndpoint(); 
5833        case 897803608:  return getReliableCacheElement();
5834        case 1587405498:  return getDocumentationElement();
5835        case -1805139079:  return addSupportedMessage(); 
5836        default: return super.makeProperty(hash, name);
5837        }
5838
5839      }
5840
5841      @Override
5842      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5843        switch (hash) {
5844        case 1741102485: /*endpoint*/ return new String[] {};
5845        case 897803608: /*reliableCache*/ return new String[] {"unsignedInt"};
5846        case 1587405498: /*documentation*/ return new String[] {"markdown"};
5847        case -1805139079: /*supportedMessage*/ return new String[] {};
5848        default: return super.getTypesForProperty(hash, name);
5849        }
5850
5851      }
5852
5853      @Override
5854      public Base addChild(String name) throws FHIRException {
5855        if (name.equals("endpoint")) {
5856          return addEndpoint();
5857        }
5858        else if (name.equals("reliableCache")) {
5859          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.reliableCache");
5860        }
5861        else if (name.equals("documentation")) {
5862          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
5863        }
5864        else if (name.equals("supportedMessage")) {
5865          return addSupportedMessage();
5866        }
5867        else
5868          return super.addChild(name);
5869      }
5870
5871      public CapabilityStatementMessagingComponent copy() {
5872        CapabilityStatementMessagingComponent dst = new CapabilityStatementMessagingComponent();
5873        copyValues(dst);
5874        if (endpoint != null) {
5875          dst.endpoint = new ArrayList<CapabilityStatementMessagingEndpointComponent>();
5876          for (CapabilityStatementMessagingEndpointComponent i : endpoint)
5877            dst.endpoint.add(i.copy());
5878        };
5879        dst.reliableCache = reliableCache == null ? null : reliableCache.copy();
5880        dst.documentation = documentation == null ? null : documentation.copy();
5881        if (supportedMessage != null) {
5882          dst.supportedMessage = new ArrayList<CapabilityStatementMessagingSupportedMessageComponent>();
5883          for (CapabilityStatementMessagingSupportedMessageComponent i : supportedMessage)
5884            dst.supportedMessage.add(i.copy());
5885        };
5886        return dst;
5887      }
5888
5889      @Override
5890      public boolean equalsDeep(Base other_) {
5891        if (!super.equalsDeep(other_))
5892          return false;
5893        if (!(other_ instanceof CapabilityStatementMessagingComponent))
5894          return false;
5895        CapabilityStatementMessagingComponent o = (CapabilityStatementMessagingComponent) other_;
5896        return compareDeep(endpoint, o.endpoint, true) && compareDeep(reliableCache, o.reliableCache, true)
5897           && compareDeep(documentation, o.documentation, true) && compareDeep(supportedMessage, o.supportedMessage, true)
5898          ;
5899      }
5900
5901      @Override
5902      public boolean equalsShallow(Base other_) {
5903        if (!super.equalsShallow(other_))
5904          return false;
5905        if (!(other_ instanceof CapabilityStatementMessagingComponent))
5906          return false;
5907        CapabilityStatementMessagingComponent o = (CapabilityStatementMessagingComponent) other_;
5908        return compareValues(reliableCache, o.reliableCache, true) && compareValues(documentation, o.documentation, true)
5909          ;
5910      }
5911
5912      public boolean isEmpty() {
5913        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(endpoint, reliableCache, documentation
5914          , supportedMessage);
5915      }
5916
5917  public String fhirType() {
5918    return "CapabilityStatement.messaging";
5919
5920  }
5921
5922  }
5923
5924    @Block()
5925    public static class CapabilityStatementMessagingEndpointComponent extends BackboneElement implements IBaseBackboneElement {
5926        /**
5927         * A list of the messaging transport protocol(s) identifiers, supported by this endpoint.
5928         */
5929        @Child(name = "protocol", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false)
5930        @Description(shortDefinition="http | ftp | mllp +", formalDefinition="A list of the messaging transport protocol(s) identifiers, supported by this endpoint." )
5931        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/message-transport")
5932        protected Coding protocol;
5933
5934        /**
5935         * The network address of the endpoint. For solutions that do not use network addresses for routing, it can be just an identifier.
5936         */
5937        @Child(name = "address", type = {UrlType.class}, order=2, min=1, max=1, modifier=false, summary=false)
5938        @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." )
5939        protected UrlType address;
5940
5941        private static final long serialVersionUID = -236946103L;
5942
5943    /**
5944     * Constructor
5945     */
5946      public CapabilityStatementMessagingEndpointComponent() {
5947        super();
5948      }
5949
5950    /**
5951     * Constructor
5952     */
5953      public CapabilityStatementMessagingEndpointComponent(Coding protocol, UrlType address) {
5954        super();
5955        this.protocol = protocol;
5956        this.address = address;
5957      }
5958
5959        /**
5960         * @return {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.)
5961         */
5962        public Coding getProtocol() { 
5963          if (this.protocol == null)
5964            if (Configuration.errorOnAutoCreate())
5965              throw new Error("Attempt to auto-create CapabilityStatementMessagingEndpointComponent.protocol");
5966            else if (Configuration.doAutoCreate())
5967              this.protocol = new Coding(); // cc
5968          return this.protocol;
5969        }
5970
5971        public boolean hasProtocol() { 
5972          return this.protocol != null && !this.protocol.isEmpty();
5973        }
5974
5975        /**
5976         * @param value {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.)
5977         */
5978        public CapabilityStatementMessagingEndpointComponent setProtocol(Coding value) { 
5979          this.protocol = value;
5980          return this;
5981        }
5982
5983        /**
5984         * @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
5985         */
5986        public UrlType getAddressElement() { 
5987          if (this.address == null)
5988            if (Configuration.errorOnAutoCreate())
5989              throw new Error("Attempt to auto-create CapabilityStatementMessagingEndpointComponent.address");
5990            else if (Configuration.doAutoCreate())
5991              this.address = new UrlType(); // bb
5992          return this.address;
5993        }
5994
5995        public boolean hasAddressElement() { 
5996          return this.address != null && !this.address.isEmpty();
5997        }
5998
5999        public boolean hasAddress() { 
6000          return this.address != null && !this.address.isEmpty();
6001        }
6002
6003        /**
6004         * @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
6005         */
6006        public CapabilityStatementMessagingEndpointComponent setAddressElement(UrlType value) { 
6007          this.address = value;
6008          return this;
6009        }
6010
6011        /**
6012         * @return The network address of the endpoint. For solutions that do not use network addresses for routing, it can be just an identifier.
6013         */
6014        public String getAddress() { 
6015          return this.address == null ? null : this.address.getValue();
6016        }
6017
6018        /**
6019         * @param value The network address of the endpoint. For solutions that do not use network addresses for routing, it can be just an identifier.
6020         */
6021        public CapabilityStatementMessagingEndpointComponent setAddress(String value) { 
6022            if (this.address == null)
6023              this.address = new UrlType();
6024            this.address.setValue(value);
6025          return this;
6026        }
6027
6028        protected void listChildren(List<Property> children) {
6029          super.listChildren(children);
6030          children.add(new Property("protocol", "Coding", "A list of the messaging transport protocol(s) identifiers, supported by this endpoint.", 0, 1, protocol));
6031          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));
6032        }
6033
6034        @Override
6035        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6036          switch (_hash) {
6037          case -989163880: /*protocol*/  return new Property("protocol", "Coding", "A list of the messaging transport protocol(s) identifiers, supported by this endpoint.", 0, 1, protocol);
6038          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);
6039          default: return super.getNamedProperty(_hash, _name, _checkValid);
6040          }
6041
6042        }
6043
6044      @Override
6045      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6046        switch (hash) {
6047        case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : new Base[] {this.protocol}; // Coding
6048        case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // UrlType
6049        default: return super.getProperty(hash, name, checkValid);
6050        }
6051
6052      }
6053
6054      @Override
6055      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6056        switch (hash) {
6057        case -989163880: // protocol
6058          this.protocol = castToCoding(value); // Coding
6059          return value;
6060        case -1147692044: // address
6061          this.address = castToUrl(value); // UrlType
6062          return value;
6063        default: return super.setProperty(hash, name, value);
6064        }
6065
6066      }
6067
6068      @Override
6069      public Base setProperty(String name, Base value) throws FHIRException {
6070        if (name.equals("protocol")) {
6071          this.protocol = castToCoding(value); // Coding
6072        } else if (name.equals("address")) {
6073          this.address = castToUrl(value); // UrlType
6074        } else
6075          return super.setProperty(name, value);
6076        return value;
6077      }
6078
6079      @Override
6080      public Base makeProperty(int hash, String name) throws FHIRException {
6081        switch (hash) {
6082        case -989163880:  return getProtocol(); 
6083        case -1147692044:  return getAddressElement();
6084        default: return super.makeProperty(hash, name);
6085        }
6086
6087      }
6088
6089      @Override
6090      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6091        switch (hash) {
6092        case -989163880: /*protocol*/ return new String[] {"Coding"};
6093        case -1147692044: /*address*/ return new String[] {"url"};
6094        default: return super.getTypesForProperty(hash, name);
6095        }
6096
6097      }
6098
6099      @Override
6100      public Base addChild(String name) throws FHIRException {
6101        if (name.equals("protocol")) {
6102          this.protocol = new Coding();
6103          return this.protocol;
6104        }
6105        else if (name.equals("address")) {
6106          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.address");
6107        }
6108        else
6109          return super.addChild(name);
6110      }
6111
6112      public CapabilityStatementMessagingEndpointComponent copy() {
6113        CapabilityStatementMessagingEndpointComponent dst = new CapabilityStatementMessagingEndpointComponent();
6114        copyValues(dst);
6115        dst.protocol = protocol == null ? null : protocol.copy();
6116        dst.address = address == null ? null : address.copy();
6117        return dst;
6118      }
6119
6120      @Override
6121      public boolean equalsDeep(Base other_) {
6122        if (!super.equalsDeep(other_))
6123          return false;
6124        if (!(other_ instanceof CapabilityStatementMessagingEndpointComponent))
6125          return false;
6126        CapabilityStatementMessagingEndpointComponent o = (CapabilityStatementMessagingEndpointComponent) other_;
6127        return compareDeep(protocol, o.protocol, true) && compareDeep(address, o.address, true);
6128      }
6129
6130      @Override
6131      public boolean equalsShallow(Base other_) {
6132        if (!super.equalsShallow(other_))
6133          return false;
6134        if (!(other_ instanceof CapabilityStatementMessagingEndpointComponent))
6135          return false;
6136        CapabilityStatementMessagingEndpointComponent o = (CapabilityStatementMessagingEndpointComponent) other_;
6137        return compareValues(address, o.address, true);
6138      }
6139
6140      public boolean isEmpty() {
6141        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(protocol, address);
6142      }
6143
6144  public String fhirType() {
6145    return "CapabilityStatement.messaging.endpoint";
6146
6147  }
6148
6149  }
6150
6151    @Block()
6152    public static class CapabilityStatementMessagingSupportedMessageComponent extends BackboneElement implements IBaseBackboneElement {
6153        /**
6154         * The mode of this event declaration - whether application is sender or receiver.
6155         */
6156        @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
6157        @Description(shortDefinition="sender | receiver", formalDefinition="The mode of this event declaration - whether application is sender or receiver." )
6158        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/event-capability-mode")
6159        protected Enumeration<EventCapabilityMode> mode;
6160
6161        /**
6162         * Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.
6163         */
6164        @Child(name = "definition", type = {CanonicalType.class}, order=2, min=1, max=1, modifier=false, summary=true)
6165        @Description(shortDefinition="Message supported by this system", formalDefinition="Points to a message definition that identifies the messaging event, message structure, allowed responses, etc." )
6166        protected CanonicalType definition;
6167
6168        private static final long serialVersionUID = -1172840676L;
6169
6170    /**
6171     * Constructor
6172     */
6173      public CapabilityStatementMessagingSupportedMessageComponent() {
6174        super();
6175      }
6176
6177    /**
6178     * Constructor
6179     */
6180      public CapabilityStatementMessagingSupportedMessageComponent(Enumeration<EventCapabilityMode> mode, CanonicalType definition) {
6181        super();
6182        this.mode = mode;
6183        this.definition = definition;
6184      }
6185
6186        /**
6187         * @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
6188         */
6189        public Enumeration<EventCapabilityMode> getModeElement() { 
6190          if (this.mode == null)
6191            if (Configuration.errorOnAutoCreate())
6192              throw new Error("Attempt to auto-create CapabilityStatementMessagingSupportedMessageComponent.mode");
6193            else if (Configuration.doAutoCreate())
6194              this.mode = new Enumeration<EventCapabilityMode>(new EventCapabilityModeEnumFactory()); // bb
6195          return this.mode;
6196        }
6197
6198        public boolean hasModeElement() { 
6199          return this.mode != null && !this.mode.isEmpty();
6200        }
6201
6202        public boolean hasMode() { 
6203          return this.mode != null && !this.mode.isEmpty();
6204        }
6205
6206        /**
6207         * @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
6208         */
6209        public CapabilityStatementMessagingSupportedMessageComponent setModeElement(Enumeration<EventCapabilityMode> value) { 
6210          this.mode = value;
6211          return this;
6212        }
6213
6214        /**
6215         * @return The mode of this event declaration - whether application is sender or receiver.
6216         */
6217        public EventCapabilityMode getMode() { 
6218          return this.mode == null ? null : this.mode.getValue();
6219        }
6220
6221        /**
6222         * @param value The mode of this event declaration - whether application is sender or receiver.
6223         */
6224        public CapabilityStatementMessagingSupportedMessageComponent setMode(EventCapabilityMode value) { 
6225            if (this.mode == null)
6226              this.mode = new Enumeration<EventCapabilityMode>(new EventCapabilityModeEnumFactory());
6227            this.mode.setValue(value);
6228          return this;
6229        }
6230
6231        /**
6232         * @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
6233         */
6234        public CanonicalType getDefinitionElement() { 
6235          if (this.definition == null)
6236            if (Configuration.errorOnAutoCreate())
6237              throw new Error("Attempt to auto-create CapabilityStatementMessagingSupportedMessageComponent.definition");
6238            else if (Configuration.doAutoCreate())
6239              this.definition = new CanonicalType(); // bb
6240          return this.definition;
6241        }
6242
6243        public boolean hasDefinitionElement() { 
6244          return this.definition != null && !this.definition.isEmpty();
6245        }
6246
6247        public boolean hasDefinition() { 
6248          return this.definition != null && !this.definition.isEmpty();
6249        }
6250
6251        /**
6252         * @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
6253         */
6254        public CapabilityStatementMessagingSupportedMessageComponent setDefinitionElement(CanonicalType value) { 
6255          this.definition = value;
6256          return this;
6257        }
6258
6259        /**
6260         * @return Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.
6261         */
6262        public String getDefinition() { 
6263          return this.definition == null ? null : this.definition.getValue();
6264        }
6265
6266        /**
6267         * @param value Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.
6268         */
6269        public CapabilityStatementMessagingSupportedMessageComponent setDefinition(String value) { 
6270            if (this.definition == null)
6271              this.definition = new CanonicalType();
6272            this.definition.setValue(value);
6273          return this;
6274        }
6275
6276        protected void listChildren(List<Property> children) {
6277          super.listChildren(children);
6278          children.add(new Property("mode", "code", "The mode of this event declaration - whether application is sender or receiver.", 0, 1, mode));
6279          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));
6280        }
6281
6282        @Override
6283        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6284          switch (_hash) {
6285          case 3357091: /*mode*/  return new Property("mode", "code", "The mode of this event declaration - whether application is sender or receiver.", 0, 1, mode);
6286          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);
6287          default: return super.getNamedProperty(_hash, _name, _checkValid);
6288          }
6289
6290        }
6291
6292      @Override
6293      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6294        switch (hash) {
6295        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<EventCapabilityMode>
6296        case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // CanonicalType
6297        default: return super.getProperty(hash, name, checkValid);
6298        }
6299
6300      }
6301
6302      @Override
6303      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6304        switch (hash) {
6305        case 3357091: // mode
6306          value = new EventCapabilityModeEnumFactory().fromType(castToCode(value));
6307          this.mode = (Enumeration) value; // Enumeration<EventCapabilityMode>
6308          return value;
6309        case -1014418093: // definition
6310          this.definition = castToCanonical(value); // CanonicalType
6311          return value;
6312        default: return super.setProperty(hash, name, value);
6313        }
6314
6315      }
6316
6317      @Override
6318      public Base setProperty(String name, Base value) throws FHIRException {
6319        if (name.equals("mode")) {
6320          value = new EventCapabilityModeEnumFactory().fromType(castToCode(value));
6321          this.mode = (Enumeration) value; // Enumeration<EventCapabilityMode>
6322        } else if (name.equals("definition")) {
6323          this.definition = castToCanonical(value); // CanonicalType
6324        } else
6325          return super.setProperty(name, value);
6326        return value;
6327      }
6328
6329      @Override
6330      public Base makeProperty(int hash, String name) throws FHIRException {
6331        switch (hash) {
6332        case 3357091:  return getModeElement();
6333        case -1014418093:  return getDefinitionElement();
6334        default: return super.makeProperty(hash, name);
6335        }
6336
6337      }
6338
6339      @Override
6340      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6341        switch (hash) {
6342        case 3357091: /*mode*/ return new String[] {"code"};
6343        case -1014418093: /*definition*/ return new String[] {"canonical"};
6344        default: return super.getTypesForProperty(hash, name);
6345        }
6346
6347      }
6348
6349      @Override
6350      public Base addChild(String name) throws FHIRException {
6351        if (name.equals("mode")) {
6352          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.mode");
6353        }
6354        else if (name.equals("definition")) {
6355          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.definition");
6356        }
6357        else
6358          return super.addChild(name);
6359      }
6360
6361      public CapabilityStatementMessagingSupportedMessageComponent copy() {
6362        CapabilityStatementMessagingSupportedMessageComponent dst = new CapabilityStatementMessagingSupportedMessageComponent();
6363        copyValues(dst);
6364        dst.mode = mode == null ? null : mode.copy();
6365        dst.definition = definition == null ? null : definition.copy();
6366        return dst;
6367      }
6368
6369      @Override
6370      public boolean equalsDeep(Base other_) {
6371        if (!super.equalsDeep(other_))
6372          return false;
6373        if (!(other_ instanceof CapabilityStatementMessagingSupportedMessageComponent))
6374          return false;
6375        CapabilityStatementMessagingSupportedMessageComponent o = (CapabilityStatementMessagingSupportedMessageComponent) other_;
6376        return compareDeep(mode, o.mode, true) && compareDeep(definition, o.definition, true);
6377      }
6378
6379      @Override
6380      public boolean equalsShallow(Base other_) {
6381        if (!super.equalsShallow(other_))
6382          return false;
6383        if (!(other_ instanceof CapabilityStatementMessagingSupportedMessageComponent))
6384          return false;
6385        CapabilityStatementMessagingSupportedMessageComponent o = (CapabilityStatementMessagingSupportedMessageComponent) other_;
6386        return compareValues(mode, o.mode, true);
6387      }
6388
6389      public boolean isEmpty() {
6390        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mode, definition);
6391      }
6392
6393  public String fhirType() {
6394    return "CapabilityStatement.messaging.supportedMessage";
6395
6396  }
6397
6398  }
6399
6400    @Block()
6401    public static class CapabilityStatementDocumentComponent extends BackboneElement implements IBaseBackboneElement {
6402        /**
6403         * Mode of this document declaration - whether an application is a producer or consumer.
6404         */
6405        @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true)
6406        @Description(shortDefinition="producer | consumer", formalDefinition="Mode of this document declaration - whether an application is a producer or consumer." )
6407        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/document-mode")
6408        protected Enumeration<DocumentMode> mode;
6409
6410        /**
6411         * 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.
6412         */
6413        @Child(name = "documentation", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false)
6414        @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." )
6415        protected MarkdownType documentation;
6416
6417        /**
6418         * A profile on the document Bundle that constrains which resources are present, and their contents.
6419         */
6420        @Child(name = "profile", type = {CanonicalType.class}, order=3, min=1, max=1, modifier=false, summary=true)
6421        @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." )
6422        protected CanonicalType profile;
6423
6424        private static final long serialVersionUID = 18026632L;
6425
6426    /**
6427     * Constructor
6428     */
6429      public CapabilityStatementDocumentComponent() {
6430        super();
6431      }
6432
6433    /**
6434     * Constructor
6435     */
6436      public CapabilityStatementDocumentComponent(Enumeration<DocumentMode> mode, CanonicalType profile) {
6437        super();
6438        this.mode = mode;
6439        this.profile = profile;
6440      }
6441
6442        /**
6443         * @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
6444         */
6445        public Enumeration<DocumentMode> getModeElement() { 
6446          if (this.mode == null)
6447            if (Configuration.errorOnAutoCreate())
6448              throw new Error("Attempt to auto-create CapabilityStatementDocumentComponent.mode");
6449            else if (Configuration.doAutoCreate())
6450              this.mode = new Enumeration<DocumentMode>(new DocumentModeEnumFactory()); // bb
6451          return this.mode;
6452        }
6453
6454        public boolean hasModeElement() { 
6455          return this.mode != null && !this.mode.isEmpty();
6456        }
6457
6458        public boolean hasMode() { 
6459          return this.mode != null && !this.mode.isEmpty();
6460        }
6461
6462        /**
6463         * @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
6464         */
6465        public CapabilityStatementDocumentComponent setModeElement(Enumeration<DocumentMode> value) { 
6466          this.mode = value;
6467          return this;
6468        }
6469
6470        /**
6471         * @return Mode of this document declaration - whether an application is a producer or consumer.
6472         */
6473        public DocumentMode getMode() { 
6474          return this.mode == null ? null : this.mode.getValue();
6475        }
6476
6477        /**
6478         * @param value Mode of this document declaration - whether an application is a producer or consumer.
6479         */
6480        public CapabilityStatementDocumentComponent setMode(DocumentMode value) { 
6481            if (this.mode == null)
6482              this.mode = new Enumeration<DocumentMode>(new DocumentModeEnumFactory());
6483            this.mode.setValue(value);
6484          return this;
6485        }
6486
6487        /**
6488         * @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
6489         */
6490        public MarkdownType getDocumentationElement() { 
6491          if (this.documentation == null)
6492            if (Configuration.errorOnAutoCreate())
6493              throw new Error("Attempt to auto-create CapabilityStatementDocumentComponent.documentation");
6494            else if (Configuration.doAutoCreate())
6495              this.documentation = new MarkdownType(); // bb
6496          return this.documentation;
6497        }
6498
6499        public boolean hasDocumentationElement() { 
6500          return this.documentation != null && !this.documentation.isEmpty();
6501        }
6502
6503        public boolean hasDocumentation() { 
6504          return this.documentation != null && !this.documentation.isEmpty();
6505        }
6506
6507        /**
6508         * @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
6509         */
6510        public CapabilityStatementDocumentComponent setDocumentationElement(MarkdownType value) { 
6511          this.documentation = value;
6512          return this;
6513        }
6514
6515        /**
6516         * @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.
6517         */
6518        public String getDocumentation() { 
6519          return this.documentation == null ? null : this.documentation.getValue();
6520        }
6521
6522        /**
6523         * @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.
6524         */
6525        public CapabilityStatementDocumentComponent setDocumentation(String value) { 
6526          if (value == null)
6527            this.documentation = null;
6528          else {
6529            if (this.documentation == null)
6530              this.documentation = new MarkdownType();
6531            this.documentation.setValue(value);
6532          }
6533          return this;
6534        }
6535
6536        /**
6537         * @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
6538         */
6539        public CanonicalType getProfileElement() { 
6540          if (this.profile == null)
6541            if (Configuration.errorOnAutoCreate())
6542              throw new Error("Attempt to auto-create CapabilityStatementDocumentComponent.profile");
6543            else if (Configuration.doAutoCreate())
6544              this.profile = new CanonicalType(); // bb
6545          return this.profile;
6546        }
6547
6548        public boolean hasProfileElement() { 
6549          return this.profile != null && !this.profile.isEmpty();
6550        }
6551
6552        public boolean hasProfile() { 
6553          return this.profile != null && !this.profile.isEmpty();
6554        }
6555
6556        /**
6557         * @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
6558         */
6559        public CapabilityStatementDocumentComponent setProfileElement(CanonicalType value) { 
6560          this.profile = value;
6561          return this;
6562        }
6563
6564        /**
6565         * @return A profile on the document Bundle that constrains which resources are present, and their contents.
6566         */
6567        public String getProfile() { 
6568          return this.profile == null ? null : this.profile.getValue();
6569        }
6570
6571        /**
6572         * @param value A profile on the document Bundle that constrains which resources are present, and their contents.
6573         */
6574        public CapabilityStatementDocumentComponent setProfile(String value) { 
6575            if (this.profile == null)
6576              this.profile = new CanonicalType();
6577            this.profile.setValue(value);
6578          return this;
6579        }
6580
6581        protected void listChildren(List<Property> children) {
6582          super.listChildren(children);
6583          children.add(new Property("mode", "code", "Mode of this document declaration - whether an application is a producer or consumer.", 0, 1, mode));
6584          children.add(new Property("documentation", "markdown", "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));
6585          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));
6586        }
6587
6588        @Override
6589        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6590          switch (_hash) {
6591          case 3357091: /*mode*/  return new Property("mode", "code", "Mode of this document declaration - whether an application is a producer or consumer.", 0, 1, mode);
6592          case 1587405498: /*documentation*/  return new Property("documentation", "markdown", "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);
6593          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);
6594          default: return super.getNamedProperty(_hash, _name, _checkValid);
6595          }
6596
6597        }
6598
6599      @Override
6600      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6601        switch (hash) {
6602        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<DocumentMode>
6603        case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // MarkdownType
6604        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // CanonicalType
6605        default: return super.getProperty(hash, name, checkValid);
6606        }
6607
6608      }
6609
6610      @Override
6611      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6612        switch (hash) {
6613        case 3357091: // mode
6614          value = new DocumentModeEnumFactory().fromType(castToCode(value));
6615          this.mode = (Enumeration) value; // Enumeration<DocumentMode>
6616          return value;
6617        case 1587405498: // documentation
6618          this.documentation = castToMarkdown(value); // MarkdownType
6619          return value;
6620        case -309425751: // profile
6621          this.profile = castToCanonical(value); // CanonicalType
6622          return value;
6623        default: return super.setProperty(hash, name, value);
6624        }
6625
6626      }
6627
6628      @Override
6629      public Base setProperty(String name, Base value) throws FHIRException {
6630        if (name.equals("mode")) {
6631          value = new DocumentModeEnumFactory().fromType(castToCode(value));
6632          this.mode = (Enumeration) value; // Enumeration<DocumentMode>
6633        } else if (name.equals("documentation")) {
6634          this.documentation = castToMarkdown(value); // MarkdownType
6635        } else if (name.equals("profile")) {
6636          this.profile = castToCanonical(value); // CanonicalType
6637        } else
6638          return super.setProperty(name, value);
6639        return value;
6640      }
6641
6642      @Override
6643      public Base makeProperty(int hash, String name) throws FHIRException {
6644        switch (hash) {
6645        case 3357091:  return getModeElement();
6646        case 1587405498:  return getDocumentationElement();
6647        case -309425751:  return getProfileElement();
6648        default: return super.makeProperty(hash, name);
6649        }
6650
6651      }
6652
6653      @Override
6654      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6655        switch (hash) {
6656        case 3357091: /*mode*/ return new String[] {"code"};
6657        case 1587405498: /*documentation*/ return new String[] {"markdown"};
6658        case -309425751: /*profile*/ return new String[] {"canonical"};
6659        default: return super.getTypesForProperty(hash, name);
6660        }
6661
6662      }
6663
6664      @Override
6665      public Base addChild(String name) throws FHIRException {
6666        if (name.equals("mode")) {
6667          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.mode");
6668        }
6669        else if (name.equals("documentation")) {
6670          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.documentation");
6671        }
6672        else if (name.equals("profile")) {
6673          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.profile");
6674        }
6675        else
6676          return super.addChild(name);
6677      }
6678
6679      public CapabilityStatementDocumentComponent copy() {
6680        CapabilityStatementDocumentComponent dst = new CapabilityStatementDocumentComponent();
6681        copyValues(dst);
6682        dst.mode = mode == null ? null : mode.copy();
6683        dst.documentation = documentation == null ? null : documentation.copy();
6684        dst.profile = profile == null ? null : profile.copy();
6685        return dst;
6686      }
6687
6688      @Override
6689      public boolean equalsDeep(Base other_) {
6690        if (!super.equalsDeep(other_))
6691          return false;
6692        if (!(other_ instanceof CapabilityStatementDocumentComponent))
6693          return false;
6694        CapabilityStatementDocumentComponent o = (CapabilityStatementDocumentComponent) other_;
6695        return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(profile, o.profile, true)
6696          ;
6697      }
6698
6699      @Override
6700      public boolean equalsShallow(Base other_) {
6701        if (!super.equalsShallow(other_))
6702          return false;
6703        if (!(other_ instanceof CapabilityStatementDocumentComponent))
6704          return false;
6705        CapabilityStatementDocumentComponent o = (CapabilityStatementDocumentComponent) other_;
6706        return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true);
6707      }
6708
6709      public boolean isEmpty() {
6710        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mode, documentation, profile
6711          );
6712      }
6713
6714  public String fhirType() {
6715    return "CapabilityStatement.document";
6716
6717  }
6718
6719  }
6720
6721    /**
6722     * Explanation of why this capability statement is needed and why it has been designed as it has.
6723     */
6724    @Child(name = "purpose", type = {MarkdownType.class}, order=0, min=0, max=1, modifier=false, summary=false)
6725    @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." )
6726    protected MarkdownType purpose;
6727
6728    /**
6729     * 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.
6730     */
6731    @Child(name = "copyright", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=false)
6732    @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." )
6733    protected MarkdownType copyright;
6734
6735    /**
6736     * 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).
6737     */
6738    @Child(name = "kind", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
6739    @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)." )
6740    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/capability-statement-kind")
6741    protected Enumeration<CapabilityStatementKind> kind;
6742
6743    /**
6744     * Reference to a canonical URL of another CapabilityStatement that this software implements. This capability statement is a published API description that corresponds to a business service. The server may actually implement a subset of the capability statement it claims to implement, so the capability statement must specify the full capability details.
6745     */
6746    @Child(name = "instantiates", type = {CanonicalType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
6747    @Description(shortDefinition="Canonical URL of another capability statement this implements", formalDefinition="Reference to a canonical URL of another CapabilityStatement that this software implements. This capability statement is a published API description that corresponds to a business service. The server may actually implement a subset of the capability statement it claims to implement, so the capability statement must specify the full capability details." )
6748    protected List<CanonicalType> instantiates;
6749
6750    /**
6751     * Reference to a canonical URL of another CapabilityStatement that this software adds to. The capability statement automatically includes everything in the other statement, and it is not duplicated, though the server may repeat the same resources, interactions and operations to add additional details to them.
6752     */
6753    @Child(name = "imports", type = {CanonicalType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
6754    @Description(shortDefinition="Canonical URL of another capability statement this adds to", formalDefinition="Reference to a canonical URL of another CapabilityStatement that this software adds to. The capability statement automatically includes everything in the other statement, and it is not duplicated, though the server may repeat the same resources, interactions and operations to add additional details to them." )
6755    protected List<CanonicalType> imports;
6756
6757    /**
6758     * 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.
6759     */
6760    @Child(name = "software", type = {}, order=5, min=0, max=1, modifier=false, summary=true)
6761    @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." )
6762    protected CapabilityStatementSoftwareComponent software;
6763
6764    /**
6765     * 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.
6766     */
6767    @Child(name = "implementation", type = {}, order=6, min=0, max=1, modifier=false, summary=true)
6768    @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." )
6769    protected CapabilityStatementImplementationComponent implementation;
6770
6771    /**
6772     * The version of the FHIR specification on which this capability statement is based.
6773     */
6774    @Child(name = "fhirVersion", type = {IdType.class}, order=7, min=1, max=1, modifier=false, summary=true)
6775    @Description(shortDefinition="FHIR Version the system uses", formalDefinition="The version of the FHIR specification on which this capability statement is based." )
6776    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fhir-versions")
6777    protected IdType fhirVersion;
6778
6779    /**
6780     * A list of the formats supported by this implementation using their content types.
6781     */
6782    @Child(name = "format", type = {CodeType.class}, order=8, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
6783    @Description(shortDefinition="formats supported (xml | json | ttl | mime type)", formalDefinition="A list of the formats supported by this implementation using their content types." )
6784    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/mimetypes")
6785    protected List<CodeType> format;
6786
6787    /**
6788     * A list of the patch formats supported by this implementation using their content types.
6789     */
6790    @Child(name = "patchFormat", type = {CodeType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
6791    @Description(shortDefinition="Patch formats supported", formalDefinition="A list of the patch formats supported by this implementation using their content types." )
6792    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/mimetypes")
6793    protected List<CodeType> patchFormat;
6794
6795    /**
6796     * A list of implementation guides that the server does (or should) support in their entirety.
6797     */
6798    @Child(name = "implementationGuide", type = {CanonicalType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
6799    @Description(shortDefinition="Implementation guides supported", formalDefinition="A list of implementation guides that the server does (or should) support in their entirety." )
6800    protected List<CanonicalType> implementationGuide;
6801
6802    /**
6803     * A definition of the restful capabilities of the solution, if any.
6804     */
6805    @Child(name = "rest", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
6806    @Description(shortDefinition="If the endpoint is a RESTful one", formalDefinition="A definition of the restful capabilities of the solution, if any." )
6807    protected List<CapabilityStatementRestComponent> rest;
6808
6809    /**
6810     * A description of the messaging capabilities of the solution.
6811     */
6812    @Child(name = "messaging", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
6813    @Description(shortDefinition="If messaging is supported", formalDefinition="A description of the messaging capabilities of the solution." )
6814    protected List<CapabilityStatementMessagingComponent> messaging;
6815
6816    /**
6817     * A document definition.
6818     */
6819    @Child(name = "document", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
6820    @Description(shortDefinition="Document definition", formalDefinition="A document definition." )
6821    protected List<CapabilityStatementDocumentComponent> document;
6822
6823    private static final long serialVersionUID = -1192000348L;
6824
6825  /**
6826   * Constructor
6827   */
6828    public CapabilityStatement() {
6829      super();
6830    }
6831
6832  /**
6833   * Constructor
6834   */
6835    public CapabilityStatement(Enumeration<PublicationStatus> status, DateTimeType date, Enumeration<CapabilityStatementKind> kind, IdType fhirVersion) {
6836      super();
6837      this.status = status;
6838      this.date = date;
6839      this.kind = kind;
6840      this.fhirVersion = fhirVersion;
6841    }
6842
6843    /**
6844     * @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 at which an authoritative instance of this capability statement is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the capability statement is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
6845     */
6846    public UriType getUrlElement() { 
6847      if (this.url == null)
6848        if (Configuration.errorOnAutoCreate())
6849          throw new Error("Attempt to auto-create CapabilityStatement.url");
6850        else if (Configuration.doAutoCreate())
6851          this.url = new UriType(); // bb
6852      return this.url;
6853    }
6854
6855    public boolean hasUrlElement() { 
6856      return this.url != null && !this.url.isEmpty();
6857    }
6858
6859    public boolean hasUrl() { 
6860      return this.url != null && !this.url.isEmpty();
6861    }
6862
6863    /**
6864     * @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 at which an authoritative instance of this capability statement is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the capability statement is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
6865     */
6866    public CapabilityStatement setUrlElement(UriType value) { 
6867      this.url = value;
6868      return this;
6869    }
6870
6871    /**
6872     * @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 at which an authoritative instance of this capability statement is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the capability statement is stored on different servers.
6873     */
6874    public String getUrl() { 
6875      return this.url == null ? null : this.url.getValue();
6876    }
6877
6878    /**
6879     * @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 at which an authoritative instance of this capability statement is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the capability statement is stored on different servers.
6880     */
6881    public CapabilityStatement setUrl(String value) { 
6882      if (Utilities.noString(value))
6883        this.url = null;
6884      else {
6885        if (this.url == null)
6886          this.url = new UriType();
6887        this.url.setValue(value);
6888      }
6889      return this;
6890    }
6891
6892    /**
6893     * @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
6894     */
6895    public StringType getVersionElement() { 
6896      if (this.version == null)
6897        if (Configuration.errorOnAutoCreate())
6898          throw new Error("Attempt to auto-create CapabilityStatement.version");
6899        else if (Configuration.doAutoCreate())
6900          this.version = new StringType(); // bb
6901      return this.version;
6902    }
6903
6904    public boolean hasVersionElement() { 
6905      return this.version != null && !this.version.isEmpty();
6906    }
6907
6908    public boolean hasVersion() { 
6909      return this.version != null && !this.version.isEmpty();
6910    }
6911
6912    /**
6913     * @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
6914     */
6915    public CapabilityStatement setVersionElement(StringType value) { 
6916      this.version = value;
6917      return this;
6918    }
6919
6920    /**
6921     * @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.
6922     */
6923    public String getVersion() { 
6924      return this.version == null ? null : this.version.getValue();
6925    }
6926
6927    /**
6928     * @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.
6929     */
6930    public CapabilityStatement setVersion(String value) { 
6931      if (Utilities.noString(value))
6932        this.version = null;
6933      else {
6934        if (this.version == null)
6935          this.version = new StringType();
6936        this.version.setValue(value);
6937      }
6938      return this;
6939    }
6940
6941    /**
6942     * @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
6943     */
6944    public StringType getNameElement() { 
6945      if (this.name == null)
6946        if (Configuration.errorOnAutoCreate())
6947          throw new Error("Attempt to auto-create CapabilityStatement.name");
6948        else if (Configuration.doAutoCreate())
6949          this.name = new StringType(); // bb
6950      return this.name;
6951    }
6952
6953    public boolean hasNameElement() { 
6954      return this.name != null && !this.name.isEmpty();
6955    }
6956
6957    public boolean hasName() { 
6958      return this.name != null && !this.name.isEmpty();
6959    }
6960
6961    /**
6962     * @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
6963     */
6964    public CapabilityStatement setNameElement(StringType value) { 
6965      this.name = value;
6966      return this;
6967    }
6968
6969    /**
6970     * @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.
6971     */
6972    public String getName() { 
6973      return this.name == null ? null : this.name.getValue();
6974    }
6975
6976    /**
6977     * @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.
6978     */
6979    public CapabilityStatement setName(String value) { 
6980      if (Utilities.noString(value))
6981        this.name = null;
6982      else {
6983        if (this.name == null)
6984          this.name = new StringType();
6985        this.name.setValue(value);
6986      }
6987      return this;
6988    }
6989
6990    /**
6991     * @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
6992     */
6993    public StringType getTitleElement() { 
6994      if (this.title == null)
6995        if (Configuration.errorOnAutoCreate())
6996          throw new Error("Attempt to auto-create CapabilityStatement.title");
6997        else if (Configuration.doAutoCreate())
6998          this.title = new StringType(); // bb
6999      return this.title;
7000    }
7001
7002    public boolean hasTitleElement() { 
7003      return this.title != null && !this.title.isEmpty();
7004    }
7005
7006    public boolean hasTitle() { 
7007      return this.title != null && !this.title.isEmpty();
7008    }
7009
7010    /**
7011     * @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
7012     */
7013    public CapabilityStatement setTitleElement(StringType value) { 
7014      this.title = value;
7015      return this;
7016    }
7017
7018    /**
7019     * @return A short, descriptive, user-friendly title for the capability statement.
7020     */
7021    public String getTitle() { 
7022      return this.title == null ? null : this.title.getValue();
7023    }
7024
7025    /**
7026     * @param value A short, descriptive, user-friendly title for the capability statement.
7027     */
7028    public CapabilityStatement setTitle(String value) { 
7029      if (Utilities.noString(value))
7030        this.title = null;
7031      else {
7032        if (this.title == null)
7033          this.title = new StringType();
7034        this.title.setValue(value);
7035      }
7036      return this;
7037    }
7038
7039    /**
7040     * @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
7041     */
7042    public Enumeration<PublicationStatus> getStatusElement() { 
7043      if (this.status == null)
7044        if (Configuration.errorOnAutoCreate())
7045          throw new Error("Attempt to auto-create CapabilityStatement.status");
7046        else if (Configuration.doAutoCreate())
7047          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
7048      return this.status;
7049    }
7050
7051    public boolean hasStatusElement() { 
7052      return this.status != null && !this.status.isEmpty();
7053    }
7054
7055    public boolean hasStatus() { 
7056      return this.status != null && !this.status.isEmpty();
7057    }
7058
7059    /**
7060     * @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
7061     */
7062    public CapabilityStatement setStatusElement(Enumeration<PublicationStatus> value) { 
7063      this.status = value;
7064      return this;
7065    }
7066
7067    /**
7068     * @return The status of this capability statement. Enables tracking the life-cycle of the content.
7069     */
7070    public PublicationStatus getStatus() { 
7071      return this.status == null ? null : this.status.getValue();
7072    }
7073
7074    /**
7075     * @param value The status of this capability statement. Enables tracking the life-cycle of the content.
7076     */
7077    public CapabilityStatement setStatus(PublicationStatus value) { 
7078        if (this.status == null)
7079          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
7080        this.status.setValue(value);
7081      return this;
7082    }
7083
7084    /**
7085     * @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
7086     */
7087    public BooleanType getExperimentalElement() { 
7088      if (this.experimental == null)
7089        if (Configuration.errorOnAutoCreate())
7090          throw new Error("Attempt to auto-create CapabilityStatement.experimental");
7091        else if (Configuration.doAutoCreate())
7092          this.experimental = new BooleanType(); // bb
7093      return this.experimental;
7094    }
7095
7096    public boolean hasExperimentalElement() { 
7097      return this.experimental != null && !this.experimental.isEmpty();
7098    }
7099
7100    public boolean hasExperimental() { 
7101      return this.experimental != null && !this.experimental.isEmpty();
7102    }
7103
7104    /**
7105     * @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
7106     */
7107    public CapabilityStatement setExperimentalElement(BooleanType value) { 
7108      this.experimental = value;
7109      return this;
7110    }
7111
7112    /**
7113     * @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.
7114     */
7115    public boolean getExperimental() { 
7116      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
7117    }
7118
7119    /**
7120     * @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.
7121     */
7122    public CapabilityStatement setExperimental(boolean value) { 
7123        if (this.experimental == null)
7124          this.experimental = new BooleanType();
7125        this.experimental.setValue(value);
7126      return this;
7127    }
7128
7129    /**
7130     * @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
7131     */
7132    public DateTimeType getDateElement() { 
7133      if (this.date == null)
7134        if (Configuration.errorOnAutoCreate())
7135          throw new Error("Attempt to auto-create CapabilityStatement.date");
7136        else if (Configuration.doAutoCreate())
7137          this.date = new DateTimeType(); // bb
7138      return this.date;
7139    }
7140
7141    public boolean hasDateElement() { 
7142      return this.date != null && !this.date.isEmpty();
7143    }
7144
7145    public boolean hasDate() { 
7146      return this.date != null && !this.date.isEmpty();
7147    }
7148
7149    /**
7150     * @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
7151     */
7152    public CapabilityStatement setDateElement(DateTimeType value) { 
7153      this.date = value;
7154      return this;
7155    }
7156
7157    /**
7158     * @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.
7159     */
7160    public Date getDate() { 
7161      return this.date == null ? null : this.date.getValue();
7162    }
7163
7164    /**
7165     * @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.
7166     */
7167    public CapabilityStatement setDate(Date value) { 
7168        if (this.date == null)
7169          this.date = new DateTimeType();
7170        this.date.setValue(value);
7171      return this;
7172    }
7173
7174    /**
7175     * @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
7176     */
7177    public StringType getPublisherElement() { 
7178      if (this.publisher == null)
7179        if (Configuration.errorOnAutoCreate())
7180          throw new Error("Attempt to auto-create CapabilityStatement.publisher");
7181        else if (Configuration.doAutoCreate())
7182          this.publisher = new StringType(); // bb
7183      return this.publisher;
7184    }
7185
7186    public boolean hasPublisherElement() { 
7187      return this.publisher != null && !this.publisher.isEmpty();
7188    }
7189
7190    public boolean hasPublisher() { 
7191      return this.publisher != null && !this.publisher.isEmpty();
7192    }
7193
7194    /**
7195     * @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
7196     */
7197    public CapabilityStatement setPublisherElement(StringType value) { 
7198      this.publisher = value;
7199      return this;
7200    }
7201
7202    /**
7203     * @return The name of the organization or individual that published the capability statement.
7204     */
7205    public String getPublisher() { 
7206      return this.publisher == null ? null : this.publisher.getValue();
7207    }
7208
7209    /**
7210     * @param value The name of the organization or individual that published the capability statement.
7211     */
7212    public CapabilityStatement setPublisher(String value) { 
7213      if (Utilities.noString(value))
7214        this.publisher = null;
7215      else {
7216        if (this.publisher == null)
7217          this.publisher = new StringType();
7218        this.publisher.setValue(value);
7219      }
7220      return this;
7221    }
7222
7223    /**
7224     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
7225     */
7226    public List<ContactDetail> getContact() { 
7227      if (this.contact == null)
7228        this.contact = new ArrayList<ContactDetail>();
7229      return this.contact;
7230    }
7231
7232    /**
7233     * @return Returns a reference to <code>this</code> for easy method chaining
7234     */
7235    public CapabilityStatement setContact(List<ContactDetail> theContact) { 
7236      this.contact = theContact;
7237      return this;
7238    }
7239
7240    public boolean hasContact() { 
7241      if (this.contact == null)
7242        return false;
7243      for (ContactDetail item : this.contact)
7244        if (!item.isEmpty())
7245          return true;
7246      return false;
7247    }
7248
7249    public ContactDetail addContact() { //3
7250      ContactDetail t = new ContactDetail();
7251      if (this.contact == null)
7252        this.contact = new ArrayList<ContactDetail>();
7253      this.contact.add(t);
7254      return t;
7255    }
7256
7257    public CapabilityStatement addContact(ContactDetail t) { //3
7258      if (t == null)
7259        return this;
7260      if (this.contact == null)
7261        this.contact = new ArrayList<ContactDetail>();
7262      this.contact.add(t);
7263      return this;
7264    }
7265
7266    /**
7267     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
7268     */
7269    public ContactDetail getContactFirstRep() { 
7270      if (getContact().isEmpty()) {
7271        addContact();
7272      }
7273      return getContact().get(0);
7274    }
7275
7276    /**
7277     * @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
7278     */
7279    public MarkdownType getDescriptionElement() { 
7280      if (this.description == null)
7281        if (Configuration.errorOnAutoCreate())
7282          throw new Error("Attempt to auto-create CapabilityStatement.description");
7283        else if (Configuration.doAutoCreate())
7284          this.description = new MarkdownType(); // bb
7285      return this.description;
7286    }
7287
7288    public boolean hasDescriptionElement() { 
7289      return this.description != null && !this.description.isEmpty();
7290    }
7291
7292    public boolean hasDescription() { 
7293      return this.description != null && !this.description.isEmpty();
7294    }
7295
7296    /**
7297     * @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
7298     */
7299    public CapabilityStatement setDescriptionElement(MarkdownType value) { 
7300      this.description = value;
7301      return this;
7302    }
7303
7304    /**
7305     * @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.
7306     */
7307    public String getDescription() { 
7308      return this.description == null ? null : this.description.getValue();
7309    }
7310
7311    /**
7312     * @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.
7313     */
7314    public CapabilityStatement setDescription(String value) { 
7315      if (value == null)
7316        this.description = null;
7317      else {
7318        if (this.description == null)
7319          this.description = new MarkdownType();
7320        this.description.setValue(value);
7321      }
7322      return this;
7323    }
7324
7325    /**
7326     * @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.)
7327     */
7328    public List<UsageContext> getUseContext() { 
7329      if (this.useContext == null)
7330        this.useContext = new ArrayList<UsageContext>();
7331      return this.useContext;
7332    }
7333
7334    /**
7335     * @return Returns a reference to <code>this</code> for easy method chaining
7336     */
7337    public CapabilityStatement setUseContext(List<UsageContext> theUseContext) { 
7338      this.useContext = theUseContext;
7339      return this;
7340    }
7341
7342    public boolean hasUseContext() { 
7343      if (this.useContext == null)
7344        return false;
7345      for (UsageContext item : this.useContext)
7346        if (!item.isEmpty())
7347          return true;
7348      return false;
7349    }
7350
7351    public UsageContext addUseContext() { //3
7352      UsageContext t = new UsageContext();
7353      if (this.useContext == null)
7354        this.useContext = new ArrayList<UsageContext>();
7355      this.useContext.add(t);
7356      return t;
7357    }
7358
7359    public CapabilityStatement addUseContext(UsageContext t) { //3
7360      if (t == null)
7361        return this;
7362      if (this.useContext == null)
7363        this.useContext = new ArrayList<UsageContext>();
7364      this.useContext.add(t);
7365      return this;
7366    }
7367
7368    /**
7369     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
7370     */
7371    public UsageContext getUseContextFirstRep() { 
7372      if (getUseContext().isEmpty()) {
7373        addUseContext();
7374      }
7375      return getUseContext().get(0);
7376    }
7377
7378    /**
7379     * @return {@link #jurisdiction} (A legal or geographic region in which the capability statement is intended to be used.)
7380     */
7381    public List<CodeableConcept> getJurisdiction() { 
7382      if (this.jurisdiction == null)
7383        this.jurisdiction = new ArrayList<CodeableConcept>();
7384      return this.jurisdiction;
7385    }
7386
7387    /**
7388     * @return Returns a reference to <code>this</code> for easy method chaining
7389     */
7390    public CapabilityStatement setJurisdiction(List<CodeableConcept> theJurisdiction) { 
7391      this.jurisdiction = theJurisdiction;
7392      return this;
7393    }
7394
7395    public boolean hasJurisdiction() { 
7396      if (this.jurisdiction == null)
7397        return false;
7398      for (CodeableConcept item : this.jurisdiction)
7399        if (!item.isEmpty())
7400          return true;
7401      return false;
7402    }
7403
7404    public CodeableConcept addJurisdiction() { //3
7405      CodeableConcept t = new CodeableConcept();
7406      if (this.jurisdiction == null)
7407        this.jurisdiction = new ArrayList<CodeableConcept>();
7408      this.jurisdiction.add(t);
7409      return t;
7410    }
7411
7412    public CapabilityStatement addJurisdiction(CodeableConcept t) { //3
7413      if (t == null)
7414        return this;
7415      if (this.jurisdiction == null)
7416        this.jurisdiction = new ArrayList<CodeableConcept>();
7417      this.jurisdiction.add(t);
7418      return this;
7419    }
7420
7421    /**
7422     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
7423     */
7424    public CodeableConcept getJurisdictionFirstRep() { 
7425      if (getJurisdiction().isEmpty()) {
7426        addJurisdiction();
7427      }
7428      return getJurisdiction().get(0);
7429    }
7430
7431    /**
7432     * @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
7433     */
7434    public MarkdownType getPurposeElement() { 
7435      if (this.purpose == null)
7436        if (Configuration.errorOnAutoCreate())
7437          throw new Error("Attempt to auto-create CapabilityStatement.purpose");
7438        else if (Configuration.doAutoCreate())
7439          this.purpose = new MarkdownType(); // bb
7440      return this.purpose;
7441    }
7442
7443    public boolean hasPurposeElement() { 
7444      return this.purpose != null && !this.purpose.isEmpty();
7445    }
7446
7447    public boolean hasPurpose() { 
7448      return this.purpose != null && !this.purpose.isEmpty();
7449    }
7450
7451    /**
7452     * @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
7453     */
7454    public CapabilityStatement setPurposeElement(MarkdownType value) { 
7455      this.purpose = value;
7456      return this;
7457    }
7458
7459    /**
7460     * @return Explanation of why this capability statement is needed and why it has been designed as it has.
7461     */
7462    public String getPurpose() { 
7463      return this.purpose == null ? null : this.purpose.getValue();
7464    }
7465
7466    /**
7467     * @param value Explanation of why this capability statement is needed and why it has been designed as it has.
7468     */
7469    public CapabilityStatement setPurpose(String value) { 
7470      if (value == null)
7471        this.purpose = null;
7472      else {
7473        if (this.purpose == null)
7474          this.purpose = new MarkdownType();
7475        this.purpose.setValue(value);
7476      }
7477      return this;
7478    }
7479
7480    /**
7481     * @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
7482     */
7483    public MarkdownType getCopyrightElement() { 
7484      if (this.copyright == null)
7485        if (Configuration.errorOnAutoCreate())
7486          throw new Error("Attempt to auto-create CapabilityStatement.copyright");
7487        else if (Configuration.doAutoCreate())
7488          this.copyright = new MarkdownType(); // bb
7489      return this.copyright;
7490    }
7491
7492    public boolean hasCopyrightElement() { 
7493      return this.copyright != null && !this.copyright.isEmpty();
7494    }
7495
7496    public boolean hasCopyright() { 
7497      return this.copyright != null && !this.copyright.isEmpty();
7498    }
7499
7500    /**
7501     * @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
7502     */
7503    public CapabilityStatement setCopyrightElement(MarkdownType value) { 
7504      this.copyright = value;
7505      return this;
7506    }
7507
7508    /**
7509     * @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.
7510     */
7511    public String getCopyright() { 
7512      return this.copyright == null ? null : this.copyright.getValue();
7513    }
7514
7515    /**
7516     * @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.
7517     */
7518    public CapabilityStatement setCopyright(String value) { 
7519      if (value == null)
7520        this.copyright = null;
7521      else {
7522        if (this.copyright == null)
7523          this.copyright = new MarkdownType();
7524        this.copyright.setValue(value);
7525      }
7526      return this;
7527    }
7528
7529    /**
7530     * @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
7531     */
7532    public Enumeration<CapabilityStatementKind> getKindElement() { 
7533      if (this.kind == null)
7534        if (Configuration.errorOnAutoCreate())
7535          throw new Error("Attempt to auto-create CapabilityStatement.kind");
7536        else if (Configuration.doAutoCreate())
7537          this.kind = new Enumeration<CapabilityStatementKind>(new CapabilityStatementKindEnumFactory()); // bb
7538      return this.kind;
7539    }
7540
7541    public boolean hasKindElement() { 
7542      return this.kind != null && !this.kind.isEmpty();
7543    }
7544
7545    public boolean hasKind() { 
7546      return this.kind != null && !this.kind.isEmpty();
7547    }
7548
7549    /**
7550     * @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
7551     */
7552    public CapabilityStatement setKindElement(Enumeration<CapabilityStatementKind> value) { 
7553      this.kind = value;
7554      return this;
7555    }
7556
7557    /**
7558     * @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).
7559     */
7560    public CapabilityStatementKind getKind() { 
7561      return this.kind == null ? null : this.kind.getValue();
7562    }
7563
7564    /**
7565     * @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).
7566     */
7567    public CapabilityStatement setKind(CapabilityStatementKind value) { 
7568        if (this.kind == null)
7569          this.kind = new Enumeration<CapabilityStatementKind>(new CapabilityStatementKindEnumFactory());
7570        this.kind.setValue(value);
7571      return this;
7572    }
7573
7574    /**
7575     * @return {@link #instantiates} (Reference to a canonical URL of another CapabilityStatement that this software implements. This capability statement is a published API description that corresponds to a business service. The server may actually implement a subset of the capability statement it claims to implement, so the capability statement must specify the full capability details.)
7576     */
7577    public List<CanonicalType> getInstantiates() { 
7578      if (this.instantiates == null)
7579        this.instantiates = new ArrayList<CanonicalType>();
7580      return this.instantiates;
7581    }
7582
7583    /**
7584     * @return Returns a reference to <code>this</code> for easy method chaining
7585     */
7586    public CapabilityStatement setInstantiates(List<CanonicalType> theInstantiates) { 
7587      this.instantiates = theInstantiates;
7588      return this;
7589    }
7590
7591    public boolean hasInstantiates() { 
7592      if (this.instantiates == null)
7593        return false;
7594      for (CanonicalType item : this.instantiates)
7595        if (!item.isEmpty())
7596          return true;
7597      return false;
7598    }
7599
7600    /**
7601     * @return {@link #instantiates} (Reference to a canonical URL of another CapabilityStatement that this software implements. This capability statement is a published API description that corresponds to a business service. The server may actually implement a subset of the capability statement it claims to implement, so the capability statement must specify the full capability details.)
7602     */
7603    public CanonicalType addInstantiatesElement() {//2 
7604      CanonicalType t = new CanonicalType();
7605      if (this.instantiates == null)
7606        this.instantiates = new ArrayList<CanonicalType>();
7607      this.instantiates.add(t);
7608      return t;
7609    }
7610
7611    /**
7612     * @param value {@link #instantiates} (Reference to a canonical URL of another CapabilityStatement that this software implements. This capability statement is a published API description that corresponds to a business service. The server may actually implement a subset of the capability statement it claims to implement, so the capability statement must specify the full capability details.)
7613     */
7614    public CapabilityStatement addInstantiates(String value) { //1
7615      CanonicalType t = new CanonicalType();
7616      t.setValue(value);
7617      if (this.instantiates == null)
7618        this.instantiates = new ArrayList<CanonicalType>();
7619      this.instantiates.add(t);
7620      return this;
7621    }
7622
7623    /**
7624     * @param value {@link #instantiates} (Reference to a canonical URL of another CapabilityStatement that this software implements. This capability statement is a published API description that corresponds to a business service. The server may actually implement a subset of the capability statement it claims to implement, so the capability statement must specify the full capability details.)
7625     */
7626    public boolean hasInstantiates(String value) { 
7627      if (this.instantiates == null)
7628        return false;
7629      for (CanonicalType v : this.instantiates)
7630        if (v.getValue().equals(value)) // canonical(CapabilityStatement)
7631          return true;
7632      return false;
7633    }
7634
7635    /**
7636     * @return {@link #imports} (Reference to a canonical URL of another CapabilityStatement that this software adds to. The capability statement automatically includes everything in the other statement, and it is not duplicated, though the server may repeat the same resources, interactions and operations to add additional details to them.)
7637     */
7638    public List<CanonicalType> getImports() { 
7639      if (this.imports == null)
7640        this.imports = new ArrayList<CanonicalType>();
7641      return this.imports;
7642    }
7643
7644    /**
7645     * @return Returns a reference to <code>this</code> for easy method chaining
7646     */
7647    public CapabilityStatement setImports(List<CanonicalType> theImports) { 
7648      this.imports = theImports;
7649      return this;
7650    }
7651
7652    public boolean hasImports() { 
7653      if (this.imports == null)
7654        return false;
7655      for (CanonicalType item : this.imports)
7656        if (!item.isEmpty())
7657          return true;
7658      return false;
7659    }
7660
7661    /**
7662     * @return {@link #imports} (Reference to a canonical URL of another CapabilityStatement that this software adds to. The capability statement automatically includes everything in the other statement, and it is not duplicated, though the server may repeat the same resources, interactions and operations to add additional details to them.)
7663     */
7664    public CanonicalType addImportsElement() {//2 
7665      CanonicalType t = new CanonicalType();
7666      if (this.imports == null)
7667        this.imports = new ArrayList<CanonicalType>();
7668      this.imports.add(t);
7669      return t;
7670    }
7671
7672    /**
7673     * @param value {@link #imports} (Reference to a canonical URL of another CapabilityStatement that this software adds to. The capability statement automatically includes everything in the other statement, and it is not duplicated, though the server may repeat the same resources, interactions and operations to add additional details to them.)
7674     */
7675    public CapabilityStatement addImports(String value) { //1
7676      CanonicalType t = new CanonicalType();
7677      t.setValue(value);
7678      if (this.imports == null)
7679        this.imports = new ArrayList<CanonicalType>();
7680      this.imports.add(t);
7681      return this;
7682    }
7683
7684    /**
7685     * @param value {@link #imports} (Reference to a canonical URL of another CapabilityStatement that this software adds to. The capability statement automatically includes everything in the other statement, and it is not duplicated, though the server may repeat the same resources, interactions and operations to add additional details to them.)
7686     */
7687    public boolean hasImports(String value) { 
7688      if (this.imports == null)
7689        return false;
7690      for (CanonicalType v : this.imports)
7691        if (v.getValue().equals(value)) // canonical(CapabilityStatement)
7692          return true;
7693      return false;
7694    }
7695
7696    /**
7697     * @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.)
7698     */
7699    public CapabilityStatementSoftwareComponent getSoftware() { 
7700      if (this.software == null)
7701        if (Configuration.errorOnAutoCreate())
7702          throw new Error("Attempt to auto-create CapabilityStatement.software");
7703        else if (Configuration.doAutoCreate())
7704          this.software = new CapabilityStatementSoftwareComponent(); // cc
7705      return this.software;
7706    }
7707
7708    public boolean hasSoftware() { 
7709      return this.software != null && !this.software.isEmpty();
7710    }
7711
7712    /**
7713     * @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.)
7714     */
7715    public CapabilityStatement setSoftware(CapabilityStatementSoftwareComponent value) { 
7716      this.software = value;
7717      return this;
7718    }
7719
7720    /**
7721     * @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.)
7722     */
7723    public CapabilityStatementImplementationComponent getImplementation() { 
7724      if (this.implementation == null)
7725        if (Configuration.errorOnAutoCreate())
7726          throw new Error("Attempt to auto-create CapabilityStatement.implementation");
7727        else if (Configuration.doAutoCreate())
7728          this.implementation = new CapabilityStatementImplementationComponent(); // cc
7729      return this.implementation;
7730    }
7731
7732    public boolean hasImplementation() { 
7733      return this.implementation != null && !this.implementation.isEmpty();
7734    }
7735
7736    /**
7737     * @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.)
7738     */
7739    public CapabilityStatement setImplementation(CapabilityStatementImplementationComponent value) { 
7740      this.implementation = value;
7741      return this;
7742    }
7743
7744    /**
7745     * @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
7746     */
7747    public IdType getFhirVersionElement() { 
7748      if (this.fhirVersion == null)
7749        if (Configuration.errorOnAutoCreate())
7750          throw new Error("Attempt to auto-create CapabilityStatement.fhirVersion");
7751        else if (Configuration.doAutoCreate())
7752          this.fhirVersion = new IdType(); // bb
7753      return this.fhirVersion;
7754    }
7755
7756    public boolean hasFhirVersionElement() { 
7757      return this.fhirVersion != null && !this.fhirVersion.isEmpty();
7758    }
7759
7760    public boolean hasFhirVersion() { 
7761      return this.fhirVersion != null && !this.fhirVersion.isEmpty();
7762    }
7763
7764    /**
7765     * @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
7766     */
7767    public CapabilityStatement setFhirVersionElement(IdType value) { 
7768      this.fhirVersion = value;
7769      return this;
7770    }
7771
7772    /**
7773     * @return The version of the FHIR specification on which this capability statement is based.
7774     */
7775    public String getFhirVersion() { 
7776      return this.fhirVersion == null ? null : this.fhirVersion.getValue();
7777    }
7778
7779    /**
7780     * @param value The version of the FHIR specification on which this capability statement is based.
7781     */
7782    public CapabilityStatement setFhirVersion(String value) { 
7783        if (this.fhirVersion == null)
7784          this.fhirVersion = new IdType();
7785        this.fhirVersion.setValue(value);
7786      return this;
7787    }
7788
7789    /**
7790     * @return {@link #format} (A list of the formats supported by this implementation using their content types.)
7791     */
7792    public List<CodeType> getFormat() { 
7793      if (this.format == null)
7794        this.format = new ArrayList<CodeType>();
7795      return this.format;
7796    }
7797
7798    /**
7799     * @return Returns a reference to <code>this</code> for easy method chaining
7800     */
7801    public CapabilityStatement setFormat(List<CodeType> theFormat) { 
7802      this.format = theFormat;
7803      return this;
7804    }
7805
7806    public boolean hasFormat() { 
7807      if (this.format == null)
7808        return false;
7809      for (CodeType item : this.format)
7810        if (!item.isEmpty())
7811          return true;
7812      return false;
7813    }
7814
7815    /**
7816     * @return {@link #format} (A list of the formats supported by this implementation using their content types.)
7817     */
7818    public CodeType addFormatElement() {//2 
7819      CodeType t = new CodeType();
7820      if (this.format == null)
7821        this.format = new ArrayList<CodeType>();
7822      this.format.add(t);
7823      return t;
7824    }
7825
7826    /**
7827     * @param value {@link #format} (A list of the formats supported by this implementation using their content types.)
7828     */
7829    public CapabilityStatement addFormat(String value) { //1
7830      CodeType t = new CodeType();
7831      t.setValue(value);
7832      if (this.format == null)
7833        this.format = new ArrayList<CodeType>();
7834      this.format.add(t);
7835      return this;
7836    }
7837
7838    /**
7839     * @param value {@link #format} (A list of the formats supported by this implementation using their content types.)
7840     */
7841    public boolean hasFormat(String value) { 
7842      if (this.format == null)
7843        return false;
7844      for (CodeType v : this.format)
7845        if (v.getValue().equals(value)) // code
7846          return true;
7847      return false;
7848    }
7849
7850    /**
7851     * @return {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.)
7852     */
7853    public List<CodeType> getPatchFormat() { 
7854      if (this.patchFormat == null)
7855        this.patchFormat = new ArrayList<CodeType>();
7856      return this.patchFormat;
7857    }
7858
7859    /**
7860     * @return Returns a reference to <code>this</code> for easy method chaining
7861     */
7862    public CapabilityStatement setPatchFormat(List<CodeType> thePatchFormat) { 
7863      this.patchFormat = thePatchFormat;
7864      return this;
7865    }
7866
7867    public boolean hasPatchFormat() { 
7868      if (this.patchFormat == null)
7869        return false;
7870      for (CodeType item : this.patchFormat)
7871        if (!item.isEmpty())
7872          return true;
7873      return false;
7874    }
7875
7876    /**
7877     * @return {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.)
7878     */
7879    public CodeType addPatchFormatElement() {//2 
7880      CodeType t = new CodeType();
7881      if (this.patchFormat == null)
7882        this.patchFormat = new ArrayList<CodeType>();
7883      this.patchFormat.add(t);
7884      return t;
7885    }
7886
7887    /**
7888     * @param value {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.)
7889     */
7890    public CapabilityStatement addPatchFormat(String value) { //1
7891      CodeType t = new CodeType();
7892      t.setValue(value);
7893      if (this.patchFormat == null)
7894        this.patchFormat = new ArrayList<CodeType>();
7895      this.patchFormat.add(t);
7896      return this;
7897    }
7898
7899    /**
7900     * @param value {@link #patchFormat} (A list of the patch formats supported by this implementation using their content types.)
7901     */
7902    public boolean hasPatchFormat(String value) { 
7903      if (this.patchFormat == null)
7904        return false;
7905      for (CodeType v : this.patchFormat)
7906        if (v.getValue().equals(value)) // code
7907          return true;
7908      return false;
7909    }
7910
7911    /**
7912     * @return {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.)
7913     */
7914    public List<CanonicalType> getImplementationGuide() { 
7915      if (this.implementationGuide == null)
7916        this.implementationGuide = new ArrayList<CanonicalType>();
7917      return this.implementationGuide;
7918    }
7919
7920    /**
7921     * @return Returns a reference to <code>this</code> for easy method chaining
7922     */
7923    public CapabilityStatement setImplementationGuide(List<CanonicalType> theImplementationGuide) { 
7924      this.implementationGuide = theImplementationGuide;
7925      return this;
7926    }
7927
7928    public boolean hasImplementationGuide() { 
7929      if (this.implementationGuide == null)
7930        return false;
7931      for (CanonicalType item : this.implementationGuide)
7932        if (!item.isEmpty())
7933          return true;
7934      return false;
7935    }
7936
7937    /**
7938     * @return {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.)
7939     */
7940    public CanonicalType addImplementationGuideElement() {//2 
7941      CanonicalType t = new CanonicalType();
7942      if (this.implementationGuide == null)
7943        this.implementationGuide = new ArrayList<CanonicalType>();
7944      this.implementationGuide.add(t);
7945      return t;
7946    }
7947
7948    /**
7949     * @param value {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.)
7950     */
7951    public CapabilityStatement addImplementationGuide(String value) { //1
7952      CanonicalType t = new CanonicalType();
7953      t.setValue(value);
7954      if (this.implementationGuide == null)
7955        this.implementationGuide = new ArrayList<CanonicalType>();
7956      this.implementationGuide.add(t);
7957      return this;
7958    }
7959
7960    /**
7961     * @param value {@link #implementationGuide} (A list of implementation guides that the server does (or should) support in their entirety.)
7962     */
7963    public boolean hasImplementationGuide(String value) { 
7964      if (this.implementationGuide == null)
7965        return false;
7966      for (CanonicalType v : this.implementationGuide)
7967        if (v.getValue().equals(value)) // canonical(ImplementationGuide)
7968          return true;
7969      return false;
7970    }
7971
7972    /**
7973     * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.)
7974     */
7975    public List<CapabilityStatementRestComponent> getRest() { 
7976      if (this.rest == null)
7977        this.rest = new ArrayList<CapabilityStatementRestComponent>();
7978      return this.rest;
7979    }
7980
7981    /**
7982     * @return Returns a reference to <code>this</code> for easy method chaining
7983     */
7984    public CapabilityStatement setRest(List<CapabilityStatementRestComponent> theRest) { 
7985      this.rest = theRest;
7986      return this;
7987    }
7988
7989    public boolean hasRest() { 
7990      if (this.rest == null)
7991        return false;
7992      for (CapabilityStatementRestComponent item : this.rest)
7993        if (!item.isEmpty())
7994          return true;
7995      return false;
7996    }
7997
7998    public CapabilityStatementRestComponent addRest() { //3
7999      CapabilityStatementRestComponent t = new CapabilityStatementRestComponent();
8000      if (this.rest == null)
8001        this.rest = new ArrayList<CapabilityStatementRestComponent>();
8002      this.rest.add(t);
8003      return t;
8004    }
8005
8006    public CapabilityStatement addRest(CapabilityStatementRestComponent t) { //3
8007      if (t == null)
8008        return this;
8009      if (this.rest == null)
8010        this.rest = new ArrayList<CapabilityStatementRestComponent>();
8011      this.rest.add(t);
8012      return this;
8013    }
8014
8015    /**
8016     * @return The first repetition of repeating field {@link #rest}, creating it if it does not already exist
8017     */
8018    public CapabilityStatementRestComponent getRestFirstRep() { 
8019      if (getRest().isEmpty()) {
8020        addRest();
8021      }
8022      return getRest().get(0);
8023    }
8024
8025    /**
8026     * @return {@link #messaging} (A description of the messaging capabilities of the solution.)
8027     */
8028    public List<CapabilityStatementMessagingComponent> getMessaging() { 
8029      if (this.messaging == null)
8030        this.messaging = new ArrayList<CapabilityStatementMessagingComponent>();
8031      return this.messaging;
8032    }
8033
8034    /**
8035     * @return Returns a reference to <code>this</code> for easy method chaining
8036     */
8037    public CapabilityStatement setMessaging(List<CapabilityStatementMessagingComponent> theMessaging) { 
8038      this.messaging = theMessaging;
8039      return this;
8040    }
8041
8042    public boolean hasMessaging() { 
8043      if (this.messaging == null)
8044        return false;
8045      for (CapabilityStatementMessagingComponent item : this.messaging)
8046        if (!item.isEmpty())
8047          return true;
8048      return false;
8049    }
8050
8051    public CapabilityStatementMessagingComponent addMessaging() { //3
8052      CapabilityStatementMessagingComponent t = new CapabilityStatementMessagingComponent();
8053      if (this.messaging == null)
8054        this.messaging = new ArrayList<CapabilityStatementMessagingComponent>();
8055      this.messaging.add(t);
8056      return t;
8057    }
8058
8059    public CapabilityStatement addMessaging(CapabilityStatementMessagingComponent t) { //3
8060      if (t == null)
8061        return this;
8062      if (this.messaging == null)
8063        this.messaging = new ArrayList<CapabilityStatementMessagingComponent>();
8064      this.messaging.add(t);
8065      return this;
8066    }
8067
8068    /**
8069     * @return The first repetition of repeating field {@link #messaging}, creating it if it does not already exist
8070     */
8071    public CapabilityStatementMessagingComponent getMessagingFirstRep() { 
8072      if (getMessaging().isEmpty()) {
8073        addMessaging();
8074      }
8075      return getMessaging().get(0);
8076    }
8077
8078    /**
8079     * @return {@link #document} (A document definition.)
8080     */
8081    public List<CapabilityStatementDocumentComponent> getDocument() { 
8082      if (this.document == null)
8083        this.document = new ArrayList<CapabilityStatementDocumentComponent>();
8084      return this.document;
8085    }
8086
8087    /**
8088     * @return Returns a reference to <code>this</code> for easy method chaining
8089     */
8090    public CapabilityStatement setDocument(List<CapabilityStatementDocumentComponent> theDocument) { 
8091      this.document = theDocument;
8092      return this;
8093    }
8094
8095    public boolean hasDocument() { 
8096      if (this.document == null)
8097        return false;
8098      for (CapabilityStatementDocumentComponent item : this.document)
8099        if (!item.isEmpty())
8100          return true;
8101      return false;
8102    }
8103
8104    public CapabilityStatementDocumentComponent addDocument() { //3
8105      CapabilityStatementDocumentComponent t = new CapabilityStatementDocumentComponent();
8106      if (this.document == null)
8107        this.document = new ArrayList<CapabilityStatementDocumentComponent>();
8108      this.document.add(t);
8109      return t;
8110    }
8111
8112    public CapabilityStatement addDocument(CapabilityStatementDocumentComponent t) { //3
8113      if (t == null)
8114        return this;
8115      if (this.document == null)
8116        this.document = new ArrayList<CapabilityStatementDocumentComponent>();
8117      this.document.add(t);
8118      return this;
8119    }
8120
8121    /**
8122     * @return The first repetition of repeating field {@link #document}, creating it if it does not already exist
8123     */
8124    public CapabilityStatementDocumentComponent getDocumentFirstRep() { 
8125      if (getDocument().isEmpty()) {
8126        addDocument();
8127      }
8128      return getDocument().get(0);
8129    }
8130
8131      protected void listChildren(List<Property> children) {
8132        super.listChildren(children);
8133        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 at which an authoritative instance of this capability statement is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the capability statement is stored on different servers.", 0, 1, url));
8134        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));
8135        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));
8136        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the capability statement.", 0, 1, title));
8137        children.add(new Property("status", "code", "The status of this capability statement. Enables tracking the life-cycle of the content.", 0, 1, status));
8138        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));
8139        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));
8140        children.add(new Property("publisher", "string", "The name of the organization or individual that published the capability statement.", 0, 1, publisher));
8141        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));
8142        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));
8143        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));
8144        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));
8145        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));
8146        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));
8147        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));
8148        children.add(new Property("instantiates", "canonical(CapabilityStatement)", "Reference to a canonical URL of another CapabilityStatement that this software implements. This capability statement is a published API description that corresponds to a business service. The server may actually implement a subset of the capability statement it claims to implement, so the capability statement must specify the full capability details.", 0, java.lang.Integer.MAX_VALUE, instantiates));
8149        children.add(new Property("imports", "canonical(CapabilityStatement)", "Reference to a canonical URL of another CapabilityStatement that this software adds to. The capability statement automatically includes everything in the other statement, and it is not duplicated, though the server may repeat the same resources, interactions and operations to add additional details to them.", 0, java.lang.Integer.MAX_VALUE, imports));
8150        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));
8151        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));
8152        children.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this capability statement is based.", 0, 1, fhirVersion));
8153        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));
8154        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));
8155        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));
8156        children.add(new Property("rest", "", "A definition of the restful capabilities of the solution, if any.", 0, java.lang.Integer.MAX_VALUE, rest));
8157        children.add(new Property("messaging", "", "A description of the messaging capabilities of the solution.", 0, java.lang.Integer.MAX_VALUE, messaging));
8158        children.add(new Property("document", "", "A document definition.", 0, java.lang.Integer.MAX_VALUE, document));
8159      }
8160
8161      @Override
8162      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8163        switch (_hash) {
8164        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 at which an authoritative instance of this capability statement is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the capability statement is stored on different servers.", 0, 1, url);
8165        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);
8166        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);
8167        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the capability statement.", 0, 1, title);
8168        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);
8169        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);
8170        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);
8171        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the organization or individual that published the capability statement.", 0, 1, publisher);
8172        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);
8173        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);
8174        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);
8175        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);
8176        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);
8177        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);
8178        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);
8179        case -246883639: /*instantiates*/  return new Property("instantiates", "canonical(CapabilityStatement)", "Reference to a canonical URL of another CapabilityStatement that this software implements. This capability statement is a published API description that corresponds to a business service. The server may actually implement a subset of the capability statement it claims to implement, so the capability statement must specify the full capability details.", 0, java.lang.Integer.MAX_VALUE, instantiates);
8180        case 1926037870: /*imports*/  return new Property("imports", "canonical(CapabilityStatement)", "Reference to a canonical URL of another CapabilityStatement that this software adds to. The capability statement automatically includes everything in the other statement, and it is not duplicated, though the server may repeat the same resources, interactions and operations to add additional details to them.", 0, java.lang.Integer.MAX_VALUE, imports);
8181        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);
8182        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);
8183        case 461006061: /*fhirVersion*/  return new Property("fhirVersion", "id", "The version of the FHIR specification on which this capability statement is based.", 0, 1, fhirVersion);
8184        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);
8185        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);
8186        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);
8187        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);
8188        case -1440008444: /*messaging*/  return new Property("messaging", "", "A description of the messaging capabilities of the solution.", 0, java.lang.Integer.MAX_VALUE, messaging);
8189        case 861720859: /*document*/  return new Property("document", "", "A document definition.", 0, java.lang.Integer.MAX_VALUE, document);
8190        default: return super.getNamedProperty(_hash, _name, _checkValid);
8191        }
8192
8193      }
8194
8195      @Override
8196      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8197        switch (hash) {
8198        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
8199        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
8200        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
8201        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
8202        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
8203        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
8204        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
8205        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
8206        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
8207        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
8208        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
8209        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
8210        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
8211        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
8212        case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration<CapabilityStatementKind>
8213        case -246883639: /*instantiates*/ return this.instantiates == null ? new Base[0] : this.instantiates.toArray(new Base[this.instantiates.size()]); // CanonicalType
8214        case 1926037870: /*imports*/ return this.imports == null ? new Base[0] : this.imports.toArray(new Base[this.imports.size()]); // CanonicalType
8215        case 1319330215: /*software*/ return this.software == null ? new Base[0] : new Base[] {this.software}; // CapabilityStatementSoftwareComponent
8216        case 1683336114: /*implementation*/ return this.implementation == null ? new Base[0] : new Base[] {this.implementation}; // CapabilityStatementImplementationComponent
8217        case 461006061: /*fhirVersion*/ return this.fhirVersion == null ? new Base[0] : new Base[] {this.fhirVersion}; // IdType
8218        case -1268779017: /*format*/ return this.format == null ? new Base[0] : this.format.toArray(new Base[this.format.size()]); // CodeType
8219        case 172338783: /*patchFormat*/ return this.patchFormat == null ? new Base[0] : this.patchFormat.toArray(new Base[this.patchFormat.size()]); // CodeType
8220        case 156966506: /*implementationGuide*/ return this.implementationGuide == null ? new Base[0] : this.implementationGuide.toArray(new Base[this.implementationGuide.size()]); // CanonicalType
8221        case 3496916: /*rest*/ return this.rest == null ? new Base[0] : this.rest.toArray(new Base[this.rest.size()]); // CapabilityStatementRestComponent
8222        case -1440008444: /*messaging*/ return this.messaging == null ? new Base[0] : this.messaging.toArray(new Base[this.messaging.size()]); // CapabilityStatementMessagingComponent
8223        case 861720859: /*document*/ return this.document == null ? new Base[0] : this.document.toArray(new Base[this.document.size()]); // CapabilityStatementDocumentComponent
8224        default: return super.getProperty(hash, name, checkValid);
8225        }
8226
8227      }
8228
8229      @Override
8230      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8231        switch (hash) {
8232        case 116079: // url
8233          this.url = castToUri(value); // UriType
8234          return value;
8235        case 351608024: // version
8236          this.version = castToString(value); // StringType
8237          return value;
8238        case 3373707: // name
8239          this.name = castToString(value); // StringType
8240          return value;
8241        case 110371416: // title
8242          this.title = castToString(value); // StringType
8243          return value;
8244        case -892481550: // status
8245          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
8246          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
8247          return value;
8248        case -404562712: // experimental
8249          this.experimental = castToBoolean(value); // BooleanType
8250          return value;
8251        case 3076014: // date
8252          this.date = castToDateTime(value); // DateTimeType
8253          return value;
8254        case 1447404028: // publisher
8255          this.publisher = castToString(value); // StringType
8256          return value;
8257        case 951526432: // contact
8258          this.getContact().add(castToContactDetail(value)); // ContactDetail
8259          return value;
8260        case -1724546052: // description
8261          this.description = castToMarkdown(value); // MarkdownType
8262          return value;
8263        case -669707736: // useContext
8264          this.getUseContext().add(castToUsageContext(value)); // UsageContext
8265          return value;
8266        case -507075711: // jurisdiction
8267          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
8268          return value;
8269        case -220463842: // purpose
8270          this.purpose = castToMarkdown(value); // MarkdownType
8271          return value;
8272        case 1522889671: // copyright
8273          this.copyright = castToMarkdown(value); // MarkdownType
8274          return value;
8275        case 3292052: // kind
8276          value = new CapabilityStatementKindEnumFactory().fromType(castToCode(value));
8277          this.kind = (Enumeration) value; // Enumeration<CapabilityStatementKind>
8278          return value;
8279        case -246883639: // instantiates
8280          this.getInstantiates().add(castToCanonical(value)); // CanonicalType
8281          return value;
8282        case 1926037870: // imports
8283          this.getImports().add(castToCanonical(value)); // CanonicalType
8284          return value;
8285        case 1319330215: // software
8286          this.software = (CapabilityStatementSoftwareComponent) value; // CapabilityStatementSoftwareComponent
8287          return value;
8288        case 1683336114: // implementation
8289          this.implementation = (CapabilityStatementImplementationComponent) value; // CapabilityStatementImplementationComponent
8290          return value;
8291        case 461006061: // fhirVersion
8292          this.fhirVersion = castToId(value); // IdType
8293          return value;
8294        case -1268779017: // format
8295          this.getFormat().add(castToCode(value)); // CodeType
8296          return value;
8297        case 172338783: // patchFormat
8298          this.getPatchFormat().add(castToCode(value)); // CodeType
8299          return value;
8300        case 156966506: // implementationGuide
8301          this.getImplementationGuide().add(castToCanonical(value)); // CanonicalType
8302          return value;
8303        case 3496916: // rest
8304          this.getRest().add((CapabilityStatementRestComponent) value); // CapabilityStatementRestComponent
8305          return value;
8306        case -1440008444: // messaging
8307          this.getMessaging().add((CapabilityStatementMessagingComponent) value); // CapabilityStatementMessagingComponent
8308          return value;
8309        case 861720859: // document
8310          this.getDocument().add((CapabilityStatementDocumentComponent) value); // CapabilityStatementDocumentComponent
8311          return value;
8312        default: return super.setProperty(hash, name, value);
8313        }
8314
8315      }
8316
8317      @Override
8318      public Base setProperty(String name, Base value) throws FHIRException {
8319        if (name.equals("url")) {
8320          this.url = castToUri(value); // UriType
8321        } else if (name.equals("version")) {
8322          this.version = castToString(value); // StringType
8323        } else if (name.equals("name")) {
8324          this.name = castToString(value); // StringType
8325        } else if (name.equals("title")) {
8326          this.title = castToString(value); // StringType
8327        } else if (name.equals("status")) {
8328          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
8329          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
8330        } else if (name.equals("experimental")) {
8331          this.experimental = castToBoolean(value); // BooleanType
8332        } else if (name.equals("date")) {
8333          this.date = castToDateTime(value); // DateTimeType
8334        } else if (name.equals("publisher")) {
8335          this.publisher = castToString(value); // StringType
8336        } else if (name.equals("contact")) {
8337          this.getContact().add(castToContactDetail(value));
8338        } else if (name.equals("description")) {
8339          this.description = castToMarkdown(value); // MarkdownType
8340        } else if (name.equals("useContext")) {
8341          this.getUseContext().add(castToUsageContext(value));
8342        } else if (name.equals("jurisdiction")) {
8343          this.getJurisdiction().add(castToCodeableConcept(value));
8344        } else if (name.equals("purpose")) {
8345          this.purpose = castToMarkdown(value); // MarkdownType
8346        } else if (name.equals("copyright")) {
8347          this.copyright = castToMarkdown(value); // MarkdownType
8348        } else if (name.equals("kind")) {
8349          value = new CapabilityStatementKindEnumFactory().fromType(castToCode(value));
8350          this.kind = (Enumeration) value; // Enumeration<CapabilityStatementKind>
8351        } else if (name.equals("instantiates")) {
8352          this.getInstantiates().add(castToCanonical(value));
8353        } else if (name.equals("imports")) {
8354          this.getImports().add(castToCanonical(value));
8355        } else if (name.equals("software")) {
8356          this.software = (CapabilityStatementSoftwareComponent) value; // CapabilityStatementSoftwareComponent
8357        } else if (name.equals("implementation")) {
8358          this.implementation = (CapabilityStatementImplementationComponent) value; // CapabilityStatementImplementationComponent
8359        } else if (name.equals("fhirVersion")) {
8360          this.fhirVersion = castToId(value); // IdType
8361        } else if (name.equals("format")) {
8362          this.getFormat().add(castToCode(value));
8363        } else if (name.equals("patchFormat")) {
8364          this.getPatchFormat().add(castToCode(value));
8365        } else if (name.equals("implementationGuide")) {
8366          this.getImplementationGuide().add(castToCanonical(value));
8367        } else if (name.equals("rest")) {
8368          this.getRest().add((CapabilityStatementRestComponent) value);
8369        } else if (name.equals("messaging")) {
8370          this.getMessaging().add((CapabilityStatementMessagingComponent) value);
8371        } else if (name.equals("document")) {
8372          this.getDocument().add((CapabilityStatementDocumentComponent) value);
8373        } else
8374          return super.setProperty(name, value);
8375        return value;
8376      }
8377
8378      @Override
8379      public Base makeProperty(int hash, String name) throws FHIRException {
8380        switch (hash) {
8381        case 116079:  return getUrlElement();
8382        case 351608024:  return getVersionElement();
8383        case 3373707:  return getNameElement();
8384        case 110371416:  return getTitleElement();
8385        case -892481550:  return getStatusElement();
8386        case -404562712:  return getExperimentalElement();
8387        case 3076014:  return getDateElement();
8388        case 1447404028:  return getPublisherElement();
8389        case 951526432:  return addContact(); 
8390        case -1724546052:  return getDescriptionElement();
8391        case -669707736:  return addUseContext(); 
8392        case -507075711:  return addJurisdiction(); 
8393        case -220463842:  return getPurposeElement();
8394        case 1522889671:  return getCopyrightElement();
8395        case 3292052:  return getKindElement();
8396        case -246883639:  return addInstantiatesElement();
8397        case 1926037870:  return addImportsElement();
8398        case 1319330215:  return getSoftware(); 
8399        case 1683336114:  return getImplementation(); 
8400        case 461006061:  return getFhirVersionElement();
8401        case -1268779017:  return addFormatElement();
8402        case 172338783:  return addPatchFormatElement();
8403        case 156966506:  return addImplementationGuideElement();
8404        case 3496916:  return addRest(); 
8405        case -1440008444:  return addMessaging(); 
8406        case 861720859:  return addDocument(); 
8407        default: return super.makeProperty(hash, name);
8408        }
8409
8410      }
8411
8412      @Override
8413      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8414        switch (hash) {
8415        case 116079: /*url*/ return new String[] {"uri"};
8416        case 351608024: /*version*/ return new String[] {"string"};
8417        case 3373707: /*name*/ return new String[] {"string"};
8418        case 110371416: /*title*/ return new String[] {"string"};
8419        case -892481550: /*status*/ return new String[] {"code"};
8420        case -404562712: /*experimental*/ return new String[] {"boolean"};
8421        case 3076014: /*date*/ return new String[] {"dateTime"};
8422        case 1447404028: /*publisher*/ return new String[] {"string"};
8423        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
8424        case -1724546052: /*description*/ return new String[] {"markdown"};
8425        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
8426        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
8427        case -220463842: /*purpose*/ return new String[] {"markdown"};
8428        case 1522889671: /*copyright*/ return new String[] {"markdown"};
8429        case 3292052: /*kind*/ return new String[] {"code"};
8430        case -246883639: /*instantiates*/ return new String[] {"canonical"};
8431        case 1926037870: /*imports*/ return new String[] {"canonical"};
8432        case 1319330215: /*software*/ return new String[] {};
8433        case 1683336114: /*implementation*/ return new String[] {};
8434        case 461006061: /*fhirVersion*/ return new String[] {"id"};
8435        case -1268779017: /*format*/ return new String[] {"code"};
8436        case 172338783: /*patchFormat*/ return new String[] {"code"};
8437        case 156966506: /*implementationGuide*/ return new String[] {"canonical"};
8438        case 3496916: /*rest*/ return new String[] {};
8439        case -1440008444: /*messaging*/ return new String[] {};
8440        case 861720859: /*document*/ return new String[] {};
8441        default: return super.getTypesForProperty(hash, name);
8442        }
8443
8444      }
8445
8446      @Override
8447      public Base addChild(String name) throws FHIRException {
8448        if (name.equals("url")) {
8449          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.url");
8450        }
8451        else if (name.equals("version")) {
8452          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.version");
8453        }
8454        else if (name.equals("name")) {
8455          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.name");
8456        }
8457        else if (name.equals("title")) {
8458          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.title");
8459        }
8460        else if (name.equals("status")) {
8461          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.status");
8462        }
8463        else if (name.equals("experimental")) {
8464          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.experimental");
8465        }
8466        else if (name.equals("date")) {
8467          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.date");
8468        }
8469        else if (name.equals("publisher")) {
8470          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.publisher");
8471        }
8472        else if (name.equals("contact")) {
8473          return addContact();
8474        }
8475        else if (name.equals("description")) {
8476          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.description");
8477        }
8478        else if (name.equals("useContext")) {
8479          return addUseContext();
8480        }
8481        else if (name.equals("jurisdiction")) {
8482          return addJurisdiction();
8483        }
8484        else if (name.equals("purpose")) {
8485          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.purpose");
8486        }
8487        else if (name.equals("copyright")) {
8488          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.copyright");
8489        }
8490        else if (name.equals("kind")) {
8491          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.kind");
8492        }
8493        else if (name.equals("instantiates")) {
8494          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.instantiates");
8495        }
8496        else if (name.equals("imports")) {
8497          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.imports");
8498        }
8499        else if (name.equals("software")) {
8500          this.software = new CapabilityStatementSoftwareComponent();
8501          return this.software;
8502        }
8503        else if (name.equals("implementation")) {
8504          this.implementation = new CapabilityStatementImplementationComponent();
8505          return this.implementation;
8506        }
8507        else if (name.equals("fhirVersion")) {
8508          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.fhirVersion");
8509        }
8510        else if (name.equals("format")) {
8511          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.format");
8512        }
8513        else if (name.equals("patchFormat")) {
8514          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.patchFormat");
8515        }
8516        else if (name.equals("implementationGuide")) {
8517          throw new FHIRException("Cannot call addChild on a primitive type CapabilityStatement.implementationGuide");
8518        }
8519        else if (name.equals("rest")) {
8520          return addRest();
8521        }
8522        else if (name.equals("messaging")) {
8523          return addMessaging();
8524        }
8525        else if (name.equals("document")) {
8526          return addDocument();
8527        }
8528        else
8529          return super.addChild(name);
8530      }
8531
8532  public String fhirType() {
8533    return "CapabilityStatement";
8534
8535  }
8536
8537      public CapabilityStatement copy() {
8538        CapabilityStatement dst = new CapabilityStatement();
8539        copyValues(dst);
8540        dst.url = url == null ? null : url.copy();
8541        dst.version = version == null ? null : version.copy();
8542        dst.name = name == null ? null : name.copy();
8543        dst.title = title == null ? null : title.copy();
8544        dst.status = status == null ? null : status.copy();
8545        dst.experimental = experimental == null ? null : experimental.copy();
8546        dst.date = date == null ? null : date.copy();
8547        dst.publisher = publisher == null ? null : publisher.copy();
8548        if (contact != null) {
8549          dst.contact = new ArrayList<ContactDetail>();
8550          for (ContactDetail i : contact)
8551            dst.contact.add(i.copy());
8552        };
8553        dst.description = description == null ? null : description.copy();
8554        if (useContext != null) {
8555          dst.useContext = new ArrayList<UsageContext>();
8556          for (UsageContext i : useContext)
8557            dst.useContext.add(i.copy());
8558        };
8559        if (jurisdiction != null) {
8560          dst.jurisdiction = new ArrayList<CodeableConcept>();
8561          for (CodeableConcept i : jurisdiction)
8562            dst.jurisdiction.add(i.copy());
8563        };
8564        dst.purpose = purpose == null ? null : purpose.copy();
8565        dst.copyright = copyright == null ? null : copyright.copy();
8566        dst.kind = kind == null ? null : kind.copy();
8567        if (instantiates != null) {
8568          dst.instantiates = new ArrayList<CanonicalType>();
8569          for (CanonicalType i : instantiates)
8570            dst.instantiates.add(i.copy());
8571        };
8572        if (imports != null) {
8573          dst.imports = new ArrayList<CanonicalType>();
8574          for (CanonicalType i : imports)
8575            dst.imports.add(i.copy());
8576        };
8577        dst.software = software == null ? null : software.copy();
8578        dst.implementation = implementation == null ? null : implementation.copy();
8579        dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy();
8580        if (format != null) {
8581          dst.format = new ArrayList<CodeType>();
8582          for (CodeType i : format)
8583            dst.format.add(i.copy());
8584        };
8585        if (patchFormat != null) {
8586          dst.patchFormat = new ArrayList<CodeType>();
8587          for (CodeType i : patchFormat)
8588            dst.patchFormat.add(i.copy());
8589        };
8590        if (implementationGuide != null) {
8591          dst.implementationGuide = new ArrayList<CanonicalType>();
8592          for (CanonicalType i : implementationGuide)
8593            dst.implementationGuide.add(i.copy());
8594        };
8595        if (rest != null) {
8596          dst.rest = new ArrayList<CapabilityStatementRestComponent>();
8597          for (CapabilityStatementRestComponent i : rest)
8598            dst.rest.add(i.copy());
8599        };
8600        if (messaging != null) {
8601          dst.messaging = new ArrayList<CapabilityStatementMessagingComponent>();
8602          for (CapabilityStatementMessagingComponent i : messaging)
8603            dst.messaging.add(i.copy());
8604        };
8605        if (document != null) {
8606          dst.document = new ArrayList<CapabilityStatementDocumentComponent>();
8607          for (CapabilityStatementDocumentComponent i : document)
8608            dst.document.add(i.copy());
8609        };
8610        return dst;
8611      }
8612
8613      protected CapabilityStatement typedCopy() {
8614        return copy();
8615      }
8616
8617      @Override
8618      public boolean equalsDeep(Base other_) {
8619        if (!super.equalsDeep(other_))
8620          return false;
8621        if (!(other_ instanceof CapabilityStatement))
8622          return false;
8623        CapabilityStatement o = (CapabilityStatement) other_;
8624        return compareDeep(purpose, o.purpose, true) && compareDeep(copyright, o.copyright, true) && compareDeep(kind, o.kind, true)
8625           && compareDeep(instantiates, o.instantiates, true) && compareDeep(imports, o.imports, true) && compareDeep(software, o.software, true)
8626           && compareDeep(implementation, o.implementation, true) && compareDeep(fhirVersion, o.fhirVersion, true)
8627           && compareDeep(format, o.format, true) && compareDeep(patchFormat, o.patchFormat, true) && compareDeep(implementationGuide, o.implementationGuide, true)
8628           && compareDeep(rest, o.rest, true) && compareDeep(messaging, o.messaging, true) && compareDeep(document, o.document, true)
8629          ;
8630      }
8631
8632      @Override
8633      public boolean equalsShallow(Base other_) {
8634        if (!super.equalsShallow(other_))
8635          return false;
8636        if (!(other_ instanceof CapabilityStatement))
8637          return false;
8638        CapabilityStatement o = (CapabilityStatement) other_;
8639        return compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true) && compareValues(kind, o.kind, true)
8640           && compareValues(fhirVersion, o.fhirVersion, true) && compareValues(format, o.format, true) && compareValues(patchFormat, o.patchFormat, true)
8641          ;
8642      }
8643
8644      public boolean isEmpty() {
8645        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(purpose, copyright, kind
8646          , instantiates, imports, software, implementation, fhirVersion, format, patchFormat
8647          , implementationGuide, rest, messaging, document);
8648      }
8649
8650  @Override
8651  public ResourceType getResourceType() {
8652    return ResourceType.CapabilityStatement;
8653   }
8654
8655 /**
8656   * Search parameter: <b>date</b>
8657   * <p>
8658   * Description: <b>The capability statement publication date</b><br>
8659   * Type: <b>date</b><br>
8660   * Path: <b>CapabilityStatement.date</b><br>
8661   * </p>
8662   */
8663  @SearchParamDefinition(name="date", path="CapabilityStatement.date", description="The capability statement publication date", type="date" )
8664  public static final String SP_DATE = "date";
8665 /**
8666   * <b>Fluent Client</b> search parameter constant for <b>date</b>
8667   * <p>
8668   * Description: <b>The capability statement publication date</b><br>
8669   * Type: <b>date</b><br>
8670   * Path: <b>CapabilityStatement.date</b><br>
8671   * </p>
8672   */
8673  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
8674
8675 /**
8676   * Search parameter: <b>resource-profile</b>
8677   * <p>
8678   * Description: <b>A profile id invoked in a capability statement</b><br>
8679   * Type: <b>reference</b><br>
8680   * Path: <b>CapabilityStatement.rest.resource.profile</b><br>
8681   * </p>
8682   */
8683  @SearchParamDefinition(name="resource-profile", path="CapabilityStatement.rest.resource.profile", description="A profile id invoked in a capability statement", type="reference", target={StructureDefinition.class } )
8684  public static final String SP_RESOURCE_PROFILE = "resource-profile";
8685 /**
8686   * <b>Fluent Client</b> search parameter constant for <b>resource-profile</b>
8687   * <p>
8688   * Description: <b>A profile id invoked in a capability statement</b><br>
8689   * Type: <b>reference</b><br>
8690   * Path: <b>CapabilityStatement.rest.resource.profile</b><br>
8691   * </p>
8692   */
8693  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESOURCE_PROFILE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESOURCE_PROFILE);
8694
8695/**
8696   * Constant for fluent queries to be used to add include statements. Specifies
8697   * the path value of "<b>CapabilityStatement:resource-profile</b>".
8698   */
8699  public static final ca.uhn.fhir.model.api.Include INCLUDE_RESOURCE_PROFILE = new ca.uhn.fhir.model.api.Include("CapabilityStatement:resource-profile").toLocked();
8700
8701 /**
8702   * Search parameter: <b>context-type-value</b>
8703   * <p>
8704   * Description: <b>A use context type and value assigned to the capability statement</b><br>
8705   * Type: <b>composite</b><br>
8706   * Path: <b></b><br>
8707   * </p>
8708   */
8709  @SearchParamDefinition(name="context-type-value", path="CapabilityStatement.useContext", description="A use context type and value assigned to the capability statement", type="composite", compositeOf={"context-type", "context"} )
8710  public static final String SP_CONTEXT_TYPE_VALUE = "context-type-value";
8711 /**
8712   * <b>Fluent Client</b> search parameter constant for <b>context-type-value</b>
8713   * <p>
8714   * Description: <b>A use context type and value assigned to the capability statement</b><br>
8715   * Type: <b>composite</b><br>
8716   * Path: <b></b><br>
8717   * </p>
8718   */
8719  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> CONTEXT_TYPE_VALUE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(SP_CONTEXT_TYPE_VALUE);
8720
8721 /**
8722   * Search parameter: <b>software</b>
8723   * <p>
8724   * Description: <b>Part of a the name of a software application</b><br>
8725   * Type: <b>string</b><br>
8726   * Path: <b>CapabilityStatement.software.name</b><br>
8727   * </p>
8728   */
8729  @SearchParamDefinition(name="software", path="CapabilityStatement.software.name", description="Part of a the name of a software application", type="string" )
8730  public static final String SP_SOFTWARE = "software";
8731 /**
8732   * <b>Fluent Client</b> search parameter constant for <b>software</b>
8733   * <p>
8734   * Description: <b>Part of a the name of a software application</b><br>
8735   * Type: <b>string</b><br>
8736   * Path: <b>CapabilityStatement.software.name</b><br>
8737   * </p>
8738   */
8739  public static final ca.uhn.fhir.rest.gclient.StringClientParam SOFTWARE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_SOFTWARE);
8740
8741 /**
8742   * Search parameter: <b>resource</b>
8743   * <p>
8744   * Description: <b>Name of a resource mentioned in a capability statement</b><br>
8745   * Type: <b>token</b><br>
8746   * Path: <b>CapabilityStatement.rest.resource.type</b><br>
8747   * </p>
8748   */
8749  @SearchParamDefinition(name="resource", path="CapabilityStatement.rest.resource.type", description="Name of a resource mentioned in a capability statement", type="token" )
8750  public static final String SP_RESOURCE = "resource";
8751 /**
8752   * <b>Fluent Client</b> search parameter constant for <b>resource</b>
8753   * <p>
8754   * Description: <b>Name of a resource mentioned in a capability statement</b><br>
8755   * Type: <b>token</b><br>
8756   * Path: <b>CapabilityStatement.rest.resource.type</b><br>
8757   * </p>
8758   */
8759  public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESOURCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESOURCE);
8760
8761 /**
8762   * Search parameter: <b>jurisdiction</b>
8763   * <p>
8764   * Description: <b>Intended jurisdiction for the capability statement</b><br>
8765   * Type: <b>token</b><br>
8766   * Path: <b>CapabilityStatement.jurisdiction</b><br>
8767   * </p>
8768   */
8769  @SearchParamDefinition(name="jurisdiction", path="CapabilityStatement.jurisdiction", description="Intended jurisdiction for the capability statement", type="token" )
8770  public static final String SP_JURISDICTION = "jurisdiction";
8771 /**
8772   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
8773   * <p>
8774   * Description: <b>Intended jurisdiction for the capability statement</b><br>
8775   * Type: <b>token</b><br>
8776   * Path: <b>CapabilityStatement.jurisdiction</b><br>
8777   * </p>
8778   */
8779  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
8780
8781 /**
8782   * Search parameter: <b>format</b>
8783   * <p>
8784   * Description: <b>formats supported (xml | json | ttl | mime type)</b><br>
8785   * Type: <b>token</b><br>
8786   * Path: <b>CapabilityStatement.format</b><br>
8787   * </p>
8788   */
8789  @SearchParamDefinition(name="format", path="CapabilityStatement.format", description="formats supported (xml | json | ttl | mime type)", type="token" )
8790  public static final String SP_FORMAT = "format";
8791 /**
8792   * <b>Fluent Client</b> search parameter constant for <b>format</b>
8793   * <p>
8794   * Description: <b>formats supported (xml | json | ttl | mime type)</b><br>
8795   * Type: <b>token</b><br>
8796   * Path: <b>CapabilityStatement.format</b><br>
8797   * </p>
8798   */
8799  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORMAT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORMAT);
8800
8801 /**
8802   * Search parameter: <b>description</b>
8803   * <p>
8804   * Description: <b>The description of the capability statement</b><br>
8805   * Type: <b>string</b><br>
8806   * Path: <b>CapabilityStatement.description</b><br>
8807   * </p>
8808   */
8809  @SearchParamDefinition(name="description", path="CapabilityStatement.description", description="The description of the capability statement", type="string" )
8810  public static final String SP_DESCRIPTION = "description";
8811 /**
8812   * <b>Fluent Client</b> search parameter constant for <b>description</b>
8813   * <p>
8814   * Description: <b>The description of the capability statement</b><br>
8815   * Type: <b>string</b><br>
8816   * Path: <b>CapabilityStatement.description</b><br>
8817   * </p>
8818   */
8819  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
8820
8821 /**
8822   * Search parameter: <b>context-type</b>
8823   * <p>
8824   * Description: <b>A type of use context assigned to the capability statement</b><br>
8825   * Type: <b>token</b><br>
8826   * Path: <b>CapabilityStatement.useContext.code</b><br>
8827   * </p>
8828   */
8829  @SearchParamDefinition(name="context-type", path="CapabilityStatement.useContext.code", description="A type of use context assigned to the capability statement", type="token" )
8830  public static final String SP_CONTEXT_TYPE = "context-type";
8831 /**
8832   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
8833   * <p>
8834   * Description: <b>A type of use context assigned to the capability statement</b><br>
8835   * Type: <b>token</b><br>
8836   * Path: <b>CapabilityStatement.useContext.code</b><br>
8837   * </p>
8838   */
8839  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT_TYPE);
8840
8841 /**
8842   * Search parameter: <b>title</b>
8843   * <p>
8844   * Description: <b>The human-friendly name of the capability statement</b><br>
8845   * Type: <b>string</b><br>
8846   * Path: <b>CapabilityStatement.title</b><br>
8847   * </p>
8848   */
8849  @SearchParamDefinition(name="title", path="CapabilityStatement.title", description="The human-friendly name of the capability statement", type="string" )
8850  public static final String SP_TITLE = "title";
8851 /**
8852   * <b>Fluent Client</b> search parameter constant for <b>title</b>
8853   * <p>
8854   * Description: <b>The human-friendly name of the capability statement</b><br>
8855   * Type: <b>string</b><br>
8856   * Path: <b>CapabilityStatement.title</b><br>
8857   * </p>
8858   */
8859  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
8860
8861 /**
8862   * Search parameter: <b>fhirversion</b>
8863   * <p>
8864   * Description: <b>The version of FHIR</b><br>
8865   * Type: <b>token</b><br>
8866   * Path: <b>CapabilityStatement.version</b><br>
8867   * </p>
8868   */
8869  @SearchParamDefinition(name="fhirversion", path="CapabilityStatement.version", description="The version of FHIR", type="token" )
8870  public static final String SP_FHIRVERSION = "fhirversion";
8871 /**
8872   * <b>Fluent Client</b> search parameter constant for <b>fhirversion</b>
8873   * <p>
8874   * Description: <b>The version of FHIR</b><br>
8875   * Type: <b>token</b><br>
8876   * Path: <b>CapabilityStatement.version</b><br>
8877   * </p>
8878   */
8879  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FHIRVERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FHIRVERSION);
8880
8881 /**
8882   * Search parameter: <b>version</b>
8883   * <p>
8884   * Description: <b>The business version of the capability statement</b><br>
8885   * Type: <b>token</b><br>
8886   * Path: <b>CapabilityStatement.version</b><br>
8887   * </p>
8888   */
8889  @SearchParamDefinition(name="version", path="CapabilityStatement.version", description="The business version of the capability statement", type="token" )
8890  public static final String SP_VERSION = "version";
8891 /**
8892   * <b>Fluent Client</b> search parameter constant for <b>version</b>
8893   * <p>
8894   * Description: <b>The business version of the capability statement</b><br>
8895   * Type: <b>token</b><br>
8896   * Path: <b>CapabilityStatement.version</b><br>
8897   * </p>
8898   */
8899  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
8900
8901 /**
8902   * Search parameter: <b>url</b>
8903   * <p>
8904   * Description: <b>The uri that identifies the capability statement</b><br>
8905   * Type: <b>uri</b><br>
8906   * Path: <b>CapabilityStatement.url</b><br>
8907   * </p>
8908   */
8909  @SearchParamDefinition(name="url", path="CapabilityStatement.url", description="The uri that identifies the capability statement", type="uri" )
8910  public static final String SP_URL = "url";
8911 /**
8912   * <b>Fluent Client</b> search parameter constant for <b>url</b>
8913   * <p>
8914   * Description: <b>The uri that identifies the capability statement</b><br>
8915   * Type: <b>uri</b><br>
8916   * Path: <b>CapabilityStatement.url</b><br>
8917   * </p>
8918   */
8919  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
8920
8921 /**
8922   * Search parameter: <b>supported-profile</b>
8923   * <p>
8924   * Description: <b>Profiles for use cases supported</b><br>
8925   * Type: <b>reference</b><br>
8926   * Path: <b>CapabilityStatement.rest.resource.supportedProfile</b><br>
8927   * </p>
8928   */
8929  @SearchParamDefinition(name="supported-profile", path="CapabilityStatement.rest.resource.supportedProfile", description="Profiles for use cases supported", type="reference", target={StructureDefinition.class } )
8930  public static final String SP_SUPPORTED_PROFILE = "supported-profile";
8931 /**
8932   * <b>Fluent Client</b> search parameter constant for <b>supported-profile</b>
8933   * <p>
8934   * Description: <b>Profiles for use cases supported</b><br>
8935   * Type: <b>reference</b><br>
8936   * Path: <b>CapabilityStatement.rest.resource.supportedProfile</b><br>
8937   * </p>
8938   */
8939  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPORTED_PROFILE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUPPORTED_PROFILE);
8940
8941/**
8942   * Constant for fluent queries to be used to add include statements. Specifies
8943   * the path value of "<b>CapabilityStatement:supported-profile</b>".
8944   */
8945  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPORTED_PROFILE = new ca.uhn.fhir.model.api.Include("CapabilityStatement:supported-profile").toLocked();
8946
8947 /**
8948   * Search parameter: <b>mode</b>
8949   * <p>
8950   * Description: <b>Mode - restful (server/client) or messaging (sender/receiver)</b><br>
8951   * Type: <b>token</b><br>
8952   * Path: <b>CapabilityStatement.rest.mode</b><br>
8953   * </p>
8954   */
8955  @SearchParamDefinition(name="mode", path="CapabilityStatement.rest.mode", description="Mode - restful (server/client) or messaging (sender/receiver)", type="token" )
8956  public static final String SP_MODE = "mode";
8957 /**
8958   * <b>Fluent Client</b> search parameter constant for <b>mode</b>
8959   * <p>
8960   * Description: <b>Mode - restful (server/client) or messaging (sender/receiver)</b><br>
8961   * Type: <b>token</b><br>
8962   * Path: <b>CapabilityStatement.rest.mode</b><br>
8963   * </p>
8964   */
8965  public static final ca.uhn.fhir.rest.gclient.TokenClientParam MODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MODE);
8966
8967 /**
8968   * Search parameter: <b>context-quantity</b>
8969   * <p>
8970   * Description: <b>A quantity- or range-valued use context assigned to the capability statement</b><br>
8971   * Type: <b>quantity</b><br>
8972   * Path: <b>CapabilityStatement.useContext.valueQuantity, CapabilityStatement.useContext.valueRange</b><br>
8973   * </p>
8974   */
8975  @SearchParamDefinition(name="context-quantity", path="(CapabilityStatement.useContext.value as Quantity) | (CapabilityStatement.useContext.value as Range)", description="A quantity- or range-valued use context assigned to the capability statement", type="quantity" )
8976  public static final String SP_CONTEXT_QUANTITY = "context-quantity";
8977 /**
8978   * <b>Fluent Client</b> search parameter constant for <b>context-quantity</b>
8979   * <p>
8980   * Description: <b>A quantity- or range-valued use context assigned to the capability statement</b><br>
8981   * Type: <b>quantity</b><br>
8982   * Path: <b>CapabilityStatement.useContext.valueQuantity, CapabilityStatement.useContext.valueRange</b><br>
8983   * </p>
8984   */
8985  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam CONTEXT_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_CONTEXT_QUANTITY);
8986
8987 /**
8988   * Search parameter: <b>security-service</b>
8989   * <p>
8990   * Description: <b>OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates</b><br>
8991   * Type: <b>token</b><br>
8992   * Path: <b>CapabilityStatement.rest.security.service</b><br>
8993   * </p>
8994   */
8995  @SearchParamDefinition(name="security-service", path="CapabilityStatement.rest.security.service", description="OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates", type="token" )
8996  public static final String SP_SECURITY_SERVICE = "security-service";
8997 /**
8998   * <b>Fluent Client</b> search parameter constant for <b>security-service</b>
8999   * <p>
9000   * Description: <b>OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates</b><br>
9001   * Type: <b>token</b><br>
9002   * Path: <b>CapabilityStatement.rest.security.service</b><br>
9003   * </p>
9004   */
9005  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SECURITY_SERVICE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SECURITY_SERVICE);
9006
9007 /**
9008   * Search parameter: <b>name</b>
9009   * <p>
9010   * Description: <b>Computationally friendly name of the capability statement</b><br>
9011   * Type: <b>string</b><br>
9012   * Path: <b>CapabilityStatement.name</b><br>
9013   * </p>
9014   */
9015  @SearchParamDefinition(name="name", path="CapabilityStatement.name", description="Computationally friendly name of the capability statement", type="string" )
9016  public static final String SP_NAME = "name";
9017 /**
9018   * <b>Fluent Client</b> search parameter constant for <b>name</b>
9019   * <p>
9020   * Description: <b>Computationally friendly name of the capability statement</b><br>
9021   * Type: <b>string</b><br>
9022   * Path: <b>CapabilityStatement.name</b><br>
9023   * </p>
9024   */
9025  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
9026
9027 /**
9028   * Search parameter: <b>context</b>
9029   * <p>
9030   * Description: <b>A use context assigned to the capability statement</b><br>
9031   * Type: <b>token</b><br>
9032   * Path: <b>CapabilityStatement.useContext.valueCodeableConcept</b><br>
9033   * </p>
9034   */
9035  @SearchParamDefinition(name="context", path="(CapabilityStatement.useContext.value as CodeableConcept)", description="A use context assigned to the capability statement", type="token" )
9036  public static final String SP_CONTEXT = "context";
9037 /**
9038   * <b>Fluent Client</b> search parameter constant for <b>context</b>
9039   * <p>
9040   * Description: <b>A use context assigned to the capability statement</b><br>
9041   * Type: <b>token</b><br>
9042   * Path: <b>CapabilityStatement.useContext.valueCodeableConcept</b><br>
9043   * </p>
9044   */
9045  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT);
9046
9047 /**
9048   * Search parameter: <b>publisher</b>
9049   * <p>
9050   * Description: <b>Name of the publisher of the capability statement</b><br>
9051   * Type: <b>string</b><br>
9052   * Path: <b>CapabilityStatement.publisher</b><br>
9053   * </p>
9054   */
9055  @SearchParamDefinition(name="publisher", path="CapabilityStatement.publisher", description="Name of the publisher of the capability statement", type="string" )
9056  public static final String SP_PUBLISHER = "publisher";
9057 /**
9058   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
9059   * <p>
9060   * Description: <b>Name of the publisher of the capability statement</b><br>
9061   * Type: <b>string</b><br>
9062   * Path: <b>CapabilityStatement.publisher</b><br>
9063   * </p>
9064   */
9065  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
9066
9067 /**
9068   * Search parameter: <b>context-type-quantity</b>
9069   * <p>
9070   * Description: <b>A use context type and quantity- or range-based value assigned to the capability statement</b><br>
9071   * Type: <b>composite</b><br>
9072   * Path: <b></b><br>
9073   * </p>
9074   */
9075  @SearchParamDefinition(name="context-type-quantity", path="CapabilityStatement.useContext", description="A use context type and quantity- or range-based value assigned to the capability statement", type="composite", compositeOf={"context-type", "context-quantity"} )
9076  public static final String SP_CONTEXT_TYPE_QUANTITY = "context-type-quantity";
9077 /**
9078   * <b>Fluent Client</b> search parameter constant for <b>context-type-quantity</b>
9079   * <p>
9080   * Description: <b>A use context type and quantity- or range-based value assigned to the capability statement</b><br>
9081   * Type: <b>composite</b><br>
9082   * Path: <b></b><br>
9083   * </p>
9084   */
9085  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam> CONTEXT_TYPE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam>(SP_CONTEXT_TYPE_QUANTITY);
9086
9087 /**
9088   * Search parameter: <b>guide</b>
9089   * <p>
9090   * Description: <b>Implementation guides supported</b><br>
9091   * Type: <b>reference</b><br>
9092   * Path: <b>CapabilityStatement.implementationGuide</b><br>
9093   * </p>
9094   */
9095  @SearchParamDefinition(name="guide", path="CapabilityStatement.implementationGuide", description="Implementation guides supported", type="reference", target={ImplementationGuide.class } )
9096  public static final String SP_GUIDE = "guide";
9097 /**
9098   * <b>Fluent Client</b> search parameter constant for <b>guide</b>
9099   * <p>
9100   * Description: <b>Implementation guides supported</b><br>
9101   * Type: <b>reference</b><br>
9102   * Path: <b>CapabilityStatement.implementationGuide</b><br>
9103   * </p>
9104   */
9105  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam GUIDE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_GUIDE);
9106
9107/**
9108   * Constant for fluent queries to be used to add include statements. Specifies
9109   * the path value of "<b>CapabilityStatement:guide</b>".
9110   */
9111  public static final ca.uhn.fhir.model.api.Include INCLUDE_GUIDE = new ca.uhn.fhir.model.api.Include("CapabilityStatement:guide").toLocked();
9112
9113 /**
9114   * Search parameter: <b>status</b>
9115   * <p>
9116   * Description: <b>The current status of the capability statement</b><br>
9117   * Type: <b>token</b><br>
9118   * Path: <b>CapabilityStatement.status</b><br>
9119   * </p>
9120   */
9121  @SearchParamDefinition(name="status", path="CapabilityStatement.status", description="The current status of the capability statement", type="token" )
9122  public static final String SP_STATUS = "status";
9123 /**
9124   * <b>Fluent Client</b> search parameter constant for <b>status</b>
9125   * <p>
9126   * Description: <b>The current status of the capability statement</b><br>
9127   * Type: <b>token</b><br>
9128   * Path: <b>CapabilityStatement.status</b><br>
9129   * </p>
9130   */
9131  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
9132
9133
9134}
9135