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