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