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