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