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