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